Module notzed.zcl
Package au.notzed.zcl

Class CLKernel

java.lang.Object
api.Native
au.notzed.zcl.CLObject
au.notzed.zcl.CLKernel

public class CLKernel
extends CLObject
Interface for cl_kernel.

Note although this has api versioning it does not extend CLExtendable for efficiency reasons. There is therefore no run-time checking of api.

  • Field Details

    • CL_KERNEL_EXEC_INFO_SVM_PTRS

      public static final int CL_KERNEL_EXEC_INFO_SVM_PTRS
      Since:
      OpenCL 2.1
      See Also:
      Constant Field Values
    • CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM

      public static final int CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM
      Since:
      OpenCL 2.1
      See Also:
      Constant Field Values
  • Method Details

    • cloneKernel

      public CLKernel cloneKernel() throws CLRuntimeException
      Calls clCloneKernel.
      Returns:
      Throws:
      CLRuntimeException
      Since:
      OpenCL 2.1
    • setArgLDS

      public void setArgLDS​(int index, long size)
      Set the size of a parameter that is of a local scope.
      Parameters:
      index -
      size - The size to reserve in bytes.
    • setArg

      public void setArg​(int index, CLObject o)
      Set an argument to an OpenCL object.
      Parameters:
      index -
      o -
    • setArg

      public void setArg​(int index, byte val)
      Set a byte-valued argument. Equates to OpenCL types char, unsigned char, and uchar (and perhaps bool?).
      Parameters:
      index -
      val -
    • setArg

      public void setArg​(int index, short val)
      Set a short-valued argument. Equates to OpenCL types short, unsigned short, and ushort.
      Parameters:
      index -
      val -
    • setArg

      public void setArg​(int index, int val)
      Set an integer-valued argument. Equates to OpenCL types int, unsigned int, and uint.
      Parameters:
      index -
      val -
    • setArg

      public void setArg​(int index, long val)
      Set a long-valued argument. Equates (somewhat conveniently) to the OpenCL types long, unsigned long, and ulong.
      Parameters:
      index -
      val -
    • setArg

      public void setArg​(int index, float val)
      Set a float-valued argument.
      Parameters:
      index -
      val -
    • setArg

      public void setArg​(int index, double val)
      Set a double-valued argument.
      Parameters:
      index -
      val -
    • setArg

      public void setArg​(int index, java.nio.ByteBuffer svm)
      Set SVM argument.
      Parameters:
      index -
      svm - MUST have been allocated using CLContext.SVMAlloc().
    • setArg

      public void setArg​(int index, byte... val)
      Set a multi-element byte argument. This may be used to setArg vector types.
      Parameters:
      index -
      val -
    • setArg

      public void setArg​(int index, short... val)
      Set a multi-element short argument. This may be used to setArg vector types.
      Parameters:
      index -
      val -
    • setArg

      public void setArg​(int index, int... val)
      Set a multi-element integer argument. This may be used to setArg vector types.
      Parameters:
      index -
      val -
    • setArg

      public void setArg​(int index, long... val)
      Set a multi-element long argument. This may be used to setArg vector types.
      Parameters:
      index -
      val -
    • setArg

      public void setArg​(int index, float... val)
      Set a multi-element float argument. This may be used to setArg vector types.
      Parameters:
      index -
      val -
    • setArg

      public void setArg​(int index, double... val)
      Set a multi-element double argument. This may be used to setArg vector types.
      Parameters:
      index -
      val -
    • setArgs

      public void setArgs​(int index0, java.lang.Object... values)
      Sets a number of arguments.

      This isn't terribly efficient.

      Parameters:
      index0 - Starting index.
      values -
    • getFunctionName

      public java.lang.String getFunctionName()
    • getNumArgs

      public int getNumArgs()
    • getContext

      public CLContext getContext()
    • getProgram

      public CLProgram getProgram()
    • getAttributes

      public java.lang.String getAttributes()
    • getGlobalWorkSize

      public long[] getGlobalWorkSize​(CLDevice device)
      gets CL_KERNEL_GLOBAL_WORK_SIZE
      Parameters:
      device - device to use, may be null
      Returns:
    • getWorkGroupSize

      public long getWorkGroupSize​(CLDevice device)
    • getCompileWorkGroupSize

      public long[] getCompileWorkGroupSize​(CLDevice device)
    • getLocalMemSize

      public long getLocalMemSize​(CLDevice device)
    • getPreferredWorkGroupSizeMultiple

      public long getPreferredWorkGroupSizeMultiple​(CLDevice device)
    • getPrivateMemSize

      public long getPrivateMemSize​(CLDevice device)
    • getMaxSubGroupSizeForNDRange

      public long getMaxSubGroupSizeForNDRange​(CLDevice device, long[] range)
      Since:
      OpenCL 2.1
    • getSubGroupCountForNDRange

      public long getSubGroupCountForNDRange​(CLDevice device, long[] range)
      Since:
      OpenCL 2.1
    • getLocalSizeForSubGroupCount

      public long[] getLocalSizeForSubGroupCount​(CLDevice device, long count)
      Since:
      OpenCL 2.1
    • getMaxNumSubGroups

      public long getMaxNumSubGroups​(CLDevice device)
    • getArgAddressQualifier

      public int getArgAddressQualifier​(int index) throws java.lang.UnsupportedOperationException
      gets CL_KERNEL_ARG_ADDRESS_QUALIFIER.
      Parameters:
      index -
      Returns:
      Throws:
      java.lang.UnsupportedOperationException
      Since:
      OpenCL 1.2
    • getArgAccessQualifier

      public int getArgAccessQualifier​(int index) throws java.lang.UnsupportedOperationException
      gets CL_KERNEL_ARG_ACCESS_QUALIFIER.
      Parameters:
      index -
      Returns:
      Throws:
      java.lang.UnsupportedOperationException
      Since:
      OpenCL 1.2
    • getArgTypeName

      public java.lang.String getArgTypeName​(int index) throws java.lang.UnsupportedOperationException
      gets CL_KERNEL_ARG_TYPE_NAME.
      Parameters:
      index -
      Returns:
      Throws:
      java.lang.UnsupportedOperationException
      Since:
      OpenCL 1.2
    • getArgTypeQualifier

      public long getArgTypeQualifier​(int index) throws java.lang.UnsupportedOperationException
      gets CL_KERNEL_ARG_TYPE_QUALIFIER.
      Parameters:
      index -
      Returns:
      Throws:
      java.lang.UnsupportedOperationException
      Since:
      OpenCL 1.2
    • getArgName

      public java.lang.String getArgName​(int index) throws java.lang.UnsupportedOperationException
      gets CL_KERNEL_ARG_NAME.
      Parameters:
      index -
      Returns:
      Throws:
      java.lang.UnsupportedOperationException
      Since:
      OpenCL 1.2