File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -111,3 +111,13 @@ def validate_usm_type_arg():
111
111
dpctl .utils .validate_usm_type ("inv" , allow_none = True )
112
112
with pytest .raises (ValueError ):
113
113
dpctl .utils .validate_usm_type ("inv" , allow_none = False )
114
+
115
+
116
+ def test_onetrace_enabled ():
117
+ import os
118
+
119
+ v_name = "PTI_ENABLE_COLLECTION"
120
+ v_v = os .getenv (v_name , None )
121
+ with dpctl .utils .onetrace_enabled ():
122
+ assert os .getenv (v_name , None ) == "1"
123
+ assert os .getenv (v_name , None ) == v_v
Original file line number Diff line number Diff line change @@ -25,12 +25,14 @@ def onetrace_enabled():
25
25
N.B.: Proper working of this utility assumes that Python interpreter
26
26
has been launched by `onetrace` tool from intel/pti-gpu project.
27
27
28
- .. Example:: bash
28
+ :Example:
29
+ Launch the Python interpreter using `onetrace` tool: ::
29
30
30
31
$ onetrace --conditional-collection -v -t --demangle \
31
32
python script.py
32
33
33
- .. Example:: bash
34
+ Now using the context manager in the Python sessions enables
35
+ data collection and its output for every offloaded kernel ::
34
36
35
37
import dpctl.tensor as dpt
36
38
from dpctl.utils import onetrace_enabled
You can’t perform that action at this time.
0 commit comments