DESCRIPTION
The char, unsigned char, short, unsigned short, integer, unsigned integer, long, unsigned long, and float vector data types are supported. The vector data type is defined with the type name i.e. char, uchar, short, ushort, int, uint, float, long, or ulong 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.
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  Description 
API type for application

charn  A vector of n 8bit signed two's complement integer values. 
cl_charn

ucharn  A vector of n 8bit unsigned integer values. 
cl_ucharn

shortn  A vector of n 16bit signed two's complement integer values. 
cl_shortn

ushortn  A vector of n 16bit unsigned integer values. 
cl_ushortn

intn  A vector of n 32bit signed two's complement integer values. 
cl_intn

uintn  A vector of n 32bit unsigned integer values. 
cl_uintn

longn  A vector of n 64bit signed two's complement integer values. 
cl_longn

ulongn  A vector of n 64bit unsigned integer values. 
cl_ulongn

floatn  A vector of n 32bit floatingpoint values. 
cl_floatn

doublen  A vector of n 64bit floatingpoint values. 
cl_doublen

NOTES
Builtin vector data types are supported by the OpenCL implementation even if the underlying compute device does not support any or all of the vector data types. These are to be converted by the device compiler to appropriate instructions that use underlying builtin types supported natively by the compute device.
The double vector type is an optional type that is supported if CL_DEVICE_DOUBLE_FP_CONFIG for a device is not zero. See clGetDeviceInfo(3clc).
OPTIONAL HALF FLOATING POINT
The half floatingpoint is supported as an optional extension. An application that wants to use half and halfn will need to include the cl_khr_fp16(3clc) directive. This will extended the list of builtin vector and scalar data types to include the following:
Type in OpenCL Language  Description 
API type for application

half2  A 2component halfprecision floatingpoint vector. 
cl_half2

half3  A 3component halfprecision floatingpoint vector. 
cl_half3

half4  A 4component halfprecision floatingpoint vector. 
cl_half4

half8  An 8component halfprecision floatingpoint vector. 
cl_half8

half16  A 16component halfprecision floatingpoint vector. 
cl_half16

The relational, equality, logical and logical unary operators can be used with half scalar and halfn vector types and shall produce a scalar int and vector shortn result respectively.
The OpenCL compiler accepts an h and H suffix on floating point literals, indicating the literal is typed as a half.
SPECIFICATION
m[blue]OpenCL Specificationm[][1]
AUTHORS
The Khronos Group
COPYRIGHT
Copyright © 20072020 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.
NOTES
 1.

OpenCL Specification
 page 198, section 6.1.2  Builtin Vector Data Types