@@ -840,7 +840,7 @@ inline const char *get_spec_constant_symbolic_ID<id_float>() {
840
840
} //namespace sycl
841
841
} // __SYCL_INLINE_NAMESPACE(cl)
842
842
843
- // get_spec_constant_symbolic_ID
843
+ // Detailed description of this header is provided below in corresponding RT section
844
844
#include <CL/sycl/detail/spec_const_integration.hpp>
845
845
```
846
846
@@ -939,6 +939,7 @@ namespace sycl {
939
939
}
940
940
}
941
941
942
+ #include <CL/sycl/detail/spec_const_integration.hpp>
942
943
```
943
944
944
945
### DPC++ runtime
@@ -1002,6 +1003,28 @@ In order to properly set default values of specialization constants,
1002
1003
is used to either fully or partially initialize the buffer with specialization
1003
1004
constant values.
1004
1005
1006
+ #### sycl/detail/spec_const_integration.hpp header file
1007
+
1008
+ DPC++ RT needs to have access to a mapping between ` specialization_id ` variables
1009
+ and corresponding unique symbolic IDs used by the compiler. As already stated
1010
+ above, we use integration footer for that by providing template specializations
1011
+ of ` get_spec_constant_symbolic_ID ` function template.
1012
+
1013
+ The tricky thing here, is that C++ specification states the following:
1014
+
1015
+ > Specialization must be declared before the first use that would cause implicit
1016
+ > instantiation, in every translation unit where such use occurs.
1017
+ >
1018
+ > [ cppreference] [ cppreference-template-specialization ]
1019
+
1020
+ [ cppreference-template-specialization ] : https://en.cppreference.com/w/cpp/language/template_specialization
1021
+
1022
+ That means that all users of ` get_spec_constant_symbolic_ID ` has to appear
1023
+ * after* we defined all ` get_spec_constant_symbolic_ID ` template specializations.
1024
+
1025
+ ` sycl/detail/spec_const/integration.hpp ` header file is intended to be a
1026
+ location for such methods/classes/functions.
1027
+
1005
1028
### SPIRV-LLVM-Translator
1006
1029
1007
1030
Given the ` __spirv_SpecConstant ` intrinsic calls produced by the
0 commit comments