How do I use local memory in OpenCL?

后端 未结 3 1236
刺人心
刺人心 2020-12-05 03:52

I\'ve been playing with OpenCL recently, and I\'m able to write simple kernels that use only global memory. Now I\'d like to start using local memory, but I can\'t seem to f

3条回答
  •  无人及你
    2020-12-05 04:53

    There is another possibility to do this, if the size of the local memory is constant. Without using a pointer in the kernels parameter list, the local buffer can be declared within the kernel just by declaring it __local:

    __local float localBuffer[1024];
    

    This removes code due to less clSetKernelArg calls.

提交回复
热议问题