dpctl.utils Functions

Other Functions

dpctl.utils.onetrace_enabled()[source]

Enable onetrace collection for kernels executed in this context.

N.B.: Proper working of this utility assumes that Python interpreter has been launched by onetrace tool from intel/pti-gpu project.

Example:

Launch the Python interpreter using onetrace tool:

$ onetrace --conditional-collection -v -t --demangle python app.py

Now using the context manager in the Python sessions enables data collection and its output for every offloaded kernel

import dpctl.tensor as dpt
from dpctl.utils import onetrace_enabled

# onetrace output reporting on execution of the kernel
# should be seen, starting with "Device Timeline"
with onetrace_enabled():
    dpt.arange(100, dtype='int16')