C Specification
To create a sampler object, call the function
// Provided by CL_VERSION_1_0
cl_sampler clCreateSampler(
cl_context context,
cl_bool normalized_coords,
cl_addressing_mode addressing_mode,
cl_filter_mode filter_mode,
cl_int* errcode_ret);
| clCreateSampler is deprecated by version 2.0. |
Parameters
-
context must be a valid OpenCL context.
-
normalized_coords has the same interpretation as
CL_SAMPLER_in the sampler creation properties table.NORMALIZED_ COORDS -
addressing_mode has the same interpretation as
CL_SAMPLER_in the sampler creation properties table.ADDRESSING_ MODE -
filter_mode has the same interpretation as
CL_SAMPLER_in the sampler creation properties table.FILTER_ MODE -
errcode_ret will return an appropriate error code. If errcode_ret is
NULL, no error code is returned.
Description
clCreateSampler returns a valid non-zero sampler object and errcode_ret is
set to CL_SUCCESS if the sampler object is created successfully.
Otherwise, it returns a NULL value with one of the following error values
returned in errcode_ret:
-
CL_INVALID_if context is not a valid context.CONTEXT -
CL_INVALID_if addressing_mode, filter_mode, normalized_coords or a combination of these arguements are not valid.VALUE -
CL_INVALID_if images are not supported by any device associated with context (i.e.OPERATION CL_DEVICE_specified in the Device Queries table isIMAGE_ SUPPORT CL_FALSE). -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the device.OF_ RESOURCES -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the host.OF_ HOST_ MEMORY
Document Notes
For more information, see the OpenCL Specification
This page is extracted from the OpenCL Specification. Fixes and changes should be made to the Specification, not directly.