The use of pointers is somewhat restricted. The following rules apply:
An image type (
image1d_array_t) can only be used as the type of a function argument. An image function argument cannot be modified. Elements of an image can only be accessed using the Built-in Image Functions.
An image type cannot be used to declare a variable, a structure or union field, an array of images, a pointer to an image, or the return type of a function. An image type cannot be used with the
constantaddress space qualifiers.
The sampler type (
sampler_t) can only be used as the type of a function argument or a variable declared in the program scope or the outermost scope of a kernel function. The behavior of a sampler variable declared in a non-outermost scope of a kernel function is implementation-defined. A sampler argument or variable cannot be modified.
Bit-fields struct members are currently not supported.
Variable length arrays and structures with flexible (or unsized) arrays are not supported.
The library functions defined in the C99 standard headers
wctype.hare not available and cannot be included by a program.
registerstorage-class specifiers are not supported.
Recursion is not supported.
The return type of a kernel function must be
Arguments to kernel functions in a program cannot be declared with the built-in scalar types
uintptr_t, or a struct and/or union that contain fields declared to be one of these built-in scalar types. The size in bytes of these types except
halfare implementation-defined and in addition can also be different for the OpenCL device and the host processor making it difficult to allocate buffer objects to be passed as arguments to a kernel declared as pointer to these types.
halfis not supported as
halfcan be used as a storage format only (unless the
cl_khr_fp16extension is supported) and is not a data type on which floating-point arithmetic can be performed.
Whether or not irreducible control flow is illegal is implementation defined.
The type qualifiers
volatileas defined by the C99 specification are supported. These qualifiers cannot be used with
image1d_array_ttypes. Types other than pointer types shall not use the
The event type (
event_t) cannot be used as the type of a kernel function argument. The event type cannot be used to declare a program scope variable. The event type cannot be used to declare a structure or union field. The event type cannot be used with the
__globaladdress space qualifiers.
reserve_id_ttypes cannot be used as arguments to kernel functions that get enqueued from the host. The
reserve_id_ttypes cannot be declared in program scope.
The behavior of applying the
sizeofoperator to the
reserve_id_ttypes is implementation-defined.
Kernels enqueued by the host must continue to have their arguments that are a pointer to a type declared to point to a named address space.
A function in an OpenCL program cannot be called