Skip to content

Commit 2e3f61e

Browse files
authored
fixed async barrier definition clash with predefined macro (#6172)
Fixed async barrier definition clash with max macro defined in some headers on windows by temporarily undefining the macro. The issue was reported here: #5303 (comment)
1 parent 3fe5f10 commit 2e3f61e

File tree

1 file changed

+6
-0
lines changed
  • sycl/include/sycl/ext/oneapi/experimental/cuda

1 file changed

+6
-0
lines changed

sycl/include/sycl/ext/oneapi/experimental/cuda/barrier.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,13 @@ class barrier {
133133
#endif
134134
}
135135

136+
// On Windows certain headers define macros min/max
137+
#pragma push_macro("max")
138+
#ifdef max
139+
#undef max
140+
#endif
136141
static constexpr uint64_t max() { return (1 << 20) - 1; }
142+
#pragma pop_macro("max")
137143
};
138144

139145
} // namespace sycl::ext::oneapi::experimental::cuda

0 commit comments

Comments
 (0)