dpctl.SyclTimer.dt¶
- property SyclTimer.dt¶
Returns a pair of elapsed times
host_dtanddevice_dt.The
host_dtis the duration as measured by the host timer, while thedevice_dtis the duration as measured by the device timer and encoded in profiling events.- Returns:
Data class with
host_dtanddevice_dtmembers which supports unpacking into a 2-tuple.- Return type:
HostDeviceDuration
- Example:
import dpctl q = dpctl.SyclQueue(property="enable_profiling") timer = dpctl.SyclTimer() x = np.linspace(-4, 4, num=10**6, dtype="float32") with timer(q): x_usm = dpctl.memory.MemoryUSMDevice(x.nbytes, queue=q) q.memcpy(dest=x_usm, src=x, count=x.nbytes) host_dt, device_dt = timer.dt
Note
Since different timers are used to measure host and device durations, one should not expect that
host_dtis always strictly greater thandevice_dt.Use tracing tools like
onetrace, orunitracefrom intel/pti-gpu repository for more accurate measurements.