15 #include <type_traits>
24 #if __cplusplus >= 201703L
27 get_specialization_constant() {
28 #ifdef __SYCL_DEVICE_ONLY__
29 return getSpecializationConstantOnDevice<S>();
32 throw cl::sycl::feature_not_supported(
33 "kernel_handler::get_specialization_constant() is not yet supported by "
35 PI_ERROR_INVALID_OPERATION);
36 #endif // __SYCL_DEVICE_ONLY__
38 #endif // __cplusplus >= 201703L
41 void __init_specialization_constants_buffer(
42 char *SpecializationConstantsBuffer =
nullptr) {
43 MSpecializationConstantsBuffer = SpecializationConstantsBuffer;
46 #ifdef __SYCL_DEVICE_ONLY__
47 #if __cplusplus >= 201703L
51 std::enable_if_t<std::is_fundamental_v<T>> * =
nullptr>
53 const char *SymbolicID = __builtin_sycl_unique_stable_id(S);
54 return __sycl_getScalar2020SpecConstantValue<T>(
55 SymbolicID, &S, MSpecializationConstantsBuffer);
60 std::enable_if_t<std::is_compound_v<T>> * =
nullptr>
62 const char *SymbolicID = __builtin_sycl_unique_stable_id(S);
63 return __sycl_getComposite2020SpecConstantValue<T>(
64 SymbolicID, &S, MSpecializationConstantsBuffer);
66 #endif // __cplusplus >= 201703L
67 #endif // __SYCL_DEVICE_ONLY__
69 char *MSpecializationConstantsBuffer =
nullptr;