@@ -132,7 +132,9 @@ def _get_queue_ref(
132
132
queue_arg_ty , (types .misc .NoneType , types .misc .Omitted )
133
133
) and isinstance (queue_arg_ty , DpctlSyclQueue ):
134
134
if not isinstance (queue_arg .type , llvmir .LiteralStructType ):
135
- raise AssertionError
135
+ raise AssertionError (
136
+ "Expected the queue_arg to be an llvmir.LiteralStructType"
137
+ )
136
138
sycl_queue_dm = dpex_dmm .lookup (queue_arg_ty )
137
139
queue_ref = builder .extract_value (
138
140
queue_arg , sycl_queue_dm .get_field_position ("queue_ref" )
@@ -147,7 +149,9 @@ def _get_queue_ref(
147
149
else :
148
150
if not isinstance (queue_arg .type , llvmir .PointerType ):
149
151
# TODO: check if the pointer is null
150
- raise AssertionError
152
+ raise AssertionError (
153
+ "Expected the queue_arg to be an llvmir.PointerType"
154
+ )
151
155
ty_sycl_queue = sig .return_type .queue
152
156
py_dpctl_sycl_queue = get_device_cached_queue (ty_sycl_queue .sycl_device )
153
157
(queue_ref , py_dpctl_sycl_queue_addr , pyapi ) = make_queue (
@@ -159,7 +163,15 @@ def _get_queue_ref(
159
163
160
164
161
165
def _update_queue_attr (array , queue ):
162
- """Sets the sycl_queue member of an ArrayStruct."""
166
+ """Assigns the sycl_queue member of an usmarystruct_t instance.
167
+
168
+ After creating a new usmarystruct_t struct (e.g. in _empty_nd_impl) the
169
+ members of the struct are populated by calling
170
+ numba.np.arrayobj.populate_array. The populate_array function does not
171
+ update the sycl_queue member as populate_array is written specifically for
172
+ numba's arystruct_t type that does not have a sycl_queue member. The
173
+ _update_queue_attr is a helper function to update the sycl_queue field.
174
+ """
163
175
164
176
attr = dict (sycl_queue = queue )
165
177
for k , v in attr .items ():
0 commit comments