Skip to content

Commit 4f864cd

Browse files
committed
[DOC] Enable syntax highlighting
1 parent 7138a41 commit 4f864cd

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

sycl/doc/SpecializationConstants.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ ordinal number. This complicates the design, as the compiler
1717

1818
Simple source code example:
1919

20-
```
20+
```c++
2121
class MyInt32Const;
22-
...
22+
// ...
2323
sycl::program p(q.get_context());
2424
sycl::ONEAPI::experimental::spec_constant<int32_t, MyInt32Const> i32 =
2525
p.set_spec_constant<MyInt32Const>(rt_val);
@@ -34,7 +34,7 @@ class MyInt32Const;
3434
acc[0] = i32.get();
3535
});
3636
});
37-
...
37+
// ...
3838
```
3939
4040
## Design
@@ -46,9 +46,9 @@ primitive numeric types. POD types support is described further in the document.
4646
4747
Key `spec_constant::get()` function implementation for the device code:
4848
49-
```
49+
```c++
5050
template <typename T, typename ID = T> class spec_constant {
51-
...
51+
// ...
5252
public:
5353
T get() const { // explicit access.
5454
#ifdef __SYCL_DEVICE_ONLY__
@@ -87,9 +87,9 @@ After this pass the sycl-post-link tool will output the
8787
attaching this info to the device binary image via the offload wrapper tool as
8888
a property set:
8989

90-
```
90+
```c++
9191
struct pi_device_binary_struct {
92-
...
92+
// ...
9393
// Array of preperty sets; e.g. specialization constants symbol-int ID map is
9494
// propagated to runtime with this mechanism.
9595
pi_device_binary_property_set PropertySetsBegin;
@@ -152,7 +152,7 @@ unaware of the clang-specific built-ins.
152152
Before JIT-ing a program, the runtime "flushes" the spec constants: it iterates
153153
through the value map and invokes the
154154

155-
```
155+
```c++
156156
pi_result piextProgramSetSpecializationConstant(pi_program prog,
157157
pi_uint32 spec_id,
158158
size_t spec_size,
@@ -167,7 +167,7 @@ Plugin Interface function for each entry, taking the `spec_id` from the ID map.
167167
168168
Say, the POD type is
169169
170-
```
170+
```c++
171171
struct A {
172172
int x;
173173
float y;
@@ -181,7 +181,7 @@ struct POD {
181181

182182
and the user says
183183

184-
```
184+
```c++
185185
POD gold{
186186
{
187187
{ goldi, goldf },

0 commit comments

Comments
 (0)