PDA

View Full Version : Local memory access question in the specification



ikedanaruki
10-23-2009, 04:50 AM
I have read the specification 1.0.48.

According to '3.3 Memory Model',
Local Memory is local to a work-group and allocated on the device.
And Table 3.1 refer to behavior of a host and kernels.
A host allocates 'local memory' dynamically but has 'No access'.

On the other hand, I have read ..


Alternatively, the local memory region may be mapped onto sections of the global memory.
.

I can't understand. I think it's not able to use clEnqueurMapBuffer.
Is a local memory allocated on a host memory dynamically?
Can I map a local memory to global memory region using something API explicitly?
Or is it the deal within OpenCL implementation?

Could you point out my misunderstanding?

jbasic
10-23-2009, 05:47 AM
Host cannot read nor write local memory. From host you can only allocate amount of local memory you need in work-groups.
Of course if you try to allocate some local memory and device runs out of free local memory, it will use global *internally*.

ikedanaruki
10-25-2009, 06:44 PM
Thanks,


Of course if you try to allocate some local memory and device runs out of free local memory, it will use global *internally*.

is It inside the OpenCL implementation?

dbs2
10-26-2009, 11:36 AM
That depends. There's no such thing as "local" memory on a CPU so the implementation will probably just allocate regular memory for CPU devices. On GPUs there is physical local memory so if you try to use too much you should get an error.