File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -55,8 +55,12 @@ template <> struct type_caster<sycl::queue>
5555 value = * q ;
5656 return true;
5757 }
58+ else if (source == Py_None ) {
59+ value = sycl ::queue {};
60+ return true;
61+ }
5862 else {
59- throw std :: runtime_error (
63+ throw py :: type_error (
6064 "Input is of unexpected type, expected dpctl.SyclQueue" );
6165 }
6266 }
@@ -87,8 +91,12 @@ template <> struct type_caster<sycl::device>
8791 value = * d ;
8892 return true;
8993 }
94+ else if (source == Py_None ) {
95+ value = sycl ::device {};
96+ return true;
97+ }
9098 else {
91- throw std :: runtime_error (
99+ throw py :: type_error (
92100 "Input is of unexpected type, expected dpctl.SyclDevice" );
93101 }
94102 }
@@ -120,7 +128,7 @@ template <> struct type_caster<sycl::context>
120128 return true;
121129 }
122130 else {
123- throw std :: runtime_error (
131+ throw py :: type_error (
124132 "Input is of unexpected type, expected dpctl.SyclContext" );
125133 }
126134 }
@@ -153,7 +161,7 @@ template <> struct type_caster<sycl::event>
153161 return true;
154162 }
155163 else {
156- throw std :: runtime_error (
164+ throw py :: type_error (
157165 "Input is of unexpected type, expected dpctl.SyclEvent" );
158166 }
159167 }
You can’t perform that action at this time.
0 commit comments