Class CL30


public class CL30 extends CL22
The core OpenCL 3.0 functionality.
  • Field Details

    • CL_VERSION_3_0

      public static final int CL_VERSION_3_0
      OpenCL Version.
      See Also:
    • CL_PLATFORM_NUMERIC_VERSION

      public static final int CL_PLATFORM_NUMERIC_VERSION
      Accepted as the param_name parameter of GetPlatformInfo, returns a cl_version value.

      Returns the detailed (major, minor, patch) version supported by the platform. The major and minor version numbers returned must match those returned via PLATFORM_VERSION.

      See Also:
    • CL_PLATFORM_EXTENSIONS_WITH_VERSION

      public static final int CL_PLATFORM_EXTENSIONS_WITH_VERSION
      Accepted as the param_name parameter of GetPlatformInfo, returns a cl_name_version[] value.

      Returns an array of description (name and version) structures that lists all the extensions supported by the platform. The same extension name must not be reported more than once. The list of extensions reported must match the list reported via PLATFORM_EXTENSIONS.

      See Also:
    • CL_DEVICE_NUMERIC_VERSION

      public static final int CL_DEVICE_NUMERIC_VERSION
      Accepted as the param_name parameter of GetDeviceInfo, returns a cl_version value.

      Returns the detailed (major, minor, patch) version supported by the device. The major and minor version numbers returned must match those returned via DEVICE_VERSION.

      See Also:
    • CL_DEVICE_EXTENSIONS_WITH_VERSION

      public static final int CL_DEVICE_EXTENSIONS_WITH_VERSION
      Accepted as the param_name parameter of GetDeviceInfo, returns a cl_name_version[] value.

      Returns an array of description (name and version) structures. The same extension name must not be reported more than once. The list of extensions reported must match the list reported via DEVICE_EXTENSIONS. See CL_DEVICE_EXTENSIONS for a list of extensions that are required to be reported for a given OpenCL version.

      See Also:
    • CL_DEVICE_ILS_WITH_VERSION

      public static final int CL_DEVICE_ILS_WITH_VERSION
      Accepted as the param_name parameter of GetDeviceInfo, returns a cl_name_version[] value.

      Returns an array of descriptions (name and version) for all supported intermediate languages. Intermediate languages with the same name may be reported more than once but each name and major/minor version combination may only be reported once. The list of intermediate languages reported must match the list reported via DEVICE_IL_VERSION.

      For an OpenCL 2.1 or 2.2 device, at least one version of SPIR-V must be reported.

      See Also:
    • CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION

      public static final int CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION
      Accepted as the param_name parameter of GetDeviceInfo, returns a cl_name_version[] value.

      Returns an array of descriptions for the built-in kernels supported by the device. Each built-in kernel may only be reported once. The list of reported kernels must match the list returned via DEVICE_BUILT_IN_KERNELS.

      See Also:
    • CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES

      public static final int CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES
      Accepted as the param_name parameter of GetDeviceInfo, returns a cl_device_atomic_capabilities value.

      Describes the various memory orders and scopes that the device supports for atomic memory operations. This is a bit-field that describes a combination of the following values:

      Because atomic memory orders are hierarchical, a device that supports a strong memory order must also support all weaker memory orders.

      Because atomic scopes are hierarchical, a device that supports a wide scope must also support all narrower scopes, except for the work-item scope, which is a special case.

      The mandated minimum capability is:

      
       CL_DEVICE_ATOMIC_ORDER_RELAXED |
       CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP
      See Also:
    • CL_DEVICE_ATOMIC_FENCE_CAPABILITIES

      public static final int CL_DEVICE_ATOMIC_FENCE_CAPABILITIES
      Accepted as the param_name parameter of GetDeviceInfo, returns a cl_device_atomic_capabilities value.

      Describes the various memory orders and scopes that the device supports for atomic fence operations. This is a bit-field that has the same set of possible values as described for DEVICE_ATOMIC_MEMORY_CAPABILITIES.

      The mandated minimum capability is:

      
       CL_DEVICE_ATOMIC_ORDER_RELAXED |
       CL_DEVICE_ATOMIC_ORDER_ACQ_REL |
       CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP            
      See Also:
    • CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT

      public static final int CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT
      Accepted as the param_name parameter of GetDeviceInfo, returns a cl_bool value.

      Is TRUE if the device supports non-uniform work groups, and FALSE otherwise.

      See Also:
    • CL_DEVICE_OPENCL_C_ALL_VERSIONS

      public static final int CL_DEVICE_OPENCL_C_ALL_VERSIONS
      Accepted as the param_name parameter of GetDeviceInfo, returns a cl_name_version[] value.

      Returns an array of name, version descriptions listing all the versions of OpenCL C supported by the compiler for the device. In each returned description structure, the name field is required to be "OpenCL C". The list may include both newer non-backwards compatible OpenCL C versions, such as OpenCL C 3.0, and older OpenCL C versions with mandatory backwards compatibility. The version returned by DEVICE_OPENCL_C_VERSION is required to be present in the list.

      For devices that support compilation from OpenCL C source:

      Because OpenCL 3.0 is backwards compatible with OpenCL C 1.2, and OpenCL C 1.2 is backwards compatible with OpenCL C 1.1 and OpenCL C 1.0, support for at least OpenCL C 3.0, OpenCL C 1.2, OpenCL C 1.1, and OpenCL C 1.0 is required for an OpenCL 3.0 device.

      Support for OpenCL C 2.0, OpenCL C 1.2, OpenCL C 1.1, and OpenCL C 1.0 is required for an OpenCL 2.0, OpenCL 2.1, or OpenCL 2.2 device.

      Support for OpenCL C 1.2, OpenCL C 1.1, and OpenCL C 1.0 is required for an OpenCL 1.2 device.

      Support for OpenCL C 1.1 and OpenCL C 1.0 is required for an OpenCL 1.1 device.

      Support for at least OpenCL C 1.0 is required for an OpenCL 1.0 device.

      For devices that do not support compilation from OpenCL C source, this query may return an empty array.

      See Also:
    • CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_MULTIPLE

      public static final int CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_MULTIPLE
      Accepted as the param_name parameter of GetDeviceInfo, returns a size_t value.

      Returns the preferred multiple of work-group size for the given device. This is a performance hint intended as a guide when specifying the local work size argument to EnqueueNDRangeKernel.

      (Refer also to GetKernelWorkGroupInfo where KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE can return a different value to CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_MULTIPLE which may be more optimal.)

      See Also:
    • CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT

      public static final int CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT
      Accepted as the param_name parameter of GetDeviceInfo, returns a cl_bool value.

      Is TRUE if the device supports work group collective functions e.g. work_group_broadcast, work_group_reduce, and work_group_scan, and FALSE otherwise.

      See Also:
    • CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT

      public static final int CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT
      Accepted as the param_name parameter of GetDeviceInfo, returns a cl_bool value.

      Is TRUE if the device supports the generic address space and its associated built-in functions, and FALSE otherwise.

      See Also:
    • CL_DEVICE_OPENCL_C_FEATURES

      public static final int CL_DEVICE_OPENCL_C_FEATURES
      Accepted as the param_name parameter of GetDeviceInfo, returns a cl_name_version[] value.

      Returns an array of optional OpenCL C features supported by the compiler for the device alongside the OpenCL C version that introduced the feature macro. For example, if a compiler supports an OpenCL C 3.0 feature, the returned name will be the full name of the OpenCL C feature macro, and the returned version will be 3.0.0.

      For devices that do not support compilation from OpenCL C source, this query may return an empty array.

      See Also:
    • CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES

      public static final int CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES
      Accepted as the param_name parameter of GetDeviceInfo, returns a cl_device_device_enqueue_capabilities value.

      Describes device-side enqueue capabilities of the device. This is a bit-field that describes one or more of the following values:

      If CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT is set, CL_DEVICE_QUEUE_SUPPORTED must also be set.

      Devices that set CL_DEVICE_QUEUE_SUPPORTED for CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES must also return TRUE for DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT.

      See Also:
    • CL_DEVICE_PIPE_SUPPORT

      public static final int CL_DEVICE_PIPE_SUPPORT
      Accepted as the param_name parameter of GetDeviceInfo, returns a cl_bool value.

      Is TRUE if the device supports pipes, and CL_FALSE otherwise.

      Devices that return TRUE for CL_DEVICE_PIPE_SUPPORT must also return CL_TRUE for DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT.

      See Also:
    • CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED

      public static final int CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED
      Accepted as the param_name parameter of GetDeviceInfo, returns a char[] value.

      Returns the latest version of the conformance test suite that this device has fully passed in accordance with the official conformance process.

      See Also:
    • CL_QUEUE_PROPERTIES_ARRAY

      public static final int CL_QUEUE_PROPERTIES_ARRAY
      Accepted as the param_name parameter of GetCommandQueueInfo, returns a cl_queue_properties[] value.

      Return the properties argument specified in CreateCommandQueueWithProperties.

      If the properties argument specified in clCreateCommandQueueWithProperties used to create command_queue was not NULL, the implementation must return the values specified in the properties argument in the same order and without including additional properties.

      If command_queue was created using CreateCommandQueue, or if the properties argument specified in clCreateCommandQueueWithProperties was NULL, the implementation must return param_value_size_ret equal to 0, indicating that there are no properties to be returned.

      See Also:
    • CL_MEM_PROPERTIES

      public static final int CL_MEM_PROPERTIES
      Accepted as the param_name parameter of GetMemObjectInfo, returns a cl_mem_properties[] value.

      Return the properties argument specified in CreateBufferWithProperties or CreateImageWithProperties.

      If the properties argument specified in clCreateBufferWithProperties or clCreateImageWithProperties used to create memobj was not NULL, the implementation must return the values specified in the properties argument in the same order and without including additional properties.

      If memobj was created using CreateBuffer, CreateSubBuffer, CreateImage, CreateImage2D, or CreateImage3D, or if the properties argument specified in clCreateBufferWithProperties or clCreateImageWithProperties was NULL, the implementation must return param_value_size_ret equal to 0, indicating that there are no properties to be returned.

      See Also:
    • CL_PIPE_PROPERTIES

      public static final int CL_PIPE_PROPERTIES
      Accepted as the param_name parameter of GetPipeInfo, returns a cl_pipe_properties[] value.

      Return the properties argument specified in CreatePipe.

      If the properties argument specified in clCreatePipe used to create pipe was not NULL, the implementation must return the values specified in the properties argument in the same order and without including additional properties.

      If the properties argument specified in clCreatePipe used to create pipe was NULL, the implementation must return param_value_size_ret equal to 0, indicating that there are no properties to be returned.

      See Also:
    • CL_SAMPLER_PROPERTIES

      public static final int CL_SAMPLER_PROPERTIES
      Accepted as the param_name parameter of GetSamplerInfo, returns a cl_sampler_properties[] value.

      Return the properties argument specified in CreateSamplerWithProperties.

      If the properties argument specified in clCreateSamplerWithProperties used to create sampler was not NULL, the implementation must return the values specified in the properties argument in the same order and without including additional properties.

      If sampler was created using CreateSampler, or if the properties argument specified in clCreateSamplerWithProperties was NULL, the implementation must return param_value_size_ret equal to 0, indicating that there are no properties to be returned.

      See Also:
    • CL_COMMAND_SVM_MIGRATE_MEM

      public static final int CL_COMMAND_SVM_MIGRATE_MEM
      cl_command_type
      See Also:
    • CL_DEVICE_ATOMIC_ORDER_RELAXED

      public static final int CL_DEVICE_ATOMIC_ORDER_RELAXED
      cl_device_atomic_capabilities - bitfield
      See Also:
    • CL_DEVICE_ATOMIC_ORDER_ACQ_REL

      public static final int CL_DEVICE_ATOMIC_ORDER_ACQ_REL
      cl_device_atomic_capabilities - bitfield
      See Also:
    • CL_DEVICE_ATOMIC_ORDER_SEQ_CST

      public static final int CL_DEVICE_ATOMIC_ORDER_SEQ_CST
      cl_device_atomic_capabilities - bitfield
      See Also:
    • CL_DEVICE_ATOMIC_SCOPE_WORK_ITEM

      public static final int CL_DEVICE_ATOMIC_SCOPE_WORK_ITEM
      cl_device_atomic_capabilities - bitfield
      See Also:
    • CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP

      public static final int CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP
      cl_device_atomic_capabilities - bitfield
      See Also:
    • CL_DEVICE_ATOMIC_SCOPE_DEVICE

      public static final int CL_DEVICE_ATOMIC_SCOPE_DEVICE
      cl_device_atomic_capabilities - bitfield
      See Also:
    • CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES

      public static final int CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES
      cl_device_atomic_capabilities - bitfield
      See Also:
    • CL_DEVICE_QUEUE_SUPPORTED

      public static final int CL_DEVICE_QUEUE_SUPPORTED
      cl_device_device_enqueue_capabilities - bitfield
      See Also:
    • CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT

      public static final int CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT
      cl_device_device_enqueue_capabilities - bitfield
      See Also:
    • CL_VERSION_MAJOR_BITS

      public static final int CL_VERSION_MAJOR_BITS
      cl_version constants
      See Also:
    • CL_VERSION_MINOR_BITS

      public static final int CL_VERSION_MINOR_BITS
      cl_version constants
      See Also:
    • CL_VERSION_PATCH_BITS

      public static final int CL_VERSION_PATCH_BITS
      cl_version constants
      See Also:
    • CL_VERSION_MAJOR_MASK

      public static final int CL_VERSION_MAJOR_MASK
      cl_version constants
      See Also:
    • CL_VERSION_MINOR_MASK

      public static final int CL_VERSION_MINOR_MASK
      cl_version constants
      See Also:
    • CL_VERSION_PATCH_MASK

      public static final int CL_VERSION_PATCH_MASK
      cl_version constants
      See Also:
  • Method Details

    • CL_VERSION_MAJOR

      public static int CL_VERSION_MAJOR(int version)
      Extracts the major version from a packed cl_version.
      Parameters:
      version - a packed cl_version
      See Also:
    • CL_VERSION_MINOR

      public static int CL_VERSION_MINOR(int version)
      Extracts the minor version from a packed cl_version.
      Parameters:
      version - a packed cl_version
      See Also:
    • CL_VERSION_PATCH

      public static int CL_VERSION_PATCH(int version)
      Extracts the patch version from a packed cl_version.
      Parameters:
      version - a packed cl_version
      See Also:
    • CL_MAKE_VERSION

      public static int CL_MAKE_VERSION(int major, int minor, int patch)
      Returns a packed cl_version from a major, minor and patch version.
      Parameters:
      major - the major version
      minor - the minor version
      patch - the patch version
      See Also:
    • nclSetContextDestructorCallback

      public static int nclSetContextDestructorCallback(long context, long pfn_notify, long user_data)
      Unsafe version of: SetContextDestructorCallback
    • clSetContextDestructorCallback

      public static int clSetContextDestructorCallback(long context, CLContextDestructorCallbackI pfn_notify, long user_data)
      Registers a callback function with a context that is called when the context is destroyed.

      Each call to clSetContextDestructorCallback registers the specified callback function on a destructor callback stack associated with context. The registered callback functions are called in the reverse order in which they were registered. If a context callback function was specified when context was created, it will not be called after any context destructor callback is called. Therefore, the context destructor callback provides a mechanism for an application to safely re-use or free any user_data specified for the context callback function when context was created.

      Parameters:
      context - specifies the OpenCL context to register the callback to
      pfn_notify - the callback function to register.

      This callback function may be called asynchronously by the OpenCL implementation. It is the application’s responsibility to ensure that the callback function is thread-safe.

      user_data - will be passed as the user_data argument when pfn_notify is called. user_data can be NULL.
      Returns:
      SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
      • INVALID_CONTEXT if context is not a valid context.
      • INVALID_VALUE if pfn_notify is NULL.
      • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
      • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
      See Also:
    • nclCreateBufferWithProperties

      public static long nclCreateBufferWithProperties(long context, long properties, long flags, long size, long host_ptr, long errcode_ret)
      Unsafe version of: CreateBufferWithProperties
      Parameters:
      size - the size in bytes of the buffer memory object to be allocated
    • clCreateBufferWithProperties

      public static long clCreateBufferWithProperties(long context, @Nullable LongBuffer properties, long flags, long size, @Nullable IntBuffer errcode_ret)
      Creates a buffer object with additional properties.

      If clCreateBufferWithProperties is called with MEM_USE_HOST_PTR set in its flags argument, the contents of the memory pointed to by host_ptr at the time of the clCreateBufferWithProperties call define the initial contents of the buffer object.

      If clCreateBufferWithProperties is called with a pointer returned by SVMAlloc as its host_ptr argument, and CL_MEM_USE_HOST_PTR is set in its flags argument, clCreateBufferWithProperties will succeed and return a valid non-zero buffer object as long as the size argument is no larger than the size argument passed in the original clSVMAlloc call. The new buffer object returned has the shared memory as the underlying storage. Locations in the buffers underlying shared memory can be operated on using atomic operations to the devices level of support as defined in the memory model.

      Parameters:
      context - a valid OpenCL context used to create the buffer object
      properties - an optional list of properties for the buffer object and their corresponding values.

      The list is terminated with the special property 0. If no properties are required, properties may be NULL.

      flags - a bit-field that is used to specify allocation and usage information about the image memory object being created. One of:
      MEM_READ_WRITEMEM_WRITE_ONLYMEM_READ_ONLYMEM_USE_HOST_PTRMEM_ALLOC_HOST_PTR
      MEM_COPY_HOST_PTRMEM_HOST_WRITE_ONLYMEM_HOST_READ_ONLYMEM_HOST_NO_ACCESS"
      size - the size in bytes of the buffer memory object to be allocated
      errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
      Returns:
      a valid non-zero buffer object and errcode_ret is set to SUCCESS if the buffer object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:
      See Also:
    • clCreateBufferWithProperties

      public static long clCreateBufferWithProperties(long context, @Nullable LongBuffer properties, long flags, ByteBuffer host_ptr, @Nullable IntBuffer errcode_ret)
      Creates a buffer object with additional properties.

      If clCreateBufferWithProperties is called with MEM_USE_HOST_PTR set in its flags argument, the contents of the memory pointed to by host_ptr at the time of the clCreateBufferWithProperties call define the initial contents of the buffer object.

      If clCreateBufferWithProperties is called with a pointer returned by SVMAlloc as its host_ptr argument, and CL_MEM_USE_HOST_PTR is set in its flags argument, clCreateBufferWithProperties will succeed and return a valid non-zero buffer object as long as the size argument is no larger than the size argument passed in the original clSVMAlloc call. The new buffer object returned has the shared memory as the underlying storage. Locations in the buffers underlying shared memory can be operated on using atomic operations to the devices level of support as defined in the memory model.

      Parameters:
      context - a valid OpenCL context used to create the buffer object
      properties - an optional list of properties for the buffer object and their corresponding values.

      The list is terminated with the special property 0. If no properties are required, properties may be NULL.

      flags - a bit-field that is used to specify allocation and usage information about the image memory object being created. One of:
      MEM_READ_WRITEMEM_WRITE_ONLYMEM_READ_ONLYMEM_USE_HOST_PTRMEM_ALLOC_HOST_PTR
      MEM_COPY_HOST_PTRMEM_HOST_WRITE_ONLYMEM_HOST_READ_ONLYMEM_HOST_NO_ACCESS"
      host_ptr - a pointer to the buffer data that may already be allocated by the application.

      The size of the buffer that host_ptr points to must be greater than or equal to size bytes.

      errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
      Returns:
      a valid non-zero buffer object and errcode_ret is set to SUCCESS if the buffer object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:
      See Also:
    • clCreateBufferWithProperties

      public static long clCreateBufferWithProperties(long context, @Nullable LongBuffer properties, long flags, ShortBuffer host_ptr, @Nullable IntBuffer errcode_ret)
      Creates a buffer object with additional properties.

      If clCreateBufferWithProperties is called with MEM_USE_HOST_PTR set in its flags argument, the contents of the memory pointed to by host_ptr at the time of the clCreateBufferWithProperties call define the initial contents of the buffer object.

      If clCreateBufferWithProperties is called with a pointer returned by SVMAlloc as its host_ptr argument, and CL_MEM_USE_HOST_PTR is set in its flags argument, clCreateBufferWithProperties will succeed and return a valid non-zero buffer object as long as the size argument is no larger than the size argument passed in the original clSVMAlloc call. The new buffer object returned has the shared memory as the underlying storage. Locations in the buffers underlying shared memory can be operated on using atomic operations to the devices level of support as defined in the memory model.

      Parameters:
      context - a valid OpenCL context used to create the buffer object
      properties - an optional list of properties for the buffer object and their corresponding values.

      The list is terminated with the special property 0. If no properties are required, properties may be NULL.

      flags - a bit-field that is used to specify allocation and usage information about the image memory object being created. One of:
      MEM_READ_WRITEMEM_WRITE_ONLYMEM_READ_ONLYMEM_USE_HOST_PTRMEM_ALLOC_HOST_PTR
      MEM_COPY_HOST_PTRMEM_HOST_WRITE_ONLYMEM_HOST_READ_ONLYMEM_HOST_NO_ACCESS"
      host_ptr - a pointer to the buffer data that may already be allocated by the application.

      The size of the buffer that host_ptr points to must be greater than or equal to size bytes.

      errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
      Returns:
      a valid non-zero buffer object and errcode_ret is set to SUCCESS if the buffer object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:
      See Also:
    • clCreateBufferWithProperties

      public static long clCreateBufferWithProperties(long context, @Nullable LongBuffer properties, long flags, IntBuffer host_ptr, @Nullable IntBuffer errcode_ret)
      Creates a buffer object with additional properties.

      If clCreateBufferWithProperties is called with MEM_USE_HOST_PTR set in its flags argument, the contents of the memory pointed to by host_ptr at the time of the clCreateBufferWithProperties call define the initial contents of the buffer object.

      If clCreateBufferWithProperties is called with a pointer returned by SVMAlloc as its host_ptr argument, and CL_MEM_USE_HOST_PTR is set in its flags argument, clCreateBufferWithProperties will succeed and return a valid non-zero buffer object as long as the size argument is no larger than the size argument passed in the original clSVMAlloc call. The new buffer object returned has the shared memory as the underlying storage. Locations in the buffers underlying shared memory can be operated on using atomic operations to the devices level of support as defined in the memory model.

      Parameters:
      context - a valid OpenCL context used to create the buffer object
      properties - an optional list of properties for the buffer object and their corresponding values.

      The list is terminated with the special property 0. If no properties are required, properties may be NULL.

      flags - a bit-field that is used to specify allocation and usage information about the image memory object being created. One of:
      MEM_READ_WRITEMEM_WRITE_ONLYMEM_READ_ONLYMEM_USE_HOST_PTRMEM_ALLOC_HOST_PTR
      MEM_COPY_HOST_PTRMEM_HOST_WRITE_ONLYMEM_HOST_READ_ONLYMEM_HOST_NO_ACCESS"
      host_ptr - a pointer to the buffer data that may already be allocated by the application.

      The size of the buffer that host_ptr points to must be greater than or equal to size bytes.

      errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
      Returns:
      a valid non-zero buffer object and errcode_ret is set to SUCCESS if the buffer object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:
      See Also:
    • clCreateBufferWithProperties

      public static long clCreateBufferWithProperties(long context, @Nullable LongBuffer properties, long flags, FloatBuffer host_ptr, @Nullable IntBuffer errcode_ret)
      Creates a buffer object with additional properties.

      If clCreateBufferWithProperties is called with MEM_USE_HOST_PTR set in its flags argument, the contents of the memory pointed to by host_ptr at the time of the clCreateBufferWithProperties call define the initial contents of the buffer object.

      If clCreateBufferWithProperties is called with a pointer returned by SVMAlloc as its host_ptr argument, and CL_MEM_USE_HOST_PTR is set in its flags argument, clCreateBufferWithProperties will succeed and return a valid non-zero buffer object as long as the size argument is no larger than the size argument passed in the original clSVMAlloc call. The new buffer object returned has the shared memory as the underlying storage. Locations in the buffers underlying shared memory can be operated on using atomic operations to the devices level of support as defined in the memory model.

      Parameters:
      context - a valid OpenCL context used to create the buffer object
      properties - an optional list of properties for the buffer object and their corresponding values.

      The list is terminated with the special property 0. If no properties are required, properties may be NULL.

      flags - a bit-field that is used to specify allocation and usage information about the image memory object being created. One of:
      MEM_READ_WRITEMEM_WRITE_ONLYMEM_READ_ONLYMEM_USE_HOST_PTRMEM_ALLOC_HOST_PTR
      MEM_COPY_HOST_PTRMEM_HOST_WRITE_ONLYMEM_HOST_READ_ONLYMEM_HOST_NO_ACCESS"
      host_ptr - a pointer to the buffer data that may already be allocated by the application.

      The size of the buffer that host_ptr points to must be greater than or equal to size bytes.

      errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
      Returns:
      a valid non-zero buffer object and errcode_ret is set to SUCCESS if the buffer object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:
      See Also:
    • clCreateBufferWithProperties

      public static long clCreateBufferWithProperties(long context, @Nullable LongBuffer properties, long flags, DoubleBuffer host_ptr, @Nullable IntBuffer errcode_ret)
      Creates a buffer object with additional properties.

      If clCreateBufferWithProperties is called with MEM_USE_HOST_PTR set in its flags argument, the contents of the memory pointed to by host_ptr at the time of the clCreateBufferWithProperties call define the initial contents of the buffer object.

      If clCreateBufferWithProperties is called with a pointer returned by SVMAlloc as its host_ptr argument, and CL_MEM_USE_HOST_PTR is set in its flags argument, clCreateBufferWithProperties will succeed and return a valid non-zero buffer object as long as the size argument is no larger than the size argument passed in the original clSVMAlloc call. The new buffer object returned has the shared memory as the underlying storage. Locations in the buffers underlying shared memory can be operated on using atomic operations to the devices level of support as defined in the memory model.

      Parameters:
      context - a valid OpenCL context used to create the buffer object
      properties - an optional list of properties for the buffer object and their corresponding values.

      The list is terminated with the special property 0. If no properties are required, properties may be NULL.

      flags - a bit-field that is used to specify allocation and usage information about the image memory object being created. One of:
      MEM_READ_WRITEMEM_WRITE_ONLYMEM_READ_ONLYMEM_USE_HOST_PTRMEM_ALLOC_HOST_PTR
      MEM_COPY_HOST_PTRMEM_HOST_WRITE_ONLYMEM_HOST_READ_ONLYMEM_HOST_NO_ACCESS"
      host_ptr - a pointer to the buffer data that may already be allocated by the application.

      The size of the buffer that host_ptr points to must be greater than or equal to size bytes.

      errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
      Returns:
      a valid non-zero buffer object and errcode_ret is set to SUCCESS if the buffer object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:
      See Also:
    • nclCreateImageWithProperties

      public static long nclCreateImageWithProperties(long context, long properties, long flags, long image_format, long image_desc, long host_ptr, long errcode_ret)
      Unsafe version of: CreateImageWithProperties
    • clCreateImageWithProperties

      public static long clCreateImageWithProperties(long context, @Nullable LongBuffer properties, long flags, CLImageFormat image_format, CLImageDesc image_desc, @Nullable ByteBuffer host_ptr, @Nullable IntBuffer errcode_ret)
      Creates an image object with additional properties.

      For a 3D image or 2D image array, the image data specified by host_ptr is stored as a linear sequence of adjacent 2D image slices or 2D images respectively. Each 2D image is a linear sequence of adjacent scanlines. Each scanline is a linear sequence of image elements.

      For a 2D image, the image data specified by host_ptr is stored as a linear sequence of adjacent scanlines. Each scanline is a linear sequence of image elements.

      For a 1D image array, the image data specified by host_ptr is stored as a linear sequence of adjacent 1D images. Each 1D image is stored as a single scanline which is a linear sequence of adjacent elements.

      For 1D image or 1D image buffer, the image data specified by host_ptr is stored as a single scanline which is a linear sequence of adjacent elements.

      Parameters:
      context - a valid OpenCL context used to create the image object
      properties - an optional list of properties for the image object and their corresponding values.

      The list is terminated with the special property 0. If no properties are required, properties may be NULL.

      flags - a bit-field that is used to specify allocation and usage information about the image memory object being created.

      For all image types except MEM_OBJECT_IMAGE1D_BUFFER, if the value specified for flags is 0, the default is used which is MEM_READ_WRITE.

      For CL_MEM_OBJECT_IMAGE1D_BUFFER image type, or an image created from another memory object (image or buffer), if the CL_MEM_READ_WRITE, MEM_READ_ONLY or MEM_WRITE_ONLY values are not specified in flags, they are inherited from the corresponding memory access qualifiers associated with mem_object. The MEM_USE_HOST_PTR, MEM_ALLOC_HOST_PTR and MEM_COPY_HOST_PTR values cannot be specified in flags but are inherited from the corresponding memory access qualifiers associated with mem_object. If CL_MEM_COPY_HOST_PTR is specified in the memory access qualifier values associated with mem_object it does not imply any additional copies when the image is created from mem_object. If the MEM_HOST_WRITE_ONLY, MEM_HOST_READ_ONLY or MEM_HOST_NO_ACCESS values are not specified in flags, they are inherited from the corresponding memory access qualifiers associated with mem_object. One of:

      MEM_READ_WRITEMEM_WRITE_ONLYMEM_READ_ONLYMEM_USE_HOST_PTRMEM_ALLOC_HOST_PTR
      MEM_COPY_HOST_PTRMEM_HOST_WRITE_ONLYMEM_HOST_READ_ONLYMEM_HOST_NO_ACCESS
      image_format - a pointer to a structure that describes format properties of the image to be allocated.

      A 1D image buffer or 2D image can be created from a buffer by specifying a buffer object in the image_desc→mem_object. A 2D image can be created from another 2D image object by specifying an image object in the image_desc→mem_object.

      image_desc - a pointer to a structure that describes type and dimensions of the image to be allocated
      host_ptr - a pointer to the image data that may already be allocated by the application.

      Refer to table below for a description of how large the buffer that host_ptr points to must be.

      ImageTypeSize of buffer that host_ptr points to
      MEM_OBJECT_IMAGE1D≥ image_row_pitch
      MEM_OBJECT_IMAGE1D_BUFFER≥ image_row_pitch
      MEM_OBJECT_IMAGE2D≥ image_row_pitch * image_height
      MEM_OBJECT_IMAGE3D≥ image_slice_pitch * image_depth
      MEM_OBJECT_IMAGE1D_ARRAY≥ image_slice_pitch * image_array_size
      MEM_OBJECT_IMAGE2D_ARRAY≥ image_slice_pitch * image_array_size
      errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
      Returns:
      a valid non-zero image object and the errcode_ret is set to SUCCESS if the image object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:
      • INVALID_CONTEXT if context is not a valid context.
      • INVALID_PROPERTY if a property name in properties is not a supported property name, if the value specified for a supported property name is not valid, or if the same property name is specified more than once.
      • INVALID_VALUE if values specified in flags are not valid.
      • INVALID_IMAGE_FORMAT_DESCRIPTOR if values specified in image_format are not valid or if image_format is NULL.
      • INVALID_IMAGE_FORMAT_DESCRIPTOR if a 2D image is created from a buffer and the row pitch and base address alignment does not follow the rules described for creating a 2D image from a buffer.
      • INVALID_IMAGE_FORMAT_DESCRIPTOR if a 2D image is created from a 2D image object and the rules described above are not followed.
      • INVALID_IMAGE_DESCRIPTOR if values specified in image_desc are not valid or if image_desc is NULL.
      • INVALID_IMAGE_SIZE if image dimensions specified in image_desc exceed the maximum image dimensions for all devices in context.
      • INVALID_HOST_PTR if host_ptr is NULL and MEM_USE_HOST_PTR or MEM_COPY_HOST_PTR are set in flags or if host_ptr is not NULL but MEM_COPY_HOST_PTR or MEM_USE_HOST_PTR are not set in flags.
      • INVALID_VALUE if an image is being created from another memory object (buffer or image) under one of the following circumstances:
        1. mem_object was created with CL_MEM_WRITE_ONLY and flags specifies CL_MEM_READ_WRITE or CL_MEM_READ_ONLY,
        2. mem_object was created with CL_MEM_READ_ONLY and flags specifies CL_MEM_READ_WRITE or CL_MEM_WRITE_ONLY,
        3. flags specifies CL_MEM_USE_HOST_PTR or CL_MEM_ALLOC_HOST_PTR or CL_MEM_COPY_HOST_PTR.
      • INVALID_VALUE if an image is being created from another memory object (buffer or image) and mem_object was created with CL_MEM_HOST_WRITE_ONLY and flags specifies CL_MEM_HOST_READ_ONLY, or if mem_object was created with CL_MEM_HOST_READ_ONLY and flags specifies CL_MEM_HOST_WRITE_ONLY, or if mem_object was created with CL_MEM_HOST_NO_ACCESS and flags specifies CL_MEM_HOST_READ_ONLY or CL_MEM_HOST_WRITE_ONLY.
      • IMAGE_FORMAT_NOT_SUPPORTED if there are no devices in context that support image_format.
      • MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for image object.
      • INVALID_OPERATION if there are no devices in context that support images.
      • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
      • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
      See Also:
    • clCreateImageWithProperties

      public static long clCreateImageWithProperties(long context, @Nullable LongBuffer properties, long flags, CLImageFormat image_format, CLImageDesc image_desc, @Nullable ShortBuffer host_ptr, @Nullable IntBuffer errcode_ret)
      Creates an image object with additional properties.

      For a 3D image or 2D image array, the image data specified by host_ptr is stored as a linear sequence of adjacent 2D image slices or 2D images respectively. Each 2D image is a linear sequence of adjacent scanlines. Each scanline is a linear sequence of image elements.

      For a 2D image, the image data specified by host_ptr is stored as a linear sequence of adjacent scanlines. Each scanline is a linear sequence of image elements.

      For a 1D image array, the image data specified by host_ptr is stored as a linear sequence of adjacent 1D images. Each 1D image is stored as a single scanline which is a linear sequence of adjacent elements.

      For 1D image or 1D image buffer, the image data specified by host_ptr is stored as a single scanline which is a linear sequence of adjacent elements.

      Parameters:
      context - a valid OpenCL context used to create the image object
      properties - an optional list of properties for the image object and their corresponding values.

      The list is terminated with the special property 0. If no properties are required, properties may be NULL.

      flags - a bit-field that is used to specify allocation and usage information about the image memory object being created.

      For all image types except MEM_OBJECT_IMAGE1D_BUFFER, if the value specified for flags is 0, the default is used which is MEM_READ_WRITE.

      For CL_MEM_OBJECT_IMAGE1D_BUFFER image type, or an image created from another memory object (image or buffer), if the CL_MEM_READ_WRITE, MEM_READ_ONLY or MEM_WRITE_ONLY values are not specified in flags, they are inherited from the corresponding memory access qualifiers associated with mem_object. The MEM_USE_HOST_PTR, MEM_ALLOC_HOST_PTR and MEM_COPY_HOST_PTR values cannot be specified in flags but are inherited from the corresponding memory access qualifiers associated with mem_object. If CL_MEM_COPY_HOST_PTR is specified in the memory access qualifier values associated with mem_object it does not imply any additional copies when the image is created from mem_object. If the MEM_HOST_WRITE_ONLY, MEM_HOST_READ_ONLY or MEM_HOST_NO_ACCESS values are not specified in flags, they are inherited from the corresponding memory access qualifiers associated with mem_object. One of:

      MEM_READ_WRITEMEM_WRITE_ONLYMEM_READ_ONLYMEM_USE_HOST_PTRMEM_ALLOC_HOST_PTR
      MEM_COPY_HOST_PTRMEM_HOST_WRITE_ONLYMEM_HOST_READ_ONLYMEM_HOST_NO_ACCESS
      image_format - a pointer to a structure that describes format properties of the image to be allocated.

      A 1D image buffer or 2D image can be created from a buffer by specifying a buffer object in the image_desc→mem_object. A 2D image can be created from another 2D image object by specifying an image object in the image_desc→mem_object.

      image_desc - a pointer to a structure that describes type and dimensions of the image to be allocated
      host_ptr - a pointer to the image data that may already be allocated by the application.

      Refer to table below for a description of how large the buffer that host_ptr points to must be.

      ImageTypeSize of buffer that host_ptr points to
      MEM_OBJECT_IMAGE1D≥ image_row_pitch
      MEM_OBJECT_IMAGE1D_BUFFER≥ image_row_pitch
      MEM_OBJECT_IMAGE2D≥ image_row_pitch * image_height
      MEM_OBJECT_IMAGE3D≥ image_slice_pitch * image_depth
      MEM_OBJECT_IMAGE1D_ARRAY≥ image_slice_pitch * image_array_size
      MEM_OBJECT_IMAGE2D_ARRAY≥ image_slice_pitch * image_array_size
      errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
      Returns:
      a valid non-zero image object and the errcode_ret is set to SUCCESS if the image object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:
      • INVALID_CONTEXT if context is not a valid context.
      • INVALID_PROPERTY if a property name in properties is not a supported property name, if the value specified for a supported property name is not valid, or if the same property name is specified more than once.
      • INVALID_VALUE if values specified in flags are not valid.
      • INVALID_IMAGE_FORMAT_DESCRIPTOR if values specified in image_format are not valid or if image_format is NULL.
      • INVALID_IMAGE_FORMAT_DESCRIPTOR if a 2D image is created from a buffer and the row pitch and base address alignment does not follow the rules described for creating a 2D image from a buffer.
      • INVALID_IMAGE_FORMAT_DESCRIPTOR if a 2D image is created from a 2D image object and the rules described above are not followed.
      • INVALID_IMAGE_DESCRIPTOR if values specified in image_desc are not valid or if image_desc is NULL.
      • INVALID_IMAGE_SIZE if image dimensions specified in image_desc exceed the maximum image dimensions for all devices in context.
      • INVALID_HOST_PTR if host_ptr is NULL and MEM_USE_HOST_PTR or MEM_COPY_HOST_PTR are set in flags or if host_ptr is not NULL but MEM_COPY_HOST_PTR or MEM_USE_HOST_PTR are not set in flags.
      • INVALID_VALUE if an image is being created from another memory object (buffer or image) under one of the following circumstances:
        1. mem_object was created with CL_MEM_WRITE_ONLY and flags specifies CL_MEM_READ_WRITE or CL_MEM_READ_ONLY,
        2. mem_object was created with CL_MEM_READ_ONLY and flags specifies CL_MEM_READ_WRITE or CL_MEM_WRITE_ONLY,
        3. flags specifies CL_MEM_USE_HOST_PTR or CL_MEM_ALLOC_HOST_PTR or CL_MEM_COPY_HOST_PTR.
      • INVALID_VALUE if an image is being created from another memory object (buffer or image) and mem_object was created with CL_MEM_HOST_WRITE_ONLY and flags specifies CL_MEM_HOST_READ_ONLY, or if mem_object was created with CL_MEM_HOST_READ_ONLY and flags specifies CL_MEM_HOST_WRITE_ONLY, or if mem_object was created with CL_MEM_HOST_NO_ACCESS and flags specifies CL_MEM_HOST_READ_ONLY or CL_MEM_HOST_WRITE_ONLY.
      • IMAGE_FORMAT_NOT_SUPPORTED if there are no devices in context that support image_format.
      • MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for image object.
      • INVALID_OPERATION if there are no devices in context that support images.
      • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
      • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
      See Also:
    • clCreateImageWithProperties

      public static long clCreateImageWithProperties(long context, @Nullable LongBuffer properties, long flags, CLImageFormat image_format, CLImageDesc image_desc, @Nullable IntBuffer host_ptr, @Nullable IntBuffer errcode_ret)
      Creates an image object with additional properties.

      For a 3D image or 2D image array, the image data specified by host_ptr is stored as a linear sequence of adjacent 2D image slices or 2D images respectively. Each 2D image is a linear sequence of adjacent scanlines. Each scanline is a linear sequence of image elements.

      For a 2D image, the image data specified by host_ptr is stored as a linear sequence of adjacent scanlines. Each scanline is a linear sequence of image elements.

      For a 1D image array, the image data specified by host_ptr is stored as a linear sequence of adjacent 1D images. Each 1D image is stored as a single scanline which is a linear sequence of adjacent elements.

      For 1D image or 1D image buffer, the image data specified by host_ptr is stored as a single scanline which is a linear sequence of adjacent elements.

      Parameters:
      context - a valid OpenCL context used to create the image object
      properties - an optional list of properties for the image object and their corresponding values.

      The list is terminated with the special property 0. If no properties are required, properties may be NULL.

      flags - a bit-field that is used to specify allocation and usage information about the image memory object being created.

      For all image types except MEM_OBJECT_IMAGE1D_BUFFER, if the value specified for flags is 0, the default is used which is MEM_READ_WRITE.

      For CL_MEM_OBJECT_IMAGE1D_BUFFER image type, or an image created from another memory object (image or buffer), if the CL_MEM_READ_WRITE, MEM_READ_ONLY or MEM_WRITE_ONLY values are not specified in flags, they are inherited from the corresponding memory access qualifiers associated with mem_object. The MEM_USE_HOST_PTR, MEM_ALLOC_HOST_PTR and MEM_COPY_HOST_PTR values cannot be specified in flags but are inherited from the corresponding memory access qualifiers associated with mem_object. If CL_MEM_COPY_HOST_PTR is specified in the memory access qualifier values associated with mem_object it does not imply any additional copies when the image is created from mem_object. If the MEM_HOST_WRITE_ONLY, MEM_HOST_READ_ONLY or MEM_HOST_NO_ACCESS values are not specified in flags, they are inherited from the corresponding memory access qualifiers associated with mem_object. One of:

      MEM_READ_WRITEMEM_WRITE_ONLYMEM_READ_ONLYMEM_USE_HOST_PTRMEM_ALLOC_HOST_PTR
      MEM_COPY_HOST_PTRMEM_HOST_WRITE_ONLYMEM_HOST_READ_ONLYMEM_HOST_NO_ACCESS
      image_format - a pointer to a structure that describes format properties of the image to be allocated.

      A 1D image buffer or 2D image can be created from a buffer by specifying a buffer object in the image_desc→mem_object. A 2D image can be created from another 2D image object by specifying an image object in the image_desc→mem_object.

      image_desc - a pointer to a structure that describes type and dimensions of the image to be allocated
      host_ptr - a pointer to the image data that may already be allocated by the application.

      Refer to table below for a description of how large the buffer that host_ptr points to must be.

      ImageTypeSize of buffer that host_ptr points to
      MEM_OBJECT_IMAGE1D≥ image_row_pitch
      MEM_OBJECT_IMAGE1D_BUFFER≥ image_row_pitch
      MEM_OBJECT_IMAGE2D≥ image_row_pitch * image_height
      MEM_OBJECT_IMAGE3D≥ image_slice_pitch * image_depth
      MEM_OBJECT_IMAGE1D_ARRAY≥ image_slice_pitch * image_array_size
      MEM_OBJECT_IMAGE2D_ARRAY≥ image_slice_pitch * image_array_size
      errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
      Returns:
      a valid non-zero image object and the errcode_ret is set to SUCCESS if the image object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:
      • INVALID_CONTEXT if context is not a valid context.
      • INVALID_PROPERTY if a property name in properties is not a supported property name, if the value specified for a supported property name is not valid, or if the same property name is specified more than once.
      • INVALID_VALUE if values specified in flags are not valid.
      • INVALID_IMAGE_FORMAT_DESCRIPTOR if values specified in image_format are not valid or if image_format is NULL.
      • INVALID_IMAGE_FORMAT_DESCRIPTOR if a 2D image is created from a buffer and the row pitch and base address alignment does not follow the rules described for creating a 2D image from a buffer.
      • INVALID_IMAGE_FORMAT_DESCRIPTOR if a 2D image is created from a 2D image object and the rules described above are not followed.
      • INVALID_IMAGE_DESCRIPTOR if values specified in image_desc are not valid or if image_desc is NULL.
      • INVALID_IMAGE_SIZE if image dimensions specified in image_desc exceed the maximum image dimensions for all devices in context.
      • INVALID_HOST_PTR if host_ptr is NULL and MEM_USE_HOST_PTR or MEM_COPY_HOST_PTR are set in flags or if host_ptr is not NULL but MEM_COPY_HOST_PTR or MEM_USE_HOST_PTR are not set in flags.
      • INVALID_VALUE if an image is being created from another memory object (buffer or image) under one of the following circumstances:
        1. mem_object was created with CL_MEM_WRITE_ONLY and flags specifies CL_MEM_READ_WRITE or CL_MEM_READ_ONLY,
        2. mem_object was created with CL_MEM_READ_ONLY and flags specifies CL_MEM_READ_WRITE or CL_MEM_WRITE_ONLY,
        3. flags specifies CL_MEM_USE_HOST_PTR or CL_MEM_ALLOC_HOST_PTR or CL_MEM_COPY_HOST_PTR.
      • INVALID_VALUE if an image is being created from another memory object (buffer or image) and mem_object was created with CL_MEM_HOST_WRITE_ONLY and flags specifies CL_MEM_HOST_READ_ONLY, or if mem_object was created with CL_MEM_HOST_READ_ONLY and flags specifies CL_MEM_HOST_WRITE_ONLY, or if mem_object was created with CL_MEM_HOST_NO_ACCESS and flags specifies CL_MEM_HOST_READ_ONLY or CL_MEM_HOST_WRITE_ONLY.
      • IMAGE_FORMAT_NOT_SUPPORTED if there are no devices in context that support image_format.
      • MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for image object.
      • INVALID_OPERATION if there are no devices in context that support images.
      • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
      • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
      See Also:
    • clCreateImageWithProperties

      public static long clCreateImageWithProperties(long context, @Nullable LongBuffer properties, long flags, CLImageFormat image_format, CLImageDesc image_desc, @Nullable FloatBuffer host_ptr, @Nullable IntBuffer errcode_ret)
      Creates an image object with additional properties.

      For a 3D image or 2D image array, the image data specified by host_ptr is stored as a linear sequence of adjacent 2D image slices or 2D images respectively. Each 2D image is a linear sequence of adjacent scanlines. Each scanline is a linear sequence of image elements.

      For a 2D image, the image data specified by host_ptr is stored as a linear sequence of adjacent scanlines. Each scanline is a linear sequence of image elements.

      For a 1D image array, the image data specified by host_ptr is stored as a linear sequence of adjacent 1D images. Each 1D image is stored as a single scanline which is a linear sequence of adjacent elements.

      For 1D image or 1D image buffer, the image data specified by host_ptr is stored as a single scanline which is a linear sequence of adjacent elements.

      Parameters:
      context - a valid OpenCL context used to create the image object
      properties - an optional list of properties for the image object and their corresponding values.

      The list is terminated with the special property 0. If no properties are required, properties may be NULL.

      flags - a bit-field that is used to specify allocation and usage information about the image memory object being created.

      For all image types except MEM_OBJECT_IMAGE1D_BUFFER, if the value specified for flags is 0, the default is used which is MEM_READ_WRITE.

      For CL_MEM_OBJECT_IMAGE1D_BUFFER image type, or an image created from another memory object (image or buffer), if the CL_MEM_READ_WRITE, MEM_READ_ONLY or MEM_WRITE_ONLY values are not specified in flags, they are inherited from the corresponding memory access qualifiers associated with mem_object. The MEM_USE_HOST_PTR, MEM_ALLOC_HOST_PTR and MEM_COPY_HOST_PTR values cannot be specified in flags but are inherited from the corresponding memory access qualifiers associated with mem_object. If CL_MEM_COPY_HOST_PTR is specified in the memory access qualifier values associated with mem_object it does not imply any additional copies when the image is created from mem_object. If the MEM_HOST_WRITE_ONLY, MEM_HOST_READ_ONLY or MEM_HOST_NO_ACCESS values are not specified in flags, they are inherited from the corresponding memory access qualifiers associated with mem_object. One of:

      MEM_READ_WRITEMEM_WRITE_ONLYMEM_READ_ONLYMEM_USE_HOST_PTRMEM_ALLOC_HOST_PTR
      MEM_COPY_HOST_PTRMEM_HOST_WRITE_ONLYMEM_HOST_READ_ONLYMEM_HOST_NO_ACCESS
      image_format - a pointer to a structure that describes format properties of the image to be allocated.

      A 1D image buffer or 2D image can be created from a buffer by specifying a buffer object in the image_desc→mem_object. A 2D image can be created from another 2D image object by specifying an image object in the image_desc→mem_object.

      image_desc - a pointer to a structure that describes type and dimensions of the image to be allocated
      host_ptr - a pointer to the image data that may already be allocated by the application.

      Refer to table below for a description of how large the buffer that host_ptr points to must be.

      ImageTypeSize of buffer that host_ptr points to
      MEM_OBJECT_IMAGE1D≥ image_row_pitch
      MEM_OBJECT_IMAGE1D_BUFFER≥ image_row_pitch
      MEM_OBJECT_IMAGE2D≥ image_row_pitch * image_height
      MEM_OBJECT_IMAGE3D≥ image_slice_pitch * image_depth
      MEM_OBJECT_IMAGE1D_ARRAY≥ image_slice_pitch * image_array_size
      MEM_OBJECT_IMAGE2D_ARRAY≥ image_slice_pitch * image_array_size
      errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
      Returns:
      a valid non-zero image object and the errcode_ret is set to SUCCESS if the image object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:
      • INVALID_CONTEXT if context is not a valid context.
      • INVALID_PROPERTY if a property name in properties is not a supported property name, if the value specified for a supported property name is not valid, or if the same property name is specified more than once.
      • INVALID_VALUE if values specified in flags are not valid.
      • INVALID_IMAGE_FORMAT_DESCRIPTOR if values specified in image_format are not valid or if image_format is NULL.
      • INVALID_IMAGE_FORMAT_DESCRIPTOR if a 2D image is created from a buffer and the row pitch and base address alignment does not follow the rules described for creating a 2D image from a buffer.
      • INVALID_IMAGE_FORMAT_DESCRIPTOR if a 2D image is created from a 2D image object and the rules described above are not followed.
      • INVALID_IMAGE_DESCRIPTOR if values specified in image_desc are not valid or if image_desc is NULL.
      • INVALID_IMAGE_SIZE if image dimensions specified in image_desc exceed the maximum image dimensions for all devices in context.
      • INVALID_HOST_PTR if host_ptr is NULL and MEM_USE_HOST_PTR or MEM_COPY_HOST_PTR are set in flags or if host_ptr is not NULL but MEM_COPY_HOST_PTR or MEM_USE_HOST_PTR are not set in flags.
      • INVALID_VALUE if an image is being created from another memory object (buffer or image) under one of the following circumstances:
        1. mem_object was created with CL_MEM_WRITE_ONLY and flags specifies CL_MEM_READ_WRITE or CL_MEM_READ_ONLY,
        2. mem_object was created with CL_MEM_READ_ONLY and flags specifies CL_MEM_READ_WRITE or CL_MEM_WRITE_ONLY,
        3. flags specifies CL_MEM_USE_HOST_PTR or CL_MEM_ALLOC_HOST_PTR or CL_MEM_COPY_HOST_PTR.
      • INVALID_VALUE if an image is being created from another memory object (buffer or image) and mem_object was created with CL_MEM_HOST_WRITE_ONLY and flags specifies CL_MEM_HOST_READ_ONLY, or if mem_object was created with CL_MEM_HOST_READ_ONLY and flags specifies CL_MEM_HOST_WRITE_ONLY, or if mem_object was created with CL_MEM_HOST_NO_ACCESS and flags specifies CL_MEM_HOST_READ_ONLY or CL_MEM_HOST_WRITE_ONLY.
      • IMAGE_FORMAT_NOT_SUPPORTED if there are no devices in context that support image_format.
      • MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for image object.
      • INVALID_OPERATION if there are no devices in context that support images.
      • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
      • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
      See Also:
    • clCreateBufferWithProperties

      public static long clCreateBufferWithProperties(long context, long @Nullable [] properties, long flags, ByteBuffer host_ptr, int @Nullable [] errcode_ret)
      Array version of: CreateBufferWithProperties
      See Also:
    • clCreateBufferWithProperties

      public static long clCreateBufferWithProperties(long context, long @Nullable [] properties, long flags, short[] host_ptr, int @Nullable [] errcode_ret)
      Array version of: CreateBufferWithProperties
      See Also:
    • clCreateBufferWithProperties

      public static long clCreateBufferWithProperties(long context, long @Nullable [] properties, long flags, int[] host_ptr, int @Nullable [] errcode_ret)
      Array version of: CreateBufferWithProperties
      See Also:
    • clCreateBufferWithProperties

      public static long clCreateBufferWithProperties(long context, long @Nullable [] properties, long flags, float[] host_ptr, int @Nullable [] errcode_ret)
      Array version of: CreateBufferWithProperties
      See Also:
    • clCreateBufferWithProperties

      public static long clCreateBufferWithProperties(long context, long @Nullable [] properties, long flags, double[] host_ptr, int @Nullable [] errcode_ret)
      Array version of: CreateBufferWithProperties
      See Also:
    • clCreateImageWithProperties

      public static long clCreateImageWithProperties(long context, long @Nullable [] properties, long flags, CLImageFormat image_format, CLImageDesc image_desc, @Nullable ByteBuffer host_ptr, int @Nullable [] errcode_ret)
      Array version of: CreateImageWithProperties
      See Also:
    • clCreateImageWithProperties

      public static long clCreateImageWithProperties(long context, long @Nullable [] properties, long flags, CLImageFormat image_format, CLImageDesc image_desc, short @Nullable [] host_ptr, int @Nullable [] errcode_ret)
      Array version of: CreateImageWithProperties
      See Also:
    • clCreateImageWithProperties

      public static long clCreateImageWithProperties(long context, long @Nullable [] properties, long flags, CLImageFormat image_format, CLImageDesc image_desc, int @Nullable [] host_ptr, int @Nullable [] errcode_ret)
      Array version of: CreateImageWithProperties
      See Also:
    • clCreateImageWithProperties

      public static long clCreateImageWithProperties(long context, long @Nullable [] properties, long flags, CLImageFormat image_format, CLImageDesc image_desc, float @Nullable [] host_ptr, int @Nullable [] errcode_ret)
      Array version of: CreateImageWithProperties
      See Also: