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 builtin vector data types.
Type 
Description 

A vector of n 8bit signed two’s complement integer values. 

A vector of n 8bit unsigned integer values. 

A vector of n 16bit signed two’s complement integer values. 

A vector of n 16bit unsigned integer values. 

A vector of n 32bit signed two’s complement integer values. 

A vector of n 32bit unsigned integer values. 

A vector of n 64bit signed two’s complement integer values. 

A vector of n 64bit unsigned integer values. 

A vector of n 32bit floatingpoint values. 

A vector of n 64bit floatingpoint values. Requires support for OpenCL C 1.2 or newer. In
OpenCL C 3.0 it requires support of the 
The builtin 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 builtin 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.