Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/src/codegenvisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ struct StatementVisitor {
//auto const& rk = std::get<std::shared_ptr<range_kind>>(node->indexSet.kind);
//auto & indices = rk->args;

os << "chplx::forall(chplx::Range{";
os << "chplx::forall(HPX_CURRENT_SOURCE_LOCATION(), chplx::Range{";

if(node->indexSet.size() == 1) {
ExprVisitor ev{os};
Expand Down Expand Up @@ -686,7 +686,7 @@ struct StatementVisitor {
//auto const& rk = std::get<std::shared_ptr<range_kind>>(node->indexSet.kind);
//auto & indices = rk->args;

os << "chplx::coforall(chplx::Range{";
os << "chplx::coforall(HPX_CURRENT_SOURCE_LOCATION(), chplx::Range{";
/*
if(std::holds_alternative<int_kind>(indices[0].kind)) {
os << int_kind::value(indices[0].literal[0]);
Expand Down
51 changes: 29 additions & 22 deletions backend/test/forall/forall.cpp.good
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ namespace forall {
B(i) = 1.000000;
});
#line 43 "forall.chpl"
chplx::forall(chplx::Range{0, 9}, [&](auto i) {
chplx::forall(
HPX_CURRENT_SOURCE_LOCATION(), chplx::Range{0, 9}, [&](auto i) {
#line 44 "forall.chpl"
B(i) = 1.000000;
});
B(i) = 1.000000;
});
};

void __thisModule::__main()
Expand All @@ -43,20 +44,22 @@ namespace forall {
std::cout << i << std::endl;
});
#line 16 "forall.chpl"
chplx::forall(chplx::Range{0, 10}, [&](auto i) {
chplx::forall(
HPX_CURRENT_SOURCE_LOCATION(), chplx::Range{0, 10}, [&](auto i) {
#line 17 "forall.chpl"
std::cout << i << std::endl;
});
std::cout << i << std::endl;
});
#line 20 "forall.chpl"
chplx::forLoop(chplx::Range{0, N}, [&](auto i) {
#line 21 "forall.chpl"
std::cout << i << std::endl;
});
#line 24 "forall.chpl"
chplx::forall(chplx::Range{0, N}, [&](auto i) {
chplx::forall(
HPX_CURRENT_SOURCE_LOCATION(), chplx::Range{0, N}, [&](auto i) {
#line 25 "forall.chpl"
std::cout << i << std::endl;
});
std::cout << i << std::endl;
});
#line 28 "forall.chpl"
chplx::forLoop(chplx::Range{0, N + 1}, [&](auto i) {
#line 29 "forall.chpl"
Expand All @@ -65,29 +68,32 @@ namespace forall {
std::cout << i << std::endl;
});
#line 33 "forall.chpl"
chplx::forall(chplx::Range{0, N + 1}, [&](auto i) {
chplx::forall(
HPX_CURRENT_SOURCE_LOCATION(), chplx::Range{0, N + 1}, [&](auto i) {
#line 34 "forall.chpl"
A(i) = 1.000000;
A(i) = 1.000000;
#line 35 "forall.chpl"
std::cout << i << std::endl;
});
std::cout << i << std::endl;
});
#line 48 "forall.chpl"
chplx::forLoop(chplx::Range{0, 9}, [&](auto i) {
#line 49 "forall.chpl"
A(i) = i;
});
#line 51 "forall.chpl"
chplx::forall(chplx::Range{0, 9}, [&](auto i) {
chplx::forall(
HPX_CURRENT_SOURCE_LOCATION(), chplx::Range{0, 9}, [&](auto i) {
#line 52 "forall.chpl"
A(i) = i;
});
A(i) = i;
});
#line 54 "forall.chpl"
chplx::Array<std::int64_t, chplx::Domain<1>> B(chplx::Range(0, 2));
#line 56 "forall.chpl"
chplx::coforall(chplx::Range{0, 2}, [&](auto tid) {
chplx::coforall(
HPX_CURRENT_SOURCE_LOCATION(), chplx::Range{0, 2}, [&](auto tid) {
#line 57 "forall.chpl"
B(tid) = tid;
});
B(tid) = tid;
});
#line 60 "forall.chpl"
chplx::forLoop(chplx::Range{0, 2}, [&](auto i) {
#line 61 "forall.chpl"
Expand All @@ -96,10 +102,11 @@ namespace forall {
#line 63 "forall.chpl"
chplx::Array<std::int64_t, chplx::Domain<1>> C(chplx::Range(0, 2));
#line 64 "forall.chpl"
chplx::coforall(chplx::Range{0, 2}, [&](auto tid) {
chplx::coforall(
HPX_CURRENT_SOURCE_LOCATION(), chplx::Range{0, 2}, [&](auto tid) {
#line 65 "forall.chpl"
C(tid) = tid;
});
C(tid) = tid;
});
#line 67 "forall.chpl"
chplx::forLoop(chplx::Range{0, 2}, [&](auto i) {
#line 68 "forall.chpl"
Expand Down
Loading
Loading