@@ -673,6 +673,7 @@ def clip(a, a_min, a_max, *, out=None, order="K", **kwargs):
673
673
674
674
if kwargs :
675
675
raise NotImplementedError (f"kwargs={ kwargs } is currently not supported" )
676
+
676
677
if a_min is None and a_max is None :
677
678
raise ValueError ("One of max or min must be given" )
678
679
@@ -923,11 +924,13 @@ def cross(a, b, axisa=-1, axisb=-1, axisc=-1, axis=None):
923
924
if not isinstance (axis , int ):
924
925
raise TypeError (f"axis should be an integer but got, { type (axis )} ." )
925
926
axisa , axisb , axisc = (axis ,) * 3
927
+
926
928
dpnp .check_supported_arrays_type (a , b )
927
929
if a .dtype == dpnp .bool and b .dtype == dpnp .bool :
928
930
raise TypeError (
929
931
"Input arrays with boolean data type are not supported."
930
932
)
933
+
931
934
# Check axisa and axisb are within bounds
932
935
axisa = normalize_axis_index (axisa , a .ndim , msg_prefix = "axisa" )
933
936
axisb = normalize_axis_index (axisb , b .ndim , msg_prefix = "axisb" )
@@ -944,6 +947,7 @@ def cross(a, b, axisa=-1, axisb=-1, axisc=-1, axis=None):
944
947
# Modify the shape of input arrays if necessary
945
948
a_shape = a .shape
946
949
b_shape = b .shape
950
+
947
951
# TODO: replace with dpnp.broadcast_shapes once implemented
948
952
res_shape = numpy .broadcast_shapes (a_shape [:- 1 ], b_shape [:- 1 ])
949
953
if a_shape [:- 1 ] != res_shape :
@@ -957,6 +961,7 @@ def cross(a, b, axisa=-1, axisb=-1, axisc=-1, axis=None):
957
961
res_shape += (3 ,)
958
962
# Check axisc is within bounds
959
963
axisc = normalize_axis_index (axisc , len (res_shape ), msg_prefix = "axisc" )
964
+
960
965
# Create the output array
961
966
dtype = dpnp .result_type (a , b )
962
967
res_usm_type , exec_q = get_usm_allocations ([a , b ])
@@ -968,7 +973,7 @@ def cross(a, b, axisa=-1, axisb=-1, axisc=-1, axis=None):
968
973
a = a .astype (dtype , copy = False )
969
974
b = b .astype (dtype , copy = False )
970
975
971
- cp = dpnp_cross (a , b , cp , exec_q )
976
+ cp = dpnp_cross (a , b , cp )
972
977
if a_shape [- 1 ] == 2 and b_shape [- 1 ] == 2 :
973
978
return cp
974
979
@@ -3184,6 +3189,9 @@ def sum(
3184
3189
sycl_sum = get_sum (input , output )
3185
3190
3186
3191
if sycl_sum :
3192
+ # TODO: pass dep events into _get_sum_over_axis_0 to remove sync
3193
+ dpnp .synchronize_array_data (input )
3194
+
3187
3195
sycl_sum (input , output , []).wait ()
3188
3196
result = dpnp_array ._create_from_usm_ndarray (output )
3189
3197
0 commit comments