OpenCL 1.0 supports half as a storage format only in the core specification. This extension adds
support for half scalar and vector types as built-in types that can be used for arithmetic
operations, conversions etc. An application that wants to use half and halfn
types will need
to include the directive shown above.
The list of built-in scalar, and vector data types defined in tables 6.1, and 6.2 are extended to
include the types in the table below.
The built-in vector data types for halfn
are also declared as appropriate types in the OpenCL
API (and header files) that can be used by an application. The following table describes the
built-in vector data types for halfn
as defined in the OpenCL C programming language and the
corresponding data type available to the application:
Type in OpenCL Language | Description | API type for application |
---|---|---|
half2 | 2-component half-precision floating-point vector | cl_half2 |
half4 | 4-component half-precision floating-point vector | cl_half4 |
half8 | 8-component half-precision floating-point vector | cl_half8 |
half16 | 16-component half-precision floating-point vector | cl_half16 |