diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 07973335d9..74670a3b7d 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -15,3 +15,5 @@ # git blame --ignore-revs-file=.git-blame-ignore-revs $file # # List skips here: +985c3a9e7343c2f612560024cae4d968f800c8ac +0ffb820881335beb0e78463c19988a0c61044705 diff --git a/.github/workflows/bdw.yml b/.github/workflows/bdw.yml index 450a0975ab..e4036d68b9 100644 --- a/.github/workflows/bdw.yml +++ b/.github/workflows/bdw.yml @@ -9,6 +9,9 @@ on: - '**/*.py' - 'docs/**' types: [ opened, reopened, synchronize ] + pull_request_review: + types: + - submitted permissions: contents: none diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 49ce377c26..1052366eff 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -33,7 +33,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 + uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0 with: egress-policy: audit @@ -44,7 +44,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12 + uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15 with: languages: c-cpp # If you wish to specify custom queries, you can do so here or in a config file. @@ -100,6 +100,6 @@ jobs: run: make -j2 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12 + uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15 with: category: "/language:c-cpp" diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 56d5770ba5..f072eabac8 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 + uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0 with: egress-policy: audit diff --git a/.github/workflows/h100.yml b/.github/workflows/h100.yml index 0d20177b96..3473f8edd7 100644 --- a/.github/workflows/h100.yml +++ b/.github/workflows/h100.yml @@ -10,6 +10,9 @@ on: - '**/*.py' - 'docs/**' types: [ opened, reopened, synchronize ] + pull_request_review: + types: + - submitted permissions: contents: none diff --git a/.github/workflows/mi210.yml b/.github/workflows/mi210.yml index 9735e405f1..70b91a908c 100644 --- a/.github/workflows/mi210.yml +++ b/.github/workflows/mi210.yml @@ -9,6 +9,9 @@ on: - '**/*.py' - 'docs/**' types: [ opened, reopened, synchronize ] + pull_request_review: + types: + - submitted permissions: contents: none diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index d81ed0e1bc..a48b1e6f89 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -33,7 +33,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 + uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0 with: egress-policy: audit @@ -43,7 +43,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3 + uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0 with: results_file: results.sarif results_format: sarif @@ -73,6 +73,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12 + uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15 with: sarif_file: results.sarif diff --git a/.github/workflows/spr.yml b/.github/workflows/spr.yml index c38d04ac8d..8b2d504926 100644 --- a/.github/workflows/spr.yml +++ b/.github/workflows/spr.yml @@ -10,6 +10,9 @@ on: workflow_dispatch # - '**/*.py' # - 'docs/**' # types: [ opened, reopened, synchronize ] + #pull_request_review: + # types: + # - submitted permissions: contents: none diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c02d71c49..d8cdd203f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,6 +127,15 @@ ELSE() IF (NOT KOKKOSKERNELS_HAS_TRILINOS AND NOT KOKKOSKERNELS_HAS_PARENT) # This is a standalone build FIND_PACKAGE(Kokkos REQUIRED) + IF(Kokkos_COMPILE_LANGUAGE) + ENABLE_LANGUAGE(${Kokkos_COMPILE_LANGUAGE}) + IF(Kokkos_COMPILE_LANGUAGE STREQUAL CUDA) + SET(CMAKE_CUDA_ARCHITECTURES ${Kokkos_CUDA_ARCHITECTURES}) + ENDIF() + IF(Kokkos_COMPILE_LANGUAGE STREQUAL HIP) + SET(CMAKE_HIP_ARCHITECTURES ${Kokkos_HIP_ARCHITECTURES}) + ENDIF() + ENDIF() IF(${Kokkos_VERSION} VERSION_GREATER_EQUAL "4.2.00") MESSAGE(STATUS "Found Kokkos version ${Kokkos_VERSION} at ${Kokkos_DIR}") IF((${Kokkos_VERSION} VERSION_GREATER "4.3.99")) diff --git a/cmake/kokkoskernels_tribits.cmake b/cmake/kokkoskernels_tribits.cmake index 2d70f656ad..f7d11c9ef1 100644 --- a/cmake/kokkoskernels_tribits.cmake +++ b/cmake/kokkoskernels_tribits.cmake @@ -85,6 +85,11 @@ ENDIF() IF(PARSE_SOURCES) LIST(REMOVE_DUPLICATES PARSE_SOURCES) ENDIF() +IF(Kokkos_COMPILE_LANGUAGE) + FOREACH(source ${PARSE_SOURCES}) + SET_SOURCE_FILES_PROPERTIES(${source} PROPERTIES LANGUAGE ${Kokkos_COMPILE_LANGUAGE}) + ENDFOREACH() +ENDIF() ADD_LIBRARY( ${LIBRARY_NAME} @@ -151,6 +156,12 @@ IF (IS_ENABLED) SOURCES ${PARSE_SOURCES} TESTONLYLIBS ${PARSE_TESTONLYLIBS}) ELSE() + # Set the correct CMake language on all source files for this exe + IF(Kokkos_COMPILE_LANGUAGE) + FOREACH(source ${PARSE_SOURCES}) + SET_SOURCE_FILES_PROPERTIES(${source} PROPERTIES LANGUAGE ${Kokkos_COMPILE_LANGUAGE}) + ENDFOREACH() + ENDIF() ADD_EXECUTABLE(${EXE_NAME} ${PARSE_SOURCES}) #AJP, BMK altered: IF(KOKKOSKERNELS_ENABLE_TESTS_AND_PERFSUITE) diff --git a/scripts/cm_test_all_sandia b/scripts/cm_test_all_sandia index 1bc7692e08..55749a67bb 100755 --- a/scripts/cm_test_all_sandia +++ b/scripts/cm_test_all_sandia @@ -593,7 +593,7 @@ elif [ "$MACHINE" = "weaver" ]; then SKIP_HWLOC=True GCC93_MODULE_TPL_LIST="cmake/3.23.1,/,openblas/0.3.20/gcc/9.3.0,gcc/9.3.0" - CLANG13_MODULE_TPL_LIST="cmake/3.23.1,/,openblas/0.3.20/gcc/9.3.0,cuda/10.1.243" + CLANG13_MODULE_TPL_LIST="cmake/3.23.1,/,openblas/0.3.20/gcc/9.3.0,cuda/10.1.243,gcc/9.3.0" BASE_MODULE_LIST="cmake/3.23.1,/" # Cuda/11 modules available rhel8 queue (rhel8 OS); gcc/8.3.1 load by default diff --git a/sparse/unit_test/Test_Sparse_coo2crs.hpp b/sparse/unit_test/Test_Sparse_coo2crs.hpp index 7e20c76f21..d8dc44a4be 100644 --- a/sparse/unit_test/Test_Sparse_coo2crs.hpp +++ b/sparse/unit_test/Test_Sparse_coo2crs.hpp @@ -214,6 +214,13 @@ void doAllCoo2Crs(size_t m, size_t n) { } TEST_F(TestCategory, sparse_coo2crs) { +#if defined(KOKKOS_ENABLE_SYCL) + if constexpr (std::is_same_v) { + std::cout << "Not running coo2csr on SYCL execution space" << std::endl; + return; + } +#endif + uint64_t ticks = std::chrono::high_resolution_clock::now().time_since_epoch().count() % UINT32_MAX; std::srand(ticks); @@ -241,6 +248,13 @@ TEST_F(TestCategory, sparse_coo2crs) { } TEST_F(TestCategory, sparse_coo2crs_staticMatrix_edgeCases) { +#if defined(KOKKOS_ENABLE_SYCL) + if constexpr (std::is_same_v) { + std::cout << "Not running coo2csr on SYCL execution space" << std::endl; + return; + } +#endif + int m = 4; int n = 4; long long staticRow[16]{0, 1, 3, 2, 3, 2, 2, 2, 0, 0, 0, 1, 2, 0, 3, 0}; diff --git a/sparse/unit_test/Test_Sparse_sptrsv.hpp b/sparse/unit_test/Test_Sparse_sptrsv.hpp index 91403bb434..385367bca2 100644 --- a/sparse/unit_test/Test_Sparse_sptrsv.hpp +++ b/sparse/unit_test/Test_Sparse_sptrsv.hpp @@ -61,9 +61,6 @@ struct SptrsvTest { using range_policy_t = Kokkos::RangePolicy; - static inline const scalar_t ZERO = scalar_t(0); - static inline const scalar_t ONE = scalar_t(1); - static std::vector> get_5x5_ut_ones_fixture() { std::vector> A = {{1.00, 0.00, 1.00, 0.00, 0.00}, {0.00, 1.00, 0.00, 0.00, 1.00}, @@ -147,7 +144,7 @@ struct SptrsvTest { // known_lhs ValuesType known_lhs("known_lhs", nrows); // Create known solution lhs set to all 1's - Kokkos::deep_copy(known_lhs, ONE); + Kokkos::deep_copy(known_lhs, scalar_t(1)); // Solution to find ValuesType lhs("lhs", nrows); @@ -156,7 +153,7 @@ struct SptrsvTest { ValuesType rhs("rhs", nrows); Crs triMtx("triMtx", nrows, nrows, nnz, values, row_map, entries); - KokkosSparse::spmv("N", ONE, triMtx, known_lhs, ZERO, rhs); + KokkosSparse::spmv("N", scalar_t(1), triMtx, known_lhs, scalar_t(0), rhs); return std::make_tuple(triMtx, lhs, rhs); } @@ -199,7 +196,7 @@ struct SptrsvTest { Kokkos::parallel_reduce(range_policy_t(0, lhs.extent(0)), ReductionCheck(lhs), sum); EXPECT_EQ(sum, lhs.extent(0)); - Kokkos::deep_copy(lhs, ZERO); + Kokkos::deep_copy(lhs, scalar_t(0)); kh.destroy_sptrsv_handle(); } @@ -273,8 +270,8 @@ struct SptrsvTest { Kokkos::deep_copy(Uvalues, hUvalues); Crs mtxU("mtxU", nrows, nrows, nnz_sp, Uvalues, Urowptr, Ucolind); - Kokkos::deep_copy(B, ONE); - KokkosSparse::spmv("N", ONE, mtxU, B, ZERO, X); + Kokkos::deep_copy(B, scalar_t(1)); + KokkosSparse::spmv("N", scalar_t(1), mtxU, B, scalar_t(0), X); } } @@ -318,23 +315,23 @@ struct SptrsvTest { // values // first column (first supernode) hUvalues(0) = FIVE; - hUvalues(1) = ZERO; + hUvalues(1) = scalar_t(0); // second column (first supernode) - hUvalues(2) = ONE; + hUvalues(2) = scalar_t(1); hUvalues(3) = FIVE; // third column (second supernode) hUvalues(4) = FIVE; - hUvalues(5) = ONE; - hUvalues(6) = ZERO; + hUvalues(5) = scalar_t(1); + hUvalues(6) = scalar_t(0); // fourth column (third supernode) hUvalues(7) = FIVE; - hUvalues(8) = ONE; + hUvalues(8) = scalar_t(1); // fifth column (fourth supernode) hUvalues(9) = FIVE; - hUvalues(10) = ZERO; - hUvalues(11) = ONE; - hUvalues(12) = ONE; - hUvalues(13) = ONE; + hUvalues(10) = scalar_t(0); + hUvalues(11) = scalar_t(1); + hUvalues(12) = scalar_t(1); + hUvalues(13) = scalar_t(1); // store Ut in crsmat host_graph_t static_graph(hUrowind, hUcolptr); @@ -386,7 +383,7 @@ struct SptrsvTest { Kokkos::deep_copy(Lvalues, hLvalues); Crs mtxL("mtxL", nrows, nrows, nnz_sp, Lvalues, Lcolptr, Lrowind); - KokkosSparse::spmv("T", ONE, mtxL, X, ZERO, B); + KokkosSparse::spmv("T", scalar_t(1), mtxL, X, scalar_t(0), B); } } @@ -417,7 +414,7 @@ struct SptrsvTest { // > solve ValuesType b("b", nrows); Kokkos::deep_copy(b, B); - Kokkos::deep_copy(X, ZERO); + Kokkos::deep_copy(X, scalar_t(0)); sptrsv_solve(&khL, &khU, X, b); Kokkos::fence(); @@ -473,7 +470,7 @@ struct SptrsvTest { // > solve ValuesType b("b", nrows); Kokkos::deep_copy(b, B); - Kokkos::deep_copy(X, ZERO); + Kokkos::deep_copy(X, scalar_t(0)); sptrsv_solve(&khLd, &khUd, X, b); Kokkos::fence(); @@ -554,7 +551,7 @@ struct SptrsvTest { // known_lhs ValuesType known_lhs("known_lhs", nrows); // Create known solution lhs set to all 1's - Kokkos::deep_copy(known_lhs, ONE); + Kokkos::deep_copy(known_lhs, scalar_t(1)); // Solution to find lhs_v[i] = ValuesType("lhs", nrows); @@ -562,7 +559,7 @@ struct SptrsvTest { // A*known_lhs generates rhs: rhs is dense, use spmv rhs_v[i] = ValuesType("rhs", nrows); - KokkosSparse::spmv("N", ONE, triMtx, known_lhs, ZERO, rhs_v[i]); + KokkosSparse::spmv("N", scalar_t(1), triMtx, known_lhs, scalar_t(0), rhs_v[i]); Kokkos::fence(); // Create handle