Skip to content

Commit 0299ac1

Browse files
authored
[SYCL][NFC] Fix min/max conflict on Windows (#7768)
Fix conflict with min/max macro on Windows in a similar way as in the #1339 This is needed to fix post-commit failure - https://github.com/intel/llvm/actions/runs/3687931956/jobs/6242122359
1 parent 4c203bb commit 0299ac1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sycl/include/sycl/detail/group_sort_impl.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ uint32_t getBucketValue(ValT value, uint32_t radix_iter) {
413413
}
414414
template <typename ValT> ValT getDefaultValue(bool is_comp_asc) {
415415
if (is_comp_asc)
416-
return std::numeric_limits<ValT>::max();
416+
return (std::numeric_limits<ValT>::max)();
417417
else
418418
return std::numeric_limits<ValT>::lowest();
419419
}

sycl/include/sycl/ext/oneapi/experimental/group_helpers_sorters.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class radix_sorter {
121121
radix_sorter(sycl::span<std::byte, Extent> scratch_,
122122
const std::bitset<sizeof(ValT) *CHAR_BIT> mask =
123123
std::bitset<sizeof(ValT) * CHAR_BIT>(
124-
std::numeric_limits<unsigned long long>::max()))
124+
(std::numeric_limits<unsigned long long>::max)()))
125125
: scratch(scratch_.data()), scratch_size(scratch_.size()) {
126126
static_assert((std::is_arithmetic<ValT>::value ||
127127
std::is_same<ValT, sycl::half>::value ||
@@ -187,8 +187,8 @@ class radix_sorter {
187187
sycl::range<dimensions> local_range) {
188188
// Scope is not important so far
189189
(void)scope;
190-
return std::max(local_range.size() * sizeof(ValT),
191-
local_range.size() * (1 << bits) * sizeof(uint32_t));
190+
return (std::max)(local_range.size() * sizeof(ValT),
191+
local_range.size() * (1 << bits) * sizeof(uint32_t));
192192
}
193193
};
194194

0 commit comments

Comments
 (0)