[libclc] 5785568 - libclc: Remove target opencl copies of mem_fence (#185207)

via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 8 00:07:56 PST 2026


Author: Matt Arsenault
Date: 2026-03-08T09:07:52+01:00
New Revision: 5785568ca12c78b33c535a67f096c16c7f19dfca

URL: https://github.com/llvm/llvm-project/commit/5785568ca12c78b33c535a67f096c16c7f19dfca
DIFF: https://github.com/llvm/llvm-project/commit/5785568ca12c78b33c535a67f096c16c7f19dfca.diff

LOG: libclc: Remove target opencl copies of mem_fence (#185207)

Added: 
    libclc/opencl/lib/generic/mem_fence/fence.cl

Modified: 
    libclc/opencl/lib/amdgcn/SOURCES
    libclc/opencl/lib/generic/SOURCES

Removed: 
    libclc/opencl/lib/amdgcn/mem_fence/fence.cl
    libclc/opencl/lib/ptx-nvidiacl/SOURCES
    libclc/opencl/lib/ptx-nvidiacl/mem_fence/fence.cl


################################################################################
diff  --git a/libclc/opencl/lib/amdgcn/SOURCES b/libclc/opencl/lib/amdgcn/SOURCES
index caf08495e8dae..8771edfc28f48 100644
--- a/libclc/opencl/lib/amdgcn/SOURCES
+++ b/libclc/opencl/lib/amdgcn/SOURCES
@@ -1,5 +1,4 @@
 async/wait_group_events.cl
-mem_fence/fence.cl
 printf/__printf_alloc.cl
 subgroup/subgroup.cl
 synchronization/sub_group_barrier.cl

diff  --git a/libclc/opencl/lib/generic/SOURCES b/libclc/opencl/lib/generic/SOURCES
index 398e326ffe482..c29f79b82e882 100644
--- a/libclc/opencl/lib/generic/SOURCES
+++ b/libclc/opencl/lib/generic/SOURCES
@@ -175,6 +175,7 @@ math/tanh.cl
 math/tanpi.cl
 math/tgamma.cl
 math/trunc.cl
+mem_fence/fence.cl
 misc/shuffle.cl
 misc/shuffle2.cl
 relational/all.cl

diff  --git a/libclc/opencl/lib/amdgcn/mem_fence/fence.cl b/libclc/opencl/lib/generic/mem_fence/fence.cl
similarity index 100%
rename from libclc/opencl/lib/amdgcn/mem_fence/fence.cl
rename to libclc/opencl/lib/generic/mem_fence/fence.cl

diff  --git a/libclc/opencl/lib/ptx-nvidiacl/SOURCES b/libclc/opencl/lib/ptx-nvidiacl/SOURCES
deleted file mode 100644
index f20917346a3bc..0000000000000
--- a/libclc/opencl/lib/ptx-nvidiacl/SOURCES
+++ /dev/null
@@ -1 +0,0 @@
-mem_fence/fence.cl

diff  --git a/libclc/opencl/lib/ptx-nvidiacl/mem_fence/fence.cl b/libclc/opencl/lib/ptx-nvidiacl/mem_fence/fence.cl
deleted file mode 100644
index 38fb15c2c1de8..0000000000000
--- a/libclc/opencl/lib/ptx-nvidiacl/mem_fence/fence.cl
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#include <clc/mem_fence/clc_mem_fence.h>
-#include <clc/opencl/synchronization/utils.h>
-
-_CLC_DEF _CLC_OVERLOAD void mem_fence(cl_mem_fence_flags flags) {
-  int memory_scope = __MEMORY_SCOPE_WRKGRP;
-  int memory_order = __ATOMIC_ACQ_REL;
-  __CLC_MemorySemantics memory_semantics = __opencl_get_memory_semantics(flags);
-  __clc_mem_fence(memory_scope, memory_order, memory_semantics);
-}
-
-_CLC_DEF _CLC_OVERLOAD void read_mem_fence(cl_mem_fence_flags flags) {
-  int memory_scope = __MEMORY_SCOPE_WRKGRP;
-  int memory_order = __ATOMIC_ACQUIRE;
-  __CLC_MemorySemantics memory_semantics = __opencl_get_memory_semantics(flags);
-  __clc_mem_fence(memory_scope, memory_order, memory_semantics);
-}
-
-_CLC_DEF _CLC_OVERLOAD void write_mem_fence(cl_mem_fence_flags flags) {
-  int memory_scope = __MEMORY_SCOPE_WRKGRP;
-  int memory_order = __ATOMIC_RELEASE;
-  __CLC_MemorySemantics memory_semantics = __opencl_get_memory_semantics(flags);
-  __clc_mem_fence(memory_scope, memory_order, memory_semantics);
-}


        


More information about the cfe-commits mailing list