Description
The char, unsigned char, short, unsigned short, int, unsigned int,
long, unsigned long, float and double vector data types are supported.
[1]
The vector data type is defined with the type name, i.e. char, uchar,
short, ushort, int, uint, long, ulong, float, or double
followed by a literal value n that defines the number of elements in the
vector.
Supported values of n are 2, 3, 4, 8, and 16 for all vector data types.
| Vector types with three elements, i.e. where n is 3, require support for OpenCL C 1.1 or newer. |
The following table describes the list of built-in vector data types.
| Type | Description |
|---|---|
|
A vector of n 8-bit signed two’s complement integer values. |
|
A vector of n 8-bit unsigned integer values. |
|
A vector of n 16-bit signed two’s complement integer values. |
|
A vector of n 16-bit unsigned integer values. |
|
A vector of n 32-bit signed two’s complement integer values. |
|
A vector of n 32-bit unsigned integer values. |
|
A vector of n 64-bit signed two’s complement integer values. |
|
A vector of n 64-bit unsigned integer values. |
|
A vector of n 16-bit floating-point values. |
|
A vector of n 32-bit floating-point values. |
|
A vector of n 64-bit floating-point values. Requires support for double-precision. |
The built-in vector data types 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 type in the OpenCL C programming language and the corresponding data type available to the application:
| Type in OpenCL Language | API type for application |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Document Notes
For more information, see the OpenCL C Specification
This page is extracted from the OpenCL C Specification. Fixes and changes should be made to the Specification, not directly.