Skip to content

Commit

Permalink
added/modified various begin-end tags for Sphinx literalinclude
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantin Läufer <[email protected]>
  • Loading branch information
klaeufer committed Dec 10, 2023
1 parent d8a29cb commit d552ecd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions integration/trapezoid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ double single_trapezoid(const double f1, const double f2, const double half_dx)
}
// {{UnoAPI:trapezoid-implementation:end}}

// {{UnoAPI:main-compute-outer-trapezoid:begin}}
// {{UnoAPI:trapezoid-compute-outer:begin}}
// common function to compute a single outer trapezoid
// from as many inner trapezoids as the grain size
double outer_trapezoid(
Expand All @@ -25,4 +25,4 @@ double outer_trapezoid(
}
return area;
}
// {{UnoAPI:main-compute-outer-trapezoid:end}}
// {{UnoAPI:trapezoid-compute-outer:end}}
4 changes: 4 additions & 0 deletions montecarlo/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ int main(const int argc, const char *const argv[]) {
spdlog::info("Device: {}", q.get_device().get_info<sycl::info::device::name>());
spdlog::info("Max workgroup size: {}", q.get_device().get_info<sycl::info::device::max_work_group_size>());

// {{UnoAPI:montecarlo-queue-dart-throwing:begin}}
q.submit([&](auto &h) {
const auto c = c_buf.get_access<sycl::access_mode::write>(h);

Expand All @@ -68,7 +69,9 @@ int main(const int argc, const char *const argv[]) {
c[index] = darts_within_circle;
});
});
// {{UnoAPI:montecarlo-queue-dart-throwing:end}}

// {{UnoAPI:montecarlo-queue-reduce:begin}}
q.submit([&](auto &h) {
const auto c{c_buf.get_access<sycl::access_mode::read>(h)};
const auto sum_reduction{sycl::reduction(s_buf, h, sycl::plus<>())};
Expand All @@ -77,6 +80,7 @@ int main(const int argc, const char *const argv[]) {
sum.combine(c[index]);
});
});
// {{UnoAPI:montecarlo-queue-reduce:end}}

spdlog::info("done submitting to queue...waiting for results");
}
Expand Down

0 comments on commit d552ecd

Please sign in to comment.