Skip to content

Commit defc38b

Browse files
[SYCL] Fix compilation fail on Windows (#6257)
* Don't bring std::max into the scope, we already have some max * the same fix in usm.hpp
1 parent 0f99c6a commit defc38b

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

sycl/include/CL/sycl/usm.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ T *aligned_alloc_device(
174174
size_t Alignment, size_t Count, const device &Dev, const context &Ctxt,
175175
const property_list &PropList = {},
176176
const detail::code_location CodeLoc = detail::code_location::current()) {
177-
return static_cast<T *>(aligned_alloc_device(std::max(Alignment, alignof(T)),
177+
return static_cast<T *>(aligned_alloc_device(max(Alignment, alignof(T)),
178178
Count * sizeof(T), Dev, Ctxt,
179179
PropList, CodeLoc));
180180
}
@@ -244,7 +244,7 @@ T *aligned_alloc_shared(
244244
size_t Alignment, size_t Count, const device &Dev, const context &Ctxt,
245245
const property_list &PropList = {},
246246
const detail::code_location CodeLoc = detail::code_location::current()) {
247-
return static_cast<T *>(aligned_alloc_shared(std::max(Alignment, alignof(T)),
247+
return static_cast<T *>(aligned_alloc_shared(max(Alignment, alignof(T)),
248248
Count * sizeof(T), Dev, Ctxt,
249249
PropList, CodeLoc));
250250
}
@@ -281,7 +281,7 @@ T *aligned_alloc(
281281
size_t Alignment, size_t Count, const device &Dev, const context &Ctxt,
282282
usm::alloc Kind, const property_list &PropList = {},
283283
const detail::code_location CodeLoc = detail::code_location::current()) {
284-
return static_cast<T *>(aligned_alloc(std::max(Alignment, alignof(T)),
284+
return static_cast<T *>(aligned_alloc(max(Alignment, alignof(T)),
285285
Count * sizeof(T), Dev, Ctxt, Kind,
286286
PropList, CodeLoc));
287287
}

sycl/include/CL/sycl/usm/usm_allocator.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ class usm_allocator {
116116
}
117117

118118
private:
119-
constexpr size_t getAlignment() const {
120-
return std::max(alignof(T), Alignment);
121-
}
119+
constexpr size_t getAlignment() const { return max(alignof(T), Alignment); }
122120

123121
template <class U, usm::alloc AllocKindU, size_t AlignmentU>
124122
friend class usm_allocator;

0 commit comments

Comments
 (0)