Class KernelRunner

java.lang.Object
com.aparapi.internal.jni.KernelRunnerJNI
com.aparapi.internal.kernel.KernelRunner

public class KernelRunner extends KernelRunnerJNI
The class is responsible for executing Kernel implementations.
The KernelRunner is the real workhorse for Aparapi. Each Kernel instance creates a single KernelRunner to encapsulate state and to help coordinate interactions between the Kernel and it's execution logic.
The KernelRunner is created lazily as a result of calling Kernel.execute(). A this time the ExecutionMode is consulted to determine the default requested mode. This will dictate how the KernelRunner will attempt to execute the Kernel
See Also:
  • Field Details

    • BINARY_CACHING_DISABLED

      public static boolean BINARY_CACHING_DISABLED
    • MINIMUM_ARRAY_SIZE

      private static final int MINIMUM_ARRAY_SIZE
      See Also:
    • PASS_ID_PREPARING_EXECUTION

      public static final int PASS_ID_PREPARING_EXECUTION
      See Also:
    • PASS_ID_COMPLETED_EXECUTION

      public static final int PASS_ID_COMPLETED_EXECUTION
      See Also:
    • CANCEL_STATUS_FALSE

      public static final int CANCEL_STATUS_FALSE
      See Also:
    • CANCEL_STATUS_TRUE

      public static final int CANCEL_STATUS_TRUE
      See Also:
    • CODE_GEN_ERROR_MARKER

      private static final String CODE_GEN_ERROR_MARKER
    • logger

      private static Logger logger
    • jniContextHandle

      private long jniContextHandle
    • kernel

      private final Kernel kernel
    • entryPoint

      private Entrypoint entryPoint
    • argc

      private int argc
    • executing

      private volatile boolean executing
    • passId

      private volatile int passId
    • inBufferRemote

      private final ByteBuffer inBufferRemote
      A direct ByteBuffer used for asynchronous intercommunication between java and JNI C code.

      At present this is a 4 byte buffer to be interpreted as an int[1], used for passing from java to C a single integer interpreted as a cancellation indicator.

    • inBufferRemoteInt

      private final IntBuffer inBufferRemoteInt
    • outBufferRemote

      private final ByteBuffer outBufferRemote
      A direct ByteBuffer used for asynchronous intercommunication between java and JNI C code.

      At present this is a 4 byte buffer to be interpreted as an int[1], used for passing from C to java a single integer interpreted as a the current pass id.

    • outBufferRemoteInt

      private final IntBuffer outBufferRemoteInt
    • isFallBack

      private boolean isFallBack
    • lowPriorityThreadFactory

      private static final ForkJoinPool.ForkJoinWorkerThreadFactory lowPriorityThreadFactory
    • handler

      private final KernelRunner.ThreadDiedHandler handler
    • threadPool

      private final ForkJoinPool threadPool
    • openCLCache

      private static HashMap<Class<? extends Kernel>,String> openCLCache
    • seenBinaryKeys

      private static LinkedHashSet<String> seenBinaryKeys
    • kernelIsCompiledForDeviceHash

      private final Hashtable<Device,Boolean> kernelIsCompiledForDeviceHash
    • kernelNeverExecutedForDeviceHash

      private final Hashtable<Device,Boolean> kernelNeverExecutedForDeviceHash
    • capabilitiesSet

      private Set<String> capabilitiesSet
    • args

      private KernelArg[] args
    • usesOopConversion

      private boolean usesOopConversion
    • puts

      private final Set<Object> puts
    • explicit

      private boolean explicit
  • Constructor Details

    • KernelRunner

      public KernelRunner(Kernel _kernel)
      Create a KernelRunner for a specific Kernel instance.
      Parameters:
      _kernel -
  • Method Details