Package com.aparapi
Annotation Type Kernel.PrivateMemorySpace
-
@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
Or use a special suffix@PrivateMemorySpace(99) int[] buffer = new int[99];
int[] buffer_$private$99 = new int[99];
Note that any code which must be runnable in
. Please seeKernel.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 aKernel.NoCL
method called at the start ofKernel.run()
which sets the field to an array returned from a staticThreadLocal
MedianKernel7x7
in the samples for an example.- See Also:
Kernel.PRIVATE_SUFFIX
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description int
value
Size of the array used as __private buffer.
-