Results 1 to 2 of 2

Thread: Specifics of barriers

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    1

    Specifics of barriers

    The standard states that

    "If barrier is inside a conditional statement, then all
    work-items must enter the conditional if any work-item
    enters the conditional statement and executes the
    barrier."

    Does "balanced" barrier usage have defined behavior or all the work-items must enter the same branch? In the other words, do the following examples conform to the standard?

    1)
    Code :
    if (cond) {
       barrier(...);
    }
    else {
       barrier(...);
    }

    2)
    Code :
    if (cond) {
        barrier(...);
        return;
    }
     
    barrier(...);

    Thanks for your time.

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

    Re: Specifics of barriers

    Neither of those examples are valid according to the standard. All work items in a work-group must hit the exact same barrier.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

Similar Threads

  1. Replies: 1
    Last Post: 09-30-2011, 02:14 PM
  2. Global Barriers?
    By guillona in forum OpenCL
    Replies: 2
    Last Post: 02-20-2010, 04:58 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
  •