@@ -17,9 +17,9 @@ ordinal number. This complicates the design, as the compiler
17
17
18
18
Simple source code example:
19
19
20
- ```
20
+ ``` c++
21
21
class MyInt32Const ;
22
- ...
22
+ // ...
23
23
sycl::program p (q.get_context());
24
24
sycl::ONEAPI::experimental::spec_constant<int32_t, MyInt32Const> i32 =
25
25
p.set_spec_constant<MyInt32Const >(rt_val);
@@ -34,7 +34,7 @@ class MyInt32Const;
34
34
acc[ 0] = i32.get();
35
35
});
36
36
});
37
- ...
37
+ // ...
38
38
```
39
39
40
40
## Design
@@ -46,9 +46,9 @@ primitive numeric types. POD types support is described further in the document.
46
46
47
47
Key `spec_constant::get()` function implementation for the device code:
48
48
49
- ```
49
+ ```c++
50
50
template <typename T, typename ID = T> class spec_constant {
51
- ...
51
+ // ...
52
52
public:
53
53
T get() const { // explicit access.
54
54
#ifdef __SYCL_DEVICE_ONLY__
@@ -87,9 +87,9 @@ After this pass the sycl-post-link tool will output the
87
87
attaching this info to the device binary image via the offload wrapper tool as
88
88
a property set:
89
89
90
- ```
90
+ ``` c++
91
91
struct pi_device_binary_struct {
92
- ...
92
+ // ...
93
93
// Array of preperty sets; e.g. specialization constants symbol-int ID map is
94
94
// propagated to runtime with this mechanism.
95
95
pi_device_binary_property_set PropertySetsBegin;
@@ -152,7 +152,7 @@ unaware of the clang-specific built-ins.
152
152
Before JIT-ing a program, the runtime "flushes" the spec constants: it iterates
153
153
through the value map and invokes the
154
154
155
- ```
155
+ ``` c++
156
156
pi_result piextProgramSetSpecializationConstant (pi_program prog,
157
157
pi_uint32 spec_id,
158
158
size_t spec_size,
@@ -167,7 +167,7 @@ Plugin Interface function for each entry, taking the `spec_id` from the ID map.
167
167
168
168
Say, the POD type is
169
169
170
- ```
170
+ ```c++
171
171
struct A {
172
172
int x;
173
173
float y;
@@ -181,7 +181,7 @@ struct POD {
181
181
182
182
and the user says
183
183
184
- ```
184
+ ``` c++
185
185
POD gold{
186
186
{
187
187
{ goldi, goldf },
0 commit comments