diff --git a/.github/workflows/oneapi-cmake.yml b/.github/workflows/oneapi-cmake.yml index d439fa4..15536a5 100644 --- a/.github/workflows/oneapi-cmake.yml +++ b/.github/workflows/oneapi-cmake.yml @@ -1,4 +1,3 @@ - name: OneAPI CI with CMake on: @@ -14,6 +13,7 @@ jobs: env: BUILD_DIR: cmake-build-debug +# UnoAPI:github-workflow-specific:begin steps: - name: Checkout project code uses: actions/checkout@v2 @@ -42,3 +42,4 @@ jobs: $BUILD_DIR/bin/montecarlo # eventually keep only this loop for discovering all tests for test_bin in $BUILD_DIR/bin/*tests; do "./$test_bin"; done +# UnoAPI:github-workflow-specific:end diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a54a4c..beb7a09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,20 +7,24 @@ project( LANGUAGES CXX ) +# UnoAPI:CMakeLists-language-settings:begin set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) +# UnoAPI:CMakeLists-language-settings:end set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) include(FetchContent) +# UnoAPI:CMakeLists-fetchcontent:begin FetchContent_Declare( fmt GIT_REPOSITORY https://github.com/fmtlib/fmt.git GIT_TAG 8.1.1 ) FetchContent_MakeAvailable(fmt) +# UnoAPI:CMakeLists-fetchcontent:end # Lots of compilation errors without this setting option(SPDLOG_FMT_EXTERNAL "Use external fmt library instead of bundled" ON) diff --git a/integration/CMakeLists.txt b/integration/CMakeLists.txt index df0f318..aa5d976 100644 --- a/integration/CMakeLists.txt +++ b/integration/CMakeLists.txt @@ -1,5 +1,7 @@ +# UnoAPI:CMakeLists-targetlibraries:begin add_executable(integration main.cpp f.cpp trapezoid.cpp timestamps.cpp) target_link_libraries(integration fmt::fmt spdlog::spdlog CLI11::CLI11) +# UnoAPI:CMakeLists-targetlibraries:end enable_testing() add_executable(integration_tests test.cpp f.cpp trapezoid.cpp) diff --git a/integration/main.cpp b/integration/main.cpp index bf4bb29..b36d3fc 100644 --- a/integration/main.cpp +++ b/integration/main.cpp @@ -144,33 +144,33 @@ int main(const int argc, const char * const argv[]) { // {{UnoAPI:main-parallel-devices:end}} // we allow the queue to figure out the correct ordering of the three tasks - // {{UnoAPI:main-parallel-inorder-q:begin}} + // {{UnoAPI:main-parallel-queue:begin}} sycl::queue q{device, dpc_common::exception_handler}; mark_time(timestamps,"Queue creation"); device_name = q.get_device().get_info(); spdlog::info("Device: {}", device_name); - // {{UnoAPI:main-parallel-inorder-q:end}} + // {{UnoAPI:main-parallel-queue:end}} // populate buffer with function values - // {{UnoAPI:main-parallel-submit-parallel-for:begin}} + // {{UnoAPI:main-parallel-submit-parallel-for-values:begin}} q.submit([&](auto & h) { const sycl::accessor v{v_buf, h}; h.parallel_for(size, [=](const auto & index) { v[index] = f(x_min + index * dx); }); }); // end of command group - // {{UnoAPI:main-parallel-submit-parallel-for:end}} + // {{UnoAPI:main-parallel-submit-parallel-for-values:end}} // populate buffer with trapezoid values // the inner, sequential loop performs a finer-grained calculation - // {{UnoAPI:main-parallel-submit-parallel-for:begin}} + // {{UnoAPI:main-parallel-submit-parallel-for-trapezoids:begin}} q.submit([&](auto & h) { const sycl::accessor t{t_buf, h}; h.parallel_for(size, [=](const auto & index) { t[index] = compute_outer_trapezoid(grain_size, x_min + index * dx, dx_inner, half_dx_inner); }); }); // end of command group - // {{UnoAPI:main-parallel-submit-parallel-for:end}} + // {{UnoAPI:main-parallel-submit-parallel-for-trapezoids:end}} // perform reduction into result // {{UnoAPI:main-parallel-submit-reduce:begin}}