Skip to content

Commit

Permalink
Update src/cunumeric/unary/unary_red_template.inl
Browse files Browse the repository at this point in the history
Co-authored-by: Manolis Papadakis <[email protected]>
  • Loading branch information
ipdemes and manopapad authored Nov 17, 2023
1 parent 4014239 commit fe84bb1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/cunumeric/unary/unary_red_template.inl
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,12 @@ struct UnaryRedImpl {

auto lhs = args.lhs.reduce_accessor<typename OP::OP, KIND != VariantKind::GPU, DIM>(rect);

AccessorRO<bool, DIM> where;
if constexpr (HAS_WHERE) {
auto where = args.where.read_accessor<bool, DIM>(rect);
UnaryRedImplBody<KIND, OP_CODE, CODE, DIM, HAS_WHERE>()(
lhs, rhs, where, rect, pitches, args.collapsed_dim, volume);
} else {
UnaryRedImplBody<KIND, OP_CODE, CODE, DIM, HAS_WHERE>()(
lhs, rhs, AccessorRO<bool, DIM>(), rect, pitches, args.collapsed_dim, volume);
where = args.where.read_accessor<bool, DIM>(rect);
}
UnaryRedImplBody<KIND, OP_CODE, CODE, DIM, HAS_WHERE>()(
lhs, rhs, where, rect, pitches, args.collapsed_dim, volume);
}

template <Type::Code CODE,
Expand Down

0 comments on commit fe84bb1

Please sign in to comment.