summaryrefslogtreecommitdiff
path: root/r600/lib/synchronization/barrier.cl
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-07-08 17:26:39 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-07-08 17:26:39 +0000
commitefd6599fc741c849dfce8e1e312e28fb33857315 (patch)
tree1ef1ef040215df64b9971b7b336edf558bcda43f /r600/lib/synchronization/barrier.cl
parenta3c59c98a5ae7d4af0c2ac0194422a466a8891cc (diff)
Implement barrier() builtin
Reviewed and Tested-by: Aaron Watry <awatry@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@185837 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'r600/lib/synchronization/barrier.cl')
-rw-r--r--r600/lib/synchronization/barrier.cl15
1 files changed, 15 insertions, 0 deletions
diff --git a/r600/lib/synchronization/barrier.cl b/r600/lib/synchronization/barrier.cl
new file mode 100644
index 0000000..ac0b4b3
--- /dev/null
+++ b/r600/lib/synchronization/barrier.cl
@@ -0,0 +1,15 @@
+
+#include <clc/clc.h>
+
+void barrier_local(void);
+void barrier_global(void);
+
+void barrier(cl_mem_fence_flags flags) {
+ if (flags & CLK_LOCAL_MEM_FENCE) {
+ barrier_local();
+ }
+
+ if (flags & CLK_GLOBAL_MEM_FENCE) {
+ barrier_global();
+ }
+}