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>
55
55
value = * q ;
56
56
return true;
57
57
}
58
+ else if (source == Py_None ) {
59
+ value = sycl ::queue {};
60
+ return true;
61
+ }
58
62
else {
59
- throw std :: runtime_error (
63
+ throw py :: type_error (
60
64
"Input is of unexpected type, expected dpctl.SyclQueue" );
61
65
}
62
66
}
@@ -87,8 +91,12 @@ template <> struct type_caster<sycl::device>
87
91
value = * d ;
88
92
return true;
89
93
}
94
+ else if (source == Py_None ) {
95
+ value = sycl ::device {};
96
+ return true;
97
+ }
90
98
else {
91
- throw std :: runtime_error (
99
+ throw py :: type_error (
92
100
"Input is of unexpected type, expected dpctl.SyclDevice" );
93
101
}
94
102
}
@@ -120,7 +128,7 @@ template <> struct type_caster<sycl::context>
120
128
return true;
121
129
}
122
130
else {
123
- throw std :: runtime_error (
131
+ throw py :: type_error (
124
132
"Input is of unexpected type, expected dpctl.SyclContext" );
125
133
}
126
134
}
@@ -153,7 +161,7 @@ template <> struct type_caster<sycl::event>
153
161
return true;
154
162
}
155
163
else {
156
- throw std :: runtime_error (
164
+ throw py :: type_error (
157
165
"Input is of unexpected type, expected dpctl.SyclEvent" );
158
166
}
159
167
}
You can’t perform that action at this time.
0 commit comments