copy from global memory to local memory..problem

I want to copy from global memory to local memory about image data.
So I researched the opencl specification document and I found a function(async_work_group_copy() function).
This function perform an async copy of elements from src to dst.
But I didn’t found example of async_work_group_copy() function.
Evne if I found it, I didn’t understand how am I control it…

So, I have to copy from global data to local data(also to copy from local data to global data)…
I want to your advise :slight_smile:
What can I do??


__local ulong	clientPixelData[2048];
__global ulong *sourcepos = (__global ulong *)(source + (sourceWidth * hexTop)+(hexLeft * 4));

event_t events = async_work_group_copy(&clientPixelData, sourcepos, cWidth,0);
				wait_group_events(1, &events);

I have tree error
:178: error: no matching overload found for arguments of type ‘long _attribute
_((address_space(3))), long attribute((address_space(1))), int, int’
event_t events = async_work_group_copy(clientPixelData, sourcepos, cWidth,0);
^~~~~~~~~~~~~~~~~~~~~
:238: error: no matching overload found for arguments of type ‘ulong __attribute
__((address_space(3)))()[2048], long attribute((address_space(1))), int, int’
event_t events = async_work_group_copy(&clientPixelData, sourcepos, cWidth,0);
^~~~~~~~~~~~~~~~~~~~~
:353: error: no matching overload found for arguments of type ‘ulong __attribute
__((address_space(3)))()[2048], long attribute((address_space(1))), int, int’
event_t events = async_work_group_copy(&clientPixelData, sourcepos, cWidth,0);
^~~~~~~~~~~~~~~~~~~~~

I have tree error
:178: error: no matching overload found for arguments of type ‘long _attribute
_((address_space(3))), long attribute((address_space(1))), int, int’
event_t events = async_work_group_copy(clientPixelData, sourcepos, cWidth,0);
^~~~~~~~~~~~~~~~~~~~~
:238: error: no matching overload found for arguments of type ‘ulong __attribute
__((address_space(3)))()[2048], long attribute((address_space(1))), int, int’
event_t events = async_work_group_copy(&clientPixelData, sourcepos, cWidth,0);
^~~~~~~~~~~~~~~~~~~~~
:353: error: no matching overload found for arguments of type ‘ulong __attribute
__((address_space(3)))()[2048], long attribute((address_space(1))), int, int’
event_t events = async_work_group_copy(&clientPixelData, sourcepos, cWidth,0);
^~~~~~~~~~~~~~~~~~~~~

anybody help me~~~~ :cry:

Try changing
event_t events = async_work_group_copy(&clientPixelData, sourcepos, cWidth,0);

to
event_t events = async_work_group_copy(clientPixelData, sourcepos, cWidth,0);
or
event_t events = async_work_group_copy(&clientPixelData[0], sourcepos, cWidth,0);

Your first argument is a ulong** instead of a ulong*.