6 Replies Latest reply on Sep 6, 2011 7:51 AM by nou

    Local, Private and Constant memories in OpenCL

    akhal

      Hello

      I am trying OpenCL code on CPUs. I know that global memories are implemented as main memory (RAM) in CPUs and GPUs. But GPUs probably have on chip local memory which implement the OpenCL "local memory and/or private memory". Is it true?

      And Also I wonder how this constant, local and private OpenCL memories are implemented/handled in CPUs? Is it like constant memory is RAM and local+private memory is CPU caches ???

        • Local, Private and Constant memories in OpenCL
          himanshu.gautam

           

          Originally posted by: akhal Hello

           

          I am trying OpenCL code on CPUs. I know that global memories are implemented as main memory (RAM) in CPUs and GPUs. But GPUs probably have on chip local memory which implement the OpenCL "local memory and/or private memory". Is it true?



          Yes, GPUs have on-chip LDS(local Data Share) which is OpenCL local memory(from 5xxx devices) and separate private memory bank with each compute unit.

           

          Originally posted by: akhal Hello

          And Also I wonder how this constant, local and private OpenCL memories are implemented/handled in CPUs? Is it like constant memory is RAM and local+private memory is CPU caches ???

           

          I am not able to recall the answer, but you may be able to find it on some other threads. Also, this may change from one vendor implementation to other, so it is not something to be sure of. If caches are used you will get better speed-up but otherwise also your kernel will run even though somawhat slowly.