-
Notifications
You must be signed in to change notification settings - Fork 801
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
sycl::half arithmetic operator promotes results to float
To Reproduce
$cat test.cpp
#include <type_traits>
#include <sycl/sycl.hpp>
int main() {
sycl::queue myQueue;
myQueue.submit([&](sycl::handler& cgh) {
sycl::device dev = myQueue.get_device();
if (dev.has(sycl::aspect::fp16)) {
cgh.single_task([=]{
static_assert(std::is_same_v<decltype(sycl::half(1)), sycl::half>,"Not a sycl::half");
static_assert(std::is_same_v<decltype(sycl::half(1) * sycl::half(1) ), sycl::half>,"Not a sycl::half");
});
};
});
return 0;
}
$dpcpp test.cpp
test.cpp:11:13: error: static_assert failed due to requirement 'std::is_same_v<float, sycl::detail::half_impl::half>' "Not a sycl::half"
static_assert(std::is_same_v<decltype(sycl::half(1) * sycl::half(1) ), sycl::half>,"Not a sycl::half");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Environment (please complete the following information):
- OS: Linux
- Target device and vendor: Intel GPU
- DPC++ version: Intel(R) oneAPI DPC++/C++ Compiler 2022.1.0 (2022.1.0.20220224)
zjin-lcf
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working