25 namespace ext::oneapi::experimental {
28 using compile_program_error::compile_program_error;
31 template <
typename T,
typename ID = T>
33 "Specialization constats extension is deprecated,
use SYCL 2020"
34 " specialization constants
instead")
40 #ifndef __SYCL_DEVICE_ONLY__
42 spec_constant(T Cst) : Val(Cst) {}
46 char padding[
sizeof(T)];
47 #endif // __SYCL_DEVICE_ONLY__
50 template <
typename V = T>
51 typename sycl::detail::enable_if_t<std::is_arithmetic<V>::value, V>
53 #ifdef __SYCL_DEVICE_ONLY__
54 const char *TName = __builtin_sycl_unique_stable_name(ID);
55 return __sycl_getScalarSpecConstantValue<T>(TName);
58 #endif // __SYCL_DEVICE_ONLY__
61 template <
typename V = T>
62 typename sycl::detail::enable_if_t<std::is_class<V>::value &&
63 std::is_pod<V>::value,
66 #ifdef __SYCL_DEVICE_ONLY__
67 const char *TName = __builtin_sycl_unique_stable_name(ID);
68 return __sycl_getCompositeSpecConstantValue<T>(TName);
71 #endif // __SYCL_DEVICE_ONLY__