The OpenCL specification describes the feature requirements for desktop platforms. This section describes the OpenCL embedded profile, which defines a subset of the OpenCL specification for handheld and embedded platforms. Optional OpenCL extensions may apply to both profiles.
The OpenCL embedded profile has the following restrictions until version 2.0 (i.e. the optionality described below was deprecated by version 2.0):
-
Support for 3D images is optional.
If {CL_DEVICE_IMAGE3D_MAX_WIDTH}, {CL_DEVICE_IMAGE3D_MAX_HEIGHT} and {CL_DEVICE_IMAGE3D_MAX_DEPTH} are zero, calls to {clCreateImage} or {clCreateImageWithProperties} will fail to create the 3D image, and the errcode_ret argument will return {CL_INVALID_OPERATION}. Declaring arguments of type
image3d_tin a kernel will result in a compilation error.If {CL_DEVICE_IMAGE3D_MAX_WIDTH}, {CL_DEVICE_IMAGE3D_MAX_HEIGHT} and {CL_DEVICE_IMAGE3D_MAX_DEPTH} are greater than zero 0, calls to {clCreateImage} and {clCreateImageWithProperties} will behave as described for full profile implementations, and the
image3d_tdata type can be used in a kernel. -
Support for 2D image array writes is optional. If the cles_khr_2d_image_array_writes extension is supported by the embedded profile, writes to 2D image arrays are supported.
-
Image and image arrays created with an
image_channel_data_typevalue of {CL_FLOAT} or {CL_HALF_FLOAT} can only be used with samplers that use a filter mode of {CL_FILTER_NEAREST}. The values returned by read_imagef [1] for 2D and 3D images ifimage_channel_data_typevalue is {CL_FLOAT} or {CL_HALF_FLOAT} and sampler with filter_mode = {CL_FILTER_LINEAR} are undefined.
Furthermore, the OpenCL embedded profile has the following restrictions for all versions:
-
64 bit integers i.e. long, ulong including the appropriate vector data types and operations on 64-bit integers are optional. The cles_khr_int64 [2] extension string will be reported if the embedded profile implementation supports 64-bit integers. If double precision is supported i.e. {CL_DEVICE_DOUBLE_FP_CONFIG} is not zero, then cles_khr_int64 must also be supported.
-
The mandated minimum single precision floating-point capability given by {CL_DEVICE_SINGLE_FP_CONFIG} is {CL_FP_ROUND_TO_ZERO} or {CL_FP_ROUND_TO_NEAREST}. If {CL_FP_ROUND_TO_NEAREST} is supported, the default rounding mode will be round to nearest even; otherwise the default rounding mode will be round to zero.
-
The single precision floating-point operations (addition, subtraction and multiplication) shall be correctly rounded. Zero results may always be positive 0.0. The accuracy of division and sqrt are given in the OpenCL C and OpenCL SPIR-V Environment specifications.
If {CL_FP_INF_NAN} is not set in {CL_DEVICE_SINGLE_FP_CONFIG}, and one of the operands or the result of addition, subtraction, multiplication or division would signal the overflow or invalid exception (see IEEE 754 specification), the value of the result is implementation-defined. Likewise, single precision comparison operators (<, >, <=, >=, ==, !=) return implementation-defined values when one or more operands is a NaN.
In all cases, conversions (see the OpenCL C and OpenCL SPIR-V Environment specifications) shall be correctly rounded as described for the FULL_PROFILE, including those that consume or produce an INF or NaN. The built-in math functions shall behave as described for the FULL_PROFILE, including edge case behavior, but with slightly different accuracy rules. Edge case behavior and accuracy rules are described in the OpenCL C and OpenCL SPIR-V Environment specifications.
NoteIf addition, subtraction and multiplication have default round to zero rounding mode, then fract, fma and fdim shall produce the correctly rounded result for round to zero rounding mode.
This relaxation of the requirement to adhere to IEEE 754 requirements for basic floating-point operations, though extremely undesirable, is to provide flexibility for embedded devices that have lot stricter requirements on hardware area budgets.
-
Denormalized numbers for the half data type which may be generated when converting a float to a half using variants of the vstore_half function or when converting from a half to a float using variants of the vload_half function can be flushed to zero. The OpenCL SPIR-V Environment Specification for details.
-
The precision of conversions from {CL_UNORM_INT8}, {CL_SNORM_INT8}, {CL_UNORM_INT16}, {CL_SNORM_INT16}, {CL_UNORM_INT_101010}, and {CL_UNORM_INT_101010_2} to float is {leq} 2 ulp for the embedded profile instead of {leq} 1.5 ulp as defined in the full profile. The exception cases described in the full profile and given below apply to the embedded profile.
For {CL_UNORM_INT8}
-
0 must convert to 0.0f and
-
255 must convert to 1.0f
For {CL_UNORM_INT16}
-
0 must convert to 0.0f and
-
65535 must convert to 1.0f
For {CL_SNORM_INT8}
-
-128 and -127 must convert to -1.0f,
-
0 must convert to 0.0f and
-
127 must convert to 1.0f
For {CL_SNORM_INT16}
-
-32768 and -32767 must convert to -1.0f,
-
0 must convert to 0.0f and
-
32767 must convert to 1.0f
For {CL_UNORM_INT_101010}
-
0 must convert to 0.0f and
-
1023 must convert to 1.0f
For {CL_UNORM_INT_101010_2}
-
0 must convert to 0.0f and
-
1023 must convert to 1.0f (for RGB)
-
3 must convert to 1.0f (for A)
-
{CL_PLATFORM_PROFILE} defined in the OpenCL Platform Queries table will return the string EMBEDDED_PROFILE if the OpenCL implementation supports the embedded profile only.
The minimum maximum values specified in the OpenCL Device Queries table that have been modified for the OpenCL embedded profile are listed in the OpenCL Embedded Device Queries table.
If {CL_DEVICE_IMAGE_SUPPORT} specified in the OpenCL Device Queries table is {CL_TRUE}, the values assigned to {CL_DEVICE_MAX_READ_IMAGE_ARGS}, {CL_DEVICE_MAX_WRITE_IMAGE_ARGS}, {CL_DEVICE_IMAGE2D_MAX_WIDTH}, {CL_DEVICE_IMAGE2D_MAX_HEIGHT}, {CL_DEVICE_IMAGE3D_MAX_WIDTH}, {CL_DEVICE_IMAGE3D_MAX_HEIGHT}, {CL_DEVICE_IMAGE3D_MAX_DEPTH}, and {CL_DEVICE_MAX_SAMPLERS} by the implementation must be greater than or equal to the minimum values specified in the OpenCL Embedded Device Queries table.
If {CL_DEVICE_IMAGE_SUPPORT} specified in the OpenCL Device Queries table is {CL_TRUE}, the minimum list of supported image formats for either reading or writing in a kernel for embedded profile devices is:
| num_channels | channel_order | channel_data_type |
|---|---|---|
4 |
{CL_RGBA} |
{CL_UNORM_INT8} |
For embedded profiles devices that support reading from and writing to the same image object from the same kernel instance (see {CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS}) there is no required minimum list of supported image formats.