Results 1 to 3 of 3

Thread: Any global barrier?

  1. #1
    Junior Member
    Join Date
    Apr 2011

    Any global barrier?


    If I understand it correctly, barrier function with any argument is responsible for synchronization inside a work-group. Is there a way to synchronize all the work-groups at the same time, besides breaking up my kernel function?

    Thanks ahead! )

  2. #2
    Senior Member
    Join Date
    May 2010
    Toronto, Canada

    Re: Any global barrier?

    Is there a way to synchronize all the work-groups at the same time, besides breaking up my kernel function?
    The only way is breaking it up into two kernel invocations.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #3
    Junior Member
    Join Date
    Dec 2011

    Re: Any global barrier?

    Hello david.garcia,

    I face the same need... i need some kind of global synchronization between all the Work Items / Processing Elements.

    I am trying to simulate the 2-dimensional diffusion using opencl.
    The algorithm is quite straightforward.
    I have two arrays CUR and PREV of dimension DIM. The diffusion process is simulated until time t reached. The following is the simple pseudo code of what i do:
    Code :
    initialize CUR and PREV;
    for (time = 0; time < t; ++time) {
        evolve(CUR, PREV);
        exchangePointers(CUR, PREV);
    So what I am doing is evolving the current array CUR taking the previous situation PREV.
    For now every evolve function call is a new invocation of kernel.... that slows down drastically the performance.

    My solution is move the for instruction with time t into kernel. But at this point i need to be sure that before I start a new iteration all the processing elements are done their work at time time.

    So... i would like to know what do you mean with two kernel invocations and how can I do this. Or how you would implement some sort of global barrier.


    Artur Tolstenco

Similar Threads

  1. Barrier
    By sher in forum OpenCL
    Replies: 2
    Last Post: 03-29-2012, 01:55 AM
  2. why use barrier?
    By memo in forum OpenCL
    Replies: 2
    Last Post: 11-18-2009, 10:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean