-
Notifications
You must be signed in to change notification settings - Fork 803
Description
Describe the bug
USM allocation functions aligned_alloc
templated on allocation type T returns non-null when the alignment argument is not a power of 2 (source ), which conflicts with the SYCL2020 specification 4.8.3 USM allocations: Some of the allocation functions take an explicit alignment parameter. Like std::aligned_alloc, these functions return nullptr if the alignment is not supported by the implementation.
To Reproduce
-
source code
https://github.com/intel/llvm/blob/e75f21902a944c2776c43082d3f01843426a9525/sycl/test-e2e/USM/align.cpp
This test checks thataligned_alloc_xxx
andaligned_alloc_xxx<T>
return nullptr when the alignment argument is not a power of 2 -
Specify the command which should be used to compile the program
compile:clang++ -fsycl -fsycl-targets=spir64 align.cpp -o align.cpp.tmp.out
run:env ONEAPI_DEVICE_SELECTOR=opencl:cpu align.cpp.tmp.out
-
Indicate what is wrong and what was expected
CI SYCL E2E test shows that the non-templatedaligned_alloc_xxx
cases return nullptr as expected, but the templatedaligned_alloc_xxx<T>
cases return non-null
Environment (please complete the following information):
- OS: Linux
- Target device and vendor: Intel CPU
- DPC++ version: clang version 18.0.0
Additional context
Add any other context about the problem here.