1 Reply Latest reply on Jan 9, 2015 8:42 AM by maxdz8

    Fastest way of copying data from private array to global buffer ?

    boxerab

      I have a private array of type uchar, and I would like to copy 1024 bytes into a global buffer of type uchar.

       

      What is the best way of doing this?

        • Re: Fastest way of copying data from private array to global buffer ?
          maxdz8

          In my experience the most effective way (but usually not very convenient) is to pack the same index of the array in subsequent memory addresses while striding subsequent indices by the global work size.

          So, if you have 4096 work items, each to copy out 1024 bytes, you get 4KiB of value[0], then 4KiB of value[1] and so on.

          This way, when processed the various wavefront generate extremely efficient packed writes.