@Retention(value=RUNTIME) @Target(value=FIELD) public static @interface Kernel.PrivateMemorySpace
@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 ThreadLocal
MedianKernel7x7
in the samples for an example.Kernel.PRIVATE_SUFFIX
Modifier and Type | Required Element and Description |
---|---|
int |
value
Size of the array used as __private buffer.
|
Copyright © 2016 Syncleus. All rights reserved.