9

I have been working on GPU threads synchronization with multi-core CPU threads with OpenCL. I did see some CUDA Examples, however, I would be more clear on this concept if someone could give me some hints on the synchronization part in terms of OpenCL. Thanks in advance for any assistance on this matter.

David Ehrmann
  • 7,366
  • 2
  • 31
  • 40
Harrisson
  • 255
  • 2
  • 21
  • 6
    This isn't your exact question, but here's a good post on barriers: http://stackoverflow.com/questions/6890302/barriers-in-opencl – David Ehrmann Oct 28 '16 at 14:04

1 Answers1

1

David Ehrmann is right on the source. I just wanted to add a few cases:

  • Barriers in cpu-devices is very slow, slowing effect is even more than speedup ratio between cpu and gpu(at least for a mid-tier amd desktop cpu and a low-end intel mobile cpu)
  • If none of the workitems in a workgroup hits a barrier,they don't have to hit it ever. An example could be early-quitting in the kernel on workgroup level where an image is processed(or not processed) in a checkerboard manner which makes alternating workgroups process or not process.(yes, this is inefficient but more complex workgroup-picking algorithms can be easy this way where some parameters or data are unknown in compile time)
  • Atomic functions are not barriers. They just access an updated(by other workitems, atomically) memory cell and update it atomically.
huseyin tugrul buyukisik
  • 11,469
  • 4
  • 45
  • 97
  • thank you very much for this explanation. But would you happen to know any good examples for conversion YUV data into image format. If you want i can create a new question for this. – Harrisson Mar 13 '17 at 07:46
  • 1
    @Harrisson you should create a new question but I will be away from keyboard. Its not easy to convert to/from YUV, was used in android phone cam output afaik. – huseyin tugrul buyukisik Mar 13 '17 at 07:50
  • thank you for your input on this. I will create a new question. I would request any help you can offer with the conversion as this has become a headache for me. i am able to convert but only partial data is being converted – Harrisson Mar 13 '17 at 07:53
  • 1
    @Harrisson there are 11231223 programmers here Im sure one can answer – huseyin tugrul buyukisik Mar 13 '17 at 07:58
  • I have posted a new question regarding the image data. However, I am yet to receive a solid answer on tat question. If you can look into this question give me any hints I would be really thankful. http://stackoverflow.com/questions/42759445/conversion-of-yuv-data-into-image-format-opencl – Harrisson Mar 14 '17 at 07:42
  • http://stackoverflow.com/questions/42759445/conversion-of-yuv-data-into-image-format-opencl – Harrisson Mar 14 '17 at 07:43
  • @Harrison im still away from Computer but yuv to rgb needs a Page full of calculations iirc but not more , depending on yuv type – huseyin tugrul buyukisik Mar 14 '17 at 08:32