Package com.aparapi

Annotation Type Kernel.PrivateMemorySpace

Enclosing class:
Kernel

@Retention(RUNTIME) @Target(FIELD) public static @interface Kernel.PrivateMemorySpace
We can use this Annotation to 'tag' __private (unshared) array fields. Data in the __private address space in OpenCL is accessible only from the current kernel instance. To so mark a field with a buffer size of 99, we can either annotate the buffer

  invalid input: '&#64'PrivateMemorySpace(99) int[] buffer = new int[99];
  
Or use a special suffix

  int[] buffer_$private$99 = new int[99];
  

Note that any code which must be runnable in Kernel.EXECUTION_MODE.JTP will fail to work correctly if it uses such an array, as the array will be shared by all threads. The solution is to create a Kernel.NoCL method called at the start of Kernel.run() which sets the field to an array returned from a static ThreadLocalinvalid input: '<'foo[]>

. Please see MedianKernel7x7 in the samples for an example.
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    int
    Size of the array used as __private buffer.
  • Element Details

    • value

      int value
      Size of the array used as __private buffer.