15.2.__half2

struct__half2

__half2 data type

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 Functions

__half2()=default

Constructor by default.

Emtpy default constructor, result is uninitialized.

__host____device__inlineconstexpr__half2(const__half&a,const__half&b)

Constructor from two__half variables.

__host____device__inline__half2(const__half2&&src)

Move constructor, available forC++11 and later dialects.

__host____device__inline__half2(const__half2&src)

Copy constructor.

__host____device__inline__half2(const__half2_raw&h2r)

Constructor from__half2_raw.

__host____device__operator__half2_raw()const

Conversion operator to__half2_raw.

__host____device____half2&operator=(const__half2&&src)

Move assignment operator, available forC++11 and later dialects.

__host____device____half2&operator=(const__half2&src)

Copy assignment operator.

__host____device____half2&operator=(const__half2_raw&h2r)

Assignment operator from__half2_raw.

Public Members

__halfx

Storage field holding lower__half part.

__halfy

Storage field holding upper__half part.