dpctl.utils Functions
Other Functions
- dpctl.utils.intel_device_info(sycl_device)[source]
For Intel(R) GPU devices returns a dictionary with device architectural details, and an empty dictionary otherwise. The dictionary contains the following keys:
device_id: 32-bits device PCI identifier gpu_eu_count: Total number of execution units gpu_hw_threads_per_eu: Number of thread contexts in EU gpu_eu_simd_width: Physical SIMD width of EU gpu_slices: Total number of slices gpu_subslices_per_slice: Number of sub-slices per slice gpu_eu_count_per_subslice: Number of EUs in subslice max_mem_bandwidth: Maximum memory bandwidth in bytes/second
Unsupported descriptors are omitted from the dictionary. Descriptors other than PCI identifier are supported only for SyclDevices with Leve-Zero backend.
- dpctl.utils.intel_device_info_device_id(device: dpctl.SyclDevice) int
Get ext_intel_device_id for the device, zero if not an intel device
- dpctl.utils.intel_device_info_gpu_eu_count(device: dpctl.SyclDevice) int
Returns the number of execution units (EUs) associated with the Intel GPU.
- dpctl.utils.intel_device_info_gpu_eu_count_per_subslice(device: dpctl.SyclDevice) int
Returns the number of EUs per subslice of GPU.
- dpctl.utils.intel_device_info_gpu_eu_simd_width(device: dpctl.SyclDevice) int
Returns the physical SIMD width of the execution unit (EU).
- dpctl.utils.intel_device_info_gpu_hw_threads_per_eu(device: dpctl.SyclDevice) int
Returns the number of hardware threads in EU.
- dpctl.utils.intel_device_info_gpu_slices(device: dpctl.SyclDevice) int
Returns the number of slices in the GPU device, or zero.
- dpctl.utils.intel_device_info_gpu_subslices_per_slice(device: dpctl.SyclDevice) int
Returns the number of subslices per slice.
- dpctl.utils.intel_device_info_max_mem_bandwidth(device: dpctl.SyclDevice) int
Returns the maximum memory bandwidth in units of bytes/second.
- 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')