Class CL12

  • Direct Known Subclasses:
    CL20

    public class CL12
    extends CL11
    The core OpenCL 1.2 functionality.
    • Method Detail

      • nclGetExtensionFunctionAddressForPlatform

        public static long nclGetExtensionFunctionAddressForPlatform​(long platform,
                                                                     long funcname)
      • clGetExtensionFunctionAddressForPlatform

        public static long clGetExtensionFunctionAddressForPlatform​(long platform,
                                                                    java.nio.ByteBuffer funcname)
        
        public static long clGetExtensionFunctionAddressForPlatform​(long platform,
                                                                    java.lang.CharSequence funcname)
        
        Returns the address of the extension function named by funcname for a given platform. 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 or platform is not a valid platform. A non-NULL return value for clGetExtensionFunctionAddressForPlatform does not guarantee that an extension function is actually supported by the platform. 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.

        clGetExtensionFunctionAddressForPlatform may not be queried for core (non-extension) functions in OpenCL. For functions that are queryable with clGetExtensionFunctionAddressForPlatform, 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:
        platform - the platform to query
        funcname - the extension function name
        See Also:
        Reference Page
      • clRetainDevice

        public static int clRetainDevice​(long device)
        Increments the device reference count if device is a valid sub-device created by a call to CreateSubDevices. If device is a root level device i.e. a cl_device_id returned by GetDeviceIDs, the device reference count remains unchanged.
        Parameters:
        device - the device to retain
        Returns:
        SUCCESS if the function is executed successfully or the device is a root-level device. Otherwise, it returns one of the following errors:
        See Also:
        Reference Page
      • clReleaseDevice

        public static int clReleaseDevice​(long device)
        Decrements the device reference count if device is a valid sub-device created by a call to CreateSubDevices. If device is a root level device i.e. a cl_device_id returned by GetDeviceIDs, the device reference count remains unchanged.

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

        Parameters:
        device - the device to release
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        See Also:
        Reference Page
      • nclCreateSubDevices

        public static int nclCreateSubDevices​(long in_device,
                                              long properties,
                                              int num_devices,
                                              long out_devices,
                                              long num_devices_ret)
        Unsafe version of: CreateSubDevices
        Parameters:
        num_devices - the size of memory pointed to by out_devices specified as the number of cl_device_id entries.
      • clCreateSubDevices

        public static int clCreateSubDevices​(long in_device,
                                             PointerBuffer properties,
                                             @Nullable
                                             PointerBuffer out_devices,
                                             @Nullable
                                             java.nio.IntBuffer num_devices_ret)
        Creates an array of sub-devices that each reference a non-intersecting set of compute units within in_device, according to a partition scheme given by properties. The output sub-devices may be used in every way that the root (or parent) device can be used, including creating contexts, building programs, further calls to clCreateSubDevices and creating command-queues. When a command-queue is created against a sub-device, the commands enqueued on the queue are executed only on the sub-device.

        A few examples that describe how to specify partition properties in properties argument to clCreateSubDevices are given below:

        Parameters:
        in_device - the device to be partitioned
        properties - specifies how in_device is to be partition described by a partition name and its corresponding value. Each partition name is immediately followed by the corresponding desired value. The list is terminated with 0. Only one partitioning scheme can be specified in properties. One of:
        DEVICE_PARTITION_EQUALLYDEVICE_PARTITION_BY_COUNTS
        DEVICE_PARTITION_BY_AFFINITY_DOMAIN
        out_devices - the buffer where the OpenCL sub-devices will be returned. If out_devices is NULL, this argument is ignored. If out_devices is not NULL, num_devices must be greater than or equal to the number of sub-devices that device may be partitioned into according to the partitioning scheme specified in properties.
        num_devices_ret - the number of sub-devices that device may be partitioned into according to the partitioning scheme specified in properties. If num_devices_ret is NULL, it is ignored.
        Returns:
        SUCCESS if the partition is created successfully. Otherwise, it returns a NULL value with the following error values returned in errcode_ret:
        • INVALID_DEVICE if in_device is not valid.
        • INVALID_VALUE if values specified in properties are not valid or if values specified in properties are valid but not supported by the device.
        • INVALID_VALUE if out_devices is not NULL and num_devices is less than the number of sub-devices created by the partition scheme.
        • DEVICE_PARTITION_FAILED if the partition name is supported by the implementation but in_device could not be further partitioned.
        • INVALID_DEVICE_PARTITION_COUNT if the partition name specified in properties is DEVICE_PARTITION_BY_COUNTS and the number of sub-devices requested exceeds DEVICE_PARTITION_MAX_SUB_DEVICES or the total number of compute units requested exceeds DEVICE_PARTITION_MAX_COMPUTE_UNITS for in_device, or the number of compute units requested for one or more sub-devices is less than zero or the number of sub-devices requested exceeds DEVICE_PARTITION_MAX_COMPUTE_UNITS for in_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
      • nclCreateImage

        public static long nclCreateImage​(long context,
                                          long flags,
                                          long image_format,
                                          long image_desc,
                                          long host_ptr,
                                          long errcode_ret)
        Unsafe version of: CreateImage
      • nclCreateProgramWithBuiltInKernels

        public static long nclCreateProgramWithBuiltInKernels​(long context,
                                                              int num_devices,
                                                              long device_list,
                                                              long kernel_names,
                                                              long errcode_ret)
        Parameters:
        num_devices - the number of devices listed in device_list
      • clCreateProgramWithBuiltInKernels

        public static long clCreateProgramWithBuiltInKernels​(long context,
                                                             PointerBuffer device_list,
                                                             java.nio.ByteBuffer kernel_names,
                                                             @Nullable
                                                             java.nio.IntBuffer errcode_ret)
        
        public static long clCreateProgramWithBuiltInKernels​(long context,
                                                             PointerBuffer device_list,
                                                             java.lang.CharSequence kernel_names,
                                                             @Nullable
                                                             java.nio.IntBuffer errcode_ret)
        
        Creates a program object for a context, and loads the information related to the built-in kernels into a program object.
        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 built-in kernels are loaded for devices specified in this list.

        The devices associated with the program object will be the list of devices specified by device_list. The list of devices specified by device_list must be devices associated with context.

        kernel_names - a semi-colon separated list of built-in kernel names
        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_VALUE if kernel_names is NULL or kernel_names contains a kernel name that is not supported by any of the devices in device_list.
        • INVALID_DEVICE if devices listed in device_list are not in the list of devices associated with context.
        • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
        • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
        See Also:
        Reference Page
      • clCreateProgramWithBuiltInKernels

        public static long clCreateProgramWithBuiltInKernels​(long context,
                                                             long device,
                                                             java.lang.CharSequence kernel_names,
                                                             @Nullable
                                                             java.nio.IntBuffer errcode_ret)
        Creates a program object for a context, and loads the information related to the built-in kernels into a program object.
        Parameters:
        context - a valid OpenCL context
        kernel_names - a semi-colon separated list of built-in kernel names
        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_VALUE if kernel_names is NULL or kernel_names contains a kernel name that is not supported by any of the devices in device_list.
        • INVALID_DEVICE if devices listed in device_list are not in the list of devices associated with context.
        • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
        • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
        See Also:
        Reference Page
      • nclCompileProgram

        public static int nclCompileProgram​(long program,
                                            int num_devices,
                                            long device_list,
                                            long options,
                                            int num_input_headers,
                                            long input_headers,
                                            long header_include_names,
                                            long pfn_notify,
                                            long user_data)
        Unsafe version of: CompileProgram
        Parameters:
        num_devices - the number of devices listed in device_list
        num_input_headers - the number of programs that describe headers in the array referenced by input_headers
      • clCompileProgram

        public static int clCompileProgram​(long program,
                                           @Nullable
                                           PointerBuffer device_list,
                                           java.nio.ByteBuffer options,
                                           @Nullable
                                           PointerBuffer input_headers,
                                           @Nullable
                                           PointerBuffer header_include_names,
                                           @Nullable
                                           CLProgramCallbackI pfn_notify,
                                           long user_data)
        
        public static int clCompileProgram​(long program,
                                           @Nullable
                                           PointerBuffer device_list,
                                           java.lang.CharSequence options,
                                           @Nullable
                                           PointerBuffer input_headers,
                                           @Nullable
                                           PointerBuffer header_include_names,
                                           @Nullable
                                           CLProgramCallbackI pfn_notify,
                                           long user_data)
        
        Compiles a program's source for all the devices or a specific device(s) in the OpenCL context associated with program. The pre-processor runs before the program sources are compiled. The compiled binary is built for all devices associated with program or the list of devices specified. The compiled binary can be queried using GetProgramInfo(program, PROGRAM_BINARIES, …) and can be specified to CreateProgramWithBinary to create a new program object.
        Parameters:
        program - the program object that is the compilation target
        device_list - a pointer to a list of devices associated with program. If device_list is a NULL value, the compile is performed for all devices associated with program. If device_list is a non-NULL value, the compile is performed for devices specified in this list.
        options - a pointer to a null-terminated string of characters that describes the compilation options to be used for building the program executable
        input_headers - an array of program embedded headers created with CreateProgramWithSource
        header_include_names - an array that has a one to one correspondence with input_headers. Each entry in header_include_names specifies the include name used by source in program that comes from an embedded header. The corresponding entry in input_headers identifies the program object which contains the header source to be used. The embedded headers are first searched before the headers in the list of directories specified by the –I compile option. If multiple entries in header_include_names refer to the same header name, the first one encountered will be used.
        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, clCompileProgram does not need to wait for the compiler to complete and can return immediately once the compilation can begin. The compilation can begin if the context, program whose sources are being compiled, list of devices, input headers, programs that describe input headers and compiler options specified are all valid and appropriate host and device resources needed to perform the compile are available.

        If pfn_notify is NULL, clCompileProgram does not return until the compiler 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:
        • INVALID_PROGRAM if program is not a valid program object.
        • INVALID_VALUE if device_list is NULL and num_devices is greater than zero, or if device_list is not NULL and num_devices is zero.
        • INVALID_VALUE if num_input_headers is zero and header_include_names or input_headers are not NULL or if num_input_headers is not zero and header_include_names or input_headers are NULL.
        • INVALID_VALUE if pfn_notify is NULL but user_data is not NULL.
        • INVALID_DEVICE if OpenCL devices listed in device_list are not in the list of devices associated with program.
        • INVALID_COMPILER_OPTIONS if the compiler options specified by options are invalid.
        • INVALID_OPERATION if the compilation or build of a program executable for any of the devices listed in device_list by a previous call to clCompileProgram or BuildProgram for program has not completed.
        • COMPILER_NOT_AVAILABLE if a compiler is not available i.e. DEVICE_COMPILER_AVAILABLE is set to FALSE.
        • COMPILE_PROGRAM_FAILURE if there is a failure to compile the program source. This error will be returned if clCompileProgram does not return until the compile has completed.
        • INVALID_OPERATION if there are kernel objects attached to program.
        • INVALID_OPERATION if program has no source i.e. it has not been created with CreateProgramWithSource.
        • 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
      • nclLinkProgram

        public static long nclLinkProgram​(long context,
                                          int num_devices,
                                          long device_list,
                                          long options,
                                          int num_input_programs,
                                          long input_programs,
                                          long pfn_notify,
                                          long user_data)
        Unsafe version of: LinkProgram
        Parameters:
        num_devices - the number of devices listed in device_list
        num_input_programs - the number of programs in array referenced by input_programs
      • clLinkProgram

        public static long clLinkProgram​(long context,
                                         @Nullable
                                         PointerBuffer device_list,
                                         java.nio.ByteBuffer options,
                                         @Nullable
                                         PointerBuffer input_programs,
                                         @Nullable
                                         CLProgramCallbackI pfn_notify,
                                         long user_data)
        
        public static long clLinkProgram​(long context,
                                         @Nullable
                                         PointerBuffer device_list,
                                         java.lang.CharSequence options,
                                         @Nullable
                                         PointerBuffer input_programs,
                                         @Nullable
                                         CLProgramCallbackI pfn_notify,
                                         long user_data)
        
        Links a set of compiled program objects and libraries for all the devices or a specific device(s) in the OpenCL context and creates an executable. clLinkProgram creates a new program object which contains this executable. The executable binary can be queried using GetProgramInfo(program, PROGRAM_BINARIES, …) and can be specified to CreateProgramWithBinary to create a new program object.

        The devices associated with the returned program object will be the list of devices specified by device_list or if device_list is NULL it will be the list of devices associated with context.

        Parameters:
        context - a valid OpenCL context
        device_list - a pointer to a list of devices that are in context. If device_list is a NULL value, the link is performed for all devices associated with context for which a compiled object is available. If device_list is a non-NULL value, the link is performed for devices specified in this list for which a compiled object is available.
        options - a pointer to a null-terminated string of characters that describes the link options to be used for building the program executable
        input_programs - an array of program objects that are compiled binaries or libraries that are to be linked to create the program executable. For each device in device_list or if device_list is NULL the list of devices associated with context, the following cases occur:
        • All programs specified by input_programs contain a compiled binary or library for the device. In this case, a link is performed to generate a program executable for this device.
        • None of the programs contain a compiled binary or library for that device. In this case, no link is performed and there will be no program executable generated for this device.
        • All other cases will return a INVALID_OPERATION error.
        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, clLinkProgram does not need to wait for the linker to complete and can return immediately once the linking operation can begin. Once the linker has completed, the pfn_notify callback function is called which returns the program object returned by clLinkProgram. The application can query the link status and log for this program object. 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, clLinkProgram does not return until the linker has completed.

        user_data - will be passed as an argument when pfn_notify is called. user_data can be NULL.
        Returns:
        a valid non-zero program object, if the linking operation can begin. The linking operation can begin if the context, list of devices, input programs and linker options specified are all valid and appropriate host and device resources needed to perform the link are available.

        If pfn_notify is NULL, the errcode_ret will be set to SUCCESS if the link operation was successful and LINK_PROGRAM_FAILURE if there is a failure to link the compiled binaries and/or libraries.

        If pfn_notify is not NULL, clLinkProgram does not have to wait until the linker to complete and can return SUCCESS in errcode_ret if the linking operation can begin. The pfn_notify callback function will return a SUCCESS or LINK_PROGRAM_FAILURE if the linking operation was successful or not.

        Otherwise clLinkProgram returns a NULL program object with an appropriate error in errcode_ret. The application should query the linker status of this program object to check if the link was successful or not. The list of errors that can be returned are:

        • INVALID_CONTEXT if context is not a valid context.
        • INVALID_VALUE if device_list is NULL and num_devices is greater than zero, or if device_list is not NULL and num_devices is zero.
        • INVALID_VALUE if num_input_programs is zero and input_programs is NULL or if num_input_programs is zero and input_programs is not NULL or if num_input_programs is not zero and input_programs is NULL.
        • INVALID_PROGRAM if programs specified in input_programs are not valid program objects.
        • INVALID_VALUE if pfn_notify is NULL but user_data is not NULL.
        • INVALID_DEVICE if OpenCL devices listed in device_list are not in the list of devices associated with context.
        • INVALID_LINKER_OPTIONS if the linker options specified by options are invalid.
        • INVALID_OPERATION if the compilation or build of a program executable for any of the devices listed in device_list by a previous call to CompileProgram or BuildProgram for program has not completed.
        • INVALID_OPERATION if the rules for devices containing compiled binaries or libraries as described in input_programs argument above are not followed.
        • LINKER_NOT_AVAILABLE if a linker is not available i.e. DEVICE_LINKER_AVAILABLE is set to FALSE.
        • LINK_PROGRAM_FAILURE if there is a failure to link the compiled binaries and/or libraries.
        • 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
      • clLinkProgram

        public static long clLinkProgram​(long context,
                                         @Nullable
                                         PointerBuffer device_list,
                                         java.lang.CharSequence options,
                                         @Nullable
                                         long input_program,
                                         @Nullable
                                         CLProgramCallbackI pfn_notify,
                                         long user_data)
        Links a set of compiled program objects and libraries for all the devices or a specific device(s) in the OpenCL context and creates an executable. clLinkProgram creates a new program object which contains this executable. The executable binary can be queried using GetProgramInfo(program, PROGRAM_BINARIES, …) and can be specified to CreateProgramWithBinary to create a new program object.

        The devices associated with the returned program object will be the list of devices specified by device_list or if device_list is NULL it will be the list of devices associated with context.

        Parameters:
        context - a valid OpenCL context
        device_list - a pointer to a list of devices that are in context. If device_list is a NULL value, the link is performed for all devices associated with context for which a compiled object is available. If device_list is a non-NULL value, the link is performed for devices specified in this list for which a compiled object is available.
        options - a pointer to a null-terminated string of characters that describes the link 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, clLinkProgram does not need to wait for the linker to complete and can return immediately once the linking operation can begin. Once the linker has completed, the pfn_notify callback function is called which returns the program object returned by clLinkProgram. The application can query the link status and log for this program object. 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, clLinkProgram does not return until the linker has completed.

        user_data - will be passed as an argument when pfn_notify is called. user_data can be NULL.
        Returns:
        a valid non-zero program object, if the linking operation can begin. The linking operation can begin if the context, list of devices, input programs and linker options specified are all valid and appropriate host and device resources needed to perform the link are available.

        If pfn_notify is NULL, the errcode_ret will be set to SUCCESS if the link operation was successful and LINK_PROGRAM_FAILURE if there is a failure to link the compiled binaries and/or libraries.

        If pfn_notify is not NULL, clLinkProgram does not have to wait until the linker to complete and can return SUCCESS in errcode_ret if the linking operation can begin. The pfn_notify callback function will return a SUCCESS or LINK_PROGRAM_FAILURE if the linking operation was successful or not.

        Otherwise clLinkProgram returns a NULL program object with an appropriate error in errcode_ret. The application should query the linker status of this program object to check if the link was successful or not. The list of errors that can be returned are:

        • INVALID_CONTEXT if context is not a valid context.
        • INVALID_VALUE if device_list is NULL and num_devices is greater than zero, or if device_list is not NULL and num_devices is zero.
        • INVALID_VALUE if num_input_programs is zero and input_programs is NULL or if num_input_programs is zero and input_programs is not NULL or if num_input_programs is not zero and input_programs is NULL.
        • INVALID_PROGRAM if programs specified in input_programs are not valid program objects.
        • INVALID_VALUE if pfn_notify is NULL but user_data is not NULL.
        • INVALID_DEVICE if OpenCL devices listed in device_list are not in the list of devices associated with context.
        • INVALID_LINKER_OPTIONS if the linker options specified by options are invalid.
        • INVALID_OPERATION if the compilation or build of a program executable for any of the devices listed in device_list by a previous call to CompileProgram or BuildProgram for program has not completed.
        • INVALID_OPERATION if the rules for devices containing compiled binaries or libraries as described in input_programs argument above are not followed.
        • LINKER_NOT_AVAILABLE if a linker is not available i.e. DEVICE_LINKER_AVAILABLE is set to FALSE.
        • LINK_PROGRAM_FAILURE if there is a failure to link the compiled binaries and/or libraries.
        • 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
      • clUnloadPlatformCompiler

        public static int clUnloadPlatformCompiler​(long platform)
        Allows the implementation to release the resources allocated by the OpenCL compiler for platform. 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, CompileProgram or LinkProgram after clUnloadPlatformCompiler will reload the compiler, if necessary, to build the appropriate program executable.
        Parameters:
        platform - the platform for which to unload the compiler
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        See Also:
        Reference Page
      • nclGetKernelArgInfo

        public static int nclGetKernelArgInfo​(long kernel,
                                              int arg_indx,
                                              int param_name,
                                              long param_value_size,
                                              long param_value,
                                              long param_value_size_ret)
        Unsafe version of: GetKernelArgInfo
        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.
      • clGetKernelArgInfo

        public static int clGetKernelArgInfo​(long kernel,
                                             int arg_indx,
                                             int param_name,
                                             @Nullable
                                             java.nio.ByteBuffer param_value,
                                             @Nullable
                                             PointerBuffer param_value_size_ret)
        
        public static int clGetKernelArgInfo​(long kernel,
                                             int arg_indx,
                                             int param_name,
                                             @Nullable
                                             java.nio.IntBuffer param_value,
                                             @Nullable
                                             PointerBuffer param_value_size_ret)
        
        public static int clGetKernelArgInfo​(long kernel,
                                             int arg_indx,
                                             int param_name,
                                             @Nullable
                                             java.nio.LongBuffer param_value,
                                             @Nullable
                                             PointerBuffer param_value_size_ret)
        
        Returns information about the arguments of a kernel. Kernel argument information is only available if the program object associated with kernel is created with CreateProgramWithSource and the program executable is built with the -cl-kernel-arg-info option specified in options argument to BuildProgram or CompileProgram.
        Parameters:
        kernel - specifies the kernel object being queried
        arg_indx - 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.
        param_name - the argument information to query. One of:
        KERNEL_ARG_ADDRESS_QUALIFIERKERNEL_ARG_ACCESS_QUALIFIERKERNEL_ARG_TYPE_NAME
        KERNEL_ARG_TYPE_QUALIFIERKERNEL_ARG_NAME
        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:
        See Also:
        Reference Page
      • nclEnqueueFillBuffer

        public static int nclEnqueueFillBuffer​(long command_queue,
                                               long buffer,
                                               long pattern,
                                               long pattern_size,
                                               long offset,
                                               long size,
                                               int num_events_in_wait_list,
                                               long event_wait_list,
                                               long event)
        Unsafe version of: EnqueueFillBuffer
        Parameters:
        pattern_size - the pattern size
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueFillBuffer

        public static int clEnqueueFillBuffer​(long command_queue,
                                              long buffer,
                                              java.nio.ByteBuffer pattern,
                                              long offset,
                                              long size,
                                              @Nullable
                                              PointerBuffer event_wait_list,
                                              @Nullable
                                              PointerBuffer event)
        Enqueues a command to fill a buffer object with a pattern of a given pattern size. The usage information which indicates whether the memory object can be read or written by a kernel and/or the host and is given by the cl_mem_flags argument value specified when buffer is created is ignored by clEnqueueFillBuffer.
        Parameters:
        command_queue - the command-queue in which the fill command will be queued. The OpenCL context associated with command_queue and buffer must be the same.
        buffer - a valid buffer object
        pattern - pointer to the data pattern of size pattern_size in bytes. pattern will be used to fill a region in buffer starting at offset and is size bytes in size. The data pattern must be a scalar or vector integer or floating-point data type supported by OpenCL. For example, if buffer is to be filled with a pattern of float4 values, then pattern will be a pointer to a cl_float4 value and pattern_size will be sizeof(cl_float4). The maximum value of pattern_size is the size of the largest integer or floating-point vector data type supported by the OpenCL device. The memory associated with pattern can be reused or freed after the function returns.
        offset - the location in bytes of the region being filled in buffer and must be a multiple of pattern_size
        size - the size in bytes of region being filled in buffer and must be a multiple of pattern_size
        event_wait_list - a list of events that need to complete before this particular command can be executed. If event_wait_list is NULL, then this particular command does not wait on any event to complete. The events specified in event_wait_list act as synchronization points. The context associated with events in event_wait_list and command_queue must be the same.
        event - Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete. event can be NULL in which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. If the event_wait_list and the event arguments are not NULL, the event argument should not refer to an element of the event_wait_list array.
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_COMMAND_QUEUE if command_queue is not a valid command-queue.
        • INVALID_CONTEXT if the context associated with command_queue and 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 buffer is not a valid buffer object.
        • INVALID_VALUE if offset or offset + size require accessing elements outside the buffer buffer object respectively.
        • INVALID_VALUE if pattern is NULL or if pattern_size is 0 or if pattern_size is not one of [1, 2, 4, 8, 16, 32, 64, 128].
        • INVALID_VALUE if offset and size are not a multiple of pattern_size.
        • INVALID_EVENT_WAIT_LIST if event_wait_list is NULL and num_events_in_wait_list > 0, or event_wait_list is not NULL and num_events_in_wait_list is 0, or if event objects in event_wait_list are not valid events.
        • MISALIGNED_SUB_BUFFER_OFFSET if 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_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for data store associated with 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
      • nclEnqueueFillImage

        public static int nclEnqueueFillImage​(long command_queue,
                                              long image,
                                              long fill_color,
                                              long origin,
                                              long region,
                                              int num_events_in_wait_list,
                                              long event_wait_list,
                                              long event)
        Unsafe version of: EnqueueFillImage
        Parameters:
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueFillImage

        public static int clEnqueueFillImage​(long command_queue,
                                             long image,
                                             java.nio.ByteBuffer fill_color,
                                             PointerBuffer origin,
                                             PointerBuffer region,
                                             @Nullable
                                             PointerBuffer event_wait_list,
                                             @Nullable
                                             PointerBuffer event)
        
        public static int clEnqueueFillImage​(long command_queue,
                                             long image,
                                             java.nio.IntBuffer fill_color,
                                             PointerBuffer origin,
                                             PointerBuffer region,
                                             @Nullable
                                             PointerBuffer event_wait_list,
                                             @Nullable
                                             PointerBuffer event)
        
        public static int clEnqueueFillImage​(long command_queue,
                                             long image,
                                             java.nio.FloatBuffer fill_color,
                                             PointerBuffer origin,
                                             PointerBuffer region,
                                             @Nullable
                                             PointerBuffer event_wait_list,
                                             @Nullable
                                             PointerBuffer event)
        
        Enqueues a command to fill an image object with a specified color. The usage information which indicates whether the memory object can be read or written by a kernel and/or the host and is given by the cl_mem_flags argument value specified when image is created is ignored by clEnqueueFillImage.
        Parameters:
        command_queue - the command-queue in which the fill command will be queued. The OpenCL context associated with command_queue and image must be the same.
        image - a valid image object
        fill_color - the fill color. The fill color is a four component RGBA floating-point color value if the image channel data type is not an unnormalized signed and unsigned integer type, is a four component signed integer value if the image channel data type is an unnormalized signed integer type and is a four component unsigned integer value if the image channel data type is an unnormalized unsigned integer type. The fill color will be converted to the appropriate image channel format and order associated with image.
        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.
        event_wait_list - a list of events that need to complete before this particular command can be executed. If event_wait_list is NULL, then this particular command does not wait on any event to complete. The events specified in event_wait_list act as synchronization points. The context associated with events in event_wait_list and command_queue must be the same.
        event - Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete. event can be NULL in which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. If the event_wait_list and the event arguments are not NULL, the event argument should not refer to an element of the event_wait_list array.
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_COMMAND_QUEUE if command_queue is not a valid command-queue.
        • INVALID_CONTEXT if the context associated with command_queue and 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 image is not a valid image object.
        • INVALID_VALUE if fill_color is NULL.
        • INVALID_VALUE if the region being filled as specified by origin and region is out of bounds or if ptr is a NULL value.
        • INVALID_VALUE if values in origin and region do not follow rules described in the argument description for 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 image are not supported by device associated with queue.
        • IMAGE_FORMAT_NOT_SUPPORTED if image format (image channel order and data type) for 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 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.
        See Also:
        Reference Page
      • nclEnqueueMigrateMemObjects

        public static int nclEnqueueMigrateMemObjects​(long command_queue,
                                                      int num_mem_objects,
                                                      long mem_objects,
                                                      long flags,
                                                      int num_events_in_wait_list,
                                                      long event_wait_list,
                                                      long event)
        Unsafe version of: EnqueueMigrateMemObjects
        Parameters:
        num_mem_objects - the number of memory objects specified in mem_objects
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueMigrateMemObjects

        public static int clEnqueueMigrateMemObjects​(long command_queue,
                                                     PointerBuffer mem_objects,
                                                     long flags,
                                                     @Nullable
                                                     PointerBuffer event_wait_list,
                                                     @Nullable
                                                     PointerBuffer event)
        Enqueues a command to indicate which device a set of memory objects should be associated with. Typically, memory objects are implicitly migrated to a device for which enqueued commands, using the memory object, are targeted. clEnqueueMigrateMemObjects allows this migration to be explicitly performed ahead of the dependent commands. This allows a user to preemptively change the association of a memory object, through regular command queue scheduling, in order to prepare for another upcoming command. This also permits an application to overlap the placement of memory objects with other unrelated operations before these memory objects are needed potentially hiding transfer latencies. Once the event, returned from clEnqueueMigrateMemObjects, has been marked COMPLETE the memory objects specified in mem_objects have been successfully migrated to the device associated with command_queue. The migrated memory object shall remain resident on the device until another command is enqueued that either implicitly or explicitly migrates it away.

        clEnqueueMigrateMemObjects can also be used to direct the initial placement of a memory object, after creation, possibly avoiding the initial overhead of instantiating the object on the first enqueued command to use it.

        The user is responsible for managing the event dependencies, associated with this command, in order to avoid overlapping access to memory objects. Improperly specified event dependencies passed to clEnqueueMigrateMemObjects could result in undefined results.

        Parameters:
        command_queue - a valid command-queue. The specified set of memory objects in mem_objects will be migrated to the OpenCL device associated with command_queue or to the host if the MIGRATE_MEM_OBJECT_HOST has been specified.
        mem_objects - a pointer to a list of memory objects
        flags - a bit-field that is used to specify migration options. One of:
        MIGRATE_MEM_OBJECT_HOSTMIGRATE_MEM_OBJECT_CONTENT_UNDEFINED
        event_wait_list - a list of events that need to complete before this particular command can be executed. If event_wait_list is NULL, then this particular command does not wait on any event to complete. The events specified in event_wait_list act as synchronization points. The context associated with events in event_wait_list and command_queue must be the same.
        event - Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete. event can be NULL in which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. If the event_wait_list and the event arguments are not NULL, the event argument should not refer to an element of the event_wait_list array.
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_COMMAND_QUEUE if command_queue is not a valid command-queue.
        • INVALID_CONTEXT if the context associated with command_queue and memory objects in mem_objects 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 any of the memory objects in mem_objects is not a valid memory object.
        • INVALID_VALUE if num_mem_objects is zero or if mem_objects is NULL.
        • INVALID_VALUE if flags is not 0 or is not any of the values described in the table above.
        • 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.
        • MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for the specified set of memory objects in mem_objects.
        • 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
      • nclEnqueueMarkerWithWaitList

        public static int nclEnqueueMarkerWithWaitList​(long command_queue,
                                                       int num_events_in_wait_list,
                                                       long event_wait_list,
                                                       long event)
        Unsafe version of: EnqueueMarkerWithWaitList
        Parameters:
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueMarkerWithWaitList

        public static int clEnqueueMarkerWithWaitList​(long command_queue,
                                                      @Nullable
                                                      PointerBuffer event_wait_list,
                                                      @Nullable
                                                      PointerBuffer event)
        Enqueues a marker command which waits for either a list of events to complete, or if the list is empty it waits for all commands previously enqueued in command_queue to complete before it completes. This command returns an event which can be waited on, i.e. this event can be waited on to insure that all events either in the event_wait_list or all previously enqueued commands, queued before this command to command_queue, have completed.
        Parameters:
        command_queue - a valid command-queue
        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 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 context associated with command_queue and events in event_wait_list are not the same.
        • INVALID_EVENT_WAIT_LIST if event_wait_list is NULL and num_events_in_wait_list > 0, or event_wait_list is not NULL and num_events_in_wait_list is 0, or if event objects in event_wait_list are not valid events.
        • 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
      • nclEnqueueBarrierWithWaitList

        public static int nclEnqueueBarrierWithWaitList​(long command_queue,
                                                        int num_events_in_wait_list,
                                                        long event_wait_list,
                                                        long event)
        Unsafe version of: EnqueueBarrierWithWaitList
        Parameters:
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueBarrierWithWaitList

        public static int clEnqueueBarrierWithWaitList​(long command_queue,
                                                       @Nullable
                                                       PointerBuffer event_wait_list,
                                                       @Nullable
                                                       PointerBuffer event)
        enqueues a barrier command which waits for either a list of events to complete, or if the list is empty it waits for all commands previously enqueued in command_queue to complete before it completes. This command blocks command execution, that is, any following commands enqueued after it do not execute until it completes. This command returns an event which can be waited on, i.e. this event can be waited on to insure that all events either in the event_wait_list or all previously enqueued commands, queued before this command to command_queue, have completed.
        Parameters:
        command_queue - a valid command-queue
        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 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 context associated with command_queue and events in event_wait_list are not the same.
        • INVALID_EVENT_WAIT_LIST if event_wait_list is NULL and num_events_in_wait_list > 0, or event_wait_list is not NULL and num_events_in_wait_list is 0, or if event objects in event_wait_list are not valid events.
        • 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
      • clCreateImage

        public static long clCreateImage​(long context,
                                         long flags,
                                         CLImageFormat image_format,
                                         CLImageDesc image_desc,
                                         @Nullable
                                         java.nio.ByteBuffer host_ptr,
                                         @Nullable
                                         int[] errcode_ret)
        
        public static long clCreateImage​(long context,
                                         long flags,
                                         CLImageFormat image_format,
                                         CLImageDesc image_desc,
                                         @Nullable
                                         short[] host_ptr,
                                         @Nullable
                                         int[] errcode_ret)
        
        public static long clCreateImage​(long context,
                                         long flags,
                                         CLImageFormat image_format,
                                         CLImageDesc image_desc,
                                         @Nullable
                                         int[] host_ptr,
                                         @Nullable
                                         int[] errcode_ret)
        
        public static long clCreateImage​(long context,
                                         long flags,
                                         CLImageFormat image_format,
                                         CLImageDesc image_desc,
                                         @Nullable
                                         float[] host_ptr,
                                         @Nullable
                                         int[] errcode_ret)
        
        Array version of: CreateImage
        See Also:
        Reference Page
      • clCreateProgramWithBuiltInKernels

        public static long clCreateProgramWithBuiltInKernels​(long context,
                                                             PointerBuffer device_list,
                                                             java.nio.ByteBuffer kernel_names,
                                                             @Nullable
                                                             int[] errcode_ret)
        
        public static long clCreateProgramWithBuiltInKernels​(long context,
                                                             PointerBuffer device_list,
                                                             java.lang.CharSequence kernel_names,
                                                             @Nullable
                                                             int[] errcode_ret)
        
        See Also:
        Reference Page
      • clGetKernelArgInfo

        public static int clGetKernelArgInfo​(long kernel,
                                             int arg_indx,
                                             int param_name,
                                             @Nullable
                                             int[] param_value,
                                             @Nullable
                                             PointerBuffer param_value_size_ret)
        
        public static int clGetKernelArgInfo​(long kernel,
                                             int arg_indx,
                                             int param_name,
                                             @Nullable
                                             long[] param_value,
                                             @Nullable
                                             PointerBuffer param_value_size_ret)
        
        Array version of: GetKernelArgInfo
        See Also:
        Reference Page