diff --git a/.github/workflows/pr_push.yml b/.github/workflows/pr_push.yml index 8b78ce3d0f..98f90d9fc5 100644 --- a/.github/workflows/pr_push.yml +++ b/.github/workflows/pr_push.yml @@ -16,64 +16,5 @@ permissions: contents: read jobs: - CodeChecks: - uses: ./.github/workflows/reusable_checks.yml - DocsBuild: - uses: ./.github/workflows/reusable_docs_build.yml - FastBuild: - name: Fast builds - needs: [CodeChecks, DocsBuild] - uses: ./.github/workflows/reusable_fast.yml - Build: - name: Basic builds - needs: [FastBuild] - uses: ./.github/workflows/reusable_basic.yml - DevDax: - needs: [FastBuild] - uses: ./.github/workflows/reusable_dax.yml - Sanitizers: - needs: [FastBuild] - uses: ./.github/workflows/reusable_sanitizers.yml - Qemu: - needs: [FastBuild] - uses: ./.github/workflows/reusable_qemu.yml - Benchmarks: - needs: [Build] - uses: ./.github/workflows/reusable_benchmarks.yml - ProxyLib: - needs: [Build] - uses: ./.github/workflows/reusable_proxy_lib.yml GPU: - needs: [Build] uses: ./.github/workflows/reusable_gpu.yml - Valgrind: - needs: [Build] - uses: ./.github/workflows/reusable_valgrind.yml - MultiNuma: - needs: [Build] - uses: ./.github/workflows/reusable_multi_numa.yml - Coverage: - # total coverage (on upstream only) - if: github.repository == 'oneapi-src/unified-memory-framework' - needs: [Build, DevDax, GPU, MultiNuma, Qemu, ProxyLib] - uses: ./.github/workflows/reusable_coverage.yml - secrets: inherit - with: - trigger: "${{github.event_name}}" - Coverage_partial: - # partial coverage (on forks) - if: github.repository != 'oneapi-src/unified-memory-framework' - needs: [Build, Qemu, ProxyLib] - uses: ./.github/workflows/reusable_coverage.yml - CodeQL: - needs: [Build] - permissions: - contents: read - security-events: write - uses: ./.github/workflows/reusable_codeql.yml - Trivy: - needs: [Build] - permissions: - contents: read - security-events: write - uses: ./.github/workflows/reusable_trivy.yml diff --git a/.github/workflows/reusable_gpu.yml b/.github/workflows/reusable_gpu.yml index 1a5d54230a..f37d440178 100644 --- a/.github/workflows/reusable_gpu.yml +++ b/.github/workflows/reusable_gpu.yml @@ -106,26 +106,6 @@ jobs: working-directory: ${{env.BUILD_DIR}} run: ctest --output-on-failure --test-dir examples -C ${{matrix.build_type}} - - name: Run benchmarks - working-directory: ${{env.BUILD_DIR}} - run: ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-bench-multithreaded - - - name: Check coverage - if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }} - working-directory: ${{env.BUILD_DIR}} - run: | - export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}} - echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME" - ../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME - mkdir -p ${{env.COVERAGE_DIR}} - mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}} - - - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }} - with: - name: ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}} - path: ${{env.COVERAGE_DIR}} - gpu-CUDA: name: CUDA env: @@ -186,23 +166,3 @@ jobs: - name: Run examples working-directory: ${{env.BUILD_DIR}} run: ctest --output-on-failure --test-dir examples -C ${{matrix.build_type}} - - - name: Run benchmarks - working-directory: ${{env.BUILD_DIR}} - run: ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-bench-multithreaded - - - name: Check coverage - if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }} - working-directory: ${{env.BUILD_DIR}} - run: | - export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}} - echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME" - ../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME - mkdir -p ${{env.COVERAGE_DIR}} - mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}} - - - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }} - with: - name: ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}} - path: ${{env.COVERAGE_DIR}} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e2e1c6f558..f2d29294d5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,17 +6,19 @@ include(${UMF_CMAKE_SOURCE_DIR}/cmake/helpers.cmake) set(UMF_LEVEL_ZERO_INCLUDE_DIR "" - CACHE PATH "Directory containing the Level Zero Headers") + CACHE PATH "Directory containing the Level Zero headers") +set(UMF_CUDA_INCLUDE_DIR + "" + CACHE PATH "Directory containing the CUDA headers") # Compile definitions for UMF library. # # TODO: Cleanup the compile definitions across all the CMake files set(UMF_COMMON_COMPILE_DEFINITIONS UMF_VERSION=${UMF_VERSION}) -# Only fetch L0 loader if needed (L0 provider and GPU tests are ON), and not -# already provided by the user (via setting UMF_LEVEL_ZERO_INCLUDE_DIR). -if(UMF_BUILD_LEVEL_ZERO_PROVIDER AND (UMF_BUILD_GPU_TESTS - OR (NOT UMF_LEVEL_ZERO_INCLUDE_DIR))) +# Fetch L0 loader only if needed i.e.: if building L0 provider is ON and L0 +# headers are not provided by the user (via setting UMF_LEVEL_ZERO_INCLUDE_DIR). +if(UMF_BUILD_LEVEL_ZERO_PROVIDER AND (NOT UMF_LEVEL_ZERO_INCLUDE_DIR)) include(FetchContent) set(LEVEL_ZERO_LOADER_REPO "https://github.com/oneapi-src/level-zero.git") @@ -44,7 +46,9 @@ elseif(UMF_BUILD_LEVEL_ZERO_PROVIDER) message(STATUS "Level Zero include directory: ${LEVEL_ZERO_INCLUDE_DIRS}") endif() -if(UMF_BUILD_CUDA_PROVIDER) +# Fetch CUDA only if needed i.e.: if building CUDA provider is ON and CUDA +# headers are not provided by the user (via setting UMF_CUDA_INCLUDE_DIR). +if(UMF_BUILD_CUDA_PROVIDER AND (NOT UMF_CUDA_INCLUDE_DIR)) include(FetchContent) set(CUDA_REPO @@ -64,6 +68,10 @@ if(UMF_BUILD_CUDA_PROVIDER) ${cuda-headers_SOURCE_DIR} CACHE PATH "Path to CUDA headers") message(STATUS "CUDA include directory: ${CUDA_INCLUDE_DIRS}") +elseif(UMF_BUILD_CUDA_PROVIDER) + # Only header is needed to build UMF + set(CUDA_INCLUDE_DIRS ${UMF_CUDA_INCLUDE_DIR}) + message(STATUS "CUDA include directory: ${CUDA_INCLUDE_DIRS}") endif() add_subdirectory(utils)