diff --git a/.github/workflows/celerity_ci.yml b/.github/workflows/celerity_ci.yml index af222e21c..87fe7672f 100644 --- a/.github/workflows/celerity_ci.yml +++ b/.github/workflows/celerity_ci.yml @@ -165,14 +165,17 @@ jobs: timeout-minutes: 5 working-directory: ${{ env.build-dir }} run: ${{ env.container-workspace }}/ci/run-unit-tests.sh - - name: Run integration tests + - name: Run examples timeout-minutes: 5 # We build examples twice, but only run the installed version (which probably has more failure modes) working-directory: ${{ env.examples-build-dir }} - run: ${{ env.container-workspace }}/ci/run-integration-tests.sh /data/Lenna.png 1 2 4 + run: ${{ env.container-workspace }}/ci/run-examples.sh /data/Lenna.png 1 2 4 - name: Run system tests working-directory: ${{ env.build-dir }} run: ${{ env.container-workspace }}/ci/run-system-tests.sh 2 4 + - name: Run integration tests + working-driectory: ${{ env.build-dir }} + run: ${{ env.container-workspace }}/test/integration/run-integration-tests.py . ${{ matrix.platform }} - name: Upload stack traces (if any) if: always() uses: actions/upload-artifact@v2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 388f4a3b1..d450ad21c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -262,6 +262,9 @@ target_link_libraries(celerity_runtime PUBLIC ${SYCL_LIB} ) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/backend) +target_link_libraries(celerity_runtime PUBLIC celerity_backends) + # For debug builds, we set the CELERITY_DETAIL_ENABLE_DEBUG preprocessor flag, # which allows Celerity to control debug functionality within headers regardless # of a user target's build type. (This flag is not intended to be modified by @@ -362,7 +365,7 @@ install( DESTINATION include/celerity/vendor ) install( - TARGETS celerity_runtime + TARGETS celerity_runtime celerity_backends EXPORT install_exports LIBRARY DESTINATION lib ARCHIVE DESTINATION lib diff --git a/ci/run-integration-tests.sh b/ci/run-examples.sh similarity index 100% rename from ci/run-integration-tests.sh rename to ci/run-examples.sh diff --git a/cmake/celerity-config.cmake.in b/cmake/celerity-config.cmake.in index f2d3daf75..4851dad28 100644 --- a/cmake/celerity-config.cmake.in +++ b/cmake/celerity-config.cmake.in @@ -21,6 +21,9 @@ find_dependency(Threads REQUIRED) find_dependency(fmt REQUIRED) find_dependency(spdlog REQUIRED) find_dependency(small_vector REQUIRED) +if(@CELERITY_ENABLE_CUDA_BACKEND@) + find_dependency(CUDAToolkit REQUIRED) +endif() if(CELERITY_SYCL_IMPL STREQUAL "hipSYCL") if(NOT DEFINED HIPSYCL_TARGETS AND NOT "@HIPSYCL_TARGETS@" STREQUAL "") diff --git a/include/backend/backend.h b/include/backend/backend.h new file mode 100644 index 000000000..eae91b500 --- /dev/null +++ b/include/backend/backend.h @@ -0,0 +1,56 @@ +#pragma once + +#include + +#include "backend/generic_backend.h" +#include "backend/traits.h" +#include "backend/type.h" + +// NOTE: These should not leak any symbols from the backend library (i.e. don't include it in the header) +#if CELERITY_DETAIL_BACKEND_CUDA_ENABLED +#include "backend/cuda_backend.h" +#endif + +namespace celerity::detail::backend_detail { +template