Skip to content

Commit b89b37f

Browse files
Boolean reductions allocate int32 temporary as USM-device
Closes gh-1563 Allocating the temporary as USM-device ensures that atomic updates are always possible.
1 parent 16f23f7 commit b89b37f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dpctl/tensor/_utility_functions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,13 @@ def _boolean_reduction(x, axis, keepdims, func):
3636
res_usm_type = x.usm_type
3737

3838
wait_list = []
39+
# always allocate the temporary as
40+
# int32 and usm-device to ensure that atomic updates
41+
# are supported
3942
res_tmp = dpt.empty(
4043
res_shape,
4144
dtype=dpt.int32,
42-
usm_type=res_usm_type,
45+
usm_type="device",
4346
sycl_queue=exec_q,
4447
)
4548
hev0, ev0 = func(

0 commit comments

Comments
 (0)