I have a problem compiling the method below. It compiles fine if the CUDA is selected as target, however if the OpenCL is selected that it throws error.
[Cudafy]
unsafe static void MyKernelMethod(
GThread thread,
[CudafyAddressSpace(eCudafyAddressSpace.Constant)] int[] a)
{
// fix our array to a ptr
fixed (int* aPtr = a)
{
// get a new array pointing to some offset of the original array
int* aPtr_Offset = aPtr + thread.blockIdx.x;
// use it for something
aPtr_Offset[thread.threadIdx.x] = 2;
// some more code...
}
}
The error:
error: illegal implicit conversion between two pointers with different address spaces
I do not have enough knowledge how to correct this (I am just starting GPGPU programming).