diff --git a/sycl/include/CL/sycl/detail/kernel_desc.hpp b/sycl/include/CL/sycl/detail/kernel_desc.hpp index 87359ff6c779b..7db5b75386e17 100644 --- a/sycl/include/CL/sycl/detail/kernel_desc.hpp +++ b/sycl/include/CL/sycl/detail/kernel_desc.hpp @@ -59,8 +59,12 @@ template struct SpecConstantInfo { #if __cplusplus >= 201703L // Translates SYCL 2020 specialization constant type to its name. template const char *get_spec_constant_symbolic_ID() { +#ifdef SYCL_LANGUAGE_VERSION return __builtin_unique_stable_name( specialization_id_name_generator); +#else + return ""; +#endif } #endif