Open nilsfriess opened 1 year ago
Note: This is related to Khronos internal issue 455.
constexpr bitcast needs compiler support, no way to do in C++17, maybe 23; so the only way is special case half so marray is not constexpr for half, also affects vec class
According to the spec, the constructors of
marray
should beconstexpr
. Also,marray
should acceptsycl::half
as element type (see 4.14.3 where it says "The element type parameter, DataT, must be a numeric type as it is defined by C++ standard.";sycl::half
is a numeric type).Hence, the following should compile
However, the spec does not require
half
to be constexpr-constructible and in C++17 this is basically impossible to achieve without using builtins that allow compile time bitcasts.How should implementations handle this? Should there be a non-constexpr
marray
overload forDataT == sycl::half
?