Class CompiledCLProgram

java.lang.Object
cz.fidentis.analyst.opencl.impl.CompiledCLProgram
All Implemented Interfaces:
CLProgram

public class CompiledCLProgram extends Object implements CLProgram
A proxy object storing the information about a CL program compiled on GPU.
  • Constructor Details

    • CompiledCLProgram

      public CompiledCLProgram(com.jogamp.opencl.CLContext clContext, CLProgramDef programDef)
      Links OpenCL source files into single file, then compiles with provided compiler options
      Parameters:
      clContext - OpenCL context. Must not be null.
      programDef - The definition of the program to be compiled
  • Method Details

    • compile

      public CompiledCLProgram compile() throws com.jogamp.opencl.CLException
      Compiles the program on GPU.
      Returns:
      this object
      Throws:
      com.jogamp.opencl.CLException - if the compilation fails
    • compile

      public CompiledCLProgram compile(Map<com.jogamp.opencl.CLDevice,byte[]> binaries) throws com.jogamp.opencl.CLException
      Compiles the program on GPU.
      Parameters:
      binaries - Uses already compiled binaries as source
      Returns:
      this object
      Throws:
      com.jogamp.opencl.CLException - if the compilation fails
    • release

      public void release()
      Ask GPU to release the program from its memory.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getKernel

      public com.jogamp.opencl.CLKernel getKernel(String key)
      Description copied from interface: CLProgram
      Gets kernel from CLProgram
      Specified by:
      getKernel in interface CLProgram
      Parameters:
      key - name of the kernel method
      Returns:
      kernel to be executed
    • getBinaries

      public Map<com.jogamp.opencl.CLDevice,byte[]> getBinaries()
      Description copied from interface: CLProgram
      Gets compiled binaries of CLProgram. It is faster to recompile binary for new context than to compile the program from scratch.
      Specified by:
      getBinaries in interface CLProgram
      Returns:
      compiled binaries