Skip to content

Commit 4bb76a7

Browse files
committed
Replaced std::min with idx_reduction_op_
1 parent 5e7b627 commit 4bb76a7

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

dpctl/tensor/libtensor/include/kernels/reductions.hpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,11 +1667,12 @@ struct SearchReduction
16671667
argT val = inp_[inp_offset];
16681668
if (val == local_red_val) {
16691669
if constexpr (!First) {
1670-
local_idx = std::min(local_idx, inds_[inp_offset]);
1670+
local_idx =
1671+
idx_reduction_op_(local_idx, inds_[inp_offset]);
16711672
}
16721673
else {
1673-
local_idx = std::min(local_idx,
1674-
static_cast<outT>(arg_reduce_gid));
1674+
local_idx = idx_reduction_op_(
1675+
local_idx, static_cast<outT>(arg_reduce_gid));
16751676
}
16761677
}
16771678
else {
@@ -1822,11 +1823,12 @@ struct CustomSearchReduction
18221823
argT val = inp_[inp_offset];
18231824
if (val == local_red_val) {
18241825
if constexpr (!First) {
1825-
local_idx = std::min(local_idx, inds_[inp_offset]);
1826+
local_idx =
1827+
idx_reduction_op_(local_idx, inds_[inp_offset]);
18261828
}
18271829
else {
1828-
local_idx = std::min(local_idx,
1829-
static_cast<outT>(arg_reduce_gid));
1830+
local_idx = idx_reduction_op_(
1831+
local_idx, static_cast<outT>(arg_reduce_gid));
18301832
}
18311833
}
18321834
else {

0 commit comments

Comments
 (0)