Class OpenCLExecutionContext

java.lang.Object
org.episteme.nativ.technical.backend.gpu.opencl.OpenCLExecutionContext
All Implemented Interfaces:
AutoCloseable, ExecutionContext

public class OpenCLExecutionContext extends Object implements ExecutionContext
Execution context for OpenCL operations.
Since:
1.2
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • OpenCLExecutionContext

      public OpenCLExecutionContext(org.jocl.cl_context context, org.jocl.cl_command_queue commandQueue, org.jocl.cl_device_id device)
  • Method Details

    • getContext

      public org.jocl.cl_context getContext()
    • getCommandQueue

      public org.jocl.cl_command_queue getCommandQueue()
    • getDevice

      public org.jocl.cl_device_id getDevice()
    • execute

      public <T> T execute(Operation<T> operation)
      Description copied from interface: ExecutionContext
      Executes an operation synchronously and returns the result.
      Specified by:
      execute in interface ExecutionContext
      Type Parameters:
      T - the result type
      Parameters:
      operation - the operation to execute
      Returns:
      the operation result
    • close

      public void close()
      Description copied from interface: ExecutionContext
      Releases resources associated with this context.

      This method is called automatically when used in try-with-resources.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface ExecutionContext