Class CL10

  • Direct Known Subclasses:
    CL11

    public class CL10
    extends java.lang.Object
    The core OpenCL 1.0 functionality.
    • Method Detail

      • nclGetPlatformIDs

        public static int nclGetPlatformIDs​(int num_entries,
                                            long platforms,
                                            long num_platforms)
        Unsafe version of: GetPlatformIDs
        Parameters:
        num_entries - the number of cl_platform_id entries that can be added to platforms. If platforms is not NULL, the num_entries must be greater than zero.
      • clGetPlatformIDs

        public static int clGetPlatformIDs​(@Nullable
                                           PointerBuffer platforms,
                                           @Nullable
                                           java.nio.IntBuffer num_platforms)
        Obtains the list of available platforms.
        Parameters:
        platforms - returns a list of OpenCL platforms found. The cl_platform_id values returned in platforms can be used to identify a specific OpenCL platform. If platforms argument is NULL, this argument is ignored. The number of OpenCL platforms returned is the minimum of the value specified by num_entries or the number of OpenCL platforms available.
        num_platforms - returns the number of OpenCL platforms available. If num_platforms is NULL, this argument is ignored.
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_VALUE if num_entries is equal to zero and platforms is not NULL or if both num_platforms and platforms are NULL.
        • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
        See Also:
        Reference Page
      • nclGetPlatformInfo

        public static int nclGetPlatformInfo​(long platform,
                                             int param_name,
                                             long param_value_size,
                                             long param_value,
                                             long param_value_size_ret)
        Unsafe version of: GetPlatformInfo
        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.
      • clGetPlatformInfo

        public static int clGetPlatformInfo​(long platform,
                                            int param_name,
                                            @Nullable
                                            java.nio.ByteBuffer param_value,
                                            @Nullable
                                            PointerBuffer param_value_size_ret)
        
        public static int clGetPlatformInfo​(long platform,
                                            int param_name,
                                            @Nullable
                                            java.nio.LongBuffer param_value,
                                            @Nullable
                                            PointerBuffer param_value_size_ret)
        
        Returns information about the specified OpenCL platform.
        Parameters:
        platform - the platform to query
        param_name - the parameter to query. One of:
        PLATFORM_PROFILEPLATFORM_VERSIONPLATFORM_NAMEPLATFORM_VENDOR
        PLATFORM_EXTENSIONSPLATFORM_HOST_TIMER_RESOLUTION
        param_value - the memory location where appropriate values for a given param_name will be returned
        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_PLATFORM if platform is not a valid platform.
        • INVALID_VALUE if param_name is not one of the supported values or if size in bytes specified by param_value_size is < size of return type and param_value is not a NULL value.
        • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
        See Also:
        Reference Page
      • nclGetDeviceIDs

        public static int nclGetDeviceIDs​(long platform,
                                          long device_type,
                                          int num_entries,
                                          long devices,
                                          long num_devices)
        Unsafe version of: GetDeviceIDs
        Parameters:
        num_entries - the number of cl_device_id entries that can be added to devices. If devices is not NULL, the num_entries must be greater than zero.
      • clGetDeviceIDs

        public static int clGetDeviceIDs​(long platform,
                                         long device_type,
                                         @Nullable
                                         PointerBuffer devices,
                                         @Nullable
                                         java.nio.IntBuffer num_devices)
        Obtains the list of devices available on a platform.
        Parameters:
        platform - the platform to query
        device_type - a bitfield that identifies the type of OpenCL device. The device_type can be used to query specific OpenCL devices or all OpenCL devices available. One or more of:
        DEVICE_TYPE_DEFAULTDEVICE_TYPE_CPUDEVICE_TYPE_GPUDEVICE_TYPE_ACCELERATOR
        DEVICE_TYPE_ALLDEVICE_TYPE_CUSTOM
        devices - returns a list of OpenCL devices found. The cl_device_id values returned in devices can be used to identify a specific OpenCL device. If devices argument is NULL, this argument is ignored. The number of OpenCL devices returned is the minimum of the value specified by num_entries or the number of OpenCL devices whose type matches device_type.
        num_devices - returns the number of OpenCL devices available that match device_type. If num_devices is NULL, this argument is ignored.
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_PLATFORM if platform is not a valid platform.
        • INVALID_DEVICE_TYPE if device_type is not a valid value.
        • INVALID_VALUE if num_entries is equal to zero and devices is not NULL or if both num_devices and devices are NULL.
        • DEVICE_NOT_FOUND if no OpenCL devices that matched device_type were found.
        • 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
      • nclGetDeviceInfo

        public static int nclGetDeviceInfo​(long device,
                                           int param_name,
                                           long param_value_size,
                                           long param_value,
                                           long param_value_size_ret)
        Unsafe version of: GetDeviceInfo
        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.
      • nclCreateContext

        public static long nclCreateContext​(long properties,
                                            int num_devices,
                                            long devices,
                                            long pfn_notify,
                                            long user_data,
                                            long errcode_ret)
        Unsafe version of: CreateContext
        Parameters:
        num_devices - the number of devices specified in the devices argument
      • clCreateContext

        public static long clCreateContext​(@Nullable
                                           PointerBuffer properties,
                                           PointerBuffer devices,
                                           @Nullable
                                           CLContextCallbackI pfn_notify,
                                           long user_data,
                                           @Nullable
                                           java.nio.IntBuffer errcode_ret)
        Creates an OpenCL context. An OpenCL context is created with one or more devices. Contexts are used by the OpenCL runtime for managing objects such as command-queues, memory, program and kernel objects and for executing kernels on one or more devices specified in the context.
        Parameters:
        properties - a list of context property names and their corresponding values. Each property name is immediately followed by the corresponding desired value. The list is terminated with 0. One of:
        CONTEXT_PLATFORMCONTEXT_INTEROP_USER_SYNCGL_CONTEXT_KHREGL_DISPLAY_KHRGLX_DISPLAY_KHR
        WGL_HDC_KHRCGL_SHAREGROUP_KHR
        devices - a list of unique devices returned by GetDeviceIDs or sub-devices created by CreateSubDevices for a platform
        pfn_notify - a callback function that can be registered by the application. This callback function will be used by the OpenCL implementation to report information on errors during context creation as well as errors that occur at runtime in this context. 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.

        If pfn_notify is NULL, no callback function is registered.

        user_data - will be passed as the user_data argument when pfn_notify is called. user_data can 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 context and errcode_ret is set to SUCCESS if the context is created successfully. Otherwise, it returns a NULL value with the following error values returned in errcode_ret:
        • INVALID_PLATFORM if properties is NULL and no platform could be selected or if platform value specified in properties is not a valid platform.
        • INVALID_PROPERTY if context 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 devices is NULL.
        • INVALID_VALUE if num_devices is equal to zero.
        • INVALID_VALUE if pfn_notify is NULL but user_data is not NULL.
        • INVALID_DEVICE if devices contains an invalid device.
        • DEVICE_NOT_AVAILABLE if a device in devices is currently not available even though the device was returned by GetDeviceIDs.
        • 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
      • clCreateContext

        public static long clCreateContext​(@Nullable
                                           PointerBuffer properties,
                                           long device,
                                           @Nullable
                                           CLContextCallbackI pfn_notify,
                                           long user_data,
                                           @Nullable
                                           java.nio.IntBuffer errcode_ret)
        Creates an OpenCL context. An OpenCL context is created with one or more devices. Contexts are used by the OpenCL runtime for managing objects such as command-queues, memory, program and kernel objects and for executing kernels on one or more devices specified in the context.
        Parameters:
        properties - a list of context property names and their corresponding values. Each property name is immediately followed by the corresponding desired value. The list is terminated with 0. One of:
        CONTEXT_PLATFORMCONTEXT_INTEROP_USER_SYNCGL_CONTEXT_KHREGL_DISPLAY_KHRGLX_DISPLAY_KHR
        WGL_HDC_KHRCGL_SHAREGROUP_KHR
        pfn_notify - a callback function that can be registered by the application. This callback function will be used by the OpenCL implementation to report information on errors during context creation as well as errors that occur at runtime in this context. 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.

        If pfn_notify is NULL, no callback function is registered.

        user_data - will be passed as the user_data argument when pfn_notify is called. user_data can 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 context and errcode_ret is set to SUCCESS if the context is created successfully. Otherwise, it returns a NULL value with the following error values returned in errcode_ret:
        • INVALID_PLATFORM if properties is NULL and no platform could be selected or if platform value specified in properties is not a valid platform.
        • INVALID_PROPERTY if context 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 devices is NULL.
        • INVALID_VALUE if num_devices is equal to zero.
        • INVALID_VALUE if pfn_notify is NULL but user_data is not NULL.
        • INVALID_DEVICE if devices contains an invalid device.
        • DEVICE_NOT_AVAILABLE if a device in devices is currently not available even though the device was returned by GetDeviceIDs.
        • 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
      • nclCreateContextFromType

        public static long nclCreateContextFromType​(long properties,
                                                    long device_type,
                                                    long pfn_notify,
                                                    long user_data,
                                                    long errcode_ret)
        Unsafe version of: CreateContextFromType
      • clCreateContextFromType

        public static long clCreateContextFromType​(@Nullable
                                                   PointerBuffer properties,
                                                   long device_type,
                                                   @Nullable
                                                   CLContextCallbackI pfn_notify,
                                                   long user_data,
                                                   @Nullable
                                                   java.nio.IntBuffer errcode_ret)
        Creates a context using devices of the specified type. See CreateContext for details.
        Parameters:
        properties - a list of context property names and their corresponding values. Each property name is immediately followed by the corresponding desired value. The list is terminated with 0.
        device_type - a bit-field that identifies the type of device. One of:
        DEVICE_TYPE_DEFAULTDEVICE_TYPE_CPUDEVICE_TYPE_GPUDEVICE_TYPE_ACCELERATOR
        DEVICE_TYPE_ALLDEVICE_TYPE_CUSTOM
        pfn_notify - a callback function that can be registered by the application
        user_data - will be passed as the user_data argument when pfn_notify is called. user_data can be NULL.
        errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
        See Also:
        Reference Page
      • clRetainContext

        public static int clRetainContext​(long context)
        Increments the context reference count.

        CreateContext and CreateContextFromType perform an implicit retain. This is very helpful for 3rd party libraries, which typically get a context passed to them by the application. However, it is possible that the application may delete the context without informing the library. Allowing functions to attach to (i.e. retain) and release a context solves the problem of a context being used by a library no longer being valid.

        Parameters:
        context - the context to retain
        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.
        • 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
      • clReleaseContext

        public static int clReleaseContext​(long context)
        Decrements the context reference count.

        After the context reference count becomes zero and all the objects attached to context (such as memory objects, command-queues) are released, the context is deleted.

        Parameters:
        context - the context to release
        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.
        • 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
      • nclGetContextInfo

        public static int nclGetContextInfo​(long context,
                                            int param_name,
                                            long param_value_size,
                                            long param_value,
                                            long param_value_size_ret)
        Unsafe version of: GetContextInfo
        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.
      • clGetContextInfo

        public static int clGetContextInfo​(long context,
                                           int param_name,
                                           @Nullable
                                           java.nio.ByteBuffer param_value,
                                           @Nullable
                                           PointerBuffer param_value_size_ret)
        
        public static int clGetContextInfo​(long context,
                                           int param_name,
                                           @Nullable
                                           java.nio.IntBuffer param_value,
                                           @Nullable
                                           PointerBuffer param_value_size_ret)
        
        public static int clGetContextInfo​(long context,
                                           int param_name,
                                           @Nullable
                                           PointerBuffer param_value,
                                           @Nullable
                                           PointerBuffer param_value_size_ret)
        
        Queries information about a context.
        Parameters:
        context - the OpenCL context being queried
        param_name - an enumeration constant that specifies the information to query. One of:
        CONTEXT_REFERENCE_COUNTCONTEXT_DEVICESCONTEXT_PROPERTIESCONTEXT_NUM_DEVICES
        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_CONTEXT if context is not a valid context.
        • INVALID_VALUE if param_name is not one of the supported values or if size in bytes specified by param_value_size is < size of return type and param_value is not a NULL 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
      • nclCreateCommandQueue

        public static long nclCreateCommandQueue​(long context,
                                                 long device,
                                                 long properties,
                                                 long errcode_ret)
        Unsafe version of: CreateCommandQueue
      • clCreateCommandQueue

        public static long clCreateCommandQueue​(long context,
                                                long device,
                                                long properties,
                                                @Nullable
                                                java.nio.IntBuffer errcode_ret)
        Creates a 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 bit-field of properties for the command-queue. One of:
        QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLEQUEUE_PROFILING_ENABLEQUEUE_ON_DEVICE
        QUEUE_ON_DEVICE_DEFAULT
        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 - This function is deprecated after OpenCL 1.2
      • clRetainCommandQueue

        public static int clRetainCommandQueue​(long command_queue)
        Increments the command_queue reference count.

        CreateCommandQueue performs an implicit retain. This is very helpful for 3rd party libraries, which typically get a command-queue passed to them by the application. However, it is possible that the application may delete the command-queue without informing the library. Allowing functions to attach to (i.e. retain) and release a command-queue solves the problem of a command-queue being used by a library no longer being valid.

        Parameters:
        command_queue - the command-queue to retain
        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.
        • 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
      • clReleaseCommandQueue

        public static int clReleaseCommandQueue​(long command_queue)
        Decrements the command_queue reference count.

        After the command_queue reference count becomes zero and all commands queued to command_queue have finished (eg. kernel executions, memory object updates etc.), the command-queue is deleted.

        clReleaseCommandQueue performs an implicit flush to issue any previously queued OpenCL commands in command_queue.

        Parameters:
        command_queue - the command-queue to release
        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.
        • 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
      • nclGetCommandQueueInfo

        public static int nclGetCommandQueueInfo​(long command_queue,
                                                 int param_name,
                                                 long param_value_size,
                                                 long param_value,
                                                 long param_value_size_ret)
        Unsafe version of: GetCommandQueueInfo
        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.
      • clGetCommandQueueInfo

        public static int clGetCommandQueueInfo​(long command_queue,
                                                int param_name,
                                                @Nullable
                                                java.nio.ByteBuffer param_value,
                                                @Nullable
                                                PointerBuffer param_value_size_ret)
        
        public static int clGetCommandQueueInfo​(long command_queue,
                                                int param_name,
                                                @Nullable
                                                java.nio.IntBuffer param_value,
                                                @Nullable
                                                PointerBuffer param_value_size_ret)
        
        public static int clGetCommandQueueInfo​(long command_queue,
                                                int param_name,
                                                @Nullable
                                                java.nio.LongBuffer param_value,
                                                @Nullable
                                                PointerBuffer param_value_size_ret)
        
        public static int clGetCommandQueueInfo​(long command_queue,
                                                int param_name,
                                                @Nullable
                                                PointerBuffer param_value,
                                                @Nullable
                                                PointerBuffer param_value_size_ret)
        
        Queries information about a command-queue.
        Parameters:
        command_queue - the command-queue being queried
        param_name - the information to query. One of:
        QUEUE_CONTEXTQUEUE_DEVICEQUEUE_REFERENCE_COUNTQUEUE_PROPERTIESQUEUE_SIZE
        QUEUE_DEVICE_DEFAULT
        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_COMMAND_QUEUE if command_queue is not a valid command-queue.
        • INVALID_VALUE if param_name is not one of the supported values or if size in bytes specified by param_value_size is < size of return type and param_value is not a NULL 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
      • nclCreateBuffer

        public static long nclCreateBuffer​(long context,
                                           long flags,
                                           long size,
                                           long host_ptr,
                                           long errcode_ret)
        Unsafe version of: CreateBuffer
        Parameters:
        size - the size in bytes of the buffer memory object to be allocated
      • clCreateBuffer

        public static long clCreateBuffer​(long context,
                                          long flags,
                                          java.nio.ByteBuffer host_ptr,
                                          @Nullable
                                          java.nio.IntBuffer errcode_ret)
        
        public static long clCreateBuffer​(long context,
                                          long flags,
                                          java.nio.ShortBuffer host_ptr,
                                          @Nullable
                                          java.nio.IntBuffer errcode_ret)
        
        public static long clCreateBuffer​(long context,
                                          long flags,
                                          java.nio.IntBuffer host_ptr,
                                          @Nullable
                                          java.nio.IntBuffer errcode_ret)
        
        public static long clCreateBuffer​(long context,
                                          long flags,
                                          java.nio.FloatBuffer host_ptr,
                                          @Nullable
                                          java.nio.IntBuffer errcode_ret)
        
        public static long clCreateBuffer​(long context,
                                          long flags,
                                          java.nio.DoubleBuffer host_ptr,
                                          @Nullable
                                          java.nio.IntBuffer errcode_ret)
        
        Creates a buffer object.
        Parameters:
        context - a valid OpenCL context used to create the buffer object
        flags - a bit-field that is used to specify allocation and usage information such as the memory area that should be used to allocate the buffer object and how it will be used. If value specified for flags is 0, the default is used which is MEM_READ_WRITE. One of:
        MEM_READ_WRITEMEM_WRITE_ONLYMEM_READ_ONLYMEM_USE_HOST_PTRMEM_ALLOC_HOST_PTR
        MEM_COPY_HOST_PTRMEM_HOST_WRITE_ONLYMEM_HOST_READ_ONLYMEM_HOST_NO_ACCESS
        host_ptr - a pointer to the buffer data that may already be allocated by the application. The size of the buffer that host_ptr points to must be ≥ size bytes.
        errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
        Returns:
        a valid non-zero buffer object and errcode_ret is set to SUCCESS if the buffer object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:
        See Also:
        Reference Page
      • nclEnqueueReadBuffer

        public static int nclEnqueueReadBuffer​(long command_queue,
                                               long buffer,
                                               int blocking_read,
                                               long offset,
                                               long size,
                                               long ptr,
                                               int num_events_in_wait_list,
                                               long event_wait_list,
                                               long event)
        Unsafe version of: EnqueueReadBuffer
        Parameters:
        size - the size in bytes of data being read
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueReadBuffer

        public static int clEnqueueReadBuffer​(long command_queue,
                                              long buffer,
                                              boolean blocking_read,
                                              long offset,
                                              java.nio.ByteBuffer ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        public static int clEnqueueReadBuffer​(long command_queue,
                                              long buffer,
                                              boolean blocking_read,
                                              long offset,
                                              java.nio.ShortBuffer ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        public static int clEnqueueReadBuffer​(long command_queue,
                                              long buffer,
                                              boolean blocking_read,
                                              long offset,
                                              java.nio.IntBuffer ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        public static int clEnqueueReadBuffer​(long command_queue,
                                              long buffer,
                                              boolean blocking_read,
                                              long offset,
                                              java.nio.FloatBuffer ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        public static int clEnqueueReadBuffer​(long command_queue,
                                              long buffer,
                                              boolean blocking_read,
                                              long offset,
                                              java.nio.DoubleBuffer ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        Enqueues a command to read from a buffer object to host memory.

        Calling clEnqueueReadBuffer to read a region of the buffer object with the ptr argument value set to host_ptr + offset, where host_ptr is a pointer to the memory region specified when the buffer object being read is created with MEM_USE_HOST_PTR, must meet the following requirements in order to avoid undefined behavior:

        • All commands that use this buffer object or a memory object (buffer or image) created from this buffer object have finished execution before the read command begins execution.
        • The buffer object or memory objects created from this buffer object are not mapped.
        • The buffer object or memory objects created from this buffer object are not used by any command-queue until the read command has finished execution.
        Parameters:
        command_queue - the command-queue in which the read command will be queued. command_queue and buffer must be created with the same OpenCL context.
        buffer - a valid buffer object
        blocking_read - indicates if the read operation is blocking or non-blocking

        If blocking_read is TRUE i.e. the read command is blocking, clEnqueueReadBuffer does not return until the buffer data has been read and copied into memory pointed to by ptr.

        If blocking_read is FALSE i.e. the read command is non-blocking, clEnqueueReadBuffer queues a non-blocking read command and returns. The contents of the buffer that ptr points to cannot be used until the read 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 read command has completed, the contents of the buffer that ptr points to can be used by the application.

        offset - the offset in bytes in the buffer object to read from
        ptr - the pointer to buffer in host memory where data is to be read into
        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:
        See Also:
        Reference Page
      • nclEnqueueWriteBuffer

        public static int nclEnqueueWriteBuffer​(long command_queue,
                                                long buffer,
                                                int blocking_write,
                                                long offset,
                                                long size,
                                                long ptr,
                                                int num_events_in_wait_list,
                                                long event_wait_list,
                                                long event)
        Unsafe version of: EnqueueWriteBuffer
        Parameters:
        size - the size in bytes of data being written
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueWriteBuffer

        public static int clEnqueueWriteBuffer​(long command_queue,
                                               long buffer,
                                               boolean blocking_write,
                                               long offset,
                                               java.nio.ByteBuffer ptr,
                                               @Nullable
                                               PointerBuffer event_wait_list,
                                               @Nullable
                                               PointerBuffer event)
        
        public static int clEnqueueWriteBuffer​(long command_queue,
                                               long buffer,
                                               boolean blocking_write,
                                               long offset,
                                               java.nio.ShortBuffer ptr,
                                               @Nullable
                                               PointerBuffer event_wait_list,
                                               @Nullable
                                               PointerBuffer event)
        
        public static int clEnqueueWriteBuffer​(long command_queue,
                                               long buffer,
                                               boolean blocking_write,
                                               long offset,
                                               java.nio.IntBuffer ptr,
                                               @Nullable
                                               PointerBuffer event_wait_list,
                                               @Nullable
                                               PointerBuffer event)
        
        public static int clEnqueueWriteBuffer​(long command_queue,
                                               long buffer,
                                               boolean blocking_write,
                                               long offset,
                                               java.nio.FloatBuffer ptr,
                                               @Nullable
                                               PointerBuffer event_wait_list,
                                               @Nullable
                                               PointerBuffer event)
        
        public static int clEnqueueWriteBuffer​(long command_queue,
                                               long buffer,
                                               boolean blocking_write,
                                               long offset,
                                               java.nio.DoubleBuffer ptr,
                                               @Nullable
                                               PointerBuffer event_wait_list,
                                               @Nullable
                                               PointerBuffer event)
        
        Enqueues a command to write to a buffer object from host memory.

        Calling clEnqueueWriteBuffer to update the latest bits in a region of the buffer object with the ptr argument value set to host_ptr + offset, where host_ptr is a pointer to the memory region specified when the buffer object being written is created with MEM_USE_HOST_PTR, must meet the following requirements in order to avoid undefined behavior:

        • The host memory region given by (host_ptr + offset, cb) contains the latest bits when the enqueued write command begins execution.
        • The buffer object or memory objects created from this buffer object are not mapped.
        • The buffer object or memory objects created from this buffer object are not used by any command-queue until the write command has finished execution.
        Parameters:
        command_queue - the command-queue in which the write command will be queued. command_queue and buffer must be created with the same OpenCL context.
        buffer - a valid buffer object
        blocking_write - indicates if the write operation is blocking or non-blocking

        If blocking_write is TRUE, the OpenCL implementation copies the data referred to by ptr and enqueues the write operation in the command-queue. The memory pointed to by ptr can be reused by the application after the clEnqueueWriteBuffer call returns.

        If blocking_write is FALSE, the OpenCL implementation will use ptr to perform a nonblocking write. As the write is non-blocking the implementation can return immediately. The memory pointed to by ptr cannot be reused by the application after the call returns. The event argument returns an event object which can be used to query the execution status of the write command. When the write command has completed, the memory pointed to by ptr can then be reused by the application.

        offset - the offset in bytes in the buffer object to write to
        ptr - the pointer to buffer in host memory where data is to be written 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:
        See Also:
        Reference Page
      • nclEnqueueCopyBuffer

        public static int nclEnqueueCopyBuffer​(long command_queue,
                                               long src_buffer,
                                               long dst_buffer,
                                               long src_offset,
                                               long dst_offset,
                                               long size,
                                               int num_events_in_wait_list,
                                               long event_wait_list,
                                               long event)
        Unsafe version of: EnqueueCopyBuffer
        Parameters:
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueCopyBuffer

        public static int clEnqueueCopyBuffer​(long command_queue,
                                              long src_buffer,
                                              long dst_buffer,
                                              long src_offset,
                                              long dst_offset,
                                              long size,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        Enqueues a command to copy a buffer object identified by src_buffer to another buffer object identified by dst_buffer.
        Parameters:
        command_queue - the command-queue in which the copy command will be queued. The OpenCL context associated with command_queue, src_buffer and dst_buffer must be the same.
        src_buffer - the source buffer
        dst_buffer - the destination buffer
        src_offset - the offset where to begin copying data from src_buffer.
        dst_offset - the offset where to begin copying data into dst_buffer
        size - the size in bytes to copy
        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, src_buffer and dst_buffer are not the same or if the context associated with command_queue and events in event_wait_list are not the same.
        • INVALID_MEM_OBJECT if src_buffer and dst_buffer are not valid buffer objects.
        • INVALID_VALUE if src_offset, dst_offset, size, src_offset + size or dst_offset + size require accessing elements outside the src_buffer and dst_buffer buffer objects respectively.
        • INVALID_VALUE if size is 0.
        • 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.
        • MISALIGNED_SUB_BUFFER_OFFSET if src_buffer is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned to DEVICE_MEM_BASE_ADDR_ALIGN value for device associated with queue.
        • MISALIGNED_SUB_BUFFER_OFFSET if dst_buffer is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned to DEVICE_MEM_BASE_ADDR_ALIGN value for device associated with queue.
        • MEM_COPY_OVERLAP if src_buffer and dst_buffer are the same buffer or sub-buffer object and the source and destination regions overlap or if src_buffer and dst_buffer are different sub-buffers of the same associated buffer object and they overlap. The regions overlap if src_offset ≤ dst_offset ≤ src_offset + size – 1 or if dst_offset ≤ src_offset ≤ dst_offset + size – 1.
        • MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for data store associated with src_buffer or dst_buffer.
        • 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
      • nclEnqueueMapBuffer

        public static long nclEnqueueMapBuffer​(long command_queue,
                                               long buffer,
                                               int blocking_map,
                                               long map_flags,
                                               long offset,
                                               long size,
                                               int num_events_in_wait_list,
                                               long event_wait_list,
                                               long event,
                                               long errcode_ret)
        Unsafe version of: EnqueueMapBuffer
        Parameters:
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueMapBuffer

        @Nullable
        public static java.nio.ByteBuffer clEnqueueMapBuffer​(long command_queue,
                                                             long buffer,
                                                             boolean blocking_map,
                                                             long map_flags,
                                                             long offset,
                                                             long size,
                                                             @Nullable
                                                             PointerBuffer event_wait_list,
                                                             @Nullable
                                                             PointerBuffer event,
                                                             @Nullable
                                                             java.nio.IntBuffer errcode_ret,
                                                             @Nullable
                                                             java.nio.ByteBuffer old_buffer)
        Enqueues a command to map a region of the buffer object given by buffer into the host address space and returns a pointer to this mapped region.

        The pointer returned maps a region starting at offset and is at least size bytes in size. The result of a memory access outside this region is undefined.

        If the buffer object is created with MEM_USE_HOST_PTR set in mem_flags, the following will be true:

        • The host_ptr specified in CreateBuffer is guaranteed to contain the latest bits in the region being mapped when the clEnqueueMapBuffer command has completed.
        • The pointer value returned by clEnqueueMapBuffer will be derived from the host_ptr specified when the buffer object is created.

        Mapped buffer objects are unmapped using EnqueueUnmapMemObject.

        Parameters:
        command_queue - a valid command-queue
        buffer - a valid buffer object. The OpenCL context associated with command_queue and buffer must be the same.
        blocking_map - indicates if the map operation is blocking or non-blocking.

        If blocking_map is TRUE, clEnqueueMapBuffer does not return until the specified region in buffer is mapped into the host address space and the application can access the contents of the mapped region using the pointer returned by clEnqueueMapBuffer.

        If blocking_map is FALSE i.e. map operation is non-blocking, the pointer to the mapped region returned by clEnqueueMapBuffer 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 mapped region using the pointer returned by clEnqueueMapBuffer.

        map_flags - a bit-field. One of:
        MAP_READMAP_WRITEMAP_WRITE_INVALIDATE_REGION
        offset - the offset in bytes of the region in the buffer object that is being mapped
        size - the size in bytes of the region in the buffer object that is being mapped
        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.
        errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
        Returns:
        a pointer to the mapped region. The errcode_ret is set to SUCCESS. A NULL pointer is returned otherwise with one of the following error values returned in errcode_ret:
        See Also:
        Reference Page
      • nclCreateImage2D

        public static long nclCreateImage2D​(long context,
                                            long flags,
                                            long image_format,
                                            long image_width,
                                            long image_height,
                                            long image_row_pitch,
                                            long host_ptr,
                                            long errcode_ret)
        Unsafe version of: CreateImage2D
      • clCreateImage2D

        public static long clCreateImage2D​(long context,
                                           long flags,
                                           CLImageFormat image_format,
                                           long image_width,
                                           long image_height,
                                           long image_row_pitch,
                                           @Nullable
                                           java.nio.ByteBuffer host_ptr,
                                           @Nullable
                                           java.nio.IntBuffer errcode_ret)
        
        public static long clCreateImage2D​(long context,
                                           long flags,
                                           CLImageFormat image_format,
                                           long image_width,
                                           long image_height,
                                           long image_row_pitch,
                                           @Nullable
                                           java.nio.ShortBuffer host_ptr,
                                           @Nullable
                                           java.nio.IntBuffer errcode_ret)
        
        public static long clCreateImage2D​(long context,
                                           long flags,
                                           CLImageFormat image_format,
                                           long image_width,
                                           long image_height,
                                           long image_row_pitch,
                                           @Nullable
                                           java.nio.IntBuffer host_ptr,
                                           @Nullable
                                           java.nio.IntBuffer errcode_ret)
        
        public static long clCreateImage2D​(long context,
                                           long flags,
                                           CLImageFormat image_format,
                                           long image_width,
                                           long image_height,
                                           long image_row_pitch,
                                           @Nullable
                                           java.nio.FloatBuffer host_ptr,
                                           @Nullable
                                           java.nio.IntBuffer errcode_ret)
        
        Creates a 2D image object.
        Parameters:
        context - a valid OpenCL context on which the image object is to be created
        flags - a bit-field that is used to specify allocation and usage information about the image memory object being created. One of:
        MEM_READ_WRITEMEM_WRITE_ONLYMEM_READ_ONLYMEM_USE_HOST_PTRMEM_ALLOC_HOST_PTR
        MEM_COPY_HOST_PTRMEM_HOST_WRITE_ONLYMEM_HOST_READ_ONLYMEM_HOST_NO_ACCESS
        image_format - a pointer to a CLImageFormat structure that describes format properties of the image to be allocated
        image_width - the width of the image in pixels
        image_height - the height of the image in pixels
        image_row_pitch - the scan-line pitch in bytes. This must be 0 if host_ptr is NULL and can be either 0 or ≥ image_width * size of element in bytes if host_ptr is not NULL. If host_ptr is not NULL and image_row_pitch = 0, image_row_pitch is calculated as image_width * size of element in bytes. If image_row_pitch is not 0, it must be a multiple of the image element size in bytes.
        host_ptr - a pointer to the image data that may already be allocated by the application. The size of the buffer that host_ptr points to must be ≥ image_row_pitch * image_height. The size of each element in bytes must be a power of 2. The image data specified by host_ptr is stored as a linear sequence of adjacent scanlines. Each scanline is stored as a linear sequence of image elements.
        errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
        Returns:
        a valid non-zero image object and 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:
        See Also:
        Reference Page - This function is deprecated after OpenCL 1.1
      • nclCreateImage3D

        public static long nclCreateImage3D​(long context,
                                            long flags,
                                            long image_format,
                                            long image_width,
                                            long image_height,
                                            long image_depth,
                                            long image_row_pitch,
                                            long image_slice_pitch,
                                            long host_ptr,
                                            long errcode_ret)
        Unsafe version of: CreateImage3D
      • clCreateImage3D

        public static long clCreateImage3D​(long context,
                                           long flags,
                                           CLImageFormat image_format,
                                           long image_width,
                                           long image_height,
                                           long image_depth,
                                           long image_row_pitch,
                                           long image_slice_pitch,
                                           @Nullable
                                           java.nio.ByteBuffer host_ptr,
                                           @Nullable
                                           java.nio.IntBuffer errcode_ret)
        
        public static long clCreateImage3D​(long context,
                                           long flags,
                                           CLImageFormat image_format,
                                           long image_width,
                                           long image_height,
                                           long image_depth,
                                           long image_row_pitch,
                                           long image_slice_pitch,
                                           @Nullable
                                           java.nio.ShortBuffer host_ptr,
                                           @Nullable
                                           java.nio.IntBuffer errcode_ret)
        
        public static long clCreateImage3D​(long context,
                                           long flags,
                                           CLImageFormat image_format,
                                           long image_width,
                                           long image_height,
                                           long image_depth,
                                           long image_row_pitch,
                                           long image_slice_pitch,
                                           @Nullable
                                           java.nio.IntBuffer host_ptr,
                                           @Nullable
                                           java.nio.IntBuffer errcode_ret)
        
        public static long clCreateImage3D​(long context,
                                           long flags,
                                           CLImageFormat image_format,
                                           long image_width,
                                           long image_height,
                                           long image_depth,
                                           long image_row_pitch,
                                           long image_slice_pitch,
                                           @Nullable
                                           java.nio.FloatBuffer host_ptr,
                                           @Nullable
                                           java.nio.IntBuffer errcode_ret)
        
        Creates a 3D image object.
        Parameters:
        context - a valid OpenCL context on which the image object is to be created
        flags - a bit-field that is used to specify allocation and usage information about the image memory object being created. One of:
        MEM_READ_WRITEMEM_WRITE_ONLYMEM_READ_ONLYMEM_USE_HOST_PTRMEM_ALLOC_HOST_PTR
        MEM_COPY_HOST_PTRMEM_HOST_WRITE_ONLYMEM_HOST_READ_ONLYMEM_HOST_NO_ACCESS
        image_format - a pointer to a CLImageFormat structure that describes format properties of the image to be allocated
        image_width - the width of the image in pixels
        image_height - the height of the image in pixels
        image_depth - the depth of the image in pixels. This must be a value > 1.
        image_row_pitch - the scan-line pitch in bytes. This must be 0 if host_ptr is NULL and can be either 0 or ≥ image_width * size of element in bytes if host_ptr is not NULL. If host_ptr is not NULL and image_row_pitch = 0, image_row_pitch is calculated as image_width * size of element in bytes. If image_row_pitch is not 0, it must be a multiple of the image element size in bytes.
        image_slice_pitch - the size in bytes of each 2D slice in the 3D image. This must be 0 if host_ptr is NULL and can be either 0 or ≥ image_row_pitch * image_height if host_ptr is not NULL. If host_ptr is not NULL and image_slice_pitch = 0, image_slice_pitch is calculated as image_row_pitch * image_height. If image_slice_pitch is not 0, it must be a multiple of the image_row_pitch.
        host_ptr - a pointer to the image data that may already be allocated by the application. The size of the buffer that host_ptr points to must be ≥ image_slice_pitch * image_depth. The size of each element in bytes must be a power of 2. The image data specified by host_ptr is stored as a linear sequence of adjacent 2D slices. Each 2D slice is a linear sequence of adjacent scanlines. Each scanline is a linear sequence of image elements.
        errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
        Returns:
        a valid non-zero image object and 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:
        See Also:
        Reference Page - This function is deprecated after OpenCL 1.1
      • nclGetSupportedImageFormats

        public static int nclGetSupportedImageFormats​(long context,
                                                      long flags,
                                                      int image_type,
                                                      int num_entries,
                                                      long image_formats,
                                                      long num_image_formats)
        Unsafe version of: GetSupportedImageFormats
        Parameters:
        num_entries - the number of entries that can be returned in the memory location given by image_formats
      • nclEnqueueReadImage

        public static int nclEnqueueReadImage​(long command_queue,
                                              long image,
                                              int blocking_read,
                                              long origin,
                                              long region,
                                              long row_pitch,
                                              long slice_pitch,
                                              long ptr,
                                              int num_events_in_wait_list,
                                              long event_wait_list,
                                              long event)
        Unsafe version of: EnqueueReadImage
        Parameters:
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueReadImage

        public static int clEnqueueReadImage​(long command_queue,
                                             long image,
                                             boolean blocking_read,
                                             PointerBuffer origin,
                                             PointerBuffer region,
                                             long row_pitch,
                                             long slice_pitch,
                                             java.nio.ByteBuffer ptr,
                                             @Nullable
                                             PointerBuffer event_wait_list,
                                             @Nullable
                                             PointerBuffer event)
        
        public static int clEnqueueReadImage​(long command_queue,
                                             long image,
                                             boolean blocking_read,
                                             PointerBuffer origin,
                                             PointerBuffer region,
                                             long row_pitch,
                                             long slice_pitch,
                                             java.nio.ShortBuffer ptr,
                                             @Nullable
                                             PointerBuffer event_wait_list,
                                             @Nullable
                                             PointerBuffer event)
        
        public static int clEnqueueReadImage​(long command_queue,
                                             long image,
                                             boolean blocking_read,
                                             PointerBuffer origin,
                                             PointerBuffer region,
                                             long row_pitch,
                                             long slice_pitch,
                                             java.nio.IntBuffer ptr,
                                             @Nullable
                                             PointerBuffer event_wait_list,
                                             @Nullable
                                             PointerBuffer event)
        
        public static int clEnqueueReadImage​(long command_queue,
                                             long image,
                                             boolean blocking_read,
                                             PointerBuffer origin,
                                             PointerBuffer region,
                                             long row_pitch,
                                             long slice_pitch,
                                             java.nio.FloatBuffer ptr,
                                             @Nullable
                                             PointerBuffer event_wait_list,
                                             @Nullable
                                             PointerBuffer event)
        
        public static int clEnqueueReadImage​(long command_queue,
                                             long image,
                                             boolean blocking_read,
                                             PointerBuffer origin,
                                             PointerBuffer region,
                                             long row_pitch,
                                             long slice_pitch,
                                             java.nio.DoubleBuffer ptr,
                                             @Nullable
                                             PointerBuffer event_wait_list,
                                             @Nullable
                                             PointerBuffer event)
        
        Enqueues a command to read from an image or image array object to host memory.

        Calling clEnqueueReadImage to read a region of the image with the ptr argument value set to host_ptr + (origin[2] * image slice pitch + origin[1] * image row pitch + origin[0] * bytes per pixel), where host_ptr is a pointer to the memory region specified when the image being read is created with MEM_USE_HOST_PTR, must meet the following requirements in order to avoid undefined behavior:

        • All commands that use this image object have finished execution before the read command begins execution.
        • The row_pitch and slice_pitch argument values in clEnqueueReadImage must be set to the image row pitch and slice pitch.
        • The image object is not mapped.
        • The image object is not used by any command-queue until the read command has finished execution.
        Parameters:
        command_queue - the command-queue in which the read command will be queued. command_queue and image must be created with the same OpenCL context.
        image - a valid image or image array object
        blocking_read - indicates if the read operation is blocking or non-blocking.

        If blocking_read is TRUE i.e. the read command is blocking, clEnqueueReadImage does not return until the buffer data has been read and copied into memory pointed to by ptr.

        If blocking_read is FALSE i.e. the read command is non-blocking, clEnqueueReadImage queues a non-blocking read command and returns. The contents of the buffer that ptr points to cannot be used until the read 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 read command has completed, the contents of the buffer that ptr points to can be used by the application.

        origin - defines the (x, y, z) offset in pixels in the 1D, 2D or 3D image, the (x, y) offset and the image index in the 2D image array or the (x) offset and the image index in the 1D image array. If image is a 2D image object, origin[2] must be 0. If image is a 1D image or 1D image buffer object, origin[1] and origin[2] must be 0. If image is a 1D image array object, origin[2] must be 0. If image is a 1D image array object, origin[1] describes the image index in the 1D image array. If image is a 2D image array object, origin[2] describes the image index in the 2D image array.
        region - defines the (width, height, depth) in pixels of the 1D, 2D or 3D rectangle, the (width, height) in pixels of the 2D rectangle and the number of images of a 2D image array or the (width) in pixels of the 1D rectangle and the number of images of a 1D image array. If image is a 2D image object, region[2] must be 1. If image is a 1D image or 1D image buffer object, region[1] and region[2] must be 1. If image is a 1D image array object, region[2] must be 1. The values in region cannot be 0.
        row_pitch - the length of each row in bytes. This value must be greater than or equal to the element size in bytes * width. If row_pitch is set to 0, the appropriate row pitch is calculated based on the size of each element in bytes multiplied by width.
        slice_pitch - the size in bytes of the 2D slice of the 3D region of a 3D image or each image of a 1D or 2D image array being read. This must be 0 if image is a 1D or 2D image. This value must be greater than or equal to row_pitch * height. If slice_pitch is set to 0, the appropriate slice pitch is calculated based on the row_pitch * height.
        ptr - the pointer to a buffer in host memory where image data is to be read to
        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:
        See Also:
        Reference Page
      • nclEnqueueWriteImage

        public static int nclEnqueueWriteImage​(long command_queue,
                                               long image,
                                               int blocking_write,
                                               long origin,
                                               long region,
                                               long input_row_pitch,
                                               long input_slice_pitch,
                                               long ptr,
                                               int num_events_in_wait_list,
                                               long event_wait_list,
                                               long event)
        Unsafe version of: EnqueueWriteImage
        Parameters:
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueWriteImage

        public static int clEnqueueWriteImage​(long command_queue,
                                              long image,
                                              boolean blocking_write,
                                              PointerBuffer origin,
                                              PointerBuffer region,
                                              long input_row_pitch,
                                              long input_slice_pitch,
                                              java.nio.ByteBuffer ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        public static int clEnqueueWriteImage​(long command_queue,
                                              long image,
                                              boolean blocking_write,
                                              PointerBuffer origin,
                                              PointerBuffer region,
                                              long input_row_pitch,
                                              long input_slice_pitch,
                                              java.nio.ShortBuffer ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        public static int clEnqueueWriteImage​(long command_queue,
                                              long image,
                                              boolean blocking_write,
                                              PointerBuffer origin,
                                              PointerBuffer region,
                                              long input_row_pitch,
                                              long input_slice_pitch,
                                              java.nio.IntBuffer ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        public static int clEnqueueWriteImage​(long command_queue,
                                              long image,
                                              boolean blocking_write,
                                              PointerBuffer origin,
                                              PointerBuffer region,
                                              long input_row_pitch,
                                              long input_slice_pitch,
                                              java.nio.FloatBuffer ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        public static int clEnqueueWriteImage​(long command_queue,
                                              long image,
                                              boolean blocking_write,
                                              PointerBuffer origin,
                                              PointerBuffer region,
                                              long input_row_pitch,
                                              long input_slice_pitch,
                                              java.nio.DoubleBuffer ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        Enqueues a command to write to an image or image array object from host memory.

        Calling clEnqueueWriteImage to update the latest bits in a region of the image with the ptr argument value set to host_ptr + (origin[2] * image slice pitch + origin[1] * image row pitch + origin[0] * bytes per pixel), where host_ptr is a pointer to the memory region specified when the image being written is created with MEM_USE_HOST_PTR, must meet the following requirements in order to avoid undefined behavior:

        • The host memory region being written contains the latest bits when the enqueued write command begins execution.
        • The input_row_pitch and input_slice_pitch argument values in clEnqueueWriteImage must be set to the image row pitch and slice pitch.
        • The image object is not mapped.
        • The image object is not used by any command-queue until the write command has finished execution.
        Parameters:
        command_queue - the command-queue in which the write command will be queued. command_queue and image must be created with the same OpenCL context.
        image - a valid image or image array object
        blocking_write - indicates if the read operation is blocking or non-blocking.

        If blocking_write is TRUE, the OpenCL implementation copies the data referred to by ptr and enqueues the write command in the command-queue. The memory pointed to by ptr can be reused by the application after the clEnqueueWriteImage call returns.

        If blocking_write is FALSE, the OpenCL implementation will use ptr to perform a non-blocking write. As the write is non-blocking the implementation can return immediately. The memory pointed to by ptr cannot be reused by the application after the call returns. The event argument returns an event object which can be used to query the execution status of the write command. When the write command has completed, the memory pointed to by ptr can then be reused by the application.

        origin - defines the (x, y, z) offset in pixels in the 1D, 2D or 3D image, the (x, y) offset and the image index in the 2D image array or the (x) offset and the image index in the 1D image array. If image is a 2D image object, origin[2] must be 0. If image is a 1D image or 1D image buffer object, origin[1] and origin[2] must be 0. If image is a 1D image array object, origin[2] must be 0. If image is a 1D image array object, origin[1] describes the image index in the 1D image array. If image is a 2D image array object, origin[2] describes the image index in the 2D image array.
        region - defines the (width, height, depth) in pixels of the 1D, 2D or 3D rectangle, the (width, height) in pixels of the 2D rectangle and the number of images of a 2D image array or the (width) in pixels of the 1D rectangle and the number of images of a 1D image array. If image is a 2D image object, region[2] must be 1. If image is a 1D image or 1D image buffer object, region[1] and region[2] must be 1. If image is a 1D image array object, region[2] must be 1. The values in region cannot be 0.
        input_row_pitch - the length of each row in bytes. This value must be greater than or equal to the element size in bytes * width. If input_row_pitch is set to 0, the appropriate row pitch is calculated based on the size of each element in bytes multiplied by width.
        input_slice_pitch - the size in bytes of the 2D slice of the 3D region of a 3D image or each image of a 1D or 2D image array being written. This must be 0 if image is a 1D or 2D image. This value must be greater than or equal to input_row_pitch * height. If input_slice_pitch is set to 0, the appropriate slice pitch is calculated based on the input_row_pitch * height.
        ptr - the pointer to a buffer in host memory where image data is to be written 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:
        See Also:
        Reference Page
      • nclEnqueueCopyImage

        public static int nclEnqueueCopyImage​(long command_queue,
                                              long src_image,
                                              long dst_image,
                                              long src_origin,
                                              long dst_origin,
                                              long region,
                                              int num_events_in_wait_list,
                                              long event_wait_list,
                                              long event)
        Unsafe version of: EnqueueCopyImage
        Parameters:
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueCopyImage

        public static int clEnqueueCopyImage​(long command_queue,
                                             long src_image,
                                             long dst_image,
                                             PointerBuffer src_origin,
                                             PointerBuffer dst_origin,
                                             PointerBuffer region,
                                             @Nullable
                                             PointerBuffer event_wait_list,
                                             @Nullable
                                             PointerBuffer event)
        Enqueues a command to copy image objects. src_image and dst_image can be 1D, 2D, 3D image or a 1D, 2D image array objects allowing us to perform the following actions:
        • Copy a 1D image object to a 1D image object.
        • Copy a 1D image object to a scanline of a 2D image object and vice-versa.
        • Copy a 1D image object to a scanline of a 2D slice of a 3D image object and vice-versa.
        • Copy a 1D image object to a scanline of a specific image index of a 1D or 2D image array object and vice-versa.
        • Copy a 2D image object to a 2D image object.
        • Copy a 2D image object to a 2D slice of a 3D image object and vice-versa.
        • Copy a 2D image object to a specific image index of a 2D image array object and vice-versa.
        • Copy images from a 1D image array object to a 1D image array object.
        • Copy images from a 2D image array object to a 2D image array object.
        • Copy a 3D image object to a 3D image object.
        Parameters:
        command_queue - the command-queue in which the copy command will be queued. The OpenCL context associated with command_queue, src_image and dst_image must be the same.
        src_origin - the (x, y, z) offset in pixels in the 1D, 2D or 3D image, the (x, y) offset and the image index in the 2D image array or the (x) offset and the image index in the 1D image array. If src_image is a 2D image object, src_origin[2] must be 0. If src_image is a 1D image object, src_origin[1] and src_origin[2] must be 0. If src_image is a 1D image array object, src_origin[2] must be 0. If src_image is a 1D image array object, src_origin[1] describes the image index in the 1D image array. If src_image is a 2D image array object, src_origin[2] describes the image index in the 2D image array.
        dst_origin - the (x, y, z) offset in pixels in the 1D, 2D or 3D image, the (x, y) offset and the image index in the 2D image array or the (x) offset and the image index in the 1D image array. If dst_image is a 2D image object, dst_origin[2] must be 0. If dst_image is a 1D image or 1D image buffer object, dst_origin[1] and dst_origin[2] must be 0. If dst_image is a 1D image array object, dst_origin[2] must be 0. If dst_image is a 1D image array object, dst_origin[1] describes the image index in the 1D image array. If dst_image is a 2D image array object, dst_origin[2] describes the image index in the 2D image array.
        region - the (width, height, depth) in pixels of the 1D, 2D or 3D rectangle, the (width, height) in pixels of the 2D rectangle and the number of images of a 2D image array or the (width) in pixels of the 1D rectangle and the number of images of a 1D image array. If src_image or dst_image is a 2D image object, region[2] must be 1. If src_image or dst_image is a 1D image or 1D image buffer object, region[1] and region[2] must be 1. If src_image or dst_image is a 1D image array object, region[2] must be 1. The values in region cannot be 0.
        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, src_image and dst_image are not the same or if the context associated with command_queue and events in event_wait_list are not the same.
        • INVALID_MEM_OBJECT if src_image and dst_image are not valid image objects.
        • IMAGE_FORMAT_MISMATCH if src_image and dst_image do not use the same image format.
        • INVALID_VALUE if the 2D or 3D rectangular region specified by src_origin and src_origin + region refers to a region outside src_image, or if the 2D or 3D rectangular region specified by dst_origin and dst_origin + region refers to a region outside dst_image.
        • INVALID_VALUE if values in src_origin, dst_origin and region do not follow rules described in the argument description for src_origin, dst_origin and region.
        • 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.
        • INVALID_IMAGE_SIZE if image dimensions (image width, height, specified or compute row and/or slice pitch) for src_image or dst_image are not supported by device associated with queue.
        • IMAGE_FORMAT_NOT_SUPPORTED if image format (image channel order and data type) for src_image or dst_image are not supported by device associated with queue.
        • MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for data store associated with src_image or dst_image.
        • 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.
        • INVALID_OPERATION if the device associated with command_queue does not support images (i.e. DEVICE_IMAGE_SUPPORT is FALSE).
        • MEM_COPY_OVERLAP if src_image and dst_image are the same image object and the source and destination regions overlap.
        See Also:
        Reference Page
      • nclEnqueueCopyImageToBuffer

        public static int nclEnqueueCopyImageToBuffer​(long command_queue,
                                                      long src_image,
                                                      long dst_buffer,
                                                      long src_origin,
                                                      long region,
                                                      long dst_offset,
                                                      int num_events_in_wait_list,
                                                      long event_wait_list,
                                                      long event)
        Unsafe version of: EnqueueCopyImageToBuffer
        Parameters:
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueCopyImageToBuffer

        public static int clEnqueueCopyImageToBuffer​(long command_queue,
                                                     long src_image,
                                                     long dst_buffer,
                                                     PointerBuffer src_origin,
                                                     PointerBuffer region,
                                                     long dst_offset,
                                                     @Nullable
                                                     PointerBuffer event_wait_list,
                                                     @Nullable
                                                     PointerBuffer event)
        Enqueues a command to copy an image object to a buffer object.
        Parameters:
        command_queue - a valid command-queue. The OpenCL context associated with command_queue, src_image and dst_buffer must be the same.
        src_image - a valid image object
        dst_buffer - a valid buffer object
        src_origin - the (x, y, z) offset in pixels in the 1D, 2D or 3D image, the (x, y) offset and the image index in the 2D image array or the (x) offset and the image index in the 1D image array. If src_image is a 2D image object, src_origin[2] must be 0. If src_image is a 1D image object, src_origin[1] and src_origin[2] must be 0. If src_image is a 1D image array object, src_origin[2] must be 0. If src_image is a 1D image array object, src_origin[1] describes the image index in the 1D image array. If src_image is a 2D image array object, src_origin[2] describes the image index in the 2D image array.
        region - the (width, height, depth) in pixels of the 1D, 2D or 3D rectangle, the (width, height) in pixels of the 2D rectangle and the number of images of a 2D image array or the (width) in pixels of the 1D rectangle and the number of images of a 1D image array. If src_image is a 2D image object, region[2] must be 1. If src_image is a 1D image or 1D image buffer object, region[1] and region[2] must be 1. If src_image is a 1D image array object, region[2] must be 1. The values in region cannot be 0.
        dst_offset - the offset where to begin copying data into dst_buffer. The size in bytes of the region to be copied referred to as dst_cb is computed as width * height * depth * bytes/image element if src_image is a 3D image object, is computed as width * height * bytes/image element if src_image is a 2D image, is computed as width * height * arraysize * bytes/image element if src_image is a 2D image array object, is computed as width * bytes/image element if src_image is a 1D image or 1D image buffer object and is computed as width * arraysize * bytes/image element if src_image is a 1D image array object.
        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, src_image and dst_buffer are not the same or if the context associated with command_queue and events in event_wait_list are not the same.
        • INVALID_MEM_OBJECT if src_image is not a valid image object or dst_buffer is not a valid buffer object or if src_image is a 1D image buffer object created from dst_buffer.
        • INVALID_VALUE if the 1D, 2D or 3D rectangular region specified by src_origin and src_origin + region refers to a region outside src_image, or if the region specified by dst_offset and dst_offset + dst_cb to a region outside dst_buffer.
        • INVALID_VALUE if values in src_origin and region do not follow rules described in the argument description for src_origin and region.
        • 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.
        • MISALIGNED_SUB_BUFFER_OFFSET if dst_buffer is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned to DEVICE_MEM_BASE_ADDR_ALIGN value for device associated with queue.
        • INVALID_IMAGE_SIZE if image dimensions (image width, height, specified or compute row and/or slice pitch) for src_image are not supported by device associated with queue.
        • IMAGE_FORMAT_NOT_SUPPORTED if image format (image channel order and data type) for src_image are not supported by device associated with queue.
        • MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for data store associated with src_image or dst_buffer.
        • INVALID_OPERATION if the device associated with command_queue does not support images (i.e. DEVICE_IMAGE_SUPPORT is FALSE).
        • 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
      • nclEnqueueCopyBufferToImage

        public static int nclEnqueueCopyBufferToImage​(long command_queue,
                                                      long src_buffer,
                                                      long dst_image,
                                                      long src_offset,
                                                      long dst_origin,
                                                      long region,
                                                      int num_events_in_wait_list,
                                                      long event_wait_list,
                                                      long event)
        Unsafe version of: EnqueueCopyBufferToImage
        Parameters:
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueCopyBufferToImage

        public static int clEnqueueCopyBufferToImage​(long command_queue,
                                                     long src_buffer,
                                                     long dst_image,
                                                     long src_offset,
                                                     PointerBuffer dst_origin,
                                                     PointerBuffer region,
                                                     @Nullable
                                                     PointerBuffer event_wait_list,
                                                     @Nullable
                                                     PointerBuffer event)
        Enqueues a command to copy a buffer object to an image object.
        Parameters:
        command_queue - a valid command-queue. The OpenCL context associated with command_queue, src_buffer and dst_image must be the same.
        src_buffer - a valid buffer object
        dst_image - a valid image object
        src_offset - the offset where to begin copying data from src_buffer
        dst_origin - the (x, y, z) offset in pixels in the 1D, 2D or 3D image, the (x, y) offset and the image index in the 2D image array or the (x) offset and the image index in the 1D image array. If dst_image is a 2D image object, dst_origin[2] must be 0. If dst_image is a 1D image or 1D image buffer object, dst_origin[1] and dst_origin[2] must be 0. If dst_image is a 1D image array object, dst_origin[2] must be 0. If dst_image is a 1D image array object, dst_origin[1] describes the image index in the 1D image array. If dst_image is a 2D image array object, dst_origin[2] describes the image index in the 2D image array.
        region - the (width, height, depth) in pixels of the 1D, 2D or 3D rectangle, the (width, height) in pixels of the 2D rectangle and the number of images of a 2D image array or the (width) in pixels of the 1D rectangle and the number of images of a 1D image array. If dst_image is a 2D image object, region[2] must be 1. If dst_image is a 1D image or 1D image buffer object, region[1] and region[2] must be 1. If dst_image is a 1D image array object, region[2] must be 1. The values in region cannot be 0.
        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, src_buffer and dst_image are not the same or if the context associated with command_queue and events in event_wait_list are not the same.
        • INVALID_MEM_OBJECT if src_buffer is not a valid buffer object or dst_image is not a valid image object or if dst_image is a 1D image buffer object created from src_buffer.
        • INVALID_VALUE if the 1D, 2D or 3D rectangular region specified by dst_origin and dst_origin + region refer to a region outside dst_image, or if the region specified by src_offset and src_offset + src_cb refer to a region outside src_buffer.
        • INVALID_VALUE if values in dst_origin and region do not follow rules described in the argument description for dst_origin and region.
        • 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.
        • MISALIGNED_SUB_BUFFER_OFFSET if src_buffer is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned to DEVICE_MEM_BASE_ADDR_ALIGN value for device associated with queue.
        • INVALID_IMAGE_SIZE if image dimensions (image width, height, specified or compute row and/or slice pitch) for dst_image are not supported by device associated with queue.
        • IMAGE_FORMAT_NOT_SUPPORTED if image format (image channel order and data type) for dst_image are not supported by device associated with queue.
        • MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for data store associated with src_buffer or dst_image.
        • INVALID_OPERATION if the device associated with command_queue does not support images (i.e. DEVICE_IMAGE_SUPPORT is FALSE).
        • 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
      • nclEnqueueMapImage

        public static long nclEnqueueMapImage​(long command_queue,
                                              long image,
                                              int blocking_map,
                                              long map_flags,
                                              long origin,
                                              long region,
                                              long image_row_pitch,
                                              long image_slice_pitch,
                                              int num_events_in_wait_list,
                                              long event_wait_list,
                                              long event,
                                              long errcode_ret)
        Unsafe version of: EnqueueMapImage
        Parameters:
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueMapImage

        @Nullable
        public static java.nio.ByteBuffer clEnqueueMapImage​(long command_queue,
                                                            long image,
                                                            boolean blocking_map,
                                                            long map_flags,
                                                            PointerBuffer origin,
                                                            PointerBuffer region,
                                                            PointerBuffer image_row_pitch,
                                                            @Nullable
                                                            PointerBuffer image_slice_pitch,
                                                            @Nullable
                                                            PointerBuffer event_wait_list,
                                                            @Nullable
                                                            PointerBuffer event,
                                                            @Nullable
                                                            java.nio.IntBuffer errcode_ret,
                                                            @Nullable
                                                            java.nio.ByteBuffer old_buffer)
        
        @Nullable
        public static java.nio.ByteBuffer clEnqueueMapImage​(long command_queue,
                                                            long image,
                                                            boolean blocking_map,
                                                            long map_flags,
                                                            PointerBuffer origin,
                                                            PointerBuffer region,
                                                            PointerBuffer image_row_pitch,
                                                            @Nullable
                                                            PointerBuffer image_slice_pitch,
                                                            @Nullable
                                                            PointerBuffer event_wait_list,
                                                            @Nullable
                                                            PointerBuffer event,
                                                            @Nullable
                                                            java.nio.IntBuffer errcode_ret,
                                                            long length,
                                                            @Nullable
                                                            java.nio.ByteBuffer old_buffer)
        
        Enqueues a command to map a region in the image object given by image into the host address space and returns a pointer to this mapped region.

        The pointer returned maps a 1D, 2D or 3D region starting at origin and is at least region[0] pixels in size for a 1D image, 1D image buffer or 1D image array, (image_row_pitch * region[1]) pixels in size for a 2D image or 2D image array, and (image_slice_pitch * region[2]) pixels in size for a 3D image. The result of a memory access outside this region is undefined.

        If the image object is created with MEM_USE_HOST_PTR set in mem_flags, the following will be true:

        • The host_ptr specified in CreateImage is guaranteed to contain the latest bits in the region being mapped when the clEnqueueMapImage command has completed.
        • The pointer value returned by clEnqueueMapImage will be derived from the host_ptr specified when the image object is created.

        Mapped image objects are unmapped using EnqueueUnmapMemObject.

        Parameters:
        command_queue - a valid command-queue
        image - a valid image object. The OpenCL context associated with command_queue and image must be the same.
        blocking_map - indicates if the map operation is blocking or non-blocking.

        If blocking_map is TRUE, clEnqueueMapImage does not return until the specified region in image is mapped into the host address space and the application can access the contents of the mapped region using the pointer returned by clEnqueueMapImage.

        If blocking_map is FALSE i.e. map operation is non-blocking, the pointer to the mapped region returned by clEnqueueMapImage 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 mapped region using the pointer returned by clEnqueueMapImage.

        map_flags - a bit-field. One of:
        MAP_READMAP_WRITEMAP_WRITE_INVALIDATE_REGION
        origin - the (x, y, z) offset in pixels in the 1D, 2D or 3D image, the (x, y) offset and the image index in the 2D image array or the (x) offset and the image index in the 1D image array. If image is a 2D image object, origin[2] must be 0. If image is a 1D image or 1D image buffer object, origin[1] and origin[2] must be 0. If image is a 1D image array object, origin[2] must be 0. If image is a 1D image array object, origin[1] describes the image index in the 1D image array. If image is a 2D image array object, origin[2] describes the image index in the 2D image array.
        region - the (width, height, depth) in pixels of the 1D, 2D or 3D rectangle, the (width, height) in pixels of the 2D rectangle and the number of images of a 2D image array or the (width) in pixels of the 1D rectangle and the number of images of a 1D image array. If image is a 2D image object, region[2] must be 1. If image is a 1D image or 1D image buffer object, region[1] and region[2] must be 1. If image is a 1D image array object, region[2] must be 1. The values in region cannot be 0.
        image_row_pitch - the scan-line pitch in bytes for the mapped region. This must be a non-NULL value.
        image_slice_pitch - returns the size in bytes of each 2D slice of a 3D image or the size of each 1D or 2D image in a 1D or 2D image array for the mapped region. For a 1D and 2D image, zero is returned if this argument is not NULL. For a 3D image, 1D and 2D image array, image_slice_pitch must be a non-NULL value.
        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.
        errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
        Returns:
        a pointer to the mapped region. The errcode_ret is set to SUCCESS. A NULL pointer is returned otherwise with one of the following error values returned in errcode_ret:
        See Also:
        Reference Page
      • nclGetImageInfo

        public static int nclGetImageInfo​(long image,
                                          int param_name,
                                          long param_value_size,
                                          long param_value,
                                          long param_value_size_ret)
        Unsafe version of: GetImageInfo
        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.
      • clGetImageInfo

        public static int clGetImageInfo​(long image,
                                         int param_name,
                                         @Nullable
                                         java.nio.ByteBuffer param_value,
                                         @Nullable
                                         PointerBuffer param_value_size_ret)
        
        public static int clGetImageInfo​(long image,
                                         int param_name,
                                         @Nullable
                                         java.nio.IntBuffer param_value,
                                         @Nullable
                                         PointerBuffer param_value_size_ret)
        
        public static int clGetImageInfo​(long image,
                                         int param_name,
                                         @Nullable
                                         PointerBuffer param_value,
                                         @Nullable
                                         PointerBuffer param_value_size_ret)
        
        Returns information specific to an image object.
        Parameters:
        image - the image object being queried
        param_name - the information to query. One of:
        IMAGE_FORMATIMAGE_ELEMENT_SIZEIMAGE_ROW_PITCHIMAGE_SLICE_PITCHIMAGE_WIDTH
        IMAGE_HEIGHTIMAGE_DEPTHIMAGE_ARRAY_SIZEIMAGE_BUFFERIMAGE_NUM_MIP_LEVELS
        IMAGE_NUM_SAMPLES
        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 image is a not a valid image 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
      • clRetainMemObject

        public static int clRetainMemObject​(long memobj)
        Increments the memobj reference count.

        CreateBuffer, CreateSubBuffer and CreateImage perform an implicit retain.

        Parameters:
        memobj - the memory object to retain
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_MEM_OBJECT if memobj is not a valid memory object (buffer or image 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
      • clReleaseMemObject

        public static int clReleaseMemObject​(long memobj)
        Decrements the memobj reference count.

        After the memobj reference count becomes zero and commands queued for execution on a command-queue(s) that use memobj have finished, the memory object is deleted. If memobj is a buffer object, memobj cannot be deleted until all sub-buffer objects associated with memobj are deleted.

        Parameters:
        memobj - the memory object to release
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_MEM_OBJECT if memobj is not a valid memory 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
      • nclEnqueueUnmapMemObject

        public static int nclEnqueueUnmapMemObject​(long command_queue,
                                                   long memobj,
                                                   long mapped_ptr,
                                                   int num_events_in_wait_list,
                                                   long event_wait_list,
                                                   long event)
        Unsafe version of: EnqueueUnmapMemObject
        Parameters:
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueUnmapMemObject

        public static int clEnqueueUnmapMemObject​(long command_queue,
                                                  long memobj,
                                                  java.nio.ByteBuffer mapped_ptr,
                                                  @Nullable
                                                  PointerBuffer event_wait_list,
                                                  @Nullable
                                                  PointerBuffer event)
        Enqueues a command to unmap a previously mapped region of a memory object. Reads or writes from the host using the pointer returned by EnqueueMapBuffer or EnqueueMapImage are considered to be complete.

        EnqueueMapBuffer, and EnqueueMapImage increments the mapped count of the memory object. The initial mapped count value of the memory object is zero. Multiple calls to EnqueueMapBuffer, or EnqueueMapImage on the same memory object will increment this mapped count by appropriate number of calls. clEnqueueUnmapMemObject decrements the mapped count of the memory object. EnqueueMapBuffer, and EnqueueMapImage act as synchronization points for a region of the buffer object being mapped.

        Parameters:
        command_queue - a valid command-queue
        memobj - a valid memory object. The OpenCL context associated with command_queue and memobj must be the same.
        mapped_ptr - the host address returned by a previous call to EnqueueMapBuffer, or EnqueueMapImage for memobj
        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_MEM_OBJECT if memobj is not a valid memory object.
        • INVALID_VALUE if mapped_ptr is not a valid pointer returned by EnqueueMapBuffer, or EnqueueMapImage for memobj.
        • 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.
        • INVALID_CONTEXT if context associated with command_queue and memobj are not the same or if the context associated with command_queue and events in event_wait_list are not the same.
        See Also:
        Reference Page
      • nclGetMemObjectInfo

        public static int nclGetMemObjectInfo​(long memobj,
                                              int param_name,
                                              long param_value_size,
                                              long param_value,
                                              long param_value_size_ret)
        Unsafe version of: GetMemObjectInfo
        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.
      • clGetMemObjectInfo

        public static int clGetMemObjectInfo​(long memobj,
                                             int param_name,
                                             @Nullable
                                             java.nio.ByteBuffer param_value,
                                             @Nullable
                                             PointerBuffer param_value_size_ret)
        
        public static int clGetMemObjectInfo​(long memobj,
                                             int param_name,
                                             @Nullable
                                             java.nio.IntBuffer param_value,
                                             @Nullable
                                             PointerBuffer param_value_size_ret)
        
        public static int clGetMemObjectInfo​(long memobj,
                                             int param_name,
                                             @Nullable
                                             java.nio.LongBuffer param_value,
                                             @Nullable
                                             PointerBuffer param_value_size_ret)
        
        public static int clGetMemObjectInfo​(long memobj,
                                             int param_name,
                                             @Nullable
                                             PointerBuffer param_value,
                                             @Nullable
                                             PointerBuffer param_value_size_ret)
        
        Returns information that is common to all memory objects (buffer and image objects).
        Parameters:
        memobj - the memory object being queried
        param_name - the information to query. One of:
        MEM_TYPEMEM_FLAGSMEM_SIZEMEM_HOST_PTRMEM_MAP_COUNTMEM_REFERENCE_COUNT
        MEM_CONTEXTMEM_ASSOCIATED_MEMOBJECTMEM_OFFSETMEM_USES_SVM_POINTER
        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 memobj is a not a valid memory 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
      • nclCreateSampler

        public static long nclCreateSampler​(long context,
                                            int normalized_coords,
                                            int addressing_mode,
                                            int filter_mode,
                                            long errcode_ret)
        Unsafe version of: CreateSampler
      • clCreateSampler

        public static long clCreateSampler​(long context,
                                           boolean normalized_coords,
                                           int addressing_mode,
                                           int filter_mode,
                                           @Nullable
                                           java.nio.IntBuffer errcode_ret)
        Creates a sampler object.

        A sampler object describes how to sample an image when the image is read in the kernel. The built-in functions to read from an image in a kernel take a sampler as an argument. The sampler arguments to the image read function can be sampler objects created using OpenCL functions and passed as argument values to the kernel or can be samplers declared inside a kernel.

        Parameters:
        context - a valid OpenCL context
        normalized_coords - determines if the image coordinates specified are normalized or not
        addressing_mode - specifies how out-of-range image coordinates are handled when reading from an image. One of:
        ADDRESS_NONEADDRESS_CLAMP_TO_EDGEADDRESS_CLAMPADDRESS_REPEAT
        ADDRESS_MIRRORED_REPEAT
        filter_mode - the type of filter that must be applied when reading an image. One of:
        FILTER_NEARESTFILTER_LINEAR
        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 addressing_mode, filter_mode or normalized_coords or combination of these argument values are not valid.
        • INVALID_OPERATION if images are not supported by any device associated with context (i.e. DEVICE_IMAGE_SUPPORT is FALSE).
        • 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 - This function is deprecated after OpenCL 1.2
      • clRetainSampler

        public static int clRetainSampler​(long sampler)
        Increments the sampler reference count. CreateSampler performs an implicit retain.
        Parameters:
        sampler - the sample object to retain
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_SAMPLER if sampler is not a valid sampler 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
      • clReleaseSampler

        public static int clReleaseSampler​(long sampler)
        Decrements the sampler reference count. The sampler object is deleted after the reference count becomes zero and commands queued for execution on a command-queue(s) that use sampler have finished.
        Parameters:
        sampler - the sample object to release
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_SAMPLER if sampler is not a valid sampler 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
      • nclGetSamplerInfo

        public static int nclGetSamplerInfo​(long sampler,
                                            int param_name,
                                            long param_value_size,
                                            long param_value,
                                            long param_value_size_ret)
        Unsafe version of: GetSamplerInfo
        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.
      • clGetSamplerInfo

        public static int clGetSamplerInfo​(long sampler,
                                           int param_name,
                                           @Nullable
                                           java.nio.ByteBuffer param_value,
                                           @Nullable
                                           PointerBuffer param_value_size_ret)
        
        public static int clGetSamplerInfo​(long sampler,
                                           int param_name,
                                           @Nullable
                                           java.nio.IntBuffer param_value,
                                           @Nullable
                                           PointerBuffer param_value_size_ret)
        
        public static int clGetSamplerInfo​(long sampler,
                                           int param_name,
                                           @Nullable
                                           PointerBuffer param_value,
                                           @Nullable
                                           PointerBuffer param_value_size_ret)
        
        Returns information about a sampler object.
        Parameters:
        sampler - the sampler being queried
        param_name - the information to query. One of:
        SAMPLER_REFERENCE_COUNTSAMPLER_CONTEXTSAMPLER_NORMALIZED_COORDSSAMPLER_ADDRESSING_MODE
        SAMPLER_FILTER_MODESAMPLER_MIP_FILTER_MODESAMPLER_LOD_MINSAMPLER_LOD_MAX
        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_SAMPLER if sampler is a not a valid sampler 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
      • nclCreateProgramWithSource

        public static long nclCreateProgramWithSource​(long context,
                                                      int count,
                                                      long strings,
                                                      long lengths,
                                                      long errcode_ret)
        Unsafe version of: CreateProgramWithSource
        Parameters:
        count - the number of elements in the strings and lengths arrays
      • clCreateProgramWithSource

        public static long clCreateProgramWithSource​(long context,
                                                     PointerBuffer strings,
                                                     @Nullable
                                                     PointerBuffer lengths,
                                                     @Nullable
                                                     java.nio.IntBuffer errcode_ret)
        Creates a program object for a context, and loads the source code specified by the text strings in the strings array into the program object. The devices associated with the program object are the devices associated with context. The source code specified by strings is either an OpenCL C program source, header or implementation-defined source for custom devices that support an online compiler.
        Parameters:
        context - a valid OpenCL context
        strings - an array of count pointers to optionally null-terminated character strings that make up the source code
        lengths - an array with the number of chars in each string (the string length). If an element in lengths is zero, its accompanying string is null-terminated. If lengths is NULL, all strings in the strings argument are considered null-terminated. Any length value passed in that is greater than zero excludes the null terminator in its count.
        errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
        Returns:
        a valid non-zero program object and errcode_ret is set to SUCCESS if the program 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 count is zero or if strings or any entry in strings is NULL.
        • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
        • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
        See Also:
        Reference Page
      • clCreateProgramWithSource

        public static long clCreateProgramWithSource​(long context,
                                                     java.lang.CharSequence[] strings,
                                                     @Nullable
                                                     java.nio.IntBuffer errcode_ret)
        Creates a program object for a context, and loads the source code specified by the text strings in the strings array into the program object. The devices associated with the program object are the devices associated with context. The source code specified by strings is either an OpenCL C program source, header or implementation-defined source for custom devices that support an online compiler.
        Parameters:
        context - a valid OpenCL context
        strings - an array of count pointers to optionally null-terminated character strings that make up the source code
        errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
        Returns:
        a valid non-zero program object and errcode_ret is set to SUCCESS if the program 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 count is zero or if strings or any entry in strings is NULL.
        • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
        • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
        See Also:
        Reference Page
      • clCreateProgramWithSource

        public static long clCreateProgramWithSource​(long context,
                                                     java.lang.CharSequence string,
                                                     @Nullable
                                                     java.nio.IntBuffer errcode_ret)
        Creates a program object for a context, and loads the source code specified by the text strings in the strings array into the program object. The devices associated with the program object are the devices associated with context. The source code specified by strings is either an OpenCL C program source, header or implementation-defined source for custom devices that support an online compiler.
        Parameters:
        context - a valid OpenCL context
        errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
        Returns:
        a valid non-zero program object and errcode_ret is set to SUCCESS if the program 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 count is zero or if strings or any entry in strings is NULL.
        • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
        • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
        See Also:
        Reference Page
      • nclCreateProgramWithBinary

        public static long nclCreateProgramWithBinary​(long context,
                                                      int num_devices,
                                                      long device_list,
                                                      long lengths,
                                                      long binaries,
                                                      long binary_status,
                                                      long errcode_ret)
        Unsafe version of: CreateProgramWithBinary
        Parameters:
        num_devices - the number of devices listed in device_list
      • clCreateProgramWithBinary

        public static long clCreateProgramWithBinary​(long context,
                                                     PointerBuffer device_list,
                                                     PointerBuffer lengths,
                                                     PointerBuffer binaries,
                                                     @Nullable
                                                     java.nio.IntBuffer binary_status,
                                                     @Nullable
                                                     java.nio.IntBuffer errcode_ret)
        Creates a program object for a context, and loads the binary bits specified by binary into the program object.

        The program binaries specified by binaries contain the bits that describe one of the following:

        • a program executable to be run on the device(s) associated with context,
        • a compiled program for device(s) associated with context, or
        • a library of compiled programs for device(s) associated with context.

        The program binary can consist of either or both:

        • Device-specific code and/or,
        • Implementation-specific intermediate representation (IR) which will be converted to the device-specific code.

        OpenCL allows applications to create a program object using the program source or binary and build appropriate program executables. This can be very useful as it allows applications to load program source and then compile and link to generate a program executable online on its first instance for appropriate OpenCL devices in the system. These executables can now be queried and cached by the application. Future instances of the application launching will no longer need to compile and link the program executables. The cached executables can be read and loaded by the application, which can help significantly reduce the application initialization time.

        Parameters:
        context - a valid OpenCL context
        device_list - a pointer to a list of devices that are in context. device_list must be a non-NULL value. The binaries are loaded for devices specified in this list.
        lengths - an array of the size in bytes of the program binaries to be loaded for devices specified by device_list.
        binaries - an array of pointers to program binaries to be loaded for devices specified by device_list. For each device given by device_list[i], the pointer to the program binary for that device is given by binaries[i] and the length of this corresponding binary is given by lengths[i]. lengths[i] cannot be zero and binaries[i] cannot be a NULL pointer.
        binary_status - returns whether the program binary for each device specified in device_list was loaded successfully or not. It is an array of num_devices entries and returns SUCCESS in binary_status[i] if binary was successfully loaded for device specified by device_list[i]; otherwise returns INVALID_VALUE if lengths[i] is zero or if binaries[i] is a NULL value or INVALID_BINARY in binary_status[i] if program binary is not a valid binary for the specified device. If binary_status is NULL, it is ignored.
        errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
        Returns:
        a valid non-zero program object and errcode_ret is set to SUCCESS if the program 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 device_list is NULL or num_devices is zero.
        • INVALID_DEVICE if OpenCL devices listed in device_list are not in the list of devices associated with context.
        • INVALID_VALUE if lengths or binaries are NULL or if any entry in lengths[i] is zero or binaries[i] is NULL.
        • INVALID_BINARY if an invalid program binary was encountered for any device. binary_status will return specific status for each 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
      • clCreateProgramWithBinary

        public static long clCreateProgramWithBinary​(long context,
                                                     PointerBuffer device_list,
                                                     java.nio.ByteBuffer[] binaries,
                                                     @Nullable
                                                     java.nio.IntBuffer binary_status,
                                                     @Nullable
                                                     java.nio.IntBuffer errcode_ret)
        Creates a program object for a context, and loads the binary bits specified by binary into the program object.

        The program binaries specified by binaries contain the bits that describe one of the following:

        • a program executable to be run on the device(s) associated with context,
        • a compiled program for device(s) associated with context, or
        • a library of compiled programs for device(s) associated with context.

        The program binary can consist of either or both:

        • Device-specific code and/or,
        • Implementation-specific intermediate representation (IR) which will be converted to the device-specific code.

        OpenCL allows applications to create a program object using the program source or binary and build appropriate program executables. This can be very useful as it allows applications to load program source and then compile and link to generate a program executable online on its first instance for appropriate OpenCL devices in the system. These executables can now be queried and cached by the application. Future instances of the application launching will no longer need to compile and link the program executables. The cached executables can be read and loaded by the application, which can help significantly reduce the application initialization time.

        Parameters:
        context - a valid OpenCL context
        device_list - a pointer to a list of devices that are in context. device_list must be a non-NULL value. The binaries are loaded for devices specified in this list.
        binaries - an array of pointers to program binaries to be loaded for devices specified by device_list. For each device given by device_list[i], the pointer to the program binary for that device is given by binaries[i] and the length of this corresponding binary is given by lengths[i]. lengths[i] cannot be zero and binaries[i] cannot be a NULL pointer.
        binary_status - returns whether the program binary for each device specified in device_list was loaded successfully or not. It is an array of num_devices entries and returns SUCCESS in binary_status[i] if binary was successfully loaded for device specified by device_list[i]; otherwise returns INVALID_VALUE if lengths[i] is zero or if binaries[i] is a NULL value or INVALID_BINARY in binary_status[i] if program binary is not a valid binary for the specified device. If binary_status is NULL, it is ignored.
        errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
        Returns:
        a valid non-zero program object and errcode_ret is set to SUCCESS if the program 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 device_list is NULL or num_devices is zero.
        • INVALID_DEVICE if OpenCL devices listed in device_list are not in the list of devices associated with context.
        • INVALID_VALUE if lengths or binaries are NULL or if any entry in lengths[i] is zero or binaries[i] is NULL.
        • INVALID_BINARY if an invalid program binary was encountered for any device. binary_status will return specific status for each 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
      • clCreateProgramWithBinary

        public static long clCreateProgramWithBinary​(long context,
                                                     PointerBuffer device_list,
                                                     java.nio.ByteBuffer binary,
                                                     @Nullable
                                                     java.nio.IntBuffer binary_status,
                                                     @Nullable
                                                     java.nio.IntBuffer errcode_ret)
        Creates a program object for a context, and loads the binary bits specified by binary into the program object.

        The program binaries specified by binaries contain the bits that describe one of the following:

        • a program executable to be run on the device(s) associated with context,
        • a compiled program for device(s) associated with context, or
        • a library of compiled programs for device(s) associated with context.

        The program binary can consist of either or both:

        • Device-specific code and/or,
        • Implementation-specific intermediate representation (IR) which will be converted to the device-specific code.

        OpenCL allows applications to create a program object using the program source or binary and build appropriate program executables. This can be very useful as it allows applications to load program source and then compile and link to generate a program executable online on its first instance for appropriate OpenCL devices in the system. These executables can now be queried and cached by the application. Future instances of the application launching will no longer need to compile and link the program executables. The cached executables can be read and loaded by the application, which can help significantly reduce the application initialization time.

        Parameters:
        context - a valid OpenCL context
        device_list - a pointer to a list of devices that are in context. device_list must be a non-NULL value. The binaries are loaded for devices specified in this list.
        binary_status - returns whether the program binary for each device specified in device_list was loaded successfully or not. It is an array of num_devices entries and returns SUCCESS in binary_status[i] if binary was successfully loaded for device specified by device_list[i]; otherwise returns INVALID_VALUE if lengths[i] is zero or if binaries[i] is a NULL value or INVALID_BINARY in binary_status[i] if program binary is not a valid binary for the specified device. If binary_status is NULL, it is ignored.
        errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
        Returns:
        a valid non-zero program object and errcode_ret is set to SUCCESS if the program 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 device_list is NULL or num_devices is zero.
        • INVALID_DEVICE if OpenCL devices listed in device_list are not in the list of devices associated with context.
        • INVALID_VALUE if lengths or binaries are NULL or if any entry in lengths[i] is zero or binaries[i] is NULL.
        • INVALID_BINARY if an invalid program binary was encountered for any device. binary_status will return specific status for each 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
      • clRetainProgram

        public static int clRetainProgram​(long program)
        Increments the program reference count. clCreateProgram does an implicit retain.
        Parameters:
        program - the program object to retain
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_PROGRAM if program is not a valid program 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
      • clReleaseProgram

        public static int clReleaseProgram​(long program)
        Decrements the program reference count. The program object is deleted after all kernel objects associated with program have been deleted and the program reference count becomes zero.
        Parameters:
        program - the program object to release
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_PROGRAM if program is not a valid program 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
      • nclBuildProgram

        public static int nclBuildProgram​(long program,
                                          int num_devices,
                                          long device_list,
                                          long options,
                                          long pfn_notify,
                                          long user_data)
        Unsafe version of: BuildProgram
        Parameters:
        num_devices - the number of devices listed in device_list
      • clBuildProgram

        public static int clBuildProgram​(long program,
                                         @Nullable
                                         PointerBuffer device_list,
                                         java.nio.ByteBuffer options,
                                         @Nullable
                                         CLProgramCallbackI pfn_notify,
                                         long user_data)
        
        public static int clBuildProgram​(long program,
                                         @Nullable
                                         PointerBuffer device_list,
                                         java.lang.CharSequence options,
                                         @Nullable
                                         CLProgramCallbackI pfn_notify,
                                         long user_data)
        
        Builds (compiles & links) a program executable from the program source or binary for all the devices or a specific device(s) in the OpenCL context associated with program. OpenCL allows program executables to be built using the source or the binary. clBuildProgram must be called for program created using either CreateProgramWithSource or CreateProgramWithBinary to build the program executable for one or more devices associated with program. If program is created with CreateProgramWithBinary, then the program binary must be an executable binary (not a compiled binary or library).

        The executable binary can be queried using GetProgramInfo and can be specified to CreateProgramWithBinary to create a new program object.

        Parameters:
        program - the program object
        device_list - a pointer to a list of devices associated with program. If device_list is a NULL value, the program executable is built for all devices associated with program for which a source or binary has been loaded. If device_list is a non-NULL value, the program executable is built for devices specified in this list for which a source or binary has been loaded.
        options - a pointer to a null-terminated string of characters that describes the build options to be used for building the program executable
        pfn_notify - a function pointer to a notification routine. The notification routine is a callback function that an application can register and which will be called when the program executable has been built (successfully or unsuccessfully). If pfn_notify is not NULL, clBuildProgram does not need to wait for the build to complete and can return immediately once the build operation can begin. The build operation can begin if the context, program whose sources are being compiled and linked, list of devices and build options specified are all valid and appropriate host and device resources needed to perform the build are available. If pfn_notify is NULL, clBuildProgram does not return until the build has completed. This callback function may be called asynchronously by the OpenCL implementation. It is the application's responsibility to ensure that the callback function is thread-safe.
        user_data - will be passed as an argument when pfn_notify is called. user_data can be NULL.
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        See Also:
        Reference Page
      • clBuildProgram

        public static int clBuildProgram​(long program,
                                         @Nullable
                                         long device,
                                         java.lang.CharSequence options,
                                         @Nullable
                                         CLProgramCallbackI pfn_notify,
                                         long user_data)
        Builds (compiles & links) a program executable from the program source or binary for all the devices or a specific device(s) in the OpenCL context associated with program. OpenCL allows program executables to be built using the source or the binary. clBuildProgram must be called for program created using either CreateProgramWithSource or CreateProgramWithBinary to build the program executable for one or more devices associated with program. If program is created with CreateProgramWithBinary, then the program binary must be an executable binary (not a compiled binary or library).

        The executable binary can be queried using GetProgramInfo and can be specified to CreateProgramWithBinary to create a new program object.

        Parameters:
        program - the program object
        options - a pointer to a null-terminated string of characters that describes the build options to be used for building the program executable
        pfn_notify - a function pointer to a notification routine. The notification routine is a callback function that an application can register and which will be called when the program executable has been built (successfully or unsuccessfully). If pfn_notify is not NULL, clBuildProgram does not need to wait for the build to complete and can return immediately once the build operation can begin. The build operation can begin if the context, program whose sources are being compiled and linked, list of devices and build options specified are all valid and appropriate host and device resources needed to perform the build are available. If pfn_notify is NULL, clBuildProgram does not return until the build has completed. This callback function may be called asynchronously by the OpenCL implementation. It is the application's responsibility to ensure that the callback function is thread-safe.
        user_data - will be passed as an argument when pfn_notify is called. user_data can be NULL.
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        See Also:
        Reference Page
      • clUnloadCompiler

        public static int clUnloadCompiler()
        Allows the implementation to release the resources allocated by the OpenCL compiler. This is a hint from the application and does not guarantee that the compiler will not be used in the future or that the compiler will actually be unloaded by the implementation.

        Calls to BuildProgram after UnloadCompiler will reload the compiler, if necessary, to build the appropriate program executable.

        Returns:
        always SUCCESS
        See Also:
        Reference Page - This function is deprecated after OpenCL 1.1
      • nclGetProgramInfo

        public static int nclGetProgramInfo​(long program,
                                            int param_name,
                                            long param_value_size,
                                            long param_value,
                                            long param_value_size_ret)
        Unsafe version of: GetProgramInfo
        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.
      • nclGetProgramBuildInfo

        public static int nclGetProgramBuildInfo​(long program,
                                                 long device,
                                                 int param_name,
                                                 long param_value_size,
                                                 long param_value,
                                                 long param_value_size_ret)
        Unsafe version of: GetProgramBuildInfo
        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.
      • clGetProgramBuildInfo

        public static int clGetProgramBuildInfo​(long program,
                                                long device,
                                                int param_name,
                                                @Nullable
                                                java.nio.ByteBuffer param_value,
                                                @Nullable
                                                PointerBuffer param_value_size_ret)
        
        public static int clGetProgramBuildInfo​(long program,
                                                long device,
                                                int param_name,
                                                @Nullable
                                                java.nio.IntBuffer param_value,
                                                @Nullable
                                                PointerBuffer param_value_size_ret)
        
        public static int clGetProgramBuildInfo​(long program,
                                                long device,
                                                int param_name,
                                                @Nullable
                                                PointerBuffer param_value,
                                                @Nullable
                                                PointerBuffer param_value_size_ret)
        
        Returns build information for each device in the program object.
        Parameters:
        program - the program object being queried
        device - the device for which build information is being queried. device must be a valid device associated with program.
        param_name - the information to query. One of:
        PROGRAM_BUILD_STATUSPROGRAM_BUILD_OPTIONSPROGRAM_BUILD_LOG
        PROGRAM_BINARY_TYPEPROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE
        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_DEVICE if device is not in the list of devices associated with program.
        • 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_PROGRAM if program is a not a valid program 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
      • nclCreateKernel

        public static long nclCreateKernel​(long program,
                                           long kernel_name,
                                           long errcode_ret)
        Unsafe version of: CreateKernel
      • clCreateKernel

        public static long clCreateKernel​(long program,
                                          java.nio.ByteBuffer kernel_name,
                                          @Nullable
                                          java.nio.IntBuffer errcode_ret)
        
        public static long clCreateKernel​(long program,
                                          java.lang.CharSequence kernel_name,
                                          @Nullable
                                          java.nio.IntBuffer errcode_ret)
        
        Creates a kernel object.

        A kernel is a function declared in a program. A kernel is identified by the __kernel qualifier applied to any function in a program. A kernel object encapsulates the specific __kernel function declared in a program and the argument values to be used when executing this __kernel function.

        Kernel objects can only be created once you have a program object with a valid program source or binary loaded into the program object and the program executable has been successfully built for one or more devices associated with program. No changes to the program executable are allowed while there are kernel objects associated with a program object. This means that calls to BuildProgram and CompileProgram return INVALID_OPERATION if there are kernel objects attached to a program object. The OpenCL context associated with program will be the context associated with kernel. The list of devices associated with program are the devices associated with kernel. Devices associated with a program object for which a valid program executable has been built can be used to execute kernels declared in the program object.

        Parameters:
        program - a program object with a successfully built executable
        kernel_name - a function name in the program declared with the __kernel qualifier
        errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
        Returns:
        a valid non-zero kernel object and errcode_ret is set to SUCCESS if the kernel object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:
        • INVALID_PROGRAM if program is not a valid program object.
        • INVALID_PROGRAM_EXECUTABLE if there is no successfully built executable for program.
        • INVALID_KERNEL_NAME if kernel_name is not found in program.
        • INVALID_KERNEL_DEFINITION if the function definition for __kernel function given by kernel_name such as the number of arguments, the argument types are not the same for all devices for which the program executable has been built.
        • INVALID_VALUE if kernel_name is NULL.
        • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
        • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
        See Also:
        Reference Page
      • nclCreateKernelsInProgram

        public static int nclCreateKernelsInProgram​(long program,
                                                    int num_kernels,
                                                    long kernels,
                                                    long num_kernels_ret)
        Unsafe version of: CreateKernelsInProgram
        Parameters:
        num_kernels - the size of memory pointed to by kernels specified as the number of cl_kernel entries
      • clCreateKernelsInProgram

        public static int clCreateKernelsInProgram​(long program,
                                                   @Nullable
                                                   PointerBuffer kernels,
                                                   @Nullable
                                                   java.nio.IntBuffer num_kernels_ret)
        Creates kernel objects for all kernel functions in program. Kernel objects are not created for any __kernel functions in program that do not have the same function definition across all devices for which a program executable has been successfully built.

        See CreateKernel for more details.

        Parameters:
        program - a program object with a successfully built executable
        kernels - the buffer where the kernel objects for kernels in program will be returned. If kernels is NULL, it is ignored. If kernels is not NULL, num_kernels must be greater than or equal to the number of kernels in program.
        num_kernels_ret - the number of kernels in program. If num_kernels_ret is NULL, it is ignored.
        Returns:
        SUCCESS if the kernel objects were successfully allocated. Otherwise, it returns one of the following errors:
        • INVALID_PROGRAM if program is not a valid program object.
        • INVALID_PROGRAM_EXECUTABLE if there is no successfully built executable for any device in program.
        • INVALID_VALUE if kernels is not NULL and num_kernels is less than the number of kernels in program.
        • 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
      • clRetainKernel

        public static int clRetainKernel​(long kernel)
        Increments the kernel reference count. CreateKernel or CreateKernelsInProgram do an implicit retain.
        Parameters:
        kernel - the kernel to retain
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_KERNEL if kernel is not a valid kernel 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
      • clReleaseKernel

        public static int clReleaseKernel​(long kernel)
        Decrements the kernel reference count.

        The kernel object is deleted once the number of instances that are retained to kernel become zero and the kernel object is no longer needed by any enqueued commands that use kernel.

        Parameters:
        kernel - the kernel to release
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_KERNEL if kernel is not a valid kernel 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
      • nclSetKernelArg

        public static int nclSetKernelArg​(long kernel,
                                          int arg_index,
                                          long arg_size,
                                          long arg_value)
        Unsafe version of: SetKernelArg
        Parameters:
        arg_size - the size of the argument value. If the argument is a memory object, the size is the size of the buffer or image object type. For arguments declared with the __local qualifier, the size specified will be the size in bytes of the buffer that must be allocated for the __local argument. If the argument is of type sampler_t, the arg_size value must be equal to sizeof(cl_sampler). For all other arguments, the size will be the size of argument type.
      • clSetKernelArg

        public static int clSetKernelArg​(long kernel,
                                         int arg_index,
                                         long arg_size)
        Set 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.

        For example, consider the following kernel:

        
                          kernel void image_filter (
                              int n, int m,
                              __constant float *filter_weights,
                              __read_only image2d_t src_image,
                              __write_only image2d_t dst_image
                          ) {
                              …
                          }

        Argument index values for image_filter will be 0 for n, 1 for m, 2 for filter_weights, 3 for src_image and 4 for dst_image.

        NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by clSetKernelArg, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.

        arg_size - the size of the argument value. If the argument is a memory object, the size is the size of the buffer or image object type. For arguments declared with the __local qualifier, the size specified will be the size in bytes of the buffer that must be allocated for the __local argument. If the argument is of type sampler_t, the arg_size value must be equal to sizeof(cl_sampler). For all other arguments, the size will be the size of argument type.
        Returns:
        SUCCESS if the function was executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_KERNEL if kernel is not a valid kernel object.
        • INVALID_ARG_INDEX if arg_index is not a valid argument index.
        • INVALID_ARG_VALUE if arg_value specified is not a valid value.
        • INVALID_MEM_OBJECT for an argument declared to be a memory object when the specified arg_value is not a valid memory object.
        • INVALID_SAMPLER for an argument declared to be of type sampler_t when the specified arg_value is not a valid sampler object.
        • INVALID_ARG_SIZE if arg_size does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object and arg_size != sizeof(cl_mem) or if arg_size is zero and the argument is declared with the __local qualifier or if the argument is a sampler and arg_size != sizeof(cl_sampler).
        • MAX_SIZE_RESTRICTION_EXCEEDED if the size in bytes of the memory object (if the argument was declared with constant qualifier) or arg_size (if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can be cl::max_size defined in OpenCL 2.2 C++ Kernel Language specification or SpvDecorationMaxByteOffset defined in SPIR-V 1.2 Specification.
        • INVALID_ARG_VALUE if the argument is an image declared with the read_only qualifier and arg_value refers to an image object created with cl_mem_flags of MEM_WRITE_ONLY or if the image argument is declared with the write_only qualifier and arg_value refers to an image object created with cl_mem_flags of MEM_READ_ONLY.
        • 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
      • clSetKernelArg

        public static int clSetKernelArg​(long kernel,
                                         int arg_index,
                                         java.nio.ByteBuffer arg_value)
        
        public static int clSetKernelArg​(long kernel,
                                         int arg_index,
                                         java.nio.ShortBuffer arg_value)
        
        public static int clSetKernelArg​(long kernel,
                                         int arg_index,
                                         java.nio.IntBuffer arg_value)
        
        public static int clSetKernelArg​(long kernel,
                                         int arg_index,
                                         java.nio.LongBuffer arg_value)
        
        public static int clSetKernelArg​(long kernel,
                                         int arg_index,
                                         java.nio.FloatBuffer arg_value)
        
        public static int clSetKernelArg​(long kernel,
                                         int arg_index,
                                         java.nio.DoubleBuffer arg_value)
        
        public static int clSetKernelArg​(long kernel,
                                         int arg_index,
                                         PointerBuffer arg_value)
        
        Set 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.

        For example, consider the following kernel:

        
                          kernel void image_filter (
                              int n, int m,
                              __constant float *filter_weights,
                              __read_only image2d_t src_image,
                              __write_only image2d_t dst_image
                          ) {
                              …
                          }

        Argument index values for image_filter will be 0 for n, 1 for m, 2 for filter_weights, 3 for src_image and 4 for dst_image.

        NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by clSetKernelArg, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.

        arg_value - a pointer to data that should be used as the argument value for argument specified by arg_index. The argument data pointed to by arg_value is copied and the arg_value pointer can therefore be reused by the application after clSetKernelArg returns. The argument value specified is the value used by all API calls that enqueue kernel (EnqueueNDRangeKernel and EnqueueTask) until the argument value is changed by a call to clSetKernelArg for kernel.

        If the argument is a memory object (buffer, image or image array), the arg_value entry will be a pointer to the appropriate buffer, image or image array object. The memory object must be created with the context associated with the kernel object. If the argument is a buffer object, the arg_value pointer can be NULL or point to a NULL value in which case a NULL value will be used as the value for the argument declared as a pointer to __global or __constant memory in the kernel. If the argument is declared with the __local qualifier, the arg_value entry must be NULL. If the argument is of type sampler_t, the arg_value entry must be a pointer to the sampler object.

        If the argument is declared to be a pointer of a built-in scalar or vector type, or a user defined structure type in the global or constant address space, the memory object specified as argument value must be a buffer object (or NULL). If the argument is declared with the __constant qualifier, the size in bytes of the memory object cannot exceed DEVICE_MAX_CONSTANT_BUFFER_SIZE and the number of arguments declared as pointers to __constant memory cannot exceed DEVICE_MAX_CONSTANT_ARGS.

        The memory object specified as argument value must be a 2D image object if the argument is declared to be of type image2d_t. The memory object specified as argument value must be a 3D image object if argument is declared to be of type image3d_t. The memory object specified as argument value must be a 1D image object if the argument is declared to be of type image1d_t. The memory object specified as argument value must be a 1D image buffer object if the argument is declared to be of type image1d_buffer_t. The memory object specified as argument value must be a 1D image array object if argument is declared to be of type image1d_array_t. The memory object specified as argument value must be a 2D image array object if argument is declared to be of type image2d_array_t.

        For all other kernel arguments, the arg_value entry must be a pointer to the actual data to be used as argument value.

        Returns:
        SUCCESS if the function was executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_KERNEL if kernel is not a valid kernel object.
        • INVALID_ARG_INDEX if arg_index is not a valid argument index.
        • INVALID_ARG_VALUE if arg_value specified is not a valid value.
        • INVALID_MEM_OBJECT for an argument declared to be a memory object when the specified arg_value is not a valid memory object.
        • INVALID_SAMPLER for an argument declared to be of type sampler_t when the specified arg_value is not a valid sampler object.
        • INVALID_ARG_SIZE if arg_size does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object and arg_size != sizeof(cl_mem) or if arg_size is zero and the argument is declared with the __local qualifier or if the argument is a sampler and arg_size != sizeof(cl_sampler).
        • MAX_SIZE_RESTRICTION_EXCEEDED if the size in bytes of the memory object (if the argument was declared with constant qualifier) or arg_size (if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can be cl::max_size defined in OpenCL 2.2 C++ Kernel Language specification or SpvDecorationMaxByteOffset defined in SPIR-V 1.2 Specification.
        • INVALID_ARG_VALUE if the argument is an image declared with the read_only qualifier and arg_value refers to an image object created with cl_mem_flags of MEM_WRITE_ONLY or if the image argument is declared with the write_only qualifier and arg_value refers to an image object created with cl_mem_flags of MEM_READ_ONLY.
        • 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
      • clSetKernelArg1b, clSetKernelArg2b, clSetKernelArg4b, clSetKernelArg1s, clSetKernelArg2s, clSetKernelArg4s, clSetKernelArg1i, clSetKernelArg2i, clSetKernelArg4i, clSetKernelArg1l, clSetKernelArg2l, clSetKernelArg4l, clSetKernelArg1f, clSetKernelArg2f, clSetKernelArg4f, clSetKernelArg1d, clSetKernelArg2d, clSetKernelArg4d, clSetKernelArg1p, clSetKernelArg2p, clSetKernelArg4p

        public static int clSetKernelArg1b​(long kernel,
                                           int arg_index,
                                           byte arg0)
        
        public static int clSetKernelArg2b​(long kernel,
                                           int arg_index,
                                           byte arg0,
                                           byte arg1)
        
        public static int clSetKernelArg4b​(long kernel,
                                           int arg_index,
                                           byte arg0,
                                           byte arg1,
                                           byte arg2,
                                           byte arg3)
        
        public static int clSetKernelArg1s​(long kernel,
                                           int arg_index,
                                           short arg0)
        
        public static int clSetKernelArg2s​(long kernel,
                                           int arg_index,
                                           short arg0,
                                           short arg1)
        
        public static int clSetKernelArg4s​(long kernel,
                                           int arg_index,
                                           short arg0,
                                           short arg1,
                                           short arg2,
                                           short arg3)
        
        public static int clSetKernelArg1i​(long kernel,
                                           int arg_index,
                                           int arg0)
        
        public static int clSetKernelArg2i​(long kernel,
                                           int arg_index,
                                           int arg0,
                                           int arg1)
        
        public static int clSetKernelArg4i​(long kernel,
                                           int arg_index,
                                           int arg0,
                                           int arg1,
                                           int arg2,
                                           int arg3)
        
        public static int clSetKernelArg1l​(long kernel,
                                           int arg_index,
                                           long arg0)
        
        public static int clSetKernelArg2l​(long kernel,
                                           int arg_index,
                                           long arg0,
                                           long arg1)
        
        public static int clSetKernelArg4l​(long kernel,
                                           int arg_index,
                                           long arg0,
                                           long arg1,
                                           long arg2,
                                           long arg3)
        
        public static int clSetKernelArg1f​(long kernel,
                                           int arg_index,
                                           float arg0)
        
        public static int clSetKernelArg2f​(long kernel,
                                           int arg_index,
                                           float arg0,
                                           float arg1)
        
        public static int clSetKernelArg4f​(long kernel,
                                           int arg_index,
                                           float arg0,
                                           float arg1,
                                           float arg2,
                                           float arg3)
        
        public static int clSetKernelArg1d​(long kernel,
                                           int arg_index,
                                           double arg0)
        
        public static int clSetKernelArg2d​(long kernel,
                                           int arg_index,
                                           double arg0,
                                           double arg1)
        
        public static int clSetKernelArg4d​(long kernel,
                                           int arg_index,
                                           double arg0,
                                           double arg1,
                                           double arg2,
                                           double arg3)
        
        public static int clSetKernelArg1p​(long kernel,
                                           int arg_index,
                                           long arg0)
        
        public static int clSetKernelArg2p​(long kernel,
                                           int arg_index,
                                           long arg0,
                                           long arg1)
        
        public static int clSetKernelArg4p​(long kernel,
                                           int arg_index,
                                           long arg0,
                                           long arg1,
                                           long arg2,
                                           long arg3)
        
        Set 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.

        For example, consider the following kernel:

        
                          kernel void image_filter (
                              int n, int m,
                              __constant float *filter_weights,
                              __read_only image2d_t src_image,
                              __write_only image2d_t dst_image
                          ) {
                              …
                          }

        Argument index values for image_filter will be 0 for n, 1 for m, 2 for filter_weights, 3 for src_image and 4 for dst_image.

        NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by clSetKernelArg, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.

        Returns:
        SUCCESS if the function was executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_KERNEL if kernel is not a valid kernel object.
        • INVALID_ARG_INDEX if arg_index is not a valid argument index.
        • INVALID_ARG_VALUE if arg_value specified is not a valid value.
        • INVALID_MEM_OBJECT for an argument declared to be a memory object when the specified arg_value is not a valid memory object.
        • INVALID_SAMPLER for an argument declared to be of type sampler_t when the specified arg_value is not a valid sampler object.
        • INVALID_ARG_SIZE if arg_size does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object and arg_size != sizeof(cl_mem) or if arg_size is zero and the argument is declared with the __local qualifier or if the argument is a sampler and arg_size != sizeof(cl_sampler).
        • MAX_SIZE_RESTRICTION_EXCEEDED if the size in bytes of the memory object (if the argument was declared with constant qualifier) or arg_size (if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can be cl::max_size defined in OpenCL 2.2 C++ Kernel Language specification or SpvDecorationMaxByteOffset defined in SPIR-V 1.2 Specification.
        • INVALID_ARG_VALUE if the argument is an image declared with the read_only qualifier and arg_value refers to an image object created with cl_mem_flags of MEM_WRITE_ONLY or if the image argument is declared with the write_only qualifier and arg_value refers to an image object created with cl_mem_flags of MEM_READ_ONLY.
        • 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
      • nclGetKernelInfo

        public static int nclGetKernelInfo​(long kernel,
                                           int param_name,
                                           long param_value_size,
                                           long param_value,
                                           long param_value_size_ret)
        Unsafe version of: GetKernelInfo
        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.
      • clGetKernelInfo

        public static int clGetKernelInfo​(long kernel,
                                          int param_name,
                                          @Nullable
                                          java.nio.ByteBuffer param_value,
                                          @Nullable
                                          PointerBuffer param_value_size_ret)
        
        public static int clGetKernelInfo​(long kernel,
                                          int param_name,
                                          @Nullable
                                          java.nio.IntBuffer param_value,
                                          @Nullable
                                          PointerBuffer param_value_size_ret)
        
        public static int clGetKernelInfo​(long kernel,
                                          int param_name,
                                          @Nullable
                                          PointerBuffer param_value,
                                          @Nullable
                                          PointerBuffer param_value_size_ret)
        
        Returns information about a kernel object.
        Parameters:
        kernel - the kernel object being queried
        param_name - the information to query. One of:
        KERNEL_FUNCTION_NAMEKERNEL_NUM_ARGSKERNEL_REFERENCE_COUNTKERNEL_CONTEXT
        KERNEL_PROGRAMKERNEL_ATTRIBUTES
        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_KERNEL if kernel is a not a valid kernel 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
      • nclGetKernelWorkGroupInfo

        public static int nclGetKernelWorkGroupInfo​(long kernel,
                                                    long device,
                                                    int param_name,
                                                    long param_value_size,
                                                    long param_value,
                                                    long param_value_size_ret)
        Unsafe version of: GetKernelWorkGroupInfo
        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.
      • clGetKernelWorkGroupInfo

        public static int clGetKernelWorkGroupInfo​(long kernel,
                                                   long device,
                                                   int param_name,
                                                   @Nullable
                                                   java.nio.ByteBuffer param_value,
                                                   @Nullable
                                                   PointerBuffer param_value_size_ret)
        
        public static int clGetKernelWorkGroupInfo​(long kernel,
                                                   long device,
                                                   int param_name,
                                                   @Nullable
                                                   java.nio.IntBuffer param_value,
                                                   @Nullable
                                                   PointerBuffer param_value_size_ret)
        
        public static int clGetKernelWorkGroupInfo​(long kernel,
                                                   long device,
                                                   int param_name,
                                                   @Nullable
                                                   java.nio.LongBuffer param_value,
                                                   @Nullable
                                                   PointerBuffer param_value_size_ret)
        
        public static int clGetKernelWorkGroupInfo​(long kernel,
                                                   long device,
                                                   int param_name,
                                                   @Nullable
                                                   PointerBuffer param_value,
                                                   @Nullable
                                                   PointerBuffer param_value_size_ret)
        
        Returns information about the kernel object that may be specific to a device.
        Parameters:
        kernel - the kernel object being queried
        device - identifies a specific device in the list of devices associated with kernel. The list of devices is the list of devices in the OpenCL context that is associated with kernel. If the list of devices associated with kernel is a single device, device can be a NULL value.
        param_name - the information to query. One of:
        KERNEL_WORK_GROUP_SIZEKERNEL_COMPILE_WORK_GROUP_SIZE
        KERNEL_LOCAL_MEM_SIZEKERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE
        KERNEL_PRIVATE_MEM_SIZEKERNEL_GLOBAL_WORK_SIZE
        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_DEVICE if device is not in the list of devices associated with kernel or if device is NULL but there is more than one device associated with kernel.
        • 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_VALUE if param_name is KERNEL_GLOBAL_WORK_SIZE and device is not a custom device or kernel is not a built-in kernel.
        • INVALID_KERNEL if kernel is a not a valid kernel 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
      • nclEnqueueNDRangeKernel

        public static int nclEnqueueNDRangeKernel​(long command_queue,
                                                  long kernel,
                                                  int work_dim,
                                                  long global_work_offset,
                                                  long global_work_size,
                                                  long local_work_size,
                                                  int num_events_in_wait_list,
                                                  long event_wait_list,
                                                  long event)
        Unsafe version of: EnqueueNDRangeKernel
        Parameters:
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueNDRangeKernel

        public static int clEnqueueNDRangeKernel​(long command_queue,
                                                 long kernel,
                                                 int work_dim,
                                                 @Nullable
                                                 PointerBuffer global_work_offset,
                                                 @Nullable
                                                 PointerBuffer global_work_size,
                                                 @Nullable
                                                 PointerBuffer local_work_size,
                                                 @Nullable
                                                 PointerBuffer event_wait_list,
                                                 @Nullable
                                                 PointerBuffer event)
        Enqueues a command to execute a kernel on a device.
        Parameters:
        command_queue - a valid command-queue. The kernel will be queued for execution on the device associated with command_queue.
        kernel - a valid kernel object. The OpenCL context associated with kernel and command_queue must be the same.
        work_dim - the number of dimensions used to specify the global work-items and work-items in the work-group. work_dim must be greater than zero and less than or equal to DEVICE_MAX_WORK_ITEM_DIMENSIONS.
        global_work_offset - can be used to specify an array of work_dim unsigned values that describe the offset used to calculate the global ID of a work-item. If global_work_offset is NULL, the global IDs start at offset (0, 0, … 0).
        global_work_size - points to an array of work_dim unsigned values that describe the number of global work-items in work_dim dimensions that will execute the kernel function. The total number of global work-items is computed as global_work_size[0] * … * global_work_size[work_dim – 1].
        local_work_size - points to an array of work_dim unsigned values that describe the number of work-items that make up a work-group (also referred to as the size of the work-group) that will execute the kernel specified by kernel. The total number of work-items in a work-group is computed as local_work_size[0] * … * local_work_size[work_dim – 1]. The total number of work-items in the work-group must be less than or equal to the DEVICE_MAX_WORK_GROUP_SIZE value and the number of work-items specified in local_work_size[0], … local_work_size[work_dim – 1] must be less than or equal to the corresponding values specified by DEVICE_MAX_WORK_ITEM_SIZES[0], … DEVICE_MAX_WORK_ITEM_SIZES[work_dim \u2013 1]. The explicitly specified local_work_size will be used to determine how to break the global work-items specified by global_work_size into appropriate work-group instances. If local_work_size is specified, the values specified in global_work_size[0], … global_work_size[work_dim - 1] must be evenly divisible by the corresponding values specified in local_work_size[0], … local_work_size[work_dim – 1].

        The work-group size to be used for kernel can also be specified in the program source using the __attribute__((reqd_work_group_size(X, Y, Z))) qualifier. In this case the size of work group specified by local_work_size must match the value specified by the reqd_work_group_size attribute qualifier.

        local_work_size can also be a NULL value in which case the OpenCL implementation will determine how to be break the global work-items into appropriate work-group instances.

        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 kernel execution was successfully queued. Otherwise, it returns one of the following errors:
        • INVALID_PROGRAM_EXECUTABLE if there is no successfully built program executable available for device associated with command_queue.
        • INVALID_COMMAND_QUEUE if command_queue is not a valid command-queue.
        • INVALID_KERNEL if kernel is not a valid kernel object.
        • INVALID_CONTEXT if context associated with command_queue and kernel are not the same or if the context associated with command_queue and events in event_wait_list are not the same.
        • INVALID_KERNEL_ARGS if the kernel argument values have not been specified.
        • INVALID_WORK_DIMENSION if work_dim is not a valid value (i.e. a value between 1 and 3).
        • INVALID_GLOBAL_WORK_SIZE if global_work_size is NULL, or if any of the values specified in global_work_size[0], … global_work_size[work_dim – 1] are 0 or exceed the range given by the sizeof(size_t) for the device on which the kernel execution will be enqueued.
        • INVALID_GLOBAL_OFFSET if the value specified in global_work_size + the corresponding values in global_work_offset for any dimensions is greater than the sizeof(size_t) for the device on which the kernel execution will be enqueued.
        • INVALID_WORK_GROUP_SIZE if local_work_size is specified and number of work-items specified by global_work_size is not evenly divisible by size of work-group given by local_work_size or does not match the work-group size specified for kernel using the __attribute__((reqd_work_group_size(X, Y, Z))) qualifier in program source.
        • INVALID_WORK_GROUP_SIZE if local_work_size is specified and the total number of work-items in the work-group computed as local_work_size[0] * … * local_work_size[work_dim – 1] is greater than the value specified by DEVICE_MAX_WORK_GROUP_SIZE
        • INVALID_WORK_GROUP_SIZE if local_work_size is NULL and the __attribute__((reqd_work_group_size(X, Y, Z))) qualifier is used to declare the work-group size for kernel in the program source.
        • INVALID_WORK_ITEM_SIZE if the number of work-items specified in any of local_work_size[0], … local_work_size[work_dim – 1] is greater than the corresponding values specified by DEVICE_MAX_WORK_ITEM_SIZES[0], … DEVICE_MAX_WORK_ITEM_SIZES[work_dim \u2013 1].
        • MISALIGNED_SUB_BUFFER_OFFSET if a sub-buffer object is specified as the value for an argument that is a buffer object and the offset specified when the sub-buffer object is created is not aligned to DEVICE_MEM_BASE_ADDR_ALIGN value for device associated with queue.
        • INVALID_IMAGE_SIZE if an image object is specified as an argument value and the image dimensions (image width, height, specified or compute row and/or slice pitch) are not supported by device associated with queue.
        • IMAGE_FORMAT_NOT_SUPPORTED if an image object is specified as an argument value and the image format (image channel order and data type) is not supported by device associated with queue.
        • OUT_OF_RESOURCES if there is a failure to queue the execution instance of kernel on the command-queue because of insufficient resources needed to execute the kernel. For example, the explicitly specified local_work_size causes a failure to execute the kernel because of insufficient resources such as registers or local memory. Another example would be the number of read-only image args used in kernel exceed the DEVICE_MAX_READ_IMAGE_ARGS value for device or the number of write-only image args used in kernel exceed the DEVICE_MAX_WRITE_IMAGE_ARGS value for device or the number of samplers used in kernel exceed DEVICE_MAX_SAMPLERS for device.
        • MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for data store associated with image or buffer objects specified as arguments to kernel.
        • 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
      • nclEnqueueTask

        public static int nclEnqueueTask​(long command_queue,
                                         long kernel,
                                         int num_events_in_wait_list,
                                         long event_wait_list,
                                         long event)
        Unsafe version of: EnqueueTask
        Parameters:
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueTask

        public static int clEnqueueTask​(long command_queue,
                                        long kernel,
                                        @Nullable
                                        PointerBuffer event_wait_list,
                                        @Nullable
                                        PointerBuffer event)
        Enqueues a command to execute a kernel on a device. The kernel is executed using a single work-item.

        clEnqueueTask is equivalent to calling EnqueueNDRangeKernel with work_dim = 1, global_work_offset = NULL, global_work_size[0] set to 1 and local_work_size[0] set to 1.

        Parameters:
        command_queue - a valid command-queue. The kernel will be queued for execution on the device associated with command_queue.
        kernel - a valid kernel object. The OpenCL context associated with kernel and command_queue must be the same.
        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 kernel execution was successfully queued. Otherwise, see EnqueueNDRangeKernel.
        See Also:
        Reference Page - This function is deprecated after OpenCL 1.2
      • nclEnqueueNativeKernel

        public static int nclEnqueueNativeKernel​(long command_queue,
                                                 long user_func,
                                                 long args,
                                                 long cb_args,
                                                 int num_mem_objects,
                                                 long mem_list,
                                                 long args_mem_loc,
                                                 int num_events_in_wait_list,
                                                 long event_wait_list,
                                                 long event)
        Unsafe version of: EnqueueNativeKernel
        Parameters:
        cb_args - the size in bytes of the args list that args points to.

        The data pointed to by args and cb_args bytes in size will be copied and a pointer to this copied region will be passed to user_func. The copy needs to be done because the memory objects (cl_mem values) that args may contain need to be modified and replaced by appropriate pointers to global memory. When clEnqueueNativeKernel returns, the memory region pointed to by args can be reused by the application.

        num_mem_objects - the number of buffer objects that are passed in args
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueNativeKernel

        public static int clEnqueueNativeKernel​(long command_queue,
                                                CLNativeKernelI user_func,
                                                @Nullable
                                                java.nio.ByteBuffer args,
                                                @Nullable
                                                PointerBuffer mem_list,
                                                @Nullable
                                                PointerBuffer args_mem_loc,
                                                @Nullable
                                                PointerBuffer event_wait_list,
                                                @Nullable
                                                PointerBuffer event)
        Enqueues a command to execute a native C/C++ function not compiled using the OpenCL compiler.
        Parameters:
        command_queue - a valid command-queue. A native user function can only be executed on a command-queue created on a device that has EXEC_NATIVE_KERNEL capability set in DEVICE_EXECUTION_CAPABILITIES.
        user_func - a pointer to a host-callable user function
        args - a pointer to the args list that user_func should be called with
        mem_list - a list of valid buffer objects, if num_mem_objects > 0. The buffer object values specified in mem_list are memory object handles (cl_mem values) returned by CreateBuffer or NULL.
        args_mem_loc - a pointer to appropriate locations that args points to where memory object handles (cl_mem values) are stored. Before the user function is executed, the memory object handles are replaced by pointers to global memory.
        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 user function execution instance was successfully queued. 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 user_func is NULL.
        • INVALID_VALUE if args is a NULL value and cb_args > 0, or if args is a NULL value and num_mem_objects > 0.
        • INVALID_VALUE if args is not NULL and cb_args is 0.
        • INVALID_VALUE if num_mem_objects > 0 and mem_list or args_mem_loc are NULL.
        • INVALID_VALUE if num_mem_objects = 0 and mem_list or args_mem_loc are not NULL.
        • INVALID_OPERATION if the device associated with command_queue cannot execute the native kernel.
        • INVALID_MEM_OBJECT if one or more memory objects specified in mem_list are not valid or are not buffer objects.
        • OUT_OF_RESOURCES if there is a failure to queue the execution instance of kernel on the command-queue because of insufficient resources needed to execute the kernel.
        • MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for data store associated with buffer objects specified as arguments to kernel.
        • 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
      • clEnqueueNativeKernel

        public static int clEnqueueNativeKernel​(long command_queue,
                                                CLNativeKernelI user_func,
                                                @Nullable
                                                java.nio.ByteBuffer args,
                                                @Nullable
                                                long memobj,
                                                @Nullable
                                                long memobj_loc,
                                                @Nullable
                                                PointerBuffer event_wait_list,
                                                @Nullable
                                                PointerBuffer event)
        Enqueues a command to execute a native C/C++ function not compiled using the OpenCL compiler.
        Parameters:
        command_queue - a valid command-queue. A native user function can only be executed on a command-queue created on a device that has EXEC_NATIVE_KERNEL capability set in DEVICE_EXECUTION_CAPABILITIES.
        user_func - a pointer to a host-callable user function
        args - a pointer to the args list that user_func should be called with
        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 user function execution instance was successfully queued. 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 user_func is NULL.
        • INVALID_VALUE if args is a NULL value and cb_args > 0, or if args is a NULL value and num_mem_objects > 0.
        • INVALID_VALUE if args is not NULL and cb_args is 0.
        • INVALID_VALUE if num_mem_objects > 0 and mem_list or args_mem_loc are NULL.
        • INVALID_VALUE if num_mem_objects = 0 and mem_list or args_mem_loc are not NULL.
        • INVALID_OPERATION if the device associated with command_queue cannot execute the native kernel.
        • INVALID_MEM_OBJECT if one or more memory objects specified in mem_list are not valid or are not buffer objects.
        • OUT_OF_RESOURCES if there is a failure to queue the execution instance of kernel on the command-queue because of insufficient resources needed to execute the kernel.
        • MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for data store associated with buffer objects specified as arguments to kernel.
        • 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
      • nclWaitForEvents

        public static int nclWaitForEvents​(int num_events,
                                           long event_list)
        Unsafe version of: WaitForEvents
        Parameters:
        num_events - the number of events in event_list
      • clWaitForEvents

        public static int clWaitForEvents​(PointerBuffer event_list)
        Waits on the host thread for commands identified by event objects in event_list to complete. A command is considered complete if its execution status is COMPLETE or a negative value. The events specified in event_list act as synchronization points.
        Parameters:
        event_list - the list of events
        Returns:
        SUCCESS if the execution status of all events in event_list is COMPLETE. Otherwise, it returns one of the following errors:
        • INVALID_VALUE if num_events is zero or event_list is NULL.
        • INVALID_CONTEXT if events specified in event_list do not belong to the same context.
        • INVALID_EVENT if event objects specified in event_list are not valid event objects.
        • EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST if the execution status of any of the events in event_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
      • clWaitForEvents

        public static int clWaitForEvents​(long event)
        Waits on the host thread for commands identified by event objects in event_list to complete. A command is considered complete if its execution status is COMPLETE or a negative value. The events specified in event_list act as synchronization points.
        Returns:
        SUCCESS if the execution status of all events in event_list is COMPLETE. Otherwise, it returns one of the following errors:
        • INVALID_VALUE if num_events is zero or event_list is NULL.
        • INVALID_CONTEXT if events specified in event_list do not belong to the same context.
        • INVALID_EVENT if event objects specified in event_list are not valid event objects.
        • EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST if the execution status of any of the events in event_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
      • nclGetEventInfo

        public static int nclGetEventInfo​(long event,
                                          int param_name,
                                          long param_value_size,
                                          long param_value,
                                          long param_value_size_ret)
        Unsafe version of: GetEventInfo
        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.
      • clGetEventInfo

        public static int clGetEventInfo​(long event,
                                         int param_name,
                                         @Nullable
                                         java.nio.ByteBuffer param_value,
                                         @Nullable
                                         PointerBuffer param_value_size_ret)
        
        public static int clGetEventInfo​(long event,
                                         int param_name,
                                         @Nullable
                                         java.nio.IntBuffer param_value,
                                         @Nullable
                                         PointerBuffer param_value_size_ret)
        
        public static int clGetEventInfo​(long event,
                                         int param_name,
                                         @Nullable
                                         PointerBuffer param_value,
                                         @Nullable
                                         PointerBuffer param_value_size_ret)
        
        Returns information about an event object.

        Using clGetEventInfo to determine if a command identified by event has finished execution (i.e. EVENT_COMMAND_EXECUTION_STATUS returns COMPLETE) is not a synchronization point. There are no guarantees that the memory objects being modified by command associated with event will be visible to other enqueued commands.

        Parameters:
        event - the event object being queried
        param_name - the information to query. One of:
        EVENT_COMMAND_QUEUEEVENT_COMMAND_TYPEEVENT_REFERENCE_COUNTEVENT_COMMAND_EXECUTION_STATUS
        EVENT_CONTEXT
        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_VALUE if information to query given in param_name cannot be queried for event.
        • INVALID_EVENT if event is a not a valid event 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
      • clRetainEvent

        public static int clRetainEvent​(long event)
        Increments the event reference count. The OpenCL commands that return an event perform an implicit retain.
        Parameters:
        event - the event to retain
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_EVENT if event is not a valid event 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
      • clReleaseEvent

        public static int clReleaseEvent​(long event)
        Decrements the event reference count.

        The event object is deleted once the reference count becomes zero, the specific command identified by this event has completed (or terminated) and there are no commands in the command-queues of a context that require a wait for this event to complete.

        NOTE: Developers should be careful when releasing their last reference count on events created by CreateUserEvent that have not yet been set to status of COMPLETE or an error. If the user event was used in the event_wait_list argument passed to a clEnqueue*** API or another application host thread is waiting for it in WaitForEvents, those commands and host threads will continue to wait for the event status to reach COMPLETE or error, even after the user has released the object. Since in this scenario the developer has released his last reference count to the user event, it would be in principle no longer valid for him to change the status of the event to unblock all the other machinery. As a result the waiting tasks will wait forever, and associated events, cl_mem objects, command queues and contexts are likely to leak. In-order command-queues caught up in this deadlock may cease to do any work.

        Parameters:
        event - the event to release
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_EVENT if event is not a valid event 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
      • nclEnqueueMarker

        public static int nclEnqueueMarker​(long command_queue,
                                           long event)
        Unsafe version of: EnqueueMarker
      • clEnqueueMarker

        public static int clEnqueueMarker​(long command_queue,
                                          @Nullable
                                          PointerBuffer event)
        Enqueues a marker command to command_queue. The marker command is not completed until all commands enqueued before it have completed. The marker command returns an event which can be waited on, i.e. this event can be waited on to insure that all commands, which have been queued before the marker command, have been completed.
        Parameters:
        command_queue - the command-queue to insert the marker to
        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 successfully executed. Otherwise, it returns one of the following errors:
        See Also:
        Reference Page - This function is deprecated after OpenCL 1.1
      • clEnqueueBarrier

        public static int clEnqueueBarrier​(long command_queue)
        Enqueues a barrier operation. The clEnqueueBarrier command ensures that all queued commands in command_queue have finished execution before the next batch of commands can begin execution. The clEnqueueBarrier command is a synchronization point.
        Parameters:
        command_queue - the command-queue to insert the barrier to
        Returns:
        SUCCESS if the function is successfully executed. Otherwise, it returns one of the following errors:
        • INVALID_COMMAND_QUEUE if command_queue is not a valid command-queue.
        • 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 - This function is deprecated after OpenCL 1.1
      • nclEnqueueWaitForEvents

        public static int nclEnqueueWaitForEvents​(long command_queue,
                                                  int num_events,
                                                  long event_list)
        Unsafe version of: EnqueueWaitForEvents
        Parameters:
        num_events - the number of events in event_list
      • clEnqueueWaitForEvents

        public static int clEnqueueWaitForEvents​(long command_queue,
                                                 PointerBuffer event_list)
        Enqueues a wait for a specific event or a list of events to complete before any future commands queued in the command-queue are executed.
        Parameters:
        command_queue - the command-queue
        event_list - the list of events
        Returns:
        SUCCESS if the function was successfully executed. 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_list are not the same.
        • INVALID_VALUE if num_events is zero or event_list is NULL.
        • INVALID_EVENT if event objects specified in event_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 - This function is deprecated after OpenCL 1.1
      • clEnqueueWaitForEvents

        public static int clEnqueueWaitForEvents​(long command_queue,
                                                 long event)
        Enqueues a wait for a specific event or a list of events to complete before any future commands queued in the command-queue are executed.
        Parameters:
        command_queue - the command-queue
        Returns:
        SUCCESS if the function was successfully executed. 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_list are not the same.
        • INVALID_VALUE if num_events is zero or event_list is NULL.
        • INVALID_EVENT if event objects specified in event_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 - This function is deprecated after OpenCL 1.1
      • nclGetEventProfilingInfo

        public static int nclGetEventProfilingInfo​(long event,
                                                   int param_name,
                                                   long param_value_size,
                                                   long param_value,
                                                   long param_value_size_ret)
        Unsafe version of: GetEventProfilingInfo
        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.
      • clGetEventProfilingInfo

        public static int clGetEventProfilingInfo​(long event,
                                                  int param_name,
                                                  @Nullable
                                                  java.nio.ByteBuffer param_value,
                                                  @Nullable
                                                  PointerBuffer param_value_size_ret)
        
        public static int clGetEventProfilingInfo​(long event,
                                                  int param_name,
                                                  @Nullable
                                                  java.nio.LongBuffer param_value,
                                                  @Nullable
                                                  PointerBuffer param_value_size_ret)
        
        Returns profiling information for the command associated with event.
        Parameters:
        event - the event object
        param_name - the profiling data to query. One of:
        PROFILING_COMMAND_QUEUEDPROFILING_COMMAND_SUBMITPROFILING_COMMAND_START
        PROFILING_COMMAND_ENDPROFILING_COMMAND_COMPLETE
        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 and the profiling information has been recorded. Otherwise, it returns one of the following errors:
        • PROFILING_INFO_NOT_AVAILABLE if the QUEUE_PROFILING_ENABLE flag is not set for the command-queue, if the execution status of the command identified by event is not COMPLETE or if event is a user event object.
        • 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_EVENT if event is a not a valid event 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
      • clFlush

        public static int clFlush​(long command_queue)
        Issues all previously queued OpenCL commands in command_queue to the device associated with command_queue. clFlush only guarantees that all queued commands to command_queue will eventually be submitted to the appropriate device. There is no guarantee that they will be complete after clFlush returns.

        Any blocking commands queued in a command-queue and ReleaseCommandQueue perform an implicit flush of the command-queue. These blocking commands are EnqueueReadBuffer, EnqueueReadBufferRect, EnqueueReadImage, with blocking_read set to TRUE; EnqueueWriteBuffer, EnqueueWriteBufferRect, EnqueueWriteImage with blocking_write set to TRUE; EnqueueMapBuffer, EnqueueMapImage with blocking_map set to TRUE; or WaitForEvents.

        To use event objects that refer to commands enqueued in a command-queue as event objects to wait on by commands enqueued in a different command-queue, the application must call a clFlush or any blocking commands that perform an implicit flush of the command-queue where the commands that refer to these event objects are enqueued.

        Parameters:
        command_queue - the command-queue
        Returns:
        SUCCESS if the function call was executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_COMMAND_QUEUE if command_queue is not a valid command-queue.
        • 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
      • clFinish

        public static int clFinish​(long command_queue)
        Blocks until all previously queued OpenCL commands in command_queue are issued to the associated device and have completed. clFinish does not return until all previously queued commands in command_queue have been processed and completed. clFinish is also a synchronization point.
        Parameters:
        command_queue - the command-queue
        See Also:
        Reference Page
      • nclGetExtensionFunctionAddress

        public static long nclGetExtensionFunctionAddress​(long funcname)
        Unsafe version of: GetExtensionFunctionAddress
      • clGetExtensionFunctionAddress

        public static long clGetExtensionFunctionAddress​(java.nio.ByteBuffer funcname)
        
        public static long clGetExtensionFunctionAddress​(java.lang.CharSequence funcname)
        
        Returns the address of the extension function named by funcname. The pointer returned should be cast to a function pointer type matching the extension function's definition defined in the appropriate extension specification and header file. A return value of NULL indicates that the specified function does not exist for the implementation. A non-NULL return value for clGetExtensionFunctionAddress does not guarantee that an extension function is actually supported. The application must also make a corresponding query using clGetPlatformInfo(platform, CL_PLATFORM_EXTENSIONS, … ) or clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS, … ) to determine if an extension is supported by the OpenCL implementation.

        clGetExtensionFunctionAddress may not be queried for core (non-extension) functions in OpenCL. For functions that are queryable with clGetExtensionFunctionAddress, implementations may choose to also export those functions statically from the object libraries implementing those functions. However, portable applications cannot rely on this behavior.

        Parameters:
        funcname - the extension function name
        Returns:
        the extension function address
        See Also:
        Reference Page - This function is deprecated after OpenCL 1.1
      • clGetPlatformInfo

        public static int clGetPlatformInfo​(long platform,
                                            int param_name,
                                            @Nullable
                                            long[] param_value,
                                            @Nullable
                                            PointerBuffer param_value_size_ret)
        Array version of: GetPlatformInfo
        See Also:
        Reference Page
      • clGetDeviceIDs

        public static int clGetDeviceIDs​(long platform,
                                         long device_type,
                                         @Nullable
                                         PointerBuffer devices,
                                         @Nullable
                                         int[] num_devices)
        Array version of: GetDeviceIDs
        See Also:
        Reference Page
      • clGetDeviceInfo

        public static int clGetDeviceInfo​(long device,
                                          int param_name,
                                          @Nullable
                                          int[] param_value,
                                          @Nullable
                                          PointerBuffer param_value_size_ret)
        
        public static int clGetDeviceInfo​(long device,
                                          int param_name,
                                          @Nullable
                                          long[] param_value,
                                          @Nullable
                                          PointerBuffer param_value_size_ret)
        
        Array version of: GetDeviceInfo
        See Also:
        Reference Page
      • clGetContextInfo

        public static int clGetContextInfo​(long context,
                                           int param_name,
                                           @Nullable
                                           int[] param_value,
                                           @Nullable
                                           PointerBuffer param_value_size_ret)
        Array version of: GetContextInfo
        See Also:
        Reference Page
      • clCreateCommandQueue

        public static long clCreateCommandQueue​(long context,
                                                long device,
                                                long properties,
                                                @Nullable
                                                int[] errcode_ret)
        Array version of: CreateCommandQueue
        See Also:
        Reference Page - This function is deprecated after OpenCL 1.2
      • clGetCommandQueueInfo

        public static int clGetCommandQueueInfo​(long command_queue,
                                                int param_name,
                                                @Nullable
                                                int[] param_value,
                                                @Nullable
                                                PointerBuffer param_value_size_ret)
        
        public static int clGetCommandQueueInfo​(long command_queue,
                                                int param_name,
                                                @Nullable
                                                long[] param_value,
                                                @Nullable
                                                PointerBuffer param_value_size_ret)
        
        Array version of: GetCommandQueueInfo
        See Also:
        Reference Page
      • clCreateBuffer

        public static long clCreateBuffer​(long context,
                                          long flags,
                                          java.nio.ByteBuffer host_ptr,
                                          @Nullable
                                          int[] errcode_ret)
        
        public static long clCreateBuffer​(long context,
                                          long flags,
                                          short[] host_ptr,
                                          @Nullable
                                          int[] errcode_ret)
        
        public static long clCreateBuffer​(long context,
                                          long flags,
                                          int[] host_ptr,
                                          @Nullable
                                          int[] errcode_ret)
        
        public static long clCreateBuffer​(long context,
                                          long flags,
                                          float[] host_ptr,
                                          @Nullable
                                          int[] errcode_ret)
        
        public static long clCreateBuffer​(long context,
                                          long flags,
                                          double[] host_ptr,
                                          @Nullable
                                          int[] errcode_ret)
        
        Array version of: CreateBuffer
        See Also:
        Reference Page
      • clEnqueueReadBuffer

        public static int clEnqueueReadBuffer​(long command_queue,
                                              long buffer,
                                              boolean blocking_read,
                                              long offset,
                                              short[] ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        public static int clEnqueueReadBuffer​(long command_queue,
                                              long buffer,
                                              boolean blocking_read,
                                              long offset,
                                              int[] ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        public static int clEnqueueReadBuffer​(long command_queue,
                                              long buffer,
                                              boolean blocking_read,
                                              long offset,
                                              float[] ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        public static int clEnqueueReadBuffer​(long command_queue,
                                              long buffer,
                                              boolean blocking_read,
                                              long offset,
                                              double[] ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        Array version of: EnqueueReadBuffer
        See Also:
        Reference Page
      • clEnqueueWriteBuffer

        public static int clEnqueueWriteBuffer​(long command_queue,
                                               long buffer,
                                               boolean blocking_write,
                                               long offset,
                                               short[] ptr,
                                               @Nullable
                                               PointerBuffer event_wait_list,
                                               @Nullable
                                               PointerBuffer event)
        
        public static int clEnqueueWriteBuffer​(long command_queue,
                                               long buffer,
                                               boolean blocking_write,
                                               long offset,
                                               int[] ptr,
                                               @Nullable
                                               PointerBuffer event_wait_list,
                                               @Nullable
                                               PointerBuffer event)
        
        public static int clEnqueueWriteBuffer​(long command_queue,
                                               long buffer,
                                               boolean blocking_write,
                                               long offset,
                                               float[] ptr,
                                               @Nullable
                                               PointerBuffer event_wait_list,
                                               @Nullable
                                               PointerBuffer event)
        
        public static int clEnqueueWriteBuffer​(long command_queue,
                                               long buffer,
                                               boolean blocking_write,
                                               long offset,
                                               double[] ptr,
                                               @Nullable
                                               PointerBuffer event_wait_list,
                                               @Nullable
                                               PointerBuffer event)
        
        Array version of: EnqueueWriteBuffer
        See Also:
        Reference Page
      • clEnqueueMapBuffer

        @Nullable
        public static java.nio.ByteBuffer clEnqueueMapBuffer​(long command_queue,
                                                             long buffer,
                                                             boolean blocking_map,
                                                             long map_flags,
                                                             long offset,
                                                             long size,
                                                             @Nullable
                                                             PointerBuffer event_wait_list,
                                                             @Nullable
                                                             PointerBuffer event,
                                                             @Nullable
                                                             int[] errcode_ret,
                                                             @Nullable
                                                             java.nio.ByteBuffer old_buffer)
        Array version of: EnqueueMapBuffer
        See Also:
        Reference Page
      • clCreateImage2D

        public static long clCreateImage2D​(long context,
                                           long flags,
                                           CLImageFormat image_format,
                                           long image_width,
                                           long image_height,
                                           long image_row_pitch,
                                           @Nullable
                                           java.nio.ByteBuffer host_ptr,
                                           @Nullable
                                           int[] errcode_ret)
        
        public static long clCreateImage2D​(long context,
                                           long flags,
                                           CLImageFormat image_format,
                                           long image_width,
                                           long image_height,
                                           long image_row_pitch,
                                           @Nullable
                                           short[] host_ptr,
                                           @Nullable
                                           int[] errcode_ret)
        
        public static long clCreateImage2D​(long context,
                                           long flags,
                                           CLImageFormat image_format,
                                           long image_width,
                                           long image_height,
                                           long image_row_pitch,
                                           @Nullable
                                           int[] host_ptr,
                                           @Nullable
                                           int[] errcode_ret)
        
        public static long clCreateImage2D​(long context,
                                           long flags,
                                           CLImageFormat image_format,
                                           long image_width,
                                           long image_height,
                                           long image_row_pitch,
                                           @Nullable
                                           float[] host_ptr,
                                           @Nullable
                                           int[] errcode_ret)
        
        Array version of: CreateImage2D
        See Also:
        Reference Page - This function is deprecated after OpenCL 1.1
      • clCreateImage3D

        public static long clCreateImage3D​(long context,
                                           long flags,
                                           CLImageFormat image_format,
                                           long image_width,
                                           long image_height,
                                           long image_depth,
                                           long image_row_pitch,
                                           long image_slice_pitch,
                                           @Nullable
                                           java.nio.ByteBuffer host_ptr,
                                           @Nullable
                                           int[] errcode_ret)
        
        public static long clCreateImage3D​(long context,
                                           long flags,
                                           CLImageFormat image_format,
                                           long image_width,
                                           long image_height,
                                           long image_depth,
                                           long image_row_pitch,
                                           long image_slice_pitch,
                                           @Nullable
                                           short[] host_ptr,
                                           @Nullable
                                           int[] errcode_ret)
        
        public static long clCreateImage3D​(long context,
                                           long flags,
                                           CLImageFormat image_format,
                                           long image_width,
                                           long image_height,
                                           long image_depth,
                                           long image_row_pitch,
                                           long image_slice_pitch,
                                           @Nullable
                                           int[] host_ptr,
                                           @Nullable
                                           int[] errcode_ret)
        
        public static long clCreateImage3D​(long context,
                                           long flags,
                                           CLImageFormat image_format,
                                           long image_width,
                                           long image_height,
                                           long image_depth,
                                           long image_row_pitch,
                                           long image_slice_pitch,
                                           @Nullable
                                           float[] host_ptr,
                                           @Nullable
                                           int[] errcode_ret)
        
        Array version of: CreateImage3D
        See Also:
        Reference Page - This function is deprecated after OpenCL 1.1
      • clEnqueueWriteImage

        public static int clEnqueueWriteImage​(long command_queue,
                                              long image,
                                              boolean blocking_write,
                                              PointerBuffer origin,
                                              PointerBuffer region,
                                              long input_row_pitch,
                                              long input_slice_pitch,
                                              short[] ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        public static int clEnqueueWriteImage​(long command_queue,
                                              long image,
                                              boolean blocking_write,
                                              PointerBuffer origin,
                                              PointerBuffer region,
                                              long input_row_pitch,
                                              long input_slice_pitch,
                                              int[] ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        public static int clEnqueueWriteImage​(long command_queue,
                                              long image,
                                              boolean blocking_write,
                                              PointerBuffer origin,
                                              PointerBuffer region,
                                              long input_row_pitch,
                                              long input_slice_pitch,
                                              float[] ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        public static int clEnqueueWriteImage​(long command_queue,
                                              long image,
                                              boolean blocking_write,
                                              PointerBuffer origin,
                                              PointerBuffer region,
                                              long input_row_pitch,
                                              long input_slice_pitch,
                                              double[] ptr,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        
        Array version of: EnqueueWriteImage
        See Also:
        Reference Page
      • clGetImageInfo

        public static int clGetImageInfo​(long image,
                                         int param_name,
                                         @Nullable
                                         int[] param_value,
                                         @Nullable
                                         PointerBuffer param_value_size_ret)
        Array version of: GetImageInfo
        See Also:
        Reference Page
      • clGetMemObjectInfo

        public static int clGetMemObjectInfo​(long memobj,
                                             int param_name,
                                             @Nullable
                                             int[] param_value,
                                             @Nullable
                                             PointerBuffer param_value_size_ret)
        
        public static int clGetMemObjectInfo​(long memobj,
                                             int param_name,
                                             @Nullable
                                             long[] param_value,
                                             @Nullable
                                             PointerBuffer param_value_size_ret)
        
        Array version of: GetMemObjectInfo
        See Also:
        Reference Page
      • clCreateSampler

        public static long clCreateSampler​(long context,
                                           boolean normalized_coords,
                                           int addressing_mode,
                                           int filter_mode,
                                           @Nullable
                                           int[] errcode_ret)
        Array version of: CreateSampler
        See Also:
        Reference Page - This function is deprecated after OpenCL 1.2
      • clGetSamplerInfo

        public static int clGetSamplerInfo​(long sampler,
                                           int param_name,
                                           @Nullable
                                           int[] param_value,
                                           @Nullable
                                           PointerBuffer param_value_size_ret)
        Array version of: GetSamplerInfo
        See Also:
        Reference Page
      • clGetProgramInfo

        public static int clGetProgramInfo​(long program,
                                           int param_name,
                                           @Nullable
                                           int[] param_value,
                                           @Nullable
                                           PointerBuffer param_value_size_ret)
        Array version of: GetProgramInfo
        See Also:
        Reference Page
      • clGetProgramBuildInfo

        public static int clGetProgramBuildInfo​(long program,
                                                long device,
                                                int param_name,
                                                @Nullable
                                                int[] param_value,
                                                @Nullable
                                                PointerBuffer param_value_size_ret)
        Array version of: GetProgramBuildInfo
        See Also:
        Reference Page
      • clCreateKernel

        public static long clCreateKernel​(long program,
                                          java.nio.ByteBuffer kernel_name,
                                          @Nullable
                                          int[] errcode_ret)
        
        public static long clCreateKernel​(long program,
                                          java.lang.CharSequence kernel_name,
                                          @Nullable
                                          int[] errcode_ret)
        
        Array version of: CreateKernel
        See Also:
        Reference Page
      • clSetKernelArg

        public static int clSetKernelArg​(long kernel,
                                         int arg_index,
                                         short[] arg_value)
        
        public static int clSetKernelArg​(long kernel,
                                         int arg_index,
                                         int[] arg_value)
        
        public static int clSetKernelArg​(long kernel,
                                         int arg_index,
                                         long[] arg_value)
        
        public static int clSetKernelArg​(long kernel,
                                         int arg_index,
                                         float[] arg_value)
        
        public static int clSetKernelArg​(long kernel,
                                         int arg_index,
                                         double[] arg_value)
        
        Array version of: SetKernelArg
        See Also:
        Reference Page
      • clGetKernelInfo

        public static int clGetKernelInfo​(long kernel,
                                          int param_name,
                                          @Nullable
                                          int[] param_value,
                                          @Nullable
                                          PointerBuffer param_value_size_ret)
        Array version of: GetKernelInfo
        See Also:
        Reference Page
      • clGetKernelWorkGroupInfo

        public static int clGetKernelWorkGroupInfo​(long kernel,
                                                   long device,
                                                   int param_name,
                                                   @Nullable
                                                   int[] param_value,
                                                   @Nullable
                                                   PointerBuffer param_value_size_ret)
        
        public static int clGetKernelWorkGroupInfo​(long kernel,
                                                   long device,
                                                   int param_name,
                                                   @Nullable
                                                   long[] param_value,
                                                   @Nullable
                                                   PointerBuffer param_value_size_ret)
        
        Array version of: GetKernelWorkGroupInfo
        See Also:
        Reference Page
      • clGetEventInfo

        public static int clGetEventInfo​(long event,
                                         int param_name,
                                         @Nullable
                                         int[] param_value,
                                         @Nullable
                                         PointerBuffer param_value_size_ret)
        Array version of: GetEventInfo
        See Also:
        Reference Page
      • clGetEventProfilingInfo

        public static int clGetEventProfilingInfo​(long event,
                                                  int param_name,
                                                  @Nullable
                                                  long[] param_value,
                                                  @Nullable
                                                  PointerBuffer param_value_size_ret)
        Array version of: GetEventProfilingInfo
        See Also:
        Reference Page