[Libclc-dev] [PATCH 1/3] Implement wait_group_events builtin v2

Jan Vesely jan.vesely at rutgers.edu
Wed Sep 24 09:23:21 PDT 2014


On Wed, 2014-09-24 at 11:00 +0100, Jeroen Ketema wrote:
> This looks good, but I think it suffices to use a barrier with an empty
> set of flags, as the function only requires the copy to have completed.
> Not that every memory operation arising from the copy has been
> committed, as I wrote before.
> 
> The above is provided that a barrier call is not removed completely in
> case of an empty set of flags, which I recall is currently the case for
> R600. I think there was a patch for that at some point; not sure what
> happened to that patch though.

if you are referring to [0] and the discussion that stemmed from it, it
never got reviewed.

I agree with your conclusion that we need to extend fence with AS
argument to get this done properly. But it looked like too big of a task
at that time, so I did not push it further.

I still plan to return to it (unless someone beats me to it), but right
now there are things higher on my TODO list (Mostly to familiarize
myself with the memory code) before getting back to fences.

sorry that I left that discussion in limbo,
jan

[0] http://www.pcc.me.uk/pipermail/libclc-dev/2014-April/000284.html


> 
> Jeroen
> 
> On 24 Sep 2014, at 01:42, Tom Stellard <thomas.stellard at amd.com> wrote:
> 
> > This is a simple default implemetation which just calls barrier().
> > 
> > v2:
> >  - Only call barrier() once.
> > ---
> > generic/include/clc/async/wait_group_events.h | 1 +
> > generic/include/clc/clc.h                     | 1 +
> > generic/lib/SOURCES                           | 1 +
> > generic/lib/async/wait_group_events.cl        | 5 +++++
> > 4 files changed, 8 insertions(+)
> > create mode 100644 generic/include/clc/async/wait_group_events.h
> > create mode 100644 generic/lib/async/wait_group_events.cl
> > 
> > diff --git a/generic/include/clc/async/wait_group_events.h b/generic/include/clc/async/wait_group_events.h
> > new file mode 100644
> > index 0000000..799efa0
> > --- /dev/null
> > +++ b/generic/include/clc/async/wait_group_events.h
> > @@ -0,0 +1 @@
> > +void wait_group_events(int num_events, event_t *event_list);
> > diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
> > index b8c1cb9..0dccf53 100644
> > --- a/generic/include/clc/clc.h
> > +++ b/generic/include/clc/clc.h
> > @@ -138,6 +138,7 @@
> > 
> > /* 6.11.10 Async Copy and Prefetch Functions */
> > #include <clc/async/prefetch.h>
> > +#include <clc/async/wait_group_events.h>
> > 
> > /* 6.11.11 Atomic Functions */
> > #include <clc/atomic/atomic_add.h>
> > diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES
> > index e4ba1d1..cefef94 100644
> > --- a/generic/lib/SOURCES
> > +++ b/generic/lib/SOURCES
> > @@ -1,4 +1,5 @@
> > async/prefetch.cl
> > +async/wait_group_events.cl
> > atomic/atomic_impl.ll
> > cl_khr_global_int32_base_atomics/atom_add.cl
> > cl_khr_global_int32_base_atomics/atom_dec.cl
> > diff --git a/generic/lib/async/wait_group_events.cl b/generic/lib/async/wait_group_events.cl
> > new file mode 100644
> > index 0000000..05c9d58
> > --- /dev/null
> > +++ b/generic/lib/async/wait_group_events.cl
> > @@ -0,0 +1,5 @@
> > +#include <clc/clc.h>
> > +
> > +_CLC_DEF void wait_group_events(int num_events, event_t *event_list) {
> > +  barrier(CLK_LOCAL_MEM_FENCE | CLK_GLOBAL_MEM_FENCE);
> > +}
> > -- 
> > 1.8.5.5
> > 
> > 
> > _______________________________________________
> > Libclc-dev mailing list
> > Libclc-dev at pcc.me.uk
> > http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev
> 
> 
> _______________________________________________
> Libclc-dev mailing list
> Libclc-dev at pcc.me.uk
> http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev

-- 
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/libclc-dev/attachments/20140924/d3d187e5/attachment.sig>


More information about the Libclc-dev mailing list