2.2. __half2 Struct Reference

[Half Precision Intrinsics]

This structure implements the datatype for storing two half-precision floating-point numbers. The structure implements assignment, arithmetic and comparison operators, and type conversions.

  • NOTE: __half2 is visible to non-nvcc host compilers

Public Constructors

__host____device__ ​ __half2 ( const __half2_raw& h2r )
__host____device__ ​ __half2 ( const __half2& src )
__host____device__ ​ __half2 ( const __half& a, const __half& b )
__host____device__ ​ __half2 ( )

Public Member Functions

__host____device__ ​  operator __half2_raw ( ) const
__host____device____half2operator= ( const __half2_raw& h2r )
__host____device____half2operator= ( const __half2& src )

Public Variables

struct __half x
struct __half y

Constructors

__host____device____half2::__half2 ( const __half2_raw& h2r ) [inline]
Description

Constructor from __half2_raw

__host____device____half2::__half2 ( const __half2& src ) [inline]
Description

Copy constructor

__host____device____half2::__half2 ( const __half& a, const __half& b ) [inline]
Description

Constructor from two __half variables

__host____device____half2::__half2 ( ) [inline]
Description

Constructor by default.

Member Functions

__host____device____half2::operator __half2_raw ( ) const [inherited]
Description

Conversion operator to __half2_raw

__host____device____half2& __half2::operator= ( const __half2_raw& h2r ) [inherited]
Description

Assignment operator from __half2_raw

__host____device____half2& __half2::operator= ( const __half2& src ) [inherited]
Description

Copy assignment operator

Variables

struct __half__half2::x [inherited]

Storage field holding lower __half part.

struct __half__half2::y [inherited]

Storage field holding upper __half part.