0

I'm still not expert in OpenCL, but I want to make a linked lists using OpenCL (want to make cells "voxels" and particles to link them in these voxels) so the 2 lists are (particles,voxels)

I have seen online an (easy) method using atom_xchg function, but atomic functions are supported in some GPUs and not in others.

Note: I know there's a check in khr opencl to check if atomic functions are supported

So the questions are:

  1. Generally speaking, which GPUs support atomic functions (for example: GPUs from nvidia series 2xx and up or ATI 4xxx and up)

  2. Is atomic functions on local memory slow?

  3. If atomic functions are not supported, is there any easy way to make linked lists?

I'm using OpenCL 1.0

aland
  • 4,829
  • 2
  • 24
  • 42
Mohamed Sakr
  • 409
  • 4
  • 16
  • if any 1 can answer any question of the 3 will be good too :D – Mohamed Sakr Dec 12 '12 at 03:37
  • 1
    Are you sure you need linked lists? It is very non-GPUish data structure (it's serial by defenition). Besides, it seems to me that atomic CAS is the weakest primitive required to make a thread-safe linked list. – aland Dec 20 '12 at 20:55
  • well i have a way to do it using gpu :D why i need linked lists ...well i got a high amount of particles (assume 1 million) ..when i want them to interact with each other...should i iterate over 1 million??or pass the data of the particles to another voxel (list) then iterate over neighbour voxels :D – Mohamed Sakr Dec 25 '12 at 13:28
  • 1
    I didn't say there is no way to implement LLs on GPU, I just meant that it is very bad solution performance-wise. I'd suggest implementing neighbor lists via simple arrays. You might have to sometimes resize the array, of course, and may be need some padding to ease addressing inside an array. But most likely its memory overhead would be much less than the overhead of storing pointers to next list element for each element. Most importantly, arrays will provide [coalesced access pattern](http://stackoverflow.com/q/5041328/929437) (and are overall cache friendly), thus improving performance. – aland Dec 25 '12 at 14:00

0 Answers0