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

Tom Stellard thomas.stellard at amd.com
Fri Aug 8 14:40:53 PDT 2014


This is a simple default implemetation which just calls barrier().
---
 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        | 6 ++++++
 4 files changed, 9 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 b6adbba..f499e6d 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -126,6 +126,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 c8eed0c..3e847fe 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..01563d7
--- /dev/null
+++ b/generic/lib/async/wait_group_events.cl
@@ -0,0 +1,6 @@
+#include <clc/clc.h>
+
+_CLC_DEF void wait_group_events(int num_events, event_t *event_list) {
+  barrier(CLK_LOCAL_MEM_FENCE);
+  barrier(CLK_GLOBAL_MEM_FENCE);
+}
-- 
1.8.1.5




More information about the Libclc-dev mailing list