2 Replies Latest reply on Oct 14, 2015 7:57 PM by nibal

    Persistent LDS


      I have a buffer that is used only for intermediate kernel calculations, never seen by the host. I would like to allocate it in LDS (it's only 4 KB) and reserve it for 8-10 kernel passes.

      In C I would reserve shared memory to be shared by different processes. I'm using SDK 2.9.1.

      Is it possible? Is it possible in ocl 3.0?

        • Re: Persistent LDS

          I don't think it is possible using OpenCL. LDS is used to store data allocated in local address space and only can be used to share data among WIs within a WG.


          As per OpenCL spec:

          " Variables allocated in the __local address space inside a kernel function are allocated for each work-group executing the kernel and exist only for the lifetime of the work-group executing the kernel."


          Similarly, as per  AMD Optimization guide:

          "Local memory is software-controlled “scratchpad” memory. ... The scratchpad allows the kernel to explicitly load items into the memory; they exist in local memory until the kernel replaces them, or until the work-group ends. To declare a block of local memory, use the __local keyword; for example: __local float localBuffer[64]"


          Normally, h/w resource manager allocates the LDS space to a new WG  as soon as one WG finishes. So, it can not be used to communicate between two kernel calls.