[Beignet] [PATCH 1/2] Add mem_fence built-in.

Yang Rong rong.r.yang at intel.com
Fri Jun 7 21:33:36 PDT 2013


According openCL spec, mem_fence is used to orders loads and stores of a work-item.
This is guarantee by hardware, so add empty mem_fence functions.

Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
 backend/src/ocl_stdlib.h |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/backend/src/ocl_stdlib.h b/backend/src/ocl_stdlib.h
index 013f4cc..46b81e1 100644
--- a/backend/src/ocl_stdlib.h
+++ b/backend/src/ocl_stdlib.h
@@ -1085,6 +1085,13 @@ INLINE void barrier(cl_mem_fence_flags flags) {
     __gen_ocl_barrier_global();
 }
 
+INLINE void mem_fence(cl_mem_fence_flags flags) {
+}
+INLINE void read_mem_fence(cl_mem_fence_flags flags) {
+}
+INLINE void write_mem_fence(cl_mem_fence_flags flags) {
+}
+
 /////////////////////////////////////////////////////////////////////////////
 // Force the compilation to SIMD8 or SIMD16
 /////////////////////////////////////////////////////////////////////////////
-- 
1.7.10.4



More information about the Beignet mailing list