Results 1 to 3 of 3

Thread: Sync across work groups

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    23

    Sync across work groups

    Hello

    I have written OpenCL kernel in which there are no work groups, only single work items in a 2D range. There are two read/write operations in kernel and I need a function like barrier/mem_fence that ensures that all work items read updated values after that sync function. In particular

    work-items writing to global memory;
    sync();
    work-items reading updated values from global memory;

    I see that barrier() and mem_fence() functions only gives this syncronization within work groups, but since I dont have work groups but only single work items, how can I achieve this synconization? or should I have to make two kernels first writing and second reading from that same global memory ?

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

    Re: Sync across work groups

    I see that barrier() and mem_fence() functions only gives this syncronization within work groups, but since I dont have work groups but only single work items, how can I achieve this synconization?
    Work-items are always executed in work-groups. If you don't specify a work-group size when you call clEnqueueNDRangeKernel() then the OpenCL driver will pick a work-group size for you.

    Whether using a work-group barrier is going to be enough or whether you will need to enqueue two different NDRanges depends on what your kernel is doing. If the work-items are only going to read data that was written by other work-items in the same work-group then a work-group barrier is enough. If work-items from one work-group need to read data that was written by other work-groups then you will need to enqueue two NDRanges.
    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
    Jul 2011
    Posts
    23

    Re: Sync across work groups

    Aha ok thank you so much...

Similar Threads

  1. doubts with work items and groups
    By mustang in forum OpenCL
    Replies: 9
    Last Post: 02-15-2012, 02:58 PM
  2. help with work items in work groups
    By gatodelsol in forum OpenCL
    Replies: 3
    Last Post: 09-14-2011, 09:12 AM
  3. how do work-groups affect performance?
    By Andre in forum OpenCL
    Replies: 4
    Last Post: 08-11-2011, 12:45 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
  •