Top Description Fields Constructors Methods
org.lwjgl.opencl

public Class CL20

extends CL12
Class Inheritance
Known Direct Subclasses
org.lwjgl.opencl.CL21
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

The core OpenCL 2.0 functionality.

Field Summary

Modifier and TypeField and Description
public static final int
CL_ABGR

cl_channel_order

public static final int
CL_COMMAND_SVM_FREE

cl_command_type

public static final int
CL_COMMAND_SVM_MAP

cl_command_type

public static final int
CL_COMMAND_SVM_MEMCPY

cl_command_type

public static final int
CL_COMMAND_SVM_MEMFILL

cl_command_type

public static final int
CL_COMMAND_SVM_UNMAP

cl_command_type

public static final int
CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE

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

public static final int
CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT

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

public static final int
CL_DEVICE_IMAGE_PITCH_ALIGNMENT

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

public static final int
CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE

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

public static final int
CL_DEVICE_MAX_ON_DEVICE_EVENTS

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

public static final int
CL_DEVICE_MAX_ON_DEVICE_QUEUES

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

public static final int
CL_DEVICE_MAX_PIPE_ARGS

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

public static final int
CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS

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

public static final int
CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS

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

public static final int
CL_DEVICE_PIPE_MAX_PACKET_SIZE

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

public static final int
CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT

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

public static final int
CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT

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

public static final int
CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT

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

public static final int
CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE

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

public static final int
CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE

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

public static final int
CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES

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

public static final int
CL_DEVICE_QUEUE_ON_HOST_PROPERTIES

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

public static final int
CL_DEVICE_SVM_ATOMICS

cl_device_svm_capabilities

public static final int
CL_DEVICE_SVM_CAPABILITIES

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

public static final int
CL_DEVICE_SVM_COARSE_GRAIN_BUFFER

cl_device_svm_capabilities

public static final int
CL_DEVICE_SVM_FINE_GRAIN_BUFFER

cl_device_svm_capabilities

public static final int
CL_DEVICE_SVM_FINE_GRAIN_SYSTEM

cl_device_svm_capabilities

public static final int
public static final int
public static final int
CL_KERNEL_ARG_TYPE_PIPE

cl_kernel_arg_type_qualifier

public static final int
CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM

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

public static final int
CL_KERNEL_EXEC_INFO_SVM_PTRS

Accepted as the param_name parameter of SetKernelExecInfo, returns a void*[] value.

public static final int
CL_MEM_KERNEL_READ_AND_WRITE

This flag is only used by GetSupportedImageFormats to query image formats that may be both read from and written to by the same kernel instance.

public static final int
CL_MEM_OBJECT_PIPE

cl_mem_object_type

public static final int
CL_MEM_SVM_ATOMICS

SVM memory flag accepted by SVMAlloc.

public static final int
CL_MEM_SVM_FINE_GRAIN_BUFFER

SVM memory flag accepted by SVMAlloc.

public static final int
CL_MEM_USES_SVM_POINTER

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

public static final int
CL_PIPE_MAX_PACKETS

Accepted as the param_name parameter of GetPipeInfo, returns a cl_uint value.

public static final int
CL_PIPE_PACKET_SIZE

Accepted as the param_name parameter of GetPipeInfo, returns a cl_uint value.

public static final int
CL_PROFILING_COMMAND_COMPLETE

Accepted as the param_name parameter of GetEventProfilingInfo, returns a cl_ulong value.

public static final int
CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE

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

public static final int
CL_QUEUE_ON_DEVICE

cl_command_queue_properties

public static final int
CL_QUEUE_ON_DEVICE_DEFAULT

cl_command_queue_properties

public static final int
CL_QUEUE_SIZE

Accepted cl_uint value for the properties parameter to CreateCommandQueueWithProperties.

public static final int
CL_SAMPLER_LOD_MAX

cl_sampler_info

public static final int
CL_SAMPLER_LOD_MIN

cl_sampler_info

public static final int
public static final int
CL_sBGRA

cl_channel_order

public static final int
CL_sRGB

cl_channel_order

public static final int
CL_sRGBA

cl_channel_order

public static final int
CL_sRGBx

cl_channel_order

public static final int
CL_VERSION_2_0

OpenCL Version.

Inherited from org.lwjgl.opencl.CL12:
CL_BLOCKINGCL_COMMAND_BARRIERCL_COMMAND_FILL_BUFFERCL_COMMAND_FILL_IMAGECL_COMMAND_MIGRATE_MEM_OBJECTSCL_COMPILE_PROGRAM_FAILURECL_CONTEXT_INTEROP_USER_SYNCCL_DEVICE_AFFINITY_DOMAIN_L1_CACHECL_DEVICE_AFFINITY_DOMAIN_L2_CACHECL_DEVICE_AFFINITY_DOMAIN_L3_CACHECL_DEVICE_AFFINITY_DOMAIN_L4_CACHECL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLECL_DEVICE_AFFINITY_DOMAIN_NUMACL_DEVICE_BUILT_IN_KERNELSCL_DEVICE_DOUBLE_FP_CONFIGCL_DEVICE_IMAGE_MAX_ARRAY_SIZECL_DEVICE_IMAGE_MAX_BUFFER_SIZECL_DEVICE_LINKER_AVAILABLECL_DEVICE_PARENT_DEVICECL_DEVICE_PARTITION_AFFINITY_DOMAINCL_DEVICE_PARTITION_BY_AFFINITY_DOMAINCL_DEVICE_PARTITION_BY_COUNTSCL_DEVICE_PARTITION_BY_COUNTS_LIST_ENDCL_DEVICE_PARTITION_EQUALLYCL_DEVICE_PARTITION_FAILEDCL_DEVICE_PARTITION_MAX_SUB_DEVICESCL_DEVICE_PARTITION_PROPERTIESCL_DEVICE_PARTITION_TYPECL_DEVICE_PREFERRED_INTEROP_USER_SYNCCL_DEVICE_PRINTF_BUFFER_SIZECL_DEVICE_REFERENCE_COUNTCL_DEVICE_TYPE_CUSTOMCL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRTCL_IMAGE_ARRAY_SIZECL_IMAGE_BUFFERCL_IMAGE_NUM_MIP_LEVELSCL_IMAGE_NUM_SAMPLESCL_INVALID_COMPILER_OPTIONSCL_INVALID_DEVICE_PARTITION_COUNTCL_INVALID_IMAGE_DESCRIPTORCL_INVALID_LINKER_OPTIONSCL_KERNEL_ARG_ACCESS_NONECL_KERNEL_ARG_ACCESS_QUALIFIERCL_KERNEL_ARG_ACCESS_READ_ONLYCL_KERNEL_ARG_ACCESS_READ_WRITECL_KERNEL_ARG_ACCESS_WRITE_ONLYCL_KERNEL_ARG_ADDRESS_CONSTANTCL_KERNEL_ARG_ADDRESS_GLOBALCL_KERNEL_ARG_ADDRESS_LOCALCL_KERNEL_ARG_ADDRESS_PRIVATECL_KERNEL_ARG_ADDRESS_QUALIFIERCL_KERNEL_ARG_INFO_NOT_AVAILABLECL_KERNEL_ARG_NAMECL_KERNEL_ARG_TYPE_CONSTCL_KERNEL_ARG_TYPE_NAMECL_KERNEL_ARG_TYPE_NONECL_KERNEL_ARG_TYPE_QUALIFIERCL_KERNEL_ARG_TYPE_RESTRICTCL_KERNEL_ARG_TYPE_VOLATILECL_KERNEL_ATTRIBUTESCL_KERNEL_GLOBAL_WORK_SIZECL_LINK_PROGRAM_FAILURECL_LINKER_NOT_AVAILABLECL_MAP_WRITE_INVALIDATE_REGIONCL_MEM_HOST_NO_ACCESSCL_MEM_HOST_READ_ONLYCL_MEM_HOST_WRITE_ONLYCL_MEM_OBJECT_IMAGE1DCL_MEM_OBJECT_IMAGE1D_ARRAYCL_MEM_OBJECT_IMAGE1D_BUFFERCL_MEM_OBJECT_IMAGE2D_ARRAYCL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINEDCL_MIGRATE_MEM_OBJECT_HOSTCL_NON_BLOCKINGCL_PROGRAM_BINARY_TYPECL_PROGRAM_BINARY_TYPE_COMPILED_OBJECTCL_PROGRAM_BINARY_TYPE_EXECUTABLECL_PROGRAM_BINARY_TYPE_LIBRARYCL_PROGRAM_BINARY_TYPE_NONECL_PROGRAM_KERNEL_NAMESCL_PROGRAM_NUM_KERNELSCL_VERSION_1_2

Constructor Summary

AccessConstructor and Description
protected
CL20()

Method Summary

Modifier and TypeMethod and Description
public static long

Returns:

a valid non-zero command-queue and errcode_ret is set to SUCCESS if the command-queue 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_DEVICE if device is not a valid device or is not associated with context.
  • INVALID_VALUE if values specified in properties are not valid.
  • INVALID_QUEUE_PROPERTIES if values specified in properties are valid but are not supported by the device.
  • 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.
clCreateCommandQueueWithProperties
(long
a valid OpenCL context
context
,
long
a device associated with context. It can either be in the list of devices specified when context is created using CreateContext or have the same device type as device type specified when context is created using CreateContextFromType.
device
,
LongBuffer
a list of properties for the command-queue and their corresponding values. Each property name is immediately followed by the corresponding desired value. The list is terminated with 0. If a supported property and its value is not specified in properties, its default value will be used. properties can be NULL in which case the default values for supported command-queue properties will be used. One of:
QUEUE_PROPERTIESQUEUE_SIZE
properties
,
IntBuffer
will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
errcode_ret
)

Creates a host or device command-queue on a specific device.

public static long
clCreateCommandQueueWithProperties(long context, long device, long[] properties, int[] errcode_ret)

Array version of: CreateCommandQueueWithProperties

public static long

Returns:

a valid non-zero pipe object and errcode_ret is set to SUCCESS if the pipe object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:
clCreatePipe
(long
a valid OpenCL context used to create the pipe object
context
,
long
a bit-field that is used to specify allocation and usage information such as the memory arena that should be used to allocate the pipe object and how it will be used. If value specified for flags is 0, the default is used which is MEM_READ_WRITE.
flags
,
int
the size in bytes of a pipe packet
pipe_packet_size
,
int
the pipe capacity by specifying the maximum number of packets the pipe can hold
pipe_max_packets
,
PointerBuffer
a list of properties for the pipe and their corresponding values. Each property name is immediately followed by the corresponding desired value. The list is terminated with 0. In OpenCL 2.0, properties must be NULL.
properties
,
IntBuffer
will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
errcode_ret
)

Creates a pipe object.

public static long
clCreatePipe(long context, long flags, int pipe_packet_size, int pipe_max_packets, PointerBuffer properties, int[] errcode_ret)

Array version of: CreatePipe

public static long

Returns:

a valid non-zero sampler object and errcode_ret is set to SUCCESS if the sampler object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:
  • INVALID_CONTEXT if context is not a valid context.
  • INVALID_VALUE if the property name in sampler_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_OPERATION if images are not supported by any device associated with context.
  • 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.
clCreateSamplerWithProperties
(long
a valid OpenCL context
context
,
LongBuffer
a list of sampler property names and their corresponding values. Each sampler property name is immediately followed by the corresponding desired value. The list is terminated with 0. If a supported property and its value is not specified in sampler_properties, its default value will be used. sampler_properties can be NULL in which case the default values for supported sampler properties will be used.
sampler_properties
,
IntBuffer
will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
errcode_ret
)

Creates a sampler object.

public static long
clCreateSamplerWithProperties(long context, long[] sampler_properties, int[] errcode_ret)

Array version of: CreateSamplerWithProperties

public static int

Returns:

SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
  • INVALID_COMMAND_QUEUE if command_queue is not a valid command-queue.
  • INVALID_VALUE if num_svm_pointers is 0 or if svm_pointers is NULL or if any of the pointers specified in svm_pointers array is NULL.
  • INVALID_EVENT_WAIT_LIST if event_wait_list is NULL and num_events_in_wait_list > 0, or event_wait_list is not NULL and num_events_in_wait_list is 0, or if event objects in event_wait_list are not valid events.
  • 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.
clEnqueueSVMFree
(long
a valid host command-queue
command_queue
,
PointerBuffer
the shared virtual memory pointers to be freed. Each pointer in svm_pointers that was allocated using SVMAlloc must have been allocated from the same context from which command_queue was created. The memory associated with svm_pointers can be reused or freed after the function returns.
svm_pointers
,
CLSVMFreeCallbackI
the callback function to be called to free the SVM pointers. If pfn_free_func is NULL, all pointers specified in svm_pointers must be allocated using SVMAlloc and the OpenCL implementation will free these SVM pointers. pfn_free_func must be a valid callback function if any SVM pointer to be freed is a shared system memory pointer i.e. not allocated using SVMAlloc. If pfn_free_func is a valid callback function, the OpenCL implementation will call pfn_free_func to free all the SVM pointers specified in svm_pointers.
pfn_free_func
,
long
will be passed as the user_data argument when pfn_free_func is called. user_data can be NULL.
user_data
,
PointerBuffer
a list of events that need to complete before this particular command can be executed. If event_wait_list is NULL, then this particular command does not wait on any event to complete. The events specified in event_wait_list act as synchronization points. The context associated with events in event_wait_list and command_queue must be the same.
event_wait_list
,
PointerBuffer
Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete. event can be NULL in which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. If the event_wait_list and the event arguments are not NULL, the event argument should not refer to an element of the event_wait_list array.
event
)

Enqueues a command to free the shared virtual memory buffer allocated using SVMAlloc or a shared system memory pointer.

public static int

Returns:

SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
  • INVALID_COMMAND_QUEUE if command_queue is not a valid command-queue.
  • INVALID_CONTEXT if context associated with command_queue and events in event_wait_list are not the same.
  • INVALID_VALUE if svm_ptr is NULL.
  • INVALID_VALUE if size is 0 or if values specified in map_flags are not valid.
  • INVALID_EVENT_WAIT_LIST if event_wait_list is NULL and num_events_in_wait_list > 0, or event_wait_list is not NULL and num_events_in_wait_list is 0, or if event objects in event_wait_list are not valid events.
  • EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST if the map operation is blocking and the execution status of any of the events in event_wait_list is a negative integer value.
  • 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.
clEnqueueSVMMap
(long
a valid host command-queue
command_queue
,
boolean
indicates if the map operation is blocking or non-blocking.

If blocking_map is TRUE, EnqueueSVMMap does not return until the application can access the contents of the SVM region specified by svm_ptr and size on the host.

If blocking_map is FALSE i.e. map operation is non-blocking, the region specified by svm_ptr and size cannot be used until the map command has completed. The event argument returns an event object which can be used to query the execution status of the map command. When the map command is completed, the application can access the contents of the region specified by svm_ptr and size.

blocking_map
,
long
a bit-field
map_flags
,
ByteBuffer
a pointer to a memory region and size in bytes that will be updated by the host. If svm_ptr is allocated using SVMAlloc then it must be allocated from the same context from which command_queue was created. Otherwise the behavior is undefined.
svm_ptr
,
PointerBuffer
a list of events that need to complete before this particular command can be executed. If event_wait_list is NULL, then this particular command does not wait on any event to complete. The events specified in event_wait_list act as synchronization points. The context associated with events in event_wait_list and command_queue must be the same.
event_wait_list
,
PointerBuffer
Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete. event can be NULL in which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. If the event_wait_list and the event arguments are not NULL, the event argument should not refer to an element of the event_wait_list array.
event
)

Enqueues a command that will allow the host to update a region of a SVM buffer.

public static int

Returns:

SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
  • INVALID_COMMAND_QUEUE if command_queue is not a valid command-queue.
  • INVALID_CONTEXT if the context associated with command_queue and events in event_wait_list are not the same.
  • INVALID_EVENT_WAIT_LIST if event_wait_list is NULL and num_events_in_wait_list > 0, or event_wait_list is not NULL and num_events_in_wait_list is 0, or if event objects in event_wait_list are not valid events.
  • EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST if the copy operation is blocking and the execution status of any of the events in event_wait_list is a negative integer value.
  • INVALID_VALUE if dst_ptr or src_ptr are NULL.
  • INVALID_VALUE if size is 0.
  • MEM_COPY_OVERLAP if the values specified for dst_ptr, src_ptr and size result in an overlapping copy.
  • 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.
clEnqueueSVMMemcpy
(long
the host command-queue in which the read / write command will be queued
command_queue
,
boolean
indicates if the copy operation is blocking or non-blocking.

If blocking_copy is TRUE i.e. the copy command is blocking, EnqueueSVMMemcpy does not return until the buffer data has been copied into memory pointed to by dst_ptr.

If blocking_copy is FALSE i.e. the copy command is non-blocking, EnqueueSVMMemcpy queues a non-blocking copy command and returns. The contents of the buffer that dst_ptr point to cannot be used until the copy command has completed. The event argument returns an event object which can be used to query the execution status of the read command. When the copy command has completed, the contents of the buffer that dst_ptr points to can be used by the application.

blocking_copy
,
ByteBuffer
the pointer to a memory region where data is copied to
dst_ptr
,
ByteBuffer
the pointer to a memory region where data is copied from
src_ptr
,
PointerBuffer
a list of events that need to complete before this particular command can be executed. If event_wait_list is NULL, then this particular command does not wait on any event to complete. The events specified in event_wait_list act as synchronization points. The context associated with events in event_wait_list and command_queue must be the same.
event_wait_list
,
PointerBuffer
Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete. event can be NULL in which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. If the event_wait_list and the event arguments are not NULL, the event argument should not refer to an element of the event_wait_list array.
event
)

Enqueues a command to do a memcpy operation.

public static int

Returns:

SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
  • INVALID_COMMAND_QUEUE if command_queue is not a valid command-queue.
  • INVALID_CONTEXT if the context associated with command_queue and events in event_wait_list are not the same.
  • INVALID_VALUE if svm_ptr is NULL.
  • INVALID_VALUE if svm_ptr is not aligned to pattern_size bytes.
  • INVALID_VALUE if pattern is NULL or if pattern_size is 0 or if pattern_size is not one of {1, 2, 4, 8, 16, 32, 64, 128}.
  • INVALID_VALUE if size is 0 or is not a multiple of pattern_size.
  • INVALID_EVENT_WAIT_LIST if event_wait_list is NULL and num_events_in_wait_list > 0, or event_wait_list is not NULL and num_events_in_wait_list is 0, or if event objects in event_wait_list are not valid events.
  • 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.
clEnqueueSVMMemFill
(long
the host command-queue in which the fill command will be queued
command_queue
,
ByteBuffer
a pointer to a memory region that will be filled with pattern. It must be aligned to pattern_size bytes. If svm_ptr is allocated using SVMAlloc then it must be allocated from the same context from which command_queue was created. Otherwise the behavior is undefined.
svm_ptr
,
ByteBuffer
a pointer to the data pattern of size pattern_size in bytes. pattern will be used to fill a region in buffer starting at svm_ptr and is size bytes in size. The data pattern must be a scalar or vector integer or floating-point data type supported by OpenCL. For example, if region pointed to by svm_ptr is to be filled with a pattern of float4 values, then pattern will be a pointer to a cl_float4 value and pattern_size will be sizeof(cl_float4). The maximum value of pattern_size is the size of the largest integer or floating-point vector data type supported by the OpenCL device. The memory associated with pattern can be reused or freed after the function returns.
pattern
,
PointerBuffer
a list of events that need to complete before this particular command can be executed. If event_wait_list is NULL, then this particular command does not wait on any event to complete. The events specified in event_wait_list act as synchronization points. The context associated with events in event_wait_list and command_queue must be the same.
event_wait_list
,
PointerBuffer
Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete. event can be NULL in which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. If the event_wait_list and the event arguments are not NULL, the event argument should not refer to an element of the event_wait_list array.
event
)

Enqueues a command to fill a region in memory with a pattern of a given pattern size.

public static int

Returns:

SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
  • INVALID_COMMAND_QUEUE if command_queue is not a valid command-queue.
  • INVALID_CONTEXT if context associated with command_queue and events in event_wait_list are not the same.
  • INVALID_VALUE if svm_ptr is NULL.
  • INVALID_EVENT_WAIT_LIST if event_wait_list is NULL and num_events_in_wait_list > 0, or event_wait_list is not NULL and num_events_in_wait_list is 0, or if event objects in event_wait_list are not valid events.
  • 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.
clEnqueueSVMUnmap
(long
a valid host command-queue
command_queue
,
ByteBuffer
a pointer that was specified in a previous call to EnqueueSVMMap. If svm_ptr is allocated using SVMAlloc then it must be allocated from the same context from which command_queue was created. Otherwise the behavior is undefined.
svm_ptr
,
PointerBuffer
a list of events that need to complete before this particular command can be executed. If event_wait_list is NULL, then this particular command does not wait on any event to complete. The events specified in event_wait_list act as synchronization points. The context associated with events in event_wait_list and command_queue must be the same.
event_wait_list
,
PointerBuffer
Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete. event can be NULL in which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. If the event_wait_list and the event arguments are not NULL, the event argument should not refer to an element of the event_wait_list array.
event
)

Enqueues a command to indicate that the host has completed updating the region given by svm_ptr and which was specified in a previous call to EnqueueSVMMap.

public static int

Returns:

SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
  • INVALID_VALUE if param_name is not valid, or if size in bytes specified by param_value_size is < size of return type and param_value is not NULL.
  • INVALID_MEM_OBJECT if pipe is not a valid pipe object.
  • 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.
clGetPipeInfo
(long
the pipe object being queried
pipe
,
int
the information to query
param_name
,
ByteBuffer
a pointer to memory where the appropriate result being queried is returned. If param_value is NULL, it is ignored.
param_value
,
PointerBuffer
the actual size in bytes of data being queried by param_value. If NULL, it is ignored.
param_value_size_ret
)

Queries information specific to a pipe object.

public static int

Returns:

SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
  • INVALID_VALUE if param_name is not valid, or if size in bytes specified by param_value_size is < size of return type and param_value is not NULL.
  • INVALID_MEM_OBJECT if pipe is not a valid pipe object.
  • 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.
clGetPipeInfo
(long
the pipe object being queried
pipe
,
int
the information to query
param_name
,
IntBuffer
a pointer to memory where the appropriate result being queried is returned. If param_value is NULL, it is ignored.
param_value
,
PointerBuffer
the actual size in bytes of data being queried by param_value. If NULL, it is ignored.
param_value_size_ret
)

Queries information specific to a pipe object.

public static int
clGetPipeInfo(long pipe, int param_name, int[] param_value, PointerBuffer param_value_size_ret)

Array version of: GetPipeInfo

public static int

Returns:

SUCCESS if the function was executed successfully. Otherwise, it returns one of the following errors:
clSetKernelArgSVMPointer
(long
a valid kernel object
kernel
,
int
the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument to n - 1, where n is the total number of arguments declared by a kernel.
arg_index
,
ByteBuffer
the SVM pointer that should be used as the argument value for argument specified by arg_index. The SVM pointer specified is the value used by all API calls that enqueue kernel (EnqueueNDRangeKernel) until the argument value is changed by a call to SetKernelArgSVMPointer for kernel. The SVM pointer can only be used for arguments that are declared to be a pointer to global or constant memory. The SVM pointer value must be aligned according to the argument's type. For example, if the argument is declared to be global float4 *p, the SVM pointer value passed for p must be at a minimum aligned to a float4. The SVM pointer value specified as the argument value can be the pointer returned by SVMAlloc or can be a pointer + offset into the SVM region.
arg_value
)

Set a SVM pointer as the argument value for a specific argument of a kernel.

public static int

Returns:

SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
clSetKernelExecInfo
(long
the kernel object being queried
kernel
,
int
the information to be passed to kernel. One of:
KERNEL_EXEC_INFO_SVM_PTRSKERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM
param_name
,
ByteBuffer
a pointer to memory where the appropriate values determined by param_name are specified
param_value
)

Can be used to pass additional information other than argument values to a kernel.

public static int

Returns:

SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
clSetKernelExecInfo
(long
the kernel object being queried
kernel
,
int
the information to be passed to kernel. One of:
KERNEL_EXEC_INFO_SVM_PTRSKERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM
param_name
,
PointerBuffer
a pointer to memory where the appropriate values determined by param_name are specified
param_value
)

Can be used to pass additional information other than argument values to a kernel.

public static int

Returns:

SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
clSetKernelExecInfo
(long
the kernel object being queried
kernel
,
int
the information to be passed to kernel. One of:
KERNEL_EXEC_INFO_SVM_PTRSKERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM
param_name
,
IntBuffer
a pointer to memory where the appropriate values determined by param_name are specified
param_value
)

Can be used to pass additional information other than argument values to a kernel.

public static int
clSetKernelExecInfo(long kernel, int param_name, int[] param_value)

Array version of: SetKernelExecInfo

public static ByteBuffer

Returns:

a valid non-NULL shared virtual memory address if the SVM buffer is successfully allocated. Otherwise, like malloc, it returns a NULL pointer value. SVMAlloc will fail if:
  • context is not a valid context.
  • flags does not contain MEM_SVM_FINE_GRAIN_BUFFER but does contain MEM_SVM_ATOMICS.
  • Values specified in flags do not follow rules for supported values.
  • MEM_SVM_FINE_GRAIN_BUFFER or MEM_SVM_ATOMICS is specified in flags and these are not supported by at least one device in context.
  • The values specified in flags are not valid.
  • size is 0 or > DEVICE_MAX_MEM_ALLOC_SIZE value for any device in context.
  • alignment is not a power of two or the OpenCL implementation cannot support the specified alignment for at least one device in context.
  • There was a failure to allocate resources.
clSVMAlloc
(long
a valid OpenCL context used to create the SVM buffer
context
,
long
a bit-field that is used to specify allocation and usage information. One of:
MEM_READ_WRITEMEM_WRITE_ONLYMEM_READ_ONLYMEM_SVM_FINE_GRAIN_BUFFERMEM_SVM_ATOMICS
flags
,
long
the size in bytes of the SVM buffer to be allocated
size
,
int
the minimum alignment in bytes that is required for the newly created buffer's memory region. It must be a power of two up to the largest data type supported by the OpenCL device. For the full profile, the largest data type is long16. For the embedded profile, it is long16 if the device supports 64-bit integers; otherwise it is int16. If alignment is 0, a default alignment will be used that is equal to the size of largest data type supported by the OpenCL implementation.
alignment
)

Allocates a shared virtual memory buffer (referred to as a SVM buffer) that can be shared by the host and all devices in an OpenCL context that support shared virtual memory.

public static void
clSVMFree(long
a valid OpenCL context used to create the SVM buffer
context
,
ByteBuffer
must be the value returned by a call to SVMAlloc. If a NULL pointer is passed in svm_pointer, no action occurs.
svm_pointer
)

Frees a shared virtual memory buffer allocated using SVMAlloc.

public static long
nclCreateCommandQueueWithProperties(long context, long device, long properties, long errcode_ret)

Unsafe version of: CreateCommandQueueWithProperties

public static long
nclCreatePipe(long context, long flags, int pipe_packet_size, int pipe_max_packets, long properties, long errcode_ret)

Unsafe version of: CreatePipe

public static long
nclCreateSamplerWithProperties(long context, long sampler_properties, long errcode_ret)

Unsafe version of: CreateSamplerWithProperties

public static int
nclEnqueueSVMFree(long command_queue, int
the number of pointers in the svm_pointers array
num_svm_pointers
,
long svm_pointers, long pfn_free_func, long user_data, int
the number of events in event_wait_list
num_events_in_wait_list
,
long event_wait_list, long event)

Unsafe version of: EnqueueSVMFree

public static int
nclEnqueueSVMMap(long command_queue, int blocking_map, long map_flags, long svm_ptr, long
the size of the memory region to map, in bytes
size
,
int
the number of events in event_wait_list
num_events_in_wait_list
,
long event_wait_list, long event)

Unsafe version of: EnqueueSVMMap

public static int
nclEnqueueSVMMemcpy(long command_queue, int blocking_copy, long dst_ptr, long src_ptr, long
the size in bytes of data being copied
size
,
int
the number of events in event_wait_list
num_events_in_wait_list
,
long event_wait_list, long event)

Unsafe version of: EnqueueSVMMemcpy

public static int
nclEnqueueSVMMemFill(long command_queue, long svm_ptr, long pattern, long
the size of the pattern array, in bytes
pattern_size
,
long
the size in bytes of region being filled starting with svm_ptr and must be a multiple of pattern_size
size
,
int
the number of events in event_wait_list
num_events_in_wait_list
,
long event_wait_list, long event)

Unsafe version of: EnqueueSVMMemFill

public static int
nclEnqueueSVMUnmap(long command_queue, long svm_ptr, int
the number of events in event_wait_list
num_events_in_wait_list
,
long event_wait_list, long event)

Unsafe version of: EnqueueSVMUnmap

public static int
nclGetPipeInfo(long pipe, int param_name, long
the size in bytes of memory pointed to by param_value. This size must be ≥ size of return type. If param_value is NULL, it is ignored.
param_value_size
,
long param_value, long param_value_size_ret)

Unsafe version of: GetPipeInfo

public static int
nclSetKernelArgSVMPointer(long kernel, int arg_index, long arg_value)

Unsafe version of: SetKernelArgSVMPointer

public static int
nclSetKernelExecInfo(long kernel, int param_name, long
the size in bytes of the memory pointed to by param_value
param_value_size
,
long param_value)

Unsafe version of: SetKernelExecInfo

public static long
nclSVMAlloc(long context, long flags, long size, int alignment)

Unsafe version of: SVMAlloc

public static void
nclSVMFree(long context, long svm_pointer)

Unsafe version of: SVMFree

Inherited from org.lwjgl.opencl.CL12:
clCompileProgramclCompileProgramclCreateImageclCreateImageclCreateImageclCreateImageclCreateImageclCreateImageclCreateImageclCreateImageclCreateProgramWithBuiltInKernelsclCreateProgramWithBuiltInKernelsclCreateProgramWithBuiltInKernelsclCreateProgramWithBuiltInKernelsclCreateProgramWithBuiltInKernelsclCreateSubDevicesclCreateSubDevicesclEnqueueBarrierWithWaitListclEnqueueFillBufferclEnqueueFillImageclEnqueueFillImageclEnqueueFillImageclEnqueueFillImageclEnqueueFillImageclEnqueueMarkerWithWaitListclEnqueueMigrateMemObjectsclGetExtensionFunctionAddressForPlatformclGetExtensionFunctionAddressForPlatformclGetKernelArgInfoclGetKernelArgInfoclGetKernelArgInfoclGetKernelArgInfoclGetKernelArgInfoclLinkProgramclLinkProgramclLinkProgramclLinkProgramclLinkProgramclReleaseDeviceclRetainDeviceclUnloadPlatformCompilernclCompileProgramnclCreateImagenclCreateProgramWithBuiltInKernelsnclCreateSubDevicesnclEnqueueBarrierWithWaitListnclEnqueueFillBuffernclEnqueueFillImagenclEnqueueMarkerWithWaitListnclEnqueueMigrateMemObjectsnclGetExtensionFunctionAddressForPlatformnclGetKernelArgInfonclLinkProgram