@@ -687,25 +687,26 @@ def __call__(self, o1, o2, out=None, order="K"):
687
687
else :
688
688
src2 = dpt .asarray (o2 , dtype = o2_dtype , sycl_queue = exec_q )
689
689
690
+ if order == "A" :
691
+ order = (
692
+ "F"
693
+ if all (
694
+ arr .flags .f_contiguous
695
+ for arr in (
696
+ src1 ,
697
+ src2 ,
698
+ )
699
+ )
700
+ else "C"
701
+ )
702
+
690
703
if buf1_dt is None and buf2_dt is None :
691
704
if out is None :
692
705
if order == "K" :
693
706
out = _empty_like_pair_orderK (
694
707
src1 , src2 , res_dt , res_shape , res_usm_type , exec_q
695
708
)
696
709
else :
697
- if order == "A" :
698
- order = (
699
- "F"
700
- if all (
701
- arr .flags .f_contiguous
702
- for arr in (
703
- src1 ,
704
- src2 ,
705
- )
706
- )
707
- else "C"
708
- )
709
710
out = dpt .empty (
710
711
res_shape ,
711
712
dtype = res_dt ,
@@ -736,8 +737,6 @@ def __call__(self, o1, o2, out=None, order="K"):
736
737
if order == "K" :
737
738
buf2 = _empty_like_orderK (src2 , buf2_dt )
738
739
else :
739
- if order == "A" :
740
- order = "F" if src1 .flags .f_contiguous else "C"
741
740
buf2 = dpt .empty_like (src2 , dtype = buf2_dt , order = order )
742
741
ht_copy_ev , copy_ev = ti ._copy_usm_ndarray_into_usm_ndarray (
743
742
src = src2 , dst = buf2 , sycl_queue = exec_q
@@ -783,8 +782,6 @@ def __call__(self, o1, o2, out=None, order="K"):
783
782
if order == "K" :
784
783
buf1 = _empty_like_orderK (src1 , buf1_dt )
785
784
else :
786
- if order == "A" :
787
- order = "F" if src1 .flags .f_contiguous else "C"
788
785
buf1 = dpt .empty_like (src1 , dtype = buf1_dt , order = order )
789
786
ht_copy_ev , copy_ev = ti ._copy_usm_ndarray_into_usm_ndarray (
790
787
src = src1 , dst = buf1 , sycl_queue = exec_q
@@ -827,13 +824,11 @@ def __call__(self, o1, o2, out=None, order="K"):
827
824
ht_binary_ev .wait ()
828
825
return out
829
826
830
- if order in [ "K" , "A" ] :
827
+ if order == "K" :
831
828
if src1 .flags .f_contiguous and src2 .flags .f_contiguous :
832
829
order = "F"
833
830
elif src1 .flags .c_contiguous and src2 .flags .c_contiguous :
834
831
order = "C"
835
- else :
836
- order = "C" if order == "A" else "K"
837
832
if order == "K" :
838
833
buf1 = _empty_like_orderK (src1 , buf1_dt )
839
834
else :
0 commit comments