Package com.aparapi
Annotation Type Kernel.PrivateMemorySpace
- Enclosing class:
Kernel
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: '@'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[]>
MedianKernel7x7
in the samples for an example.- See Also:
-
Required Element Summary
Modifier and TypeRequired ElementDescriptionint
Size of the array used as __private buffer.
-
Element Details
-
value
int valueSize of the array used as __private buffer.
-