llvm
afd0d780 - [SYCL] Decouple <sycl/builtins.hpp> from <sycl/usm.hpp> (#22312)

Commit
1 day ago
[SYCL] Decouple <sycl/builtins.hpp> from <sycl/usm.hpp> (#22312) <sycl/usm.hpp> transitively pulled in <sycl/builtins.hpp> (and through it <sycl/half_type.hpp>, <algorithm>, vec/marray definitions, libc device declarations like __assert_fail, etc.). User code and tests came to rely on this implicit re-export chain. Once `sycl_khr_split_headers` ships, <sycl/usm.hpp> is meant to deliver only USM symbols. Keeping the <sycl/builtins.hpp> include would either defeat the purpose of split-headers or force a source break later. Fix the dependency now: * Drop <sycl/builtins.hpp> and <algorithm> from <sycl/usm.hpp>. * Replace four unqualified max(...) callsites (which previously resolved to sycl::max via builtins) with inline ternaries. * Add the explicit headers each affected test/common helper actually needs: - <algorithm> for std::any_of / all_of / find / sort etc. - <sycl/half_type.hpp> for sycl::half as a complete type. - <sycl/vector.hpp> for sycl::vec. - <sycl/marray.hpp> for sycl::marray. - <sycl/builtins.hpp> for sycl math builtins or device-side assert / libc declarations.
Author
Parents
Loading