Questions regarding the local memory

Hello! :wave:

I’m a newbie in OpenCL so i read the spec and play around with the OpenCL-calls…
I’ve read in the OpenCL 1.1 spec that the minimum value of [font=“Courier New”]CL_DEVICE_LOCAL_MEM_SIZE[/font] should be 32KB but if I print this value for my GTX260 then I only get 16384 Bytes. Why is it smaller than 32KB? Where are my remaining 16KB? I want them back!!! :shock:

The next thing is that if I try for example to allocate more than 16KB of local memory
[font=“Courier New”]clSetKernelArg(ckTest, 3, 20*1024, NULL);[/font]
then a [font=“Courier New”]CL_SUCCESS[/font] is returned but is that right?
I thought that it shouldn’t be able to allocate more than 16KB in my case.
Also the behaviour of my application is very strange if I allocate almost 16kB or more of local memory. :alien:

Have I misunderstood anything?
Thanks for your help!

Best regards,
Lukas

This is my system:
OS: OpenSUSE 11.0

NVidia Software:
cudatoolkit_3.1_linux_64_suse11.2.run
devdriver_3.1_linux_64_258.19_opencl1.1.run
gpucomputingsdk_1_1_beta_linux.run

NVidia Hardware:
CL_DEVICE_NAME: GeForce GTX 260
CL_DRIVER_VERSION: 258.19
CL_DEVICE_GLOBAL_MEM_SIZE: 895 MB
CL_DEVICE_MAX_MEM_ALLOC_SIZE: 223 MB
CL_DEVICE_LOCAL_MEM_SIZE: 16384 Bytes

Your card really does have only 16KB of local memory. Only Fermi cards have more.

Curiously, in 1.0 specs it says the minimum is 16KB and in 1.1 it’s 32KB. It’s definitely not a typo, in Appendix E they explicitly list changes and there’s:

Those numbers make all pre-Fermi devices technically not up to spec. It might be NVIDIA’s aggressive marketing…

It’s definitely a bad thing you don’t get an error with that allocation. You should probably get an CL_OUT_OF_RESOURCES.

You shouldn’t be able to allocate exactly 16KB either. Some of it goes for storing kernel arguments and perhaps other things, you don’t really get everything up to the last byte.