PDA

View Full Version : copy from global memory to local memory..problem



phoebe0105
06-01-2010, 11:26 AM
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 :)
What can I do??

phoebe0105
06-01-2010, 11:37 AM
__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);
^~~~~~~~~~~~~~~~~~~~~

phoebe0105
06-02-2010, 01:17 AM
anybody help me~~~~ :cry:

dweo
06-03-2010, 02:14 PM
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*.