vloadn

Read vectors from a pointer to memory.

gentypen vloadn ( size_t  offset ,
  const __global gentype  *p)
gentypen vloadn ( size_t  offset ,
  const __local gentype  *p )
gentypen vloadn ( size_t  offset ,
  const __constant gentype  *p )
gentypen vloadn ( size_t  offset ,
  const __private gentype  *p )

Description

Return sizeof (gentypen) bytes of data read from location (p + (offset * n)).

The read 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 read address must be 64-bit aligned if gentype is longn, ulongn, or doublen.

If the half extension is enabled, the read address computed as (p + (offset * n) must be 16-bit aligned.

Notes

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. vloadn, vstoren, etc.) represents the number of elements in the built-in vector type (n = 2, 4, 8, or 16).

If the double extension is enabled with cl_khr_fp64, the vector data load (vloadn) and store (vstoren) 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 is extended to include double{2|4|8|16} as arguments and return values.

If the half extension is enabled with cl_khr_fp16, the vector data load (vloadn) and store (vstoren) 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 is extended to include half{2|4|8|16} as arguments and return values.

Specification

OpenCL Specification

Also see

Vector Data Load and Store Functions

Copyright © 2007-2009 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.