I am trying to fill an array as a test of jocl using the following kernel but I am having a problem of not knowing how to setup the buffer such that I do not receive the following error
" subscripted value is not an array, pointer"
kernel void FillArray(global float2* arr,
const int L,const int val) {
//Get global position in Y direction
int row = get_global_id(1);
//Get global position in X direction
int col = get_global_id(0);
if (row >= L || col >= L) {
return;
}
arr[row][col]= val;
}
I tried using the following to setup the buffer
CLBuffer<FloatBuffer> clBufferA = context.createFloatBuffer(globalWorkSize);
How does one setup a write buffer for the kernel so that one has a multidimensional array in the kernel.