Hi, I was trying to implement a simple memcpy function in the opencl kernel:
void memcpyint(__global int *dest, const __global int *src, int len)
{
for(int i=0;i<len;i++) dest=src;
return;
}
and here is my kenel:
__kernel void simple(__global int *a; __global int *b)
{
int id=get_global_id(0);
memcpyint(a[id*10],b[id*10],10)
return;
}
But I got error "CL_OUT_OF_RESOURCES " when I try to copy GPU memory back to CPU
If I do not call the memcpyint function and change the kernel to:
__kernel void simple(__global int *a; __global int *b)
{
int id=get_global_id(0);
for(int i =0;i<10;i++)
{
a[id*10+i] = b[id*10+i];
}
return;
}
the code is working. Can anyone tell me why the function memcpyint does not work? Thanks!