[libclc] [libclc] Add atomic_init, atomic_flag_clear and atomic_flag_test_and_set (PR #168329)

Wenju He via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 23 22:44:39 PST 2025


================
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// 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/atomic/clc_atomic_flag_clear.h>
+#include <clc/atomic/clc_atomic_store.h>
+
+#define __CLC_ATOMIC_FLAG_FALSE 0
+
+#define __CLC_DEFINE_ATOMIC_FLAG_CLEAR(ADDRSPACE)                              \
+  _CLC_OVERLOAD _CLC_DEF void __clc_atomic_flag_clear(                         \
+      volatile ADDRSPACE int *Ptr, int MemoryOrder, int MemoryScope) {         \
----------------
wenju-he wrote:

> clc versions at least shouldn't be volatile?

removed volatile in https://github.com/llvm/llvm-project/pull/168329/commits/1d50e74036782ceb61d20c8092c77caf67b87766

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


More information about the cfe-commits mailing list