[Beignet] [PATCH 07/22 V2] Add the sync module into the libocl

junyan.he at inbox.com junyan.he at inbox.com
Sun Aug 31 19:09:28 PDT 2014


From: Junyan He <junyan.he at linux.intel.com>

Signed-off-by: Junyan He <junyan.he at linux.intel.com>
---
 backend/src/libocl/include/ocl_sync.h |   18 ++++++++++++++++++
 backend/src/libocl/src/ocl_sync.cl    |   14 ++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 backend/src/libocl/include/ocl_sync.h
 create mode 100644 backend/src/libocl/src/ocl_sync.cl

diff --git a/backend/src/libocl/include/ocl_sync.h b/backend/src/libocl/include/ocl_sync.h
new file mode 100644
index 0000000..f983824
--- /dev/null
+++ b/backend/src/libocl/include/ocl_sync.h
@@ -0,0 +1,18 @@
+#ifndef __OCL_SYNC_H__
+#define __OCL_SYNC_H__
+
+#include "ocl_types.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// Synchronization functions
+/////////////////////////////////////////////////////////////////////////////
+#define CLK_LOCAL_MEM_FENCE  (1 << 0)
+#define CLK_GLOBAL_MEM_FENCE (1 << 1)
+
+typedef uint cl_mem_fence_flags;
+void barrier(cl_mem_fence_flags flags);
+void mem_fence(cl_mem_fence_flags flags);
+void read_mem_fence(cl_mem_fence_flags flags);
+void write_mem_fence(cl_mem_fence_flags flags);
+
+#endif  /* __OCL_SYNC_H__ */
diff --git a/backend/src/libocl/src/ocl_sync.cl b/backend/src/libocl/src/ocl_sync.cl
new file mode 100644
index 0000000..3489450
--- /dev/null
+++ b/backend/src/libocl/src/ocl_sync.cl
@@ -0,0 +1,14 @@
+#include "ocl_sync.h"
+
+void __gen_ocl_barrier_local(void);
+void __gen_ocl_barrier_global(void);
+void __gen_ocl_barrier_local_and_global(void);
+
+void mem_fence(cl_mem_fence_flags flags) {
+}
+
+void read_mem_fence(cl_mem_fence_flags flags) {
+}
+
+void write_mem_fence(cl_mem_fence_flags flags) {
+}
-- 
1.7.9.5





More information about the Beignet mailing list