Skip to content

Commit 7f62c5a

Browse files
committed
C++: translate the first loop index also
1 parent 1bd7d2d commit 7f62c5a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libasr/codegen/asr_to_cpp.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,9 @@ Kokkos::View<T*> from_std_vector(const std::vector<T> &v)
10701070
void visit_DoConcurrentLoop(const ASR::DoConcurrentLoop_t &x) {
10711071
std::string indent(indentation_level*indentation_spaces, ' ');
10721072
std::string out = indent + "Kokkos::parallel_for(";
1073-
out += "Kokkos::RangePolicy<Kokkos::DefaultExecutionSpace>(1, ";
1073+
out += "Kokkos::RangePolicy<Kokkos::DefaultExecutionSpace>(";
1074+
visit_expr(*x.m_head.m_start);
1075+
out += src + ", ";
10741076
visit_expr(*x.m_head.m_end);
10751077
out += src + "+1)";
10761078
ASR::Variable_t *loop_var = LFortran::ASRUtils::EXPR2VAR(x.m_head.m_v);

0 commit comments

Comments
 (0)