Write sizeof(gentype
bytes given by n
)data
to address (p
+ (offset
* n
)). The write address computed as (p
+ (offset
* n
)) must be 8-bit aligned if gentype is charn
, ucharn
; 16-bit aligned if gentype is shortn
, ushortn
; 32-bit aligned if gentype is intn
, uintn
, floatn
; 64-bit aligned if gentype is longn
, ulongn
.
If the double extension is enabled, then in addition to the above the address must be 64-bit aligned if gentype is longn
, ulongn
, or doublen
.
If the half extension is enabled, the address computed as (p
+ (offset
* n
) must be 16-bit aligned.
The generic type gentype is used to indicate the built-in data types char, uchar, short, ushort, int, uint, long, ulong, or float.
The generic type name gentypen
is used to indicate the built-in data types char{2|4|8|16},
uchar{2|4|8|16}, short{2|4|8|16}, ushort{2|4|8|16},
int{2|4|8|16}, uint{2|4|8|16}, long{2|4|8|16}, ulong{2|4|8|16}, or float{2|4|8|16} as the type for the arguments unless otherwise stated. The suffix used in gentypen
or the function name (i.e. vload
, n
vstore
, etc.) represents the number of elements in the built-in vector type (n
n
= 2, 4, 8, or 16).
If the double extension is enabled with cl_khr_fp64, the vector data load (vload
) and store (n
vstore
) functions are extended to include versions that read from or write to double scalar or vector values. The generic type gentype is extended to include double and the generic type gentypen
n
is extended to include double{2|4|8|16} as arguments and return values. Also if the double extension is enabled, the vstore_half
, vstore_half
, and n
vstorea_half
functions are extended to allow a double precision scalar or vector value to be written to memory as half values.
n
If the half extension is enabled with cl_khr_fp16, the vector data load (vload
) and store (n
vstore
) functions are extended to include versions that read from or write to half scalar or vector values. The generic type gentype is extended to include half and the generic type gentypen
n
is extended to include half{2|4|8|16} as arguments and return values.