Class INTELAccelerator


  • public class INTELAccelerator
    extends java.lang.Object
    Native bindings to the intel_accelerator extension.

    The accelerator extension consists of a unified set of OpenCL runtime APIs to create, query, and manage the lifetime of objects which represent acceleration processors, engines, or algorithms. Accelerator object instances are referenced with the generic cl_accelerator_intel type by the runtime API, but they are always associated with a specific acceleration engine type, which is assigned by the application at accelerator object creation time. Descriptors are used to assign acceleration engine-specific properties to the accelerator objects. This mechanism of specialized creation with generic referencing is analogous to the way image objects are managed in the OpenCL 1.2 runtime API via generic cl_mem referencing but specialized descriptor-based creation with CreateImage.

    Each accelerator object is assigned a unique type id. Vendors are freely encouraged to define new accelerator types and ids. This base extension provides unified mechanism for the creation and lifetime management of new accelerator types, but the semantics and creation descriptors of these types are to be defined in acceleration engine-specific extensions.

    Accelerator objects can be supplied to kernels as arguments. Unless an extension defines a new OpenCL C language type for the engine-specific accelerator (e.g. sampler_t), accelerator objects can only be used in conjunction with built-in kernels. If an extension does define such a new type, or if it provides a mechanism to access accelerator data within kernels, then accelerator objects can act as regular kernel arguments as well.

    Requires CL12.

    • Method Detail

      • nclCreateAcceleratorINTEL

        public static long nclCreateAcceleratorINTEL​(long context,
                                                     int accelerator_type,
                                                     long descriptor_size,
                                                     long descriptor,
                                                     long errcode_ret)
        Unsafe version of: CreateAcceleratorINTEL
        Parameters:
        descriptor_size - a value which specifies of the size, in bytes, of the immediately following descriptor structure
      • clCreateAcceleratorINTEL

        public static long clCreateAcceleratorINTEL​(long context,
                                                    int accelerator_type,
                                                    java.nio.ByteBuffer descriptor,
                                                    @Nullable
                                                    java.nio.IntBuffer errcode_ret)
        Accelerator objects represent the programmable state of an acceleration processor, engine, or algorithm. Accelerator objects can be supplied to kernels as arguments. Unless an extension defines a new OpenCL C language type for the engine-specific accelerator (e.g. sampler_t), accelerator objects can only be used in conjunction with built-in kernels.

        This function creates an accelerator object. The accelerator object will be created with a reference count of one. Accelerator objects created with this function have semantics defined by the parameter accelerator_type, which are defined and described by extensions external to this document.

        Parameters:
        context - a valid OpenCL context
        accelerator_type - specifies the type of accelerator object created. The type constants are defined by acceleration engine-specific extensions. It is encouraged that extensions follow the naming scheme of CL_ACCELERATOR_TYPE_{name}_INTEL where {name} is a descriptive acceleration engine string.
        descriptor - a pointer to a structure that defines the parameter set of the accelerator object. This parameter set describes the configurable state of the underlying object. The actual structure supplied must be consistent with accelerator_type. The descriptor structures are defined by acceleration engine-specific extensions. It is encouraged that extensions follow the naming scheme of cl_{name}_desc_INTEL where {name} is a descriptive acceleration engine string.
        errcode_ret - will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
        Returns:
        a valid non-zero accelerator object, and errcode_ret is set to SUCCESS if the accelerator object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:
      • clRetainAcceleratorINTEL

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

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

        public static int nclGetAcceleratorInfoINTEL​(long accelerator,
                                                     int param_name,
                                                     long param_value_size,
                                                     long param_value,
                                                     long param_value_size_ret)
        Unsafe version of: GetAcceleratorInfoINTEL
        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.
      • clGetAcceleratorInfoINTEL

        public static int clGetAcceleratorInfoINTEL​(long accelerator,
                                                    int param_name,
                                                    @Nullable
                                                    java.nio.ByteBuffer param_value,
                                                    @Nullable
                                                    PointerBuffer param_value_size_ret)
        
        public static int clGetAcceleratorInfoINTEL​(long accelerator,
                                                    int param_name,
                                                    @Nullable
                                                    java.nio.IntBuffer param_value,
                                                    @Nullable
                                                    PointerBuffer param_value_size_ret)
        
        public static int clGetAcceleratorInfoINTEL​(long accelerator,
                                                    int param_name,
                                                    @Nullable
                                                    PointerBuffer param_value,
                                                    @Nullable
                                                    PointerBuffer param_value_size_ret)
        
        Returns information about the accelerator object.
        Parameters:
        accelerator - the accelerator object being queried
        param_name - the information to query. One of:
        ACCELERATOR_DESCRIPTOR_INTELACCELERATOR_REFERENCE_COUNT_INTEL
        ACCELERATOR_CONTEXT_INTELACCELERATOR_TYPE_INTEL
        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_ACCELERATOR_INTEL if accelerator is a not a valid accelerator 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.
      • clCreateAcceleratorINTEL

        public static long clCreateAcceleratorINTEL​(long context,
                                                    int accelerator_type,
                                                    java.nio.ByteBuffer descriptor,
                                                    @Nullable
                                                    int[] errcode_ret)
        Array version of: CreateAcceleratorINTEL
      • clGetAcceleratorInfoINTEL

        public static int clGetAcceleratorInfoINTEL​(long accelerator,
                                                    int param_name,
                                                    @Nullable
                                                    int[] param_value,
                                                    @Nullable
                                                    PointerBuffer param_value_size_ret)
        Array version of: GetAcceleratorInfoINTEL