Skip to content

Commit 6fd7ff4

Browse files
[Backport to llvm_release_150] Explicitly cast OCLMemOrderKind members from std::memory_order in C++20 case (#3257)
Backport of PR #3254 into `llvm_release_150`. All commits applied cleanly. Co-authored-by: Jakub Jakacki <[email protected]>
1 parent 66d53a4 commit 6fd7ff4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/SPIRV/OCLUtil.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ enum OCLScopeKind {
9595
// the corresponding constants from 'std::memory_order' enum.
9696
enum OCLMemOrderKind {
9797
#if __cplusplus >= 202002L
98-
OCLMO_relaxed = std::memory_order_relaxed,
99-
OCLMO_acquire = std::memory_order_acquire,
100-
OCLMO_release = std::memory_order_release,
101-
OCLMO_acq_rel = std::memory_order_acq_rel,
102-
OCLMO_seq_cst = std::memory_order_seq_cst
98+
OCLMO_relaxed = static_cast<int>(std::memory_order::relaxed),
99+
OCLMO_acquire = static_cast<int>(std::memory_order::acquire),
100+
OCLMO_release = static_cast<int>(std::memory_order::release),
101+
OCLMO_acq_rel = static_cast<int>(std::memory_order::acq_rel),
102+
OCLMO_seq_cst = static_cast<int>(std::memory_order::seq_cst)
103103
#else
104104
OCLMO_relaxed = std::memory_order::memory_order_relaxed,
105105
OCLMO_acquire = std::memory_order::memory_order_acquire,

0 commit comments

Comments
 (0)