We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7fec53 commit 24d7cafCopy full SHA for 24d7caf
dpctl/tests/test_sycl_event.py
@@ -157,3 +157,20 @@ def test_profiling_info():
157
assert event.profiling_info_end
158
else:
159
pytest.skip("No OpenCL CPU queues available")
160
+
161
162
+def test_sycl_timer():
163
+ try:
164
+ q = dpctl.SyclQueue(property="enable_profiling")
165
+ except dpctl.SyclQueueCreationError:
166
+ pytest.skip("Queue creation of default device failed")
167
+ timer = dpctl.SyclTimer()
168
+ m1 = dpctl_mem.MemoryUSMDevice(256 * 1024, queue=q)
169
+ m2 = dpctl_mem.MemoryUSMDevice(256 * 1024, queue=q)
170
+ with timer(q):
171
+ # device task
172
+ m1.copy_from_device(m2)
173
+ # host task
174
+ [x ** 2 for x in range(1024)]
175
+ host_dt, device_dt = timer.dt
176
+ assert host_dt > device_dt
0 commit comments