[libclc] [libclc] update __clc_mem_fence: add MemorySemantic arg and use __builtin_amdgcn_fence for AMDGPU (PR #152275)
Wenju He via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 11 17:47:20 PDT 2025
================
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CLC_MEM_FENCE_CLC_MEM_SEMANTIC_H__
+#define __CLC_MEM_FENCE_CLC_MEM_SEMANTIC_H__
+
+// The memory or address space to which the memory ordering is applied.
+typedef enum MemorySemantic {
+ MEMORY_PRIVATE = 1 << 0,
+ MEMORY_GLOBAL = 1 << 1,
+ MEMORY_CONSTANT = 1 << 2,
+ MEMORY_LOCAL = 1 << 3,
+ MEMORY_GENERIC = 1 << 4,
+} MemorySemantic;
----------------
wenju-he wrote:
> I'd prefer `MemorySemantics` - plural - as you can combine multiple in the same operation. This is also what the SPIR-V spec calls them.
done in https://github.com/llvm/llvm-project/pull/152275/commits/001cec4941559bbdf0be8a1e0441509cdddbd25c
https://github.com/llvm/llvm-project/pull/152275
More information about the cfe-commits
mailing list