Skip to content

Commit 7ae8283

Browse files
author
Alexander Batashev
committed
Address feedback
1 parent 5ea7a2f commit 7ae8283

File tree

4 files changed

+28
-32
lines changed

4 files changed

+28
-32
lines changed

sycl/doc/EnvironmentVariables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ subject to change. Do not rely on these variables in production code.
4747
| `SYCL_CACHE_THRESHOLD` | Positive integer | Cache eviction threshold in days (default value is 7 for 1 week). Set to 0 for disabling time-based cache eviction. |
4848
| `SYCL_CACHE_MIN_DEVICE_IMAGE_SIZE` | Positive integer | Minimum size of device code image in bytes which is reasonable to cache on disk because disk access operation may take more time than do JIT compilation for it. Default value is 0 to cache all images. |
4949
| `SYCL_CACHE_MAX_DEVICE_IMAGE_SIZE` | Positive integer | Maximum size of device image in bytes which is cached. Too big kernels may overload disk too fast. Default value is 1 GB. |
50+
| `INTEL_ENABLE_OFFLOAD_ANNOTATIONS` | Any(\*) | Enables ITT Annotations support for SYCL runtime. This variable should only be used by tools, that support ITT Annotations. |
5051

5152
`(*) Note: Any means this environment variable is effective when set to any non-null value.`
5253

sycl/doc/extensions/ITTAnnotations/ITTAnnotations.rst renamed to sycl/doc/ITTAnnotations.md

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
ITT annotations support
2-
=======================
1+
# ITT annotations support
32

43
This extension enables a set of functions implementing
54
the Instrumentation and Tracing Technology (ITT) functionality
@@ -8,63 +7,59 @@ in SYCL device code.
87
There are three sets of functions defined by this extension,
98
and they serve different purposes.
109

11-
User APIs
12-
---------
10+
## User APIs
1311

1412
The user code calling these functions must include the corresponding header
15-
file(s) provided by ``ittnotify`` project (TBD: reference ITT repo here).
13+
file(s) provided by `ittnotify` project (TBD: reference ITT repo here).
1614

17-
These functions are named using ``__itt_notify_`` prefix.
15+
These functions are named using `__itt_notify_` prefix.
1816

19-
Stub APIs
20-
---------
17+
## Stub APIs
2118

2219
These functions are not defined in any header file, and their declarations
2320
follow exactly the declarations of the corresponding user APIs, except that
24-
they have an extra ``_stub`` suffix in their names.
21+
they have an extra `_stub` suffix in their names.
2522

2623
These functions implement the ITT functionality in a way that allows
2724
the tools, such as Intel(R) Inspector, to recognize the ITT annotations
2825
and run their analysis methods based on that.
2926

30-
For SYCL device code these functions are implemented as ``noinline`` and
31-
``optnone`` functions so that the corresponding calls may be distinguished
27+
For SYCL device code these functions are implemented as `noinline` and
28+
`optnone` functions so that the corresponding calls may be distinguished
3229
in the execution trace. This is just one way for implementing them,
3330
and the actual implementation may change in future.
3431

35-
Compiler wrapper APIs
36-
---------------------
32+
## Compiler wrapper APIs
3733

3834
These functions are not defined in any header file, and they are supposed
3935
to be called from the compiler generated code. These thin wrappers
4036
just provide a convenient way for compilers to produce ITT annotations
4137
without generating too much code in the compilers' IR.
4238

43-
These functions have ``_wrapper`` suffix in their names.
39+
These functions have `_wrapper` suffix in their names.
4440

45-
Example
46-
~~~~~~~
41+
**Example**
4742

48-
.. code: c++
49-
DEVICE_EXTERN_C void __itt_offload_wi_start_stub(
50-
size_t[3], size_t, uint32_t);
43+
```c++
44+
DEVICE_EXTERN_C void __itt_offload_wi_start_stub(
45+
size_t[3], size_t, uint32_t);
5146

52-
DEVICE_EXTERN_C void __itt_offload_wi_start_wrapper() {
53-
if (__spirv_SpecConstant(0xFF747469, 0)) {
54-
size_t GroupID[3] = ...;
55-
size_t WIId = ...;
56-
uint32_t WGSize = ...;
57-
__itt_offload_wi_start_stub(GroupID, WIId, WGSize);
58-
}
59-
}
47+
DEVICE_EXTERN_C void __itt_offload_wi_start_wrapper() {
48+
if (__spirv_SpecConstant(0xFF747469, 0)) {
49+
size_t GroupID[3] = ...;
50+
size_t WIId = ...;
51+
uint32_t WGSize = ...;
52+
__itt_offload_wi_start_stub(GroupID, WIId, WGSize);
53+
}
54+
}
55+
```
6056
61-
A compiler may generate a simple call to ``__itt_offload_wi_start_wrapper``
57+
A compiler may generate a simple call to `__itt_offload_wi_start_wrapper`
6258
to annotate a kernel entry point. Compare this to the code inside the wrapper
6359
function, which a compiler would have to generate if there were no such
6460
a wrapper.
6561
66-
Conditional compilation
67-
-----------------------
62+
## Conditional compilation
6863
6964
Data Parallel C++ compiler automatically instruments user code through
7065
SPIRITTAnnotations LLVM pass, which is enabled for targets, that natively
@@ -78,7 +73,7 @@ enabled, we expect that the overall effect of the annotations will be minimized
7873
by the dead code elimination optimization(s) made by the device compilers.
7974
8075
For this purpose we reserve a 1-byte specialization constant numbered
81-
``4285822057`` (``0xFF747469``). The users/tools/runtimes should set this
76+
`4285822057` (`0xFF747469`). The users/tools/runtimes should set this
8277
specialization constant to non-zero value to enable the ITT annotations
8378
in SYCL device code.
8479

sycl/doc/extensions/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ DPC++ extensions status:
3636
| [Unified Shared Memory](USM/USM.adoc) | Supported(OpenCL) | |
3737
| [Use Pinned Memory Property](UsePinnedMemoryProperty/UsePinnedMemoryPropery.adoc) | Supported | |
3838
| [Level-Zero backend specification](LevelZeroBackend/LevelZeroBackend.md) | Supported | |
39-
| [ITT annotations support](ITTAnnotations/ITTAnnotations.rst) | Supported | |
4039
| [SYCL_EXT_ONEAPI_DEVICE_IF](DeviceIf/device_if.asciidoc) | Proposal | |
4140
| [SYCL_INTEL_group_sort](GroupAlgorithms/SYCL_INTEL_group_sort.asciidoc) | Proposal | |
4241
| [Invoke SIMD](InvokeSIMD/InvokeSIMD.asciidoc) | Proposal | |

sycl/doc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ Developing oneAPI DPC++ Compiler
3939
MultiTileCardWithLevelZero
4040
OptionalDeviceFeatures
4141
SYCLInstrumentationUsingXPTI
42+
ITTAnnotations
4243

0 commit comments

Comments
 (0)