Skip to content

Commit 58eb240

Browse files
Merge pull request #857 from IntelPython/testing-on-wsl-with-iris-xe
Changes from testing dpctl under wsl on a laptop with Iris Xe
2 parents 646aee6 + 00bd38a commit 58eb240

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

dpctl/tests/test_sycl_kernel_submit.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def test_create_program_from_source(ctype_str, dtype, ctypes_ctor):
4545
q = dpctl.SyclQueue("opencl", property="enable_profiling")
4646
except dpctl.SyclQueueCreationError:
4747
pytest.skip("OpenCL queue could not be created")
48+
if dtype == np.dtype("f8") and q.sycl_device.has_aspect_fp64 is False:
49+
pytest.skip(
50+
"Device does not support double precision floating point type"
51+
)
4852
# OpenCL conventions for indexing global_id is opposite to
4953
# that of SYCL (and DPCTL)
5054
oclSrc = (

dpctl/tests/test_sycl_queue_memcpy.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
import dpctl.memory
2525

2626

27-
def _create_memory():
27+
def _create_memory(q):
2828
nbytes = 1024
29-
mobj = dpctl.memory.MemoryUSMShared(nbytes)
29+
mobj = dpctl.memory.MemoryUSMShared(nbytes, queue=q)
3030
return mobj
3131

3232

@@ -35,9 +35,9 @@ def _create_memory():
3535
reason="No SYCL devices except the default host device.",
3636
)
3737
def test_memcpy_copy_usm_to_usm():
38-
mobj1 = _create_memory()
39-
mobj2 = _create_memory()
4038
q = dpctl.SyclQueue()
39+
mobj1 = _create_memory(q)
40+
mobj2 = _create_memory(q)
4141

4242
mv1 = memoryview(mobj1)
4343
mv2 = memoryview(mobj2)
@@ -54,8 +54,8 @@ def test_memcpy_copy_usm_to_usm():
5454
# reason="No SYCL devices except the default host device."
5555
# )
5656
def test_memcpy_type_error():
57-
mobj = _create_memory()
58-
q = mobj._queue
57+
q = dpctl.SyclQueue()
58+
mobj = _create_memory(q)
5959

6060
with pytest.raises(TypeError) as cm:
6161
q.memcpy(None, mobj, 3)

libsyclinterface/source/dpctl_sycl_event_interface.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ void DPCTLEvent_Wait(__dpctl_keep DPCTLSyclEventRef ERef)
6060
{
6161
if (ERef) {
6262
auto SyclEvent = unwrap(ERef);
63-
if (SyclEvent)
64-
SyclEvent->wait();
63+
try {
64+
if (SyclEvent)
65+
SyclEvent->wait();
66+
} catch (std::exception const &e) {
67+
error_handler(e, __FILE__, __func__, __LINE__);
68+
}
6569
}
6670
else {
6771
error_handler("Cannot wait for the event. DPCTLSyclEventRef as "
@@ -74,8 +78,12 @@ void DPCTLEvent_WaitAndThrow(__dpctl_keep DPCTLSyclEventRef ERef)
7478
{
7579
if (ERef) {
7680
auto SyclEvent = unwrap(ERef);
77-
if (SyclEvent)
78-
SyclEvent->wait_and_throw();
81+
try {
82+
if (SyclEvent)
83+
SyclEvent->wait_and_throw();
84+
} catch (std::exception const &e) {
85+
error_handler(e, __FILE__, __func__, __LINE__);
86+
}
7987
}
8088
else {
8189
error_handler("Cannot wait_and_throw for the event. DPCTLSyclEventRef "

0 commit comments

Comments
 (0)