diff --git a/libclc/opencl/include/clc/opencl/synchronization/utils.h b/libclc/opencl/include/clc/opencl/synchronization/utils.h index a8841658598c1..a4f06ba8da6ac 100644 --- a/libclc/opencl/include/clc/opencl/synchronization/utils.h +++ b/libclc/opencl/include/clc/opencl/synchronization/utils.h @@ -13,16 +13,15 @@ #include #include -_CLC_INLINE int __opencl_get_memory_scope(cl_mem_fence_flags flag) { - int memory_scope = 0; +static _CLC_INLINE int __opencl_get_memory_scope(cl_mem_fence_flags flag) { if (flag & CLK_GLOBAL_MEM_FENCE) - memory_scope |= __MEMORY_SCOPE_DEVICE; + return __MEMORY_SCOPE_DEVICE; if (flag & CLK_LOCAL_MEM_FENCE) - memory_scope |= __MEMORY_SCOPE_WRKGRP; - return memory_scope; + return __MEMORY_SCOPE_WRKGRP; + return __MEMORY_SCOPE_SINGLE; } -_CLC_INLINE __CLC_MemorySemantics +static _CLC_INLINE __CLC_MemorySemantics __opencl_get_memory_semantics(cl_mem_fence_flags flag) { if ((flag & CLK_LOCAL_MEM_FENCE) && (flag & CLK_GLOBAL_MEM_FENCE)) return __CLC_MEMORY_LOCAL | __CLC_MEMORY_GLOBAL;