[libclc] [libclc] update __clc_mem_fence: add MemorySemantic arg and use __builtin_amdgcn_fence for AMDGPU (PR #152275)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 6 17:51:41 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 = 0x1,
+  MEMORY_LOCAL = 0x2,
+  MEMORY_GLOBAL = 0x4,
+  MEMORY_CONSTANT = 0x8,
+  MEMORY_GENERIC = 0x10
----------------
arsenm wrote:

This is a bit mask, so write out as 1 << N for the values? 

https://github.com/llvm/llvm-project/pull/152275


More information about the cfe-commits mailing list