Skip to content

Commit 1217550

Browse files
committed
Replaced std::min with idx_reduction_op_
1 parent ea4c477 commit 1217550

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
@@ -1672,11 +1672,12 @@ struct SearchReduction
16721672
argT val = inp_[inp_offset];
16731673
if (val == local_red_val) {
16741674
if constexpr (!First) {
1675-
local_idx = std::min(local_idx, inds_[inp_offset]);
1675+
local_idx =
1676+
idx_reduction_op_(local_idx, inds_[inp_offset]);
16761677
}
16771678
else {
1678-
local_idx = std::min(local_idx,
1679-
static_cast<outT>(arg_reduce_gid));
1679+
local_idx = idx_reduction_op_(
1680+
local_idx, static_cast<outT>(arg_reduce_gid));
16801681
}
16811682
}
16821683
else {
@@ -1827,11 +1828,12 @@ struct CustomSearchReduction
18271828
argT val = inp_[inp_offset];
18281829
if (val == local_red_val) {
18291830
if constexpr (!First) {
1830-
local_idx = std::min(local_idx, inds_[inp_offset]);
1831+
local_idx =
1832+
idx_reduction_op_(local_idx, inds_[inp_offset]);
18311833
}
18321834
else {
1833-
local_idx = std::min(local_idx,
1834-
static_cast<outT>(arg_reduce_gid));
1835+
local_idx = idx_reduction_op_(
1836+
local_idx, static_cast<outT>(arg_reduce_gid));
18351837
}
18361838
}
18371839
else {

0 commit comments

Comments
 (0)