Class CL20

  • Direct Known Subclasses:
    CL21

    public class CL20
    extends CL12
    The core OpenCL 2.0 functionality.
    • Method Detail

      • nclCreateCommandQueueWithProperties

        public static long nclCreateCommandQueueWithProperties​(long context,
                                                               long device,
                                                               long properties,
                                                               long errcode_ret)
      • clCreateCommandQueueWithProperties

        public static long clCreateCommandQueueWithProperties​(long context,
                                                              long device,
                                                              @Nullable
                                                              java.nio.LongBuffer properties,
                                                              @Nullable
                                                              java.nio.IntBuffer errcode_ret)
        Creates a host or device command-queue on a specific device.

        OpenCL objects such as memory, program and kernel objects are created using a context. Operations on these objects are performed using a command-queue. The command-queue can be used to queue a set of operations (referred to as commands) in order. Having multiple command-queues allows applications to queue multiple independent commands without requiring synchronization. Note that this should work as long as these objects are not being shared. Sharing of objects across multiple command-queues will require the application to perform appropriate synchronization.

        Parameters:
        context - a valid OpenCL context
        device - 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.
        properties - 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
        errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
        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.
        See Also:
        Reference Page
      • nclCreatePipe

        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
      • clCreatePipe

        public static long clCreatePipe​(long context,
                                        long flags,
                                        int pipe_packet_size,
                                        int pipe_max_packets,
                                        @Nullable
                                        java.nio.IntBuffer properties,
                                        @Nullable
                                        java.nio.IntBuffer errcode_ret)
        Creates a pipe object.
        Parameters:
        context - a valid OpenCL context used to create the pipe object
        flags - 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.
        pipe_packet_size - the size in bytes of a pipe packet
        pipe_max_packets - the pipe capacity by specifying the maximum number of packets the pipe can hold
        properties - 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.
        errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
        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:
        See Also:
        Reference Page
      • nclGetPipeInfo

        public static int nclGetPipeInfo​(long pipe,
                                         int param_name,
                                         long param_value_size,
                                         long param_value,
                                         long param_value_size_ret)
        Unsafe version of: GetPipeInfo
        Parameters:
        param_value_size - 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.
      • clGetPipeInfo

        public static int clGetPipeInfo​(long pipe,
                                        int param_name,
                                        @Nullable
                                        java.nio.ByteBuffer param_value,
                                        @Nullable
                                        PointerBuffer param_value_size_ret)
        
        public static int clGetPipeInfo​(long pipe,
                                        int param_name,
                                        @Nullable
                                        java.nio.IntBuffer param_value,
                                        @Nullable
                                        PointerBuffer param_value_size_ret)
        
        Queries information specific to a pipe object.
        Parameters:
        pipe - the pipe object being queried
        param_name - the information to query
        param_value - a pointer to memory where the appropriate result being queried is returned. If param_value is NULL, it is ignored.
        param_value_size_ret - the actual size in bytes of data being queried by param_value. If NULL, it is ignored.
        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.
        See Also:
        Reference Page
      • nclSVMAlloc

        public static long nclSVMAlloc​(long context,
                                       long flags,
                                       long size,
                                       int alignment)
        Unsafe version of: SVMAlloc
      • clSVMAlloc

        @Nullable
        public static java.nio.ByteBuffer clSVMAlloc​(long context,
                                                     long flags,
                                                     long size,
                                                     int 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.

        If MEM_SVM_FINE_GRAIN_BUFFER is not specified, the buffer can be created as a coarse grained SVM allocation. Similarly, if MEM_SVM_ATOMICS is not specified, the buffer can be created without support for the OpenCL 2.0 SVM atomic operations.

        Calling SVMAlloc does not itself provide consistency for the shared memory region. When the host can't use the SVM atomic operations, it must rely on OpenCL's guaranteed memory consistency at synchronization points. To initialize a buffer to be shared with a kernel, the host can create the buffer and use the resulting virtual memory pointer to initialize the buffer's contents.

        For SVM to be used efficiently, the host and any devices sharing a buffer containing virtual memory pointers should have the same endianness. If the context passed to SVMAlloc has devices with mixed endianness and the OpenCL implementation is unable to implement SVM because of that mixed endianness, SVMAlloc will fail and return NULL.

        Although SVM is generally not supported for image objects, CreateImage may create an image from a buffer (a 1D image from a buffer or a 2D image from buffer) if the buffer specified in its image description parameter is a SVM buffer. Such images have a linear memory representation so their memory can be shared using SVM. However, fine grained sharing and atomics are not supported for image reads and writes in a kernel.

        If CreateBuffer is called with a pointer returned by SVMAlloc as its host_ptr argument, and MEM_USE_HOST_PTR is set in its flags argument, CreateBuffer will succeed and return a valid non-zero buffer object as long as the size argument to CreateBuffer is no larger than the size argument passed in the original SVMAlloc call. The new buffer object returned has the shared memory as the underlying storage. Locations in the buffer's underlying shared memory can be operated on using, e.g., atomic operations if the device supports them.

        Parameters:
        context - a valid OpenCL context used to create the SVM buffer
        flags - 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
        size - the size in bytes of the SVM buffer to be allocated
        alignment - 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.
        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.
        See Also:
        Reference Page
      • nclSVMFree

        public static void nclSVMFree​(long context,
                                      long svm_pointer)
        Unsafe version of: SVMFree
      • clSVMFree

        public static void clSVMFree​(long context,
                                     java.nio.ByteBuffer svm_pointer)
        Frees a shared virtual memory buffer allocated using SVMAlloc.

        Note that SVMFree does not wait for previously enqueued commands that may be using svm_pointer to finish before freeing svm_pointer. It is the responsibility of the application to make sure that enqueued commands that use svm_pointer have finished before freeing svm_pointer. This can be done by enqueuing a blocking operation such as Finish, WaitForEvents, EnqueueReadBuffer or by registering a callback with the events associated with enqueued commands and when the last enqueued command has finished freeing svm_pointer.

        The behavior of using svm_pointer after it has been freed is undefined. In addition, if a buffer object is created using CreateBuffer with svm_pointer, the buffer object must first be released before the svm_pointer is freed.

        Parameters:
        context - a valid OpenCL context used to create the SVM buffer
        svm_pointer - must be the value returned by a call to SVMAlloc. If a NULL pointer is passed in svm_pointer, no action occurs.
        See Also:
        Reference Page
      • nclEnqueueSVMFree

        public static int nclEnqueueSVMFree​(long command_queue,
                                            int num_svm_pointers,
                                            long svm_pointers,
                                            long pfn_free_func,
                                            long user_data,
                                            int num_events_in_wait_list,
                                            long event_wait_list,
                                            long event)
        Unsafe version of: EnqueueSVMFree
        Parameters:
        num_svm_pointers - the number of pointers in the svm_pointers array
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueSVMFree

        public static int clEnqueueSVMFree​(long command_queue,
                                           PointerBuffer svm_pointers,
                                           @Nullable
                                           CLSVMFreeCallbackI pfn_free_func,
                                           long user_data,
                                           @Nullable
                                           PointerBuffer event_wait_list,
                                           @Nullable
                                           PointerBuffer event)
        Enqueues a command to free the shared virtual memory buffer allocated using SVMAlloc or a shared system memory pointer.
        Parameters:
        command_queue - a valid host command-queue
        svm_pointers - 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.
        pfn_free_func - 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.
        user_data - will be passed as the user_data argument when pfn_free_func is called. user_data can be NULL.
        event_wait_list - 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 - 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.
        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.
        See Also:
        Reference Page
      • nclEnqueueSVMMemcpy

        public static int nclEnqueueSVMMemcpy​(long command_queue,
                                              int blocking_copy,
                                              long dst_ptr,
                                              long src_ptr,
                                              long size,
                                              int num_events_in_wait_list,
                                              long event_wait_list,
                                              long event)
        Unsafe version of: EnqueueSVMMemcpy
        Parameters:
        size - the size in bytes of data being copied
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueSVMMemcpy

        public static int clEnqueueSVMMemcpy​(long command_queue,
                                             boolean blocking_copy,
                                             java.nio.ByteBuffer dst_ptr,
                                             java.nio.ByteBuffer src_ptr,
                                             @Nullable
                                             PointerBuffer event_wait_list,
                                             @Nullable
                                             PointerBuffer event)
        Enqueues a command to do a memcpy operation.

        If dst_ptr and/or src_ptr are allocated using SVMAlloc then they must be allocated from the same context from which command_queue was created. Otherwise the behavior is undefined.

        Parameters:
        command_queue - the host command-queue in which the read / write command will be queued
        blocking_copy - 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.

        dst_ptr - the pointer to a memory region where data is copied to
        src_ptr - the pointer to a memory region where data is copied from
        event_wait_list - 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 - 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.
        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.
        See Also:
        Reference Page
      • nclEnqueueSVMMemFill

        public static int nclEnqueueSVMMemFill​(long command_queue,
                                               long svm_ptr,
                                               long pattern,
                                               long pattern_size,
                                               long size,
                                               int num_events_in_wait_list,
                                               long event_wait_list,
                                               long event)
        Unsafe version of: EnqueueSVMMemFill
        Parameters:
        pattern_size - the size of the pattern array, in bytes
        size - the size in bytes of region being filled starting with svm_ptr and must be a multiple of pattern_size
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueSVMMemFill

        public static int clEnqueueSVMMemFill​(long command_queue,
                                              java.nio.ByteBuffer svm_ptr,
                                              java.nio.ByteBuffer pattern,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        Enqueues a command to fill a region in memory with a pattern of a given pattern size.
        Parameters:
        command_queue - the host command-queue in which the fill command will be queued
        svm_ptr - 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.
        pattern - 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.
        event_wait_list - 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 - 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.
        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 &#123;1, 2, 4, 8, 16, 32, 64, 128&#125;.
        • 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.
        See Also:
        Reference Page
      • nclEnqueueSVMMap

        public static int nclEnqueueSVMMap​(long command_queue,
                                           int blocking_map,
                                           long map_flags,
                                           long svm_ptr,
                                           long size,
                                           int num_events_in_wait_list,
                                           long event_wait_list,
                                           long event)
        Unsafe version of: EnqueueSVMMap
        Parameters:
        size - the size of the memory region to map, in bytes
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueSVMMap

        public static int clEnqueueSVMMap​(long command_queue,
                                          boolean blocking_map,
                                          long map_flags,
                                          java.nio.ByteBuffer svm_ptr,
                                          @Nullable
                                          PointerBuffer event_wait_list,
                                          @Nullable
                                          PointerBuffer event)
        Enqueues a command that will allow the host to update a region of a SVM buffer. Note that since we are enqueuing a command with a SVM buffer, the region is already mapped in the host address space.
        Parameters:
        command_queue - a valid host command-queue
        blocking_map - 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.

        map_flags - a bit-field
        svm_ptr - 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.
        event_wait_list - 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 - 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.
        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.
        See Also:
        Reference Page
      • nclEnqueueSVMUnmap

        public static int nclEnqueueSVMUnmap​(long command_queue,
                                             long svm_ptr,
                                             int num_events_in_wait_list,
                                             long event_wait_list,
                                             long event)
        Unsafe version of: EnqueueSVMUnmap
        Parameters:
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueSVMUnmap

        public static int clEnqueueSVMUnmap​(long command_queue,
                                            java.nio.ByteBuffer svm_ptr,
                                            @Nullable
                                            PointerBuffer event_wait_list,
                                            @Nullable
                                            PointerBuffer 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.
        Parameters:
        command_queue - a valid host command-queue
        svm_ptr - 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.
        event_wait_list - 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 - 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.
        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.
        See Also:
        Reference Page
      • nclSetKernelArgSVMPointer

        public static int nclSetKernelArgSVMPointer​(long kernel,
                                                    int arg_index,
                                                    long arg_value)
        Unsafe version of: SetKernelArgSVMPointer
      • clSetKernelArgSVMPointer

        public static int clSetKernelArgSVMPointer​(long kernel,
                                                   int arg_index,
                                                   java.nio.ByteBuffer arg_value)
        Set a SVM pointer as the argument value for a specific argument of a kernel.
        Parameters:
        kernel - a valid kernel object
        arg_index - 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_value - 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.
        Returns:
        SUCCESS if the function was executed successfully. Otherwise, it returns one of the following errors:
        See Also:
        Reference Page
      • nclSetKernelExecInfo

        public static int nclSetKernelExecInfo​(long kernel,
                                               int param_name,
                                               long param_value_size,
                                               long param_value)
        Unsafe version of: SetKernelExecInfo
        Parameters:
        param_value_size - the size in bytes of the memory pointed to by param_value
      • clSetKernelExecInfo

        public static int clSetKernelExecInfo​(long kernel,
                                              int param_name,
                                              java.nio.ByteBuffer param_value)
        
        public static int clSetKernelExecInfo​(long kernel,
                                              int param_name,
                                              PointerBuffer param_value)
        
        public static int clSetKernelExecInfo​(long kernel,
                                              int param_name,
                                              java.nio.IntBuffer param_value)
        
        Can be used to pass additional information other than argument values to a kernel.

        NOTES

        1. Coarse-grain or fine-grain buffer SVM pointers used by a kernel which are not passed as a kernel arguments must be specified using SetKernelExecInfo with KERNEL_EXEC_INFO_SVM_PTRS. For example, if SVM buffer A contains a pointer to another SVM buffer B, and the kernel dereferences that pointer, then a pointer to B must either be passed as an argument in the call to that kernel or it must be made available to the kernel using SetKernelExecInfo. For example, we might pass extra SVM pointers as follows:

        clSetKernelExecInfo(kernel, CL_KERNEL_EXEC_INFO_SVM_PTRS, num_ptrs * sizeof(void *), extra_svm_ptr_list);

        Here num_ptrs specifies the number of additional SVM pointers while extra_svm_ptr_list specifies a pointer to memory containing those SVM pointers. When calling SetKernelExecInfo with KERNEL_EXEC_INFO_SVM_PTRS to specify pointers to non-argument SVM buffers as extra arguments to a kernel, each of these pointers can be the SVM pointer returned by SVMAlloc or can be a pointer + offset into the SVM region. It is sufficient to provide one pointer for each SVM buffer used.

        2. KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM is used to indicate whether SVM pointers used by a kernel will refer to system allocations or not.

        KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM = FALSE indicates that the OpenCL implementation may assume that system pointers are not passed as kernel arguments and are not stored inside SVM allocations passed as kernel arguments.

        KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM = TRUE indicates that the OpenCL implementation must assume that system pointers might be passed as kernel arguments and/or stored inside SVM allocations passed as kernel arguments. In this case, if the device to which the kernel is enqueued does not support system SVM pointers, EnqueueNDRangeKernel will return a INVALID_OPERATION error. If none of the devices in the context associated with kernel support fine-grain system SVM allocations, SetKernelExecInfo will return a INVALID_OPERATION error.

        If SetKernelExecInfo has not been called with a value for KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM, the default value is used for this kernel attribute. The default value depends on whether the device on which the kernel is enqueued supports fine-grain system SVM allocations. If so, the default value used is TRUE (system pointers might be passed); otherwise, the default is FALSE.

        Parameters:
        kernel - the kernel object being queried
        param_name - the information to be passed to kernel. One of:
        KERNEL_EXEC_INFO_SVM_PTRSKERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM
        param_value - a pointer to memory where the appropriate values determined by param_name are specified
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        See Also:
        Reference Page
      • nclCreateSamplerWithProperties

        public static long nclCreateSamplerWithProperties​(long context,
                                                          long sampler_properties,
                                                          long errcode_ret)
        Unsafe version of: CreateSamplerWithProperties
      • clCreateSamplerWithProperties

        public static long clCreateSamplerWithProperties​(long context,
                                                         @Nullable
                                                         java.nio.IntBuffer sampler_properties,
                                                         @Nullable
                                                         java.nio.IntBuffer errcode_ret)
        Creates a sampler object.
        Parameters:
        context - a valid OpenCL context
        sampler_properties - 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.
        errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
        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.
        See Also:
        Reference Page
      • clCreateCommandQueueWithProperties

        public static long clCreateCommandQueueWithProperties​(long context,
                                                              long device,
                                                              @Nullable
                                                              long[] properties,
                                                              @Nullable
                                                              int[] errcode_ret)
        See Also:
        Reference Page
      • clCreatePipe

        public static long clCreatePipe​(long context,
                                        long flags,
                                        int pipe_packet_size,
                                        int pipe_max_packets,
                                        @Nullable
                                        int[] properties,
                                        @Nullable
                                        int[] errcode_ret)
        Array version of: CreatePipe
        See Also:
        Reference Page
      • clGetPipeInfo

        public static int clGetPipeInfo​(long pipe,
                                        int param_name,
                                        @Nullable
                                        int[] param_value,
                                        @Nullable
                                        PointerBuffer param_value_size_ret)
        Array version of: GetPipeInfo
        See Also:
        Reference Page
      • clSetKernelExecInfo

        public static int clSetKernelExecInfo​(long kernel,
                                              int param_name,
                                              int[] param_value)
        Array version of: SetKernelExecInfo
        See Also:
        Reference Page
      • clCreateSamplerWithProperties

        public static long clCreateSamplerWithProperties​(long context,
                                                         @Nullable
                                                         int[] sampler_properties,
                                                         @Nullable
                                                         int[] errcode_ret)
        Array version of: CreateSamplerWithProperties
        See Also:
        Reference Page