- All Known Implementing Classes:
KernelContext
public interface ExecutionContext
Generic interface for TornadoVM to implement a Thread-Context API. This
interface allows the client to implement barriers, allocate memory in local
memory (OpenCL) or in shared memory (NVIDIA PTX).
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]allocateByteLocalArray(int size) Array Allocation in Local Memory (OpenCL terminology).double[]allocateDoubleLocalArray(int size) Array Allocation in Local Memory (OpenCL terminology).float[]allocateFloatLocalArray(int size) Array Allocation in Local Memory (OpenCL terminology).allocateHalfFloatLocalArray(int size) Array Allocation in Local Memory (OpenCL terminology).int[]allocateIntLocalArray(int size) Array Allocation in Local Memory (OpenCL terminology).long[]allocateLongLocalArray(int size) Array Allocation in Local Memory (OpenCL terminology).voidatomicAdd(int[] array, int index, int val) Method used to read a memory address by using the array and the index, then add the value of val to it, and write the result back to the same address.voidatomicAdd(DoubleArray array, int index, double val) Method used to read a memory address by using the array and the index, then add the value of val to it, and write the result back to the same address.voidatomicAdd(FloatArray array, int index, float val) Method used to read a memory address by using the array and the index, then add the value of val to it, and write the result back to the same address.voidMethod used to read a memory address by using the array and the index, then add the value of val to it, and write the result back to the same address.voidMethod used to read a memory address by using the array and the index, then add the value of val to it, and write the result back to the same address.voidIt adds a barrier for sync all threads within the same work-group to ensure correct order in global memory (OpenCL terminology).voidIt adds a barrier for sync all threads within the same work-group to ensure correct order in local memory (OpenCL terminology).
-
Method Details
-
localBarrier
void localBarrier()It adds a barrier for sync all threads within the same work-group to ensure correct order in local memory (OpenCL terminology).Similar the OpenCL construct:
barrier(CLK_LOCAL_MEM_FENCE); -
globalBarrier
void globalBarrier()It adds a barrier for sync all threads within the same work-group to ensure correct order in global memory (OpenCL terminology).Similar the OpenCL construct:
barrier(CLK_GLOBAL_MEM_FENCE); -
allocateIntLocalArray
int[] allocateIntLocalArray(int size) Array Allocation in Local Memory (OpenCL terminology).- Parameters:
size- size of the int-array.- Returns:
- int[]
-
allocateLongLocalArray
long[] allocateLongLocalArray(int size) Array Allocation in Local Memory (OpenCL terminology).- Parameters:
size- size of the long-array.- Returns:
- long[]
-
allocateFloatLocalArray
float[] allocateFloatLocalArray(int size) Array Allocation in Local Memory (OpenCL terminology).- Parameters:
size- size of the float-array.- Returns:
- float[]
-
allocateDoubleLocalArray
double[] allocateDoubleLocalArray(int size) Array Allocation in Local Memory (OpenCL terminology).- Parameters:
size- size of the double-array.- Returns:
- double[]
-
allocateByteLocalArray
byte[] allocateByteLocalArray(int size) Array Allocation in Local Memory (OpenCL terminology).- Parameters:
size- size of the byte-array.- Returns:
- byte[]
-
allocateHalfFloatLocalArray
Array Allocation in Local Memory (OpenCL terminology).- Parameters:
size- size of the byte-array.- Returns:
- HalfFloat[]
-
atomicAdd
Method used to read a memory address by using the array and the index, then add the value of val to it, and write the result back to the same address.PTX equivalent: atomicAdd(int* address, int val);
-
atomicAdd
void atomicAdd(int[] array, int index, int val) Method used to read a memory address by using the array and the index, then add the value of val to it, and write the result back to the same address.PTX equivalent: atomicAdd(int* address, int val);
-
atomicAdd
Method used to read a memory address by using the array and the index, then add the value of val to it, and write the result back to the same address.PTX equivalent: atomicAdd(long* address, long val);
-
atomicAdd
Method used to read a memory address by using the array and the index, then add the value of val to it, and write the result back to the same address.PTX equivalent: atomicAdd(float* address, float val);
-
atomicAdd
Method used to read a memory address by using the array and the index, then add the value of val to it, and write the result back to the same address.PTX equivalent: atomicAdd(double* address, double val);
-