Top Description Fields Constructors Methods
org.lwjgl.opencl

public Class CL30

extends CL22
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.system.*

The core OpenCL 3.0 functionality.

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
CL_DEVICE_ATOMIC_FENCE_CAPABILITIES

Accepted as the param_name parameter of GetDeviceInfo, returns a cl_device_atomic_capabilities value.

public static final int
CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES

Accepted as the param_name parameter of GetDeviceInfo, returns a cl_device_atomic_capabilities value.

public static final int
CL_DEVICE_ATOMIC_ORDER_ACQ_REL

cl_device_atomic_capabilities - bitfield

public static final int
CL_DEVICE_ATOMIC_ORDER_RELAXED

cl_device_atomic_capabilities - bitfield

public static final int
CL_DEVICE_ATOMIC_ORDER_SEQ_CST

cl_device_atomic_capabilities - bitfield

public static final int
CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES

cl_device_atomic_capabilities - bitfield

public static final int
CL_DEVICE_ATOMIC_SCOPE_DEVICE

cl_device_atomic_capabilities - bitfield

public static final int
CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP

cl_device_atomic_capabilities - bitfield

public static final int
CL_DEVICE_ATOMIC_SCOPE_WORK_ITEM

cl_device_atomic_capabilities - bitfield

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.

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.

public static final int
CL_DEVICE_EXTENSIONS_WITH_VERSION

Accepted as the param_name parameter of GetDeviceInfo, returns a cl_name_version[] value.

public static final int
CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT

Accepted as the param_name parameter of GetDeviceInfo, returns a cl_bool value.

public static final int
CL_DEVICE_ILS_WITH_VERSION

Accepted as the param_name parameter of GetDeviceInfo, returns a cl_name_version[] value.

public static final int
CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED

Accepted as the param_name parameter of GetDeviceInfo, returns a char[] value.

public static final int
CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT

Accepted as the param_name parameter of GetDeviceInfo, returns a cl_bool value.

public static final int
CL_DEVICE_NUMERIC_VERSION

Accepted as the param_name parameter of GetDeviceInfo, returns a cl_version value.

public static final int
CL_DEVICE_OPENCL_C_ALL_VERSIONS

Accepted as the param_name parameter of GetDeviceInfo, returns a cl_name_version[] value.

public static final int
CL_DEVICE_OPENCL_C_FEATURES

Accepted as the param_name parameter of GetDeviceInfo, returns a cl_name_version[] value.

public static final int
CL_DEVICE_PIPE_SUPPORT

Accepted as the param_name parameter of GetDeviceInfo, returns a cl_bool value.

public static final int
CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_MULTIPLE

Accepted as the param_name parameter of GetDeviceInfo, returns a size_t value.

public static final int
CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT

cl_device_device_enqueue_capabilities - bitfield

public static final int
CL_DEVICE_QUEUE_SUPPORTED

cl_device_device_enqueue_capabilities - bitfield

public static final int
CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT

Accepted as the param_name parameter of GetDeviceInfo, returns a cl_bool value.

public static final int
CL_MEM_PROPERTIES

Accepted as the param_name parameter of GetMemObjectInfo, returns a cl_mem_properties[] value.

public static final int
CL_PIPE_PROPERTIES

Accepted as the param_name parameter of GetPipeInfo, returns a cl_pipe_properties[] value.

public static final int
CL_PLATFORM_EXTENSIONS_WITH_VERSION

Accepted as the param_name parameter of GetPlatformInfo, returns a cl_name_version[] value.

public static final int
CL_PLATFORM_NUMERIC_VERSION

Accepted as the param_name parameter of GetPlatformInfo, returns a cl_version value.

public static final int
CL_QUEUE_PROPERTIES_ARRAY

Accepted as the param_name parameter of GetCommandQueueInfo, returns a cl_queue_properties[] value.

public static final int
CL_SAMPLER_PROPERTIES

Accepted as the param_name parameter of GetSamplerInfo, returns a cl_sampler_properties[] value.

public static final int
CL_VERSION_3_0

OpenCL Version.

public static final int
CL_VERSION_MAJOR_BITS

cl_version constants

public static final int
CL_VERSION_MAJOR_MASK

cl_version constants

public static final int
CL_VERSION_MINOR_BITS

cl_version constants

public static final int
CL_VERSION_MINOR_MASK

cl_version constants

public static final int
CL_VERSION_PATCH_BITS

cl_version constants

public static final int
CL_VERSION_PATCH_MASK

cl_version constants

Inherited from org.lwjgl.opencl.CL22:
CL_INVALID_SPEC_IDCL_MAX_SIZE_RESTRICTION_EXCEEDEDCL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENTCL_PROGRAM_SCOPE_GLOBAL_DTORS_PRESENTCL_VERSION_2_2

Constructor Summary

AccessConstructor and Description
protected
CL30()

Method Summary

Modifier and TypeMethod and Description
public static int
CL_MAKE_VERSION(int
the major version
major
,
int
the minor version
minor
,
int
the patch version
patch
)

Returns a packed cl_version from a major, minor and patch version.

public static int
CL_VERSION_MAJOR(int
a packed cl_version
version
)

Extracts the major version from a packed cl_version.

public static int
CL_VERSION_MINOR(int
a packed cl_version
version
)

Extracts the minor version from a packed cl_version.

public static int
CL_VERSION_PATCH(int
a packed cl_version
version
)

Extracts the patch version from a packed cl_version.

public static long

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:
clCreateBufferWithProperties
(long
a valid OpenCL context used to create the buffer object
context
,
LongBuffer
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.

properties
,
long
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"
flags
,
long
the size in bytes of the buffer memory object to be allocated
size
,
IntBuffer
will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
errcode_ret
)

Creates a buffer object with additional properties.

public static long

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:
clCreateBufferWithProperties
(long
a valid OpenCL context used to create the buffer object
context
,
LongBuffer
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.

properties
,
long
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"
flags
,
ByteBuffer
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.

host_ptr
,
IntBuffer
will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
errcode_ret
)

Creates a buffer object with additional properties.

public static long

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:
clCreateBufferWithProperties
(long
a valid OpenCL context used to create the buffer object
context
,
LongBuffer
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.

properties
,
long
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"
flags
,
ShortBuffer
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.

host_ptr
,
IntBuffer
will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
errcode_ret
)

Creates a buffer object with additional properties.

public static long

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:
clCreateBufferWithProperties
(long
a valid OpenCL context used to create the buffer object
context
,
LongBuffer
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.

properties
,
long
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"
flags
,
IntBuffer
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.

host_ptr
,
IntBuffer
will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
errcode_ret
)

Creates a buffer object with additional properties.

public static long

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:
clCreateBufferWithProperties
(long
a valid OpenCL context used to create the buffer object
context
,
LongBuffer
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.

properties
,
long
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"
flags
,
FloatBuffer
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.

host_ptr
,
IntBuffer
will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
errcode_ret
)

Creates a buffer object with additional properties.

public static long

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:
clCreateBufferWithProperties
(long
a valid OpenCL context used to create the buffer object
context
,
LongBuffer
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.

properties
,
long
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"
flags
,
DoubleBuffer
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.

host_ptr
,
IntBuffer
will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
errcode_ret
)

Creates a buffer object with additional properties.

public static long
clCreateBufferWithProperties(long context, long[] properties, long flags, ByteBuffer host_ptr, int[] errcode_ret)

Array version of: CreateBufferWithProperties

public static long
clCreateBufferWithProperties(long context, long[] properties, long flags, short[] host_ptr, int[] errcode_ret)

Array version of: CreateBufferWithProperties

public static long
clCreateBufferWithProperties(long context, long[] properties, long flags, int[] host_ptr, int[] errcode_ret)

Array version of: CreateBufferWithProperties

public static long
clCreateBufferWithProperties(long context, long[] properties, long flags, float[] host_ptr, int[] errcode_ret)

Array version of: CreateBufferWithProperties

public static long
clCreateBufferWithProperties(long context, long[] properties, long flags, double[] host_ptr, int[] errcode_ret)

Array version of: CreateBufferWithProperties

public static long

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.
clCreateImageWithProperties
(long
a valid OpenCL context used to create the image object
context
,
LongBuffer
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.

properties
,
long
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
flags
,
CLImageFormat
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_format
,
CLImageDesc
a pointer to a structure that describes type and dimensions of the image to be allocated
image_desc
,
ByteBuffer
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
host_ptr
,
IntBuffer
will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
errcode_ret
)

Creates an image object with additional properties.

public static long

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.
clCreateImageWithProperties
(long
a valid OpenCL context used to create the image object
context
,
LongBuffer
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.

properties
,
long
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
flags
,
CLImageFormat
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_format
,
CLImageDesc
a pointer to a structure that describes type and dimensions of the image to be allocated
image_desc
,
ShortBuffer
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
host_ptr
,
IntBuffer
will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
errcode_ret
)

Creates an image object with additional properties.

public static long

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.
clCreateImageWithProperties
(long
a valid OpenCL context used to create the image object
context
,
LongBuffer
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.

properties
,
long
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
flags
,
CLImageFormat
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_format
,
CLImageDesc
a pointer to a structure that describes type and dimensions of the image to be allocated
image_desc
,
IntBuffer
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
host_ptr
,
IntBuffer
will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
errcode_ret
)

Creates an image object with additional properties.

public static long

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.
clCreateImageWithProperties
(long
a valid OpenCL context used to create the image object
context
,
LongBuffer
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.

properties
,
long
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
flags
,
CLImageFormat
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_format
,
CLImageDesc
a pointer to a structure that describes type and dimensions of the image to be allocated
image_desc
,
FloatBuffer
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
host_ptr
,
IntBuffer
will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
errcode_ret
)

Creates an image object with additional properties.

public static long
clCreateImageWithProperties(long context, long[] properties, long flags, CLImageFormat image_format, CLImageDesc image_desc, ByteBuffer host_ptr, int[] errcode_ret)

Array version of: CreateImageWithProperties

public static long
clCreateImageWithProperties(long context, long[] properties, long flags, CLImageFormat image_format, CLImageDesc image_desc, short[] host_ptr, int[] errcode_ret)

Array version of: CreateImageWithProperties

public static long
clCreateImageWithProperties(long context, long[] properties, long flags, CLImageFormat image_format, CLImageDesc image_desc, int[] host_ptr, int[] errcode_ret)

Array version of: CreateImageWithProperties

public static long
clCreateImageWithProperties(long context, long[] properties, long flags, CLImageFormat image_format, CLImageDesc image_desc, float[] host_ptr, int[] errcode_ret)

Array version of: CreateImageWithProperties

public static int

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.
clSetContextDestructorCallback
(long
specifies the OpenCL context to register the callback to
context
,
CLContextDestructorCallbackI
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.

pfn_notify
,
long
will be passed as the user_data argument when pfn_notify is called. user_data can be NULL.
user_data
)

Registers a callback function with a context that is called when the context is destroyed.

public static long
nclCreateBufferWithProperties(long context, long properties, long flags, long
the size in bytes of the buffer memory object to be allocated
size
,
long host_ptr, long errcode_ret)

Unsafe version of: CreateBufferWithProperties

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

public static int
nclSetContextDestructorCallback(long context, long pfn_notify, long user_data)

Unsafe version of: SetContextDestructorCallback

Inherited from org.lwjgl.opencl.CL22:
clSetProgramReleaseCallbackclSetProgramSpecializationConstantclSetProgramSpecializationConstantclSetProgramSpecializationConstantclSetProgramSpecializationConstantclSetProgramSpecializationConstantclSetProgramSpecializationConstantclSetProgramSpecializationConstantclSetProgramSpecializationConstantclSetProgramSpecializationConstantclSetProgramSpecializationConstantclSetProgramSpecializationConstantnclSetProgramReleaseCallbacknclSetProgramSpecializationConstant