From 7844b534db13ecbf3f6c4a3b4264daf92a4389a1 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Thu, 2 Apr 2026 16:57:40 -0700 Subject: [PATCH 01/33] Update BLT --- blt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blt b/blt index e783e30f28..aaf5d1862c 160000 --- a/blt +++ b/blt @@ -1 +1 @@ -Subproject commit e783e30f2823ee1a208f7f90741b41c1f5a08063 +Subproject commit aaf5d1862ce9a7f98ef29640ae82fd214621e286 From 923dbc17f401fdb46980f1db2650ecbba0bc0515 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Fri, 3 Apr 2026 12:36:06 -0700 Subject: [PATCH 02/33] Initial CUDA 13 work. Compiles and runs on RH9 with both CUDA 12 and 13. --- include/RAJA/policy/cuda/MemUtils_CUDA.hpp | 16 +++++++++++++ .../tests/test-resource-AsyncTime.hpp | 23 +++++++++++++------ tpl/camp | 2 +- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/include/RAJA/policy/cuda/MemUtils_CUDA.hpp b/include/RAJA/policy/cuda/MemUtils_CUDA.hpp index 6b51d04249..28df079f03 100644 --- a/include/RAJA/policy/cuda/MemUtils_CUDA.hpp +++ b/include/RAJA/policy/cuda/MemUtils_CUDA.hpp @@ -146,10 +146,26 @@ struct DevicePinnedAllocator void* ptr; CAMP_CUDA_API_INVOKE_AND_CHECK(cudaMallocManaged, &ptr, nbytes, cudaMemAttachGlobal); +#if CUDART_VERSION >= 13000 + cudaMemLocation devLoc{}; + devLoc.type = cudaMemLocationTypeDevice; + devLoc.id = device; + + CAMP_CUDA_API_INVOKE_AND_CHECK(cudaMemAdvise, ptr, nbytes, + cudaMemAdviseSetPreferredLocation, devLoc); + + cudaMemLocation cpuLoc{}; + cpuLoc.type = cudaMemLocationTypeHost; + cpuLoc.id = 0; + + CAMP_CUDA_API_INVOKE_AND_CHECK(cudaMemAdvise, ptr, nbytes, + cudaMemAdviseSetAccessedBy, cpuLoc); +#else CAMP_CUDA_API_INVOKE_AND_CHECK(cudaMemAdvise, ptr, nbytes, cudaMemAdviseSetPreferredLocation, device); CAMP_CUDA_API_INVOKE_AND_CHECK(cudaMemAdvise, ptr, nbytes, cudaMemAdviseSetAccessedBy, cudaCpuDeviceId); +#endif return ptr; } diff --git a/test/unit/resource/tests/test-resource-AsyncTime.hpp b/test/unit/resource/tests/test-resource-AsyncTime.hpp index d3cede75e7..47c9462115 100644 --- a/test/unit/resource/tests/test-resource-AsyncTime.hpp +++ b/test/unit/resource/tests/test-resource-AsyncTime.hpp @@ -32,22 +32,31 @@ gpu_time_wait_for(float time, float clockrate) { int get_clockrate() { int cuda_device = 0; - cudaDeviceProp deviceProp; CAMP_CUDA_API_INVOKE_AND_CHECK(cudaGetDevice, &cuda_device); - CAMP_CUDA_API_INVOKE_AND_CHECK(cudaGetDeviceProperties, &deviceProp, cuda_device); - if ((deviceProp.concurrentKernels == 0)) + + int concurrentKernels = 0; + CAMP_CUDA_API_INVOKE_AND_CHECK(cudaDeviceGetAttribute, + &concurrentKernels, + cudaDevAttrConcurrentKernels, + cuda_device); + + if (concurrentKernels == 0) { printf("> GPU does not support concurrent kernel execution\n"); printf(" CUDA kernel runs will be serialized\n"); return -1; } - //printf("> Detected Compute SM %d.%d hardware with %d multi-processors\n", - // deviceProp.major, deviceProp.minor, deviceProp.multiProcessorCount); + + int clockRate = 0; + CAMP_CUDA_API_INVOKE_AND_CHECK(cudaDeviceGetAttribute, + &clockRate, + cudaDevAttrClockRate, + cuda_device); #if defined(__arm__) || defined(__aarch64__) - return deviceProp.clockRate/1000; + return clockRate / 1000; #else - return deviceProp.clockRate; + return clockRate; #endif } diff --git a/tpl/camp b/tpl/camp index a8caefa9f4..3792ecd8ef 160000 --- a/tpl/camp +++ b/tpl/camp @@ -1 +1 @@ -Subproject commit a8caefa9f4c811b1a114b4ed2c9b681d40f12325 +Subproject commit 3792ecd8ef41436b502f71b3f407771528a25021 From e4e7db8d6b45f35bc1466d73efca0c5c69b6f31f Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Fri, 3 Apr 2026 14:08:38 -0700 Subject: [PATCH 03/33] Style --- include/RAJA/policy/cuda/MemUtils_CUDA.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/RAJA/policy/cuda/MemUtils_CUDA.hpp b/include/RAJA/policy/cuda/MemUtils_CUDA.hpp index 28df079f03..0812b24680 100644 --- a/include/RAJA/policy/cuda/MemUtils_CUDA.hpp +++ b/include/RAJA/policy/cuda/MemUtils_CUDA.hpp @@ -147,19 +147,19 @@ struct DevicePinnedAllocator CAMP_CUDA_API_INVOKE_AND_CHECK(cudaMallocManaged, &ptr, nbytes, cudaMemAttachGlobal); #if CUDART_VERSION >= 13000 - cudaMemLocation devLoc{}; + cudaMemLocation devLoc {}; devLoc.type = cudaMemLocationTypeDevice; - devLoc.id = device; + devLoc.id = device; CAMP_CUDA_API_INVOKE_AND_CHECK(cudaMemAdvise, ptr, nbytes, - cudaMemAdviseSetPreferredLocation, devLoc); + cudaMemAdviseSetPreferredLocation, devLoc); - cudaMemLocation cpuLoc{}; + cudaMemLocation cpuLoc {}; cpuLoc.type = cudaMemLocationTypeHost; - cpuLoc.id = 0; + cpuLoc.id = 0; CAMP_CUDA_API_INVOKE_AND_CHECK(cudaMemAdvise, ptr, nbytes, - cudaMemAdviseSetAccessedBy, cpuLoc); + cudaMemAdviseSetAccessedBy, cpuLoc); #else CAMP_CUDA_API_INVOKE_AND_CHECK(cudaMemAdvise, ptr, nbytes, cudaMemAdviseSetPreferredLocation, device); From 2522afe18298fd8613a95a1950e722a0b0a0bcd3 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Tue, 7 Apr 2026 17:01:27 -0700 Subject: [PATCH 04/33] CUB location has changed in CUDA 13 --- cmake/thirdparty/FindCUB.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/thirdparty/FindCUB.cmake b/cmake/thirdparty/FindCUB.cmake index 866157ff85..53bf3cd3b9 100644 --- a/cmake/thirdparty/FindCUB.cmake +++ b/cmake/thirdparty/FindCUB.cmake @@ -14,7 +14,8 @@ find_path(CUB_INCLUDE_DIRS HINTS ${CUB_DIR}/ ${CUB_DIR}/include - ${CUDA_TOOLKIT_ROOT_DIR}/include) + ${CUDA_TOOLKIT_ROOT_DIR}/include + ${CUDA_TOOLKIT_ROOT_DIR}/include/cccl) find_package_handle_standard_args( CUB From 9a7821bf573401df4cfe0506331bf5bcafbde3cb Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Wed, 8 Apr 2026 09:35:19 -0700 Subject: [PATCH 05/33] Add CUDA 13 test to matrix suite --- .gitlab/jobs/matrix.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitlab/jobs/matrix.yml b/.gitlab/jobs/matrix.yml index 73a8eef9e1..96c1c88e0c 100644 --- a/.gitlab/jobs/matrix.yml +++ b/.gitlab/jobs/matrix.yml @@ -36,3 +36,8 @@ clang_18_1_8_cuda_12_6_0: variables: SPEC: " ~shared +cuda cuda_arch=90 +tests %llvm@=18.1.8 ^cuda@12.6.0+allow-unsupported-compilers" extends: .job_on_matrix + +clang_18_1_8_cuda_13_1_1: + variables: + SPEC: " ~shared +cuda cuda_arch=90 +tests %llvm@=18.1.8 ^cuda@13.1.1+allow-unsupported-compilers" + extends: .job_on_matrix From dc6d9f40835149c37ac56315e3f5475cf31ae4fe Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Wed, 8 Apr 2026 15:47:38 -0700 Subject: [PATCH 06/33] update camp --- tpl/camp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tpl/camp b/tpl/camp index 3792ecd8ef..a1fdc5412a 160000 --- a/tpl/camp +++ b/tpl/camp @@ -1 +1 @@ -Subproject commit 3792ecd8ef41436b502f71b3f407771528a25021 +Subproject commit a1fdc5412a55c5f8368fb15da16ec9431c7b0471 From 2cebf15564e0d2a43796eb7e6add83a2a72a2431 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Wed, 8 Apr 2026 16:03:43 -0700 Subject: [PATCH 07/33] Adding more retional to questions for discussion --- tpl/camp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tpl/camp b/tpl/camp index a1fdc5412a..8435e0d72a 160000 --- a/tpl/camp +++ b/tpl/camp @@ -1 +1 @@ -Subproject commit a1fdc5412a55c5f8368fb15da16ec9431c7b0471 +Subproject commit 8435e0d72aa5d1f39bb4bd9c5fda10980ab34d9f From f02c310ccd7a571cc0e45a31a7a79dbcf86f93bc Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Fri, 10 Apr 2026 10:00:54 -0700 Subject: [PATCH 08/33] Testing matrix CUDA build with modified spack package --- .uberenv_config.json | 2 +- .../llnl_raja/packages/.gitkeep | 0 .../llnl_raja/packages/raja/package.py | 643 ++++++++++++++++++ .../pull-request-testing/llnl_raja/repo.yaml | 3 + 4 files changed, 647 insertions(+), 1 deletion(-) create mode 100644 scripts/pull-request-testing/llnl_raja/packages/.gitkeep create mode 100644 scripts/pull-request-testing/llnl_raja/packages/raja/package.py create mode 100644 scripts/pull-request-testing/llnl_raja/repo.yaml diff --git a/.uberenv_config.json b/.uberenv_config.json index 452aa08baf..2d52007a34 100644 --- a/.uberenv_config.json +++ b/.uberenv_config.json @@ -6,6 +6,6 @@ "spack_url": "https://github.com/spack/spack.git", "spack_branch": "v1.1.1", "spack_configs_path": "scripts/radiuss-spack-configs", -"spack_packages_path": "scripts/radiuss-spack-configs/spack_repo/llnl_radiuss/packages", + "spack_packages_path": ["scripts/radiuss-spack-configs/spack_repo/llnl_radiuss/packages", "scripts/pull-request-testing/spack_repo"], "spack_setup_clingo": false } diff --git a/scripts/pull-request-testing/llnl_raja/packages/.gitkeep b/scripts/pull-request-testing/llnl_raja/packages/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/scripts/pull-request-testing/llnl_raja/packages/raja/package.py b/scripts/pull-request-testing/llnl_raja/packages/raja/package.py new file mode 100644 index 0000000000..d8d8f54188 --- /dev/null +++ b/scripts/pull-request-testing/llnl_raja/packages/raja/package.py @@ -0,0 +1,643 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import re +import socket + +from spack_repo.builtin.build_systems.cached_cmake import ( + CachedCMakePackage, + cmake_cache_option, + cmake_cache_path, + cmake_cache_string, +) +from spack_repo.builtin.build_systems.cuda import CudaPackage +from spack_repo.builtin.build_systems.rocm import ROCmPackage +from spack_repo.builtin.packages.blt.package import llnl_link_helpers + +from spack.package import * + + +# Starting with 2022.03.0, the only submodule we want to fetch is tpl/desul +# since there is no package for it. Other RAJA submodules are defined as +# dependencies. +def submodules(package): + submodules = [] + submodules.append("tpl/desul") + return submodules + + +class Raja(CachedCMakePackage, CudaPackage, ROCmPackage): + """RAJA Parallel Framework.""" + + homepage = "https://github.com/LLNL/RAJA" + git = "https://github.com/LLNL/RAJA.git" + tags = ["radiuss", "e4s"] + + maintainers("adrienbernede", "davidbeckingsale", "kab163") + + license("BSD-3-Clause") + + version("develop", branch="develop", submodules=submodules) + version("main", branch="main", submodules=submodules) + version( + "2025.12.2", + tag="v2025.12.2", + commit="eca7c5015a5cf8bf7cc8ad1829fd36d3276ab274", + submodules=submodules, + ) + version( + "2025.12.1", + tag="v2025.12.1", + commit="3b8b59a1e9be2e1066c0d77372b3bf5956e6d6e2", + submodules=submodules, + ) + version( + "2025.12.0", + tag="v2025.12.0", + commit="e827035c630e71a9358e2f21c2f3cf6fd5fb6605", + submodules=submodules, + ) + version( + "2025.09.1", + tag="v2025.09.1", + commit="1e0756eda3c344da362e483afb9100ebd8137a2c", + submodules=submodules, + ) + version( + "2025.09.0", + tag="v2025.09.0", + commit="ca756788dbdd43fec2a3840389126ae94a905d5f", + submodules=submodules, + ) + version( + "2025.03.2", + tag="v2025.03.2", + commit="6e36a94380adbe88fed11a3213fc08461428ece0", + submodules=submodules, + ) + version( + "2025.03.1", + tag="v2025.03.1", + commit="ffa7b92377705aff855b4bf602e197ae4f8e8cc3", + submodules=submodules, + ) + version( + "2025.03.0", + tag="v2025.03.0", + commit="1d70abf171474d331f1409908bdf1b1c3fe19222", + submodules=submodules, + ) + version( + "2024.07.0", + tag="v2024.07.0", + commit="4d7fcba55ebc7cb972b7cc9f6778b48e43792ea1", + submodules=submodules, + ) + version( + "2024.02.2", + tag="v2024.02.2", + commit="593f756b14ac57ded33ee61d8d2292d4beb840e6", + submodules=submodules, + ) + version( + "2024.02.1", + tag="v2024.02.1", + commit="3ada0950b0774ec907d30a9eceaf6af7478b833b", + submodules=submodules, + ) + version( + "2024.02.0", + tag="v2024.02.0", + commit="82d1b926ada0fbb15a4a6e0adadc30c715cfda7b", + submodules=submodules, + ) + version( + "2023.06.1", + tag="v2023.06.1", + commit="9b5f61edf3aa1e6fdbc9a4b30828c81504639963", + submodules=submodules, + ) + version( + "2023.06.0", + tag="v2023.06.0", + commit="e330b2560747d5417cd7bd265fab3fb91d32ecbd", + submodules=submodules, + ) + version( + "2022.10.5", + tag="v2022.10.5", + commit="3774f51339459bbbdb77055aa23f82919b6335b6", + submodules=submodules, + ) + version( + "2022.10.4", + tag="v2022.10.4", + commit="c2a6b1740759ae3ae7c85b35e20dbffbe235355d", + submodules=submodules, + ) + version( + "2022.03.0", + tag="v2022.03.0", + commit="4351fe6a50bd579511a625b017c9e054885e7fd2", + submodules=submodules, + ) + version( + "0.14.0", tag="v0.14.0", commit="357933a42842dd91de5c1034204d937fce0a2a44", submodules=True + ) + version( + "0.13.0", tag="v0.13.0", commit="3047fa720132d19ee143b1fcdacaa72971f5988c", submodules=True + ) + version( + "0.12.1", tag="v0.12.1", commit="9cb6370bb2868e35ebba23cdce927f5f7f9da530", submodules=True + ) + version( + "0.12.0", tag="v0.12.0", commit="32d92e38da41cc8d4db25ec79b9884a73a0cb3a1", submodules=True + ) + version( + "0.11.0", tag="v0.11.0", commit="0502b9b69c4cb60aa0afbdf699b555c76cb18f22", submodules=True + ) + version( + "0.10.1", tag="v0.10.1", commit="be91e040130678b1350dbda56cc352433db758bd", submodules=True + ) + version( + "0.10.0", tag="v0.10.0", commit="53cb89cf788d28bc4ed2b4e6f75483fdd26024aa", submodules=True + ) + version( + "0.9.0", tag="v0.9.0", commit="df7ca1fa892b6ac4147c614d2d739d5022f63fc7", submodules=True + ) + version( + "0.8.0", tag="v0.8.0", commit="8d19a8c2cbac611de6f92ad8852b9f3454b27e63", submodules=True + ) + version( + "0.7.0", tag="v0.7.0", commit="caa33b371b586dfae3d8569caee91c5eddfd7b31", submodules=True + ) + version( + "0.6.0", tag="v0.6.0", commit="cc7a97e8b4e52c3de820c9dfacd358822a147871", submodules=True + ) + version( + "0.5.3", tag="v0.5.3", commit="1ca35c0ed2a43a3fa9c6cd70c5d25f16d88ecd8c", submodules=True + ) + version( + "0.5.2", tag="v0.5.2", commit="4d5c3d5d7f311838855f7010810610349e729f64", submodules=True + ) + version( + "0.5.1", tag="v0.5.1", commit="bf340abe5199d7e051520913c9a7a5de336b5820", submodules=True + ) + version( + "0.5.0", tag="v0.5.0", commit="9b539d84fdad049f65caeba836f41031f5baf4cc", submodules=True + ) + version( + "0.4.1", tag="v0.4.1", commit="3618cfe95d6a442fa50fbe7bfbcf654cf9f800b9", submodules=True + ) + version( + "0.4.0", tag="v0.4.0", commit="31b2a48192542c2da426885baa5af0ed57606b78", submodules=True + ) + + # export targets when building pre-2.4.0 release with BLT 0.4.0+ + patch( + "https://github.com/LLNL/RAJA/commit/eca1124ee4af380d6613adc6012c307d1fd4176b.patch?full_index=1", + sha256="12bb78c00b6683ad3e7fd4e3f87f9776bae074b722431b79696bc862816735ef", + when="@:0.13.0 ^blt@0.4:", + ) + + # Backward compatibility is stopped from ROCm 6.0 + # Future relase will have the change from PR https://github.com/LLNL/RAJA/pull/1568 + patch( + "https://github.com/LLNL/RAJA/commit/406eb8dee05a41eb32c421c375688a4863b60642.patch?full_index=1", + sha256="d9ce5ef038555cbccb330a9016b7be77e56ae0660583cba955dab9d0297a4b07", + when="^hip@6.0", + ) + + # Fix compilation issue reported by Intel from their new compiler version + patch( + "https://github.com/LLNL/RAJA/commit/3e831e034bd92daacf49f40b66459aefd6ea3972.patch?full_index=1", + sha256="c0548fc5220f24082fb2592d5b4e8b7c8c783b87906d5f0950d53953d25161f6", + when="@2024.02.1:2024.02.99 %oneapi@2025:", + ) + + variant("openmp", default=False, description="Build OpenMP backend") + variant("shared", default=False, description="Build shared libs") + variant("desul", default=False, description="Build desul atomics backend") + variant("vectorization", default=True, description="Build SIMD/SIMT intrinsics support") + variant( + "omptask", default=False, description="Build OpenMP task variants of internal algorithms" + ) + variant("omptarget", default=False, description="Build OpenMP on target device support") + variant("sycl", default=False, description="Build sycl backend") + variant("gpu-profiling", default=False, description="Enable GPU profiling") + + variant("plugins", default=False, description="Enable runtime plugins") + variant("caliper", default=False, description="Enable caliper support") + variant("examples", default=True, description="Build examples.") + variant("exercises", default=True, description="Build exercises.") + # TODO: figure out gtest dependency and then set this default True + # and remove the +tests conflict below. + variant("tests", default=False, description="Build tests") + + # we don't use variants to express the failing test, we only add a variant to + # define whether we want to run all the tests (including those known to fail) + # or only the passing ones. + variant( + "run-all-tests", + default=False, + description="Run all the tests, including those known to fail.", + ) + + variant( + "lowopttest", + default=False, + description="For developers, lowers optimization level to pass tests with some compilers", + ) + + variant( + "cxxstd", + default="17", + values=("11", "14", "17", "20"), + description="C++ standard to build with", + ) + conflicts("cxxstd=11", when="@0.14.0:") + conflicts("cxxstd=14", when="@2025.09.0:") + conflicts("+sycl cxxstd=14", when="@2024.07.0:") + + depends_on("cxx", type="build") + depends_on("c", type="build") + + depends_on("blt", type="build") + depends_on("blt@0.7.1:", type="build", when="@2025.09.0:") + depends_on("blt@0.7.0:", type="build", when="@2025.03.0:") + depends_on("blt@0.6.2:", type="build", when="@2024.02.1:") + depends_on("blt@0.6.1", type="build", when="@2024.02.0") + depends_on("blt@0.5.3", type="build", when="@2023.06.0:2023.06.1") + depends_on("blt@0.5.2:0.5.3", type="build", when="@2022.10.5") + depends_on("blt@0.5.0:0.5.3", type="build", when="@0.14.1:2022.10.4") + depends_on("blt@0.4.1", type="build", when="@0.14.0") + depends_on("blt@0.4.0:0.4.1", type="build", when="@0.13.0") + depends_on("blt@0.3.6:0.4.1", type="build", when="@:0.12.0") + conflicts("^blt@:0.3.6", when="+rocm") + + depends_on("camp") + depends_on("camp+openmp", when="+openmp") + depends_on("camp+omptarget", when="+omptarget") + depends_on("camp+sycl", when="+sycl") + depends_on("camp@2025.12:", when="@2025.12:") + depends_on("camp@2025.09", when="@2025.09") + depends_on("camp@2025.03", when="@2025.03") + depends_on("camp@2024.07", when="@2024.07") + depends_on("camp@2024.02.1", when="@2024.02.1") + depends_on("camp@2024.02.0", when="@2024.02.0") + depends_on("camp@2023.06.0", when="@2023.06.0:2023.06.1") + depends_on("camp@2022.10.1:2023.06.0", when="@2022.10.3:2022.10.5") + depends_on("camp@2022.10.0:2023.06.0", when="@2022.10.0:2022.10.2") + depends_on("camp@2022.03.2", when="@2022.03.0:2022.03.1") + depends_on("camp@0.2.2:0.2.3", when="@0.14.0") + depends_on("camp@0.1.0", when="@0.10.0:0.13.0") + + depends_on("cmake@3.24:", when="@2025.09.0:", type="build") + depends_on("cmake@3.23:", when="@2024.07.0:2025.03.2", type="build") + depends_on("cmake@3.23:", when="@2022.10.0:2024.02.2+rocm", type="build") + depends_on("cmake@3.20:", when="@2022.10.0:2024.02.2", type="build") + depends_on("cmake@3.20:", when="@:2022.03+rocm", type="build") + depends_on("cmake@3.14:", when="@:2022.03", type="build") + + depends_on("llvm-openmp", when="+openmp %apple-clang") + + depends_on("caliper", when="+caliper") + + depends_on("rocprim", when="+rocm") + with when("+rocm @0.12.0:"): + depends_on("camp+rocm") + for arch in ROCmPackage.amdgpu_targets: + depends_on( + "camp+rocm amdgpu_target={0}".format(arch), when="amdgpu_target={0}".format(arch) + ) + conflicts("+openmp", when="@:2022.03") + + with when("+cuda @0.12.0:"): + depends_on("camp+cuda") + for sm_ in CudaPackage.cuda_arch_values: + depends_on("camp +cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) + + conflicts("+gpu-profiling", when="~cuda~rocm", msg="GPU profiling requires CUDA or ROCm") + conflicts("+gpu-profiling +cuda", when="@:2022.02.99") + conflicts("+gpu-profiling +rocm", when="@:2022.02.99") + + conflicts("+omptarget +rocm") + conflicts("+sycl +omptarget") + conflicts("+sycl +rocm") + conflicts( + "+sycl", + when="@:2024.02.99", + msg="Support for SYCL was introduced in RAJA after 2024.02 release, " + "please use a newer release.", + ) + + # https://github.com/spack/spack-packages/pull/2059#issuecomment-3443184517 + # SGS removing for testing with CUDA 13 + # conflicts("^cuda@13:", when="+cuda") + + def _get_sys_type(self, spec): + sys_type = spec.architecture + if "SYS_TYPE" in env: + sys_type = env["SYS_TYPE"] + return sys_type + + @property + def libs(self): + shared = "+shared" in self.spec + return find_libraries("libRAJA", root=self.prefix, shared=shared, recursive=True) + + @property + def cache_name(self): + hostname = socket.gethostname() + if "SYS_TYPE" in env: + hostname = hostname.rstrip("1234567890") + return "{0}-{1}-{2}@{3}-{4}.cmake".format( + hostname, + self._get_sys_type(self.spec), + self.spec.compiler.name, + self.spec.compiler.version, + self.spec.dag_hash(8), + ) + + def initconfig_compiler_entries(self): + spec = self.spec + compiler = self.compiler + # Default entries are already defined in CachedCMakePackage, inherit them: + entries = super().initconfig_compiler_entries() + + if spec.satisfies("+rocm ^blt@:0.6"): + entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) + + llnl_link_helpers(entries, spec, compiler) + + return entries + + def initconfig_hardware_entries(self): + spec = self.spec + entries = super().initconfig_hardware_entries() + + entries.append("#------------------{0}".format("-" * 30)) + entries.append("# Package custom hardware settings") + entries.append("#------------------{0}\n".format("-" * 30)) + + entries.append(cmake_cache_option("ENABLE_OPENMP", spec.satisfies("+openmp"))) + entries.append(cmake_cache_option("ENABLE_CUDA", spec.satisfies("+cuda"))) + + if spec.satisfies("+cuda"): + # CUDA configuration from cuda_for_radiuss_projects + cuda_flags = [] + if not spec.satisfies("cuda_arch=none"): + cuda_archs = ";".join(spec.variants["cuda_arch"].value) + entries.append(cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", cuda_archs)) + + # gcc-toolchain support + gcc_toolchain_regex = re.compile(".*gcc-toolchain.*") + using_toolchain = list( + filter(gcc_toolchain_regex.match, spec.compiler_flags["cxxflags"]) + ) + if using_toolchain: + cuda_flags.append("-Xcompiler {}".format(using_toolchain[0])) + + if cuda_flags: + entries.append(cmake_cache_string("CMAKE_CUDA_FLAGS", " ".join(cuda_flags))) + + if spec.satisfies("+rocm"): + entries.append(cmake_cache_option("ENABLE_HIP", True)) + + # HIP configuration from hip_for_radiuss_projects + rocm_root = spec["llvm-amdgpu"].prefix + gcc_toolchain_regex = re.compile(".*gcc-toolchain.*") + using_toolchain = list( + filter(gcc_toolchain_regex.match, spec.compiler_flags["cxxflags"]) + ) + hip_link_flags = "" + + if using_toolchain: + gcc_prefix = using_toolchain[0] + entries.append( + cmake_cache_string("HIP_CLANG_FLAGS", "--gcc-toolchain={0}".format(gcc_prefix)) + ) + entries.append( + cmake_cache_string( + "CMAKE_EXE_LINKER_FLAGS", + hip_link_flags + " -Wl,-rpath={0}/lib64".format(gcc_prefix), + ) + ) + else: + entries.append( + cmake_cache_string( + "CMAKE_EXE_LINKER_FLAGS", "-Wl,-rpath={0}/llvm/lib/".format(rocm_root) + ) + ) + + hipcc_flags = [] + if self.spec.satisfies("^rocprim@7.0"): + hipcc_flags.append("-std=c++17") + if self.spec.satisfies("@2025.09.0:"): + hipcc_flags.append("-std=c++17") + elif self.spec.satisfies("@0.14.0:2025.09.0"): + hipcc_flags.append("-std=c++14") + entries.append(cmake_cache_string("HIP_HIPCC_FLAGS", " ".join(hipcc_flags))) + else: + entries.append(cmake_cache_option("ENABLE_HIP", False)) + + return entries + + @property + def cxx_std(self): + return self.spec.variants.get("cxxstd").value + + def initconfig_package_entries(self): + spec = self.spec + entries = [] + + option_prefix = "RAJA_" if spec.satisfies("@0.14.0:") else "" + + # TPL locations + entries.append("#------------------{0}".format("-" * 60)) + entries.append("# TPLs") + entries.append("#------------------{0}\n".format("-" * 60)) + + entries.append(cmake_cache_path("BLT_SOURCE_DIR", spec["blt"].prefix)) + if "camp" in self.spec: + entries.append(cmake_cache_path("camp_DIR", spec["camp"].prefix)) + + # Build options + entries.append("#------------------{0}".format("-" * 60)) + entries.append("# Build Options") + entries.append("#------------------{0}\n".format("-" * 60)) + + entries.append(cmake_cache_string("CMAKE_BUILD_TYPE", spec.variants["build_type"].value)) + entries.append(cmake_cache_option("BUILD_SHARED_LIBS", spec.satisfies("+shared"))) + + entries.append(cmake_cache_option("RAJA_ENABLE_DESUL_ATOMICS", spec.satisfies("+desul"))) + + entries.append( + cmake_cache_option("RAJA_ENABLE_VECTORIZATION", spec.satisfies("+vectorization")) + ) + + entries.append(cmake_cache_option("RAJA_ENABLE_OPENMP_TASK", spec.satisfies("+omptask"))) + + entries.append( + cmake_cache_option("RAJA_ENABLE_TARGET_OPENMP", spec.satisfies("+omptarget")) + ) + + entries.append(cmake_cache_option("RAJA_ENABLE_SYCL", spec.satisfies("+sycl"))) + entries.append( + cmake_cache_option("RAJA_ENABLE_NV_TOOLS_EXT", spec.satisfies("+gpu-profiling +cuda")) + ) + entries.append( + cmake_cache_option("RAJA_ENABLE_ROCTX", spec.satisfies("+gpu-profiling +rocm")) + ) + + if spec.satisfies("+lowopttest"): + entries.append(cmake_cache_string("CMAKE_CXX_FLAGS_RELEASE", "-O1")) + + # C++ standard + entries.append(cmake_cache_string("BLT_CXX_STD", f"c++{self.cxx_std}")) + + entries.append( + cmake_cache_option("RAJA_ENABLE_RUNTIME_PLUGINS", spec.satisfies("+plugins")) + ) + + if spec.satisfies("+omptarget"): + entries.append( + cmake_cache_string( + "BLT_OPENMP_COMPILE_FLAGS", "-fopenmp;-fopenmp-targets=nvptx64-nvidia-cuda" + ) + ) + entries.append( + cmake_cache_string( + "BLT_OPENMP_LINK_FLAGS", "-fopenmp;-fopenmp-targets=nvptx64-nvidia-cuda" + ) + ) + + entries.append( + cmake_cache_option( + "{}ENABLE_EXAMPLES".format(option_prefix), spec.satisfies("+examples") + ) + ) + if spec.satisfies("@0.14.0:"): + entries.append( + cmake_cache_option( + "{}ENABLE_EXERCISES".format(option_prefix), spec.satisfies("+exercises") + ) + ) + else: + entries.append(cmake_cache_option("ENABLE_EXERCISES", spec.satisfies("+exercises"))) + + # TODO: Treat the workaround when building tests with spack wrapper + # For now, removing it to test CI, which builds tests outside of wrapper. + # Work around spack adding -march=ppc64le to SPACK_TARGET_ARGS which + # is used by the spack compiler wrapper. This can go away when BLT + # removes -Werror from GTest flags + # + # if self.spec.satisfies("%clang target=ppc64le:") + # or (not self.run_tests and not spec.satisfies("+tests")): + if not self.run_tests and not spec.satisfies("+tests"): + entries.append(cmake_cache_option("ENABLE_TESTS", False)) + else: + entries.append(cmake_cache_option("ENABLE_TESTS", True)) + if not spec.satisfies("+run-all-tests"): + if spec.satisfies("%clang@12.0.0:13.9.999"): + entries.append( + cmake_cache_string( + "CTEST_CUSTOM_TESTS_IGNORE", + "test-algorithm-sort-OpenMP.exe;test-algorithm-stable-sort-OpenMP.exe", + ) + ) + excluded_tests = [ + "test-algorithm-sort-Cuda.exe", + "test-algorithm-stable-sort-Cuda.exe", + "test-algorithm-sort-OpenMP.exe", + "test-algorithm-stable-sort-OpenMP.exe", + ] + if spec.satisfies("+cuda %clang@12.0.0:13.9.999"): + entries.append( + cmake_cache_string("CTEST_CUSTOM_TESTS_IGNORE", ";".join(excluded_tests)) + ) + if spec.satisfies("+cuda %xl@16.1.1.12"): + entries.append( + cmake_cache_string( + "CTEST_CUSTOM_TESTS_IGNORE", + "test-algorithm-sort-Cuda.exe;test-algorithm-stable-sort-Cuda.exe", + ) + ) + + entries.append(cmake_cache_option("RAJA_HOST_CONFIG_LOADED", True)) + + return entries + + def cmake_args(self): + return [] + + @property + def build_relpath(self): + """Relative path to the cmake build subdirectory.""" + return join_path("..", self.build_dirname) + + @run_after("install") + def setup_build_tests(self): + """Copy the build test files after the package is installed to a + relative install test subdirectory for use during `spack test run`.""" + # Now copy the relative files + cache_extra_test_sources(self, self.build_relpath) + + # Ensure the path exists since relying on a relative path at the + # same level as the normal stage source path. + mkdirp(install_test_root(self)) + + @property + def _extra_tests_path(self): + # TODO: The tests should be converted to re-build and run examples + # TODO: using the installed libraries. + return join_path(install_test_root(self), self.build_relpath, "bin") + + def run_example(self, exe, expected): + """run and check outputs of the example""" + with working_dir(self._extra_tests_path): + example = which(exe) + if example is None: + raise SkipTest(f"{exe} was not built") + + out = example(output=str.split, error=str.split) + check_outputs(expected, out) + + def test_line_of_sight(self): + """check line of sight example""" + self.run_example( + "ex5_line-of-sight_solution", + [r"C-style sequential", r"RAJA sequential", r"result -- PASS"], + ) + + def test_stencil_offset_layout(self): + """check stencil offset layout""" + self.run_example( + "ex6_stencil-offset-layout_solution", [r"RAJA Views \(permuted\)", r"result -- PASS"] + ) + + def test_tiled_matrix(self): + """check tiled matrix transpose""" + self.run_example( + "ex8_tiled-matrix-transpose_solution", + [r"C-version", r"RAJA sequential", r"result -- PASS"], + ) + + def test_dynamic_tile(self): + """check kernel dynamic tile""" + self.run_example("kernel-dynamic-tile", [r"Running index", r"(24,24)"]) + + def test_plugin_example(self): + """check plugin example""" + self.run_example("plugin-example", [r"Launching host kernel for the 10 time"]) + + def test_matrix_multiply(self): + """check batched matrix multiple tutorial""" + self.run_example( + "tut_batched-matrix-multiply", [r"batched matrix multiplication", r"result -- PASS"] + ) + + def test_wave_equation(self): + """check wave equation""" + self.run_example("wave-eqn", [r"Max Error = 2", r"Evolved solution to time"]) diff --git a/scripts/pull-request-testing/llnl_raja/repo.yaml b/scripts/pull-request-testing/llnl_raja/repo.yaml new file mode 100644 index 0000000000..1b9a844d50 --- /dev/null +++ b/scripts/pull-request-testing/llnl_raja/repo.yaml @@ -0,0 +1,3 @@ +repo: + namespace: 'llnl_raja' + api: v2.0 From 7490bf4f4867ab36715897194ef6478a83155308 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Fri, 10 Apr 2026 10:38:03 -0700 Subject: [PATCH 09/33] Fixed directory structure --- .../{ => spack_repo}/llnl_raja/packages/.gitkeep | 0 .../{ => spack_repo}/llnl_raja/packages/raja/package.py | 0 scripts/pull-request-testing/{ => spack_repo}/llnl_raja/repo.yaml | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename scripts/pull-request-testing/{ => spack_repo}/llnl_raja/packages/.gitkeep (100%) rename scripts/pull-request-testing/{ => spack_repo}/llnl_raja/packages/raja/package.py (100%) rename scripts/pull-request-testing/{ => spack_repo}/llnl_raja/repo.yaml (100%) diff --git a/scripts/pull-request-testing/llnl_raja/packages/.gitkeep b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/.gitkeep similarity index 100% rename from scripts/pull-request-testing/llnl_raja/packages/.gitkeep rename to scripts/pull-request-testing/spack_repo/llnl_raja/packages/.gitkeep diff --git a/scripts/pull-request-testing/llnl_raja/packages/raja/package.py b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py similarity index 100% rename from scripts/pull-request-testing/llnl_raja/packages/raja/package.py rename to scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py diff --git a/scripts/pull-request-testing/llnl_raja/repo.yaml b/scripts/pull-request-testing/spack_repo/llnl_raja/repo.yaml similarity index 100% rename from scripts/pull-request-testing/llnl_raja/repo.yaml rename to scripts/pull-request-testing/spack_repo/llnl_raja/repo.yaml From 7c5465c0350776ee3b314543b8f94ebfc5c6478b Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Fri, 10 Apr 2026 11:25:37 -0700 Subject: [PATCH 10/33] Deep sigh, fixing path again --- .uberenv_config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.uberenv_config.json b/.uberenv_config.json index 2d52007a34..6482699cc6 100644 --- a/.uberenv_config.json +++ b/.uberenv_config.json @@ -6,6 +6,6 @@ "spack_url": "https://github.com/spack/spack.git", "spack_branch": "v1.1.1", "spack_configs_path": "scripts/radiuss-spack-configs", - "spack_packages_path": ["scripts/radiuss-spack-configs/spack_repo/llnl_radiuss/packages", "scripts/pull-request-testing/spack_repo"], +"spack_packages_path": ["scripts/pull-request-testing/spack_repo/llnl_raja/packages", "scripts/radiuss-spack-configs/spack_repo/llnl_radiuss/packages"], "spack_setup_clingo": false } From a1bf791c0c491d1751c794c11050f2595be0a22a Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Fri, 10 Apr 2026 15:44:00 -0700 Subject: [PATCH 11/33] Use development versions of BLT and Camp --- .gitlab/jobs/matrix.yml | 2 +- .../llnl_raja/packages/camp/camp-rocm6.patch | 15 ++ .../camp/libstdc++-13-missing-header.patch | 24 +++ .../llnl_raja/packages/camp/package.py | 161 ++++++++++++++++++ 4 files changed, 201 insertions(+), 1 deletion(-) create mode 100644 scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/camp-rocm6.patch create mode 100644 scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/libstdc++-13-missing-header.patch create mode 100644 scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py diff --git a/.gitlab/jobs/matrix.yml b/.gitlab/jobs/matrix.yml index 96c1c88e0c..e77397a950 100644 --- a/.gitlab/jobs/matrix.yml +++ b/.gitlab/jobs/matrix.yml @@ -39,5 +39,5 @@ clang_18_1_8_cuda_12_6_0: clang_18_1_8_cuda_13_1_1: variables: - SPEC: " ~shared +cuda cuda_arch=90 +tests %llvm@=18.1.8 ^cuda@13.1.1+allow-unsupported-compilers" + SPEC: " ~shared +cuda cuda_arch=90 +tests %llvm@=18.1.8 ^cuda@13.1.1+allow-unsupported-compilers ^blt@develop ^camp@main" extends: .job_on_matrix diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/camp-rocm6.patch b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/camp-rocm6.patch new file mode 100644 index 0000000000..dbb3fa0220 --- /dev/null +++ b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/camp-rocm6.patch @@ -0,0 +1,15 @@ +diff -ruN spack-src/include/camp/resource/hip.hpp spack-src-patched/include/camp/resource/hip.hpp +--- spack-src/include/camp/resource/hip.hpp 2021-08-20 23:38:39.000000000 +0000 ++++ spack-src-patched/include/camp/resource/hip.hpp 2024-06-06 21:34:25.174477941 +0000 +@@ -111,7 +111,11 @@ + hipPointerAttribute_t a; + hipError_t status = hipPointerGetAttributes(&a, p); + if (status == hipSuccess) { ++#if (HIP_VERSION_MAJOR >= 6) ++ switch (a.type) { ++#else + switch (a.memoryType) { ++#endif + case hipMemoryTypeHost: + return MemoryAccess::Pinned; + case hipMemoryTypeDevice: diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/libstdc++-13-missing-header.patch b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/libstdc++-13-missing-header.patch new file mode 100644 index 0000000000..d3c642abe6 --- /dev/null +++ b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/libstdc++-13-missing-header.patch @@ -0,0 +1,24 @@ +diff --git a/include/camp/resource.hpp b/include/camp/resource.hpp +index 58df206..763aa20 100644 +--- a/include/camp/resource.hpp ++++ b/include/camp/resource.hpp +@@ -12,6 +12,7 @@ http://github.com/llnl/camp + #define __CAMP_RESOURCE_HPP + + #include ++#include + #include + #include + #include +diff --git a/include/camp/resource/host.hpp b/include/camp/resource/host.hpp +index c765175..4428c57 100644 +--- a/include/camp/resource/host.hpp ++++ b/include/camp/resource/host.hpp +@@ -13,6 +13,7 @@ http://github.com/llnl/camp + + #include "camp/resource/event.hpp" + #include "camp/resource/platform.hpp" ++#include + + namespace camp + { diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py new file mode 100644 index 0000000000..dd6ca82bfe --- /dev/null +++ b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py @@ -0,0 +1,161 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack_repo.builtin.build_systems.cached_cmake import cmake_cache_string +from spack_repo.builtin.build_systems.cmake import CMakePackage +from spack_repo.builtin.build_systems.cuda import CudaPackage +from spack_repo.builtin.build_systems.rocm import ROCmPackage + +from spack.package import * + + +class Camp(CMakePackage, CudaPackage, ROCmPackage): + """ + Compiler agnostic metaprogramming library providing concepts, + type operations and tuples for C++ and cuda + """ + + #homepage = "https://github.com/LLNL/camp" + #git = "https://github.com/LLNL/camp.git" + #url = "https://github.com/LLNL/camp/archive/v0.1.0.tar.gz" + + # SGS Hacking for CUDA 13 testing + homepage = "https://github.com/smithsg/camp" + git = "https://github.com/smithsg/camp.git" + url = "https://github.com/LLNL/smithsg/archive/v0.1.0.tar.gz" + + maintainers("adrienbernede", "kab163", "trws") + + license("BSD-3-Clause") + + version("main", branch="feature/smith84/cuda-13-support", submodules=False) + version( + "2025.12.0", + tag="v2025.12.0", + commit="a8caefa9f4c811b1a114b4ed2c9b681d40f12325", + submodules=False, + ) + version( + "2025.09.2", + tag="v2025.09.2", + commit="4070ce93a802849d61037310a87c50cc24c9e498", + submodules=False, + ) + version( + "2025.09.0", + tag="v2025.09.0", + commit="b642f29b9d0eee9113bea2791958c29243063e5c", + submodules=False, + ) + version( + "2025.03.0", + tag="v2025.03.0", + commit="ee0a3069a7ae72da8bcea63c06260fad34901d43", + submodules=False, + ) + version( + "2024.07.0", + tag="v2024.07.0", + commit="0f07de4240c42e0b38a8d872a20440cb4b33d9f5", + submodules=False, + ) + version( + "2024.02.1", + tag="v2024.02.1", + commit="79c320fa09db987923b56884afdc9f82f4b70fc4", + submodules=False, + ) + version( + "2024.02.0", + tag="v2024.02.0", + commit="03c80a6c6ab4f97e76a52639563daec71435a277", + submodules=False, + ) + version( + "2023.06.0", + tag="v2023.06.0", + commit="ac34c25b722a06b138bc045d38bfa5e8fa3ec9c5", + submodules=False, + ) + version("2022.10.1", sha256="2d12f1a46f5a6d01880fc075cfbd332e2cf296816a7c1aa12d4ee5644d386f02") + version("2022.10.0", sha256="3561c3ef00bbcb61fe3183c53d49b110e54910f47e7fc689ad9ccce57e55d6b8") + version("2022.03.2", sha256="bc4aaeacfe8f2912e28f7a36fc731ab9e481bee15f2c6daf0cb208eed3f201eb") + version("2022.03.0", sha256="e9090d5ee191ea3a8e36b47a8fe78f3ac95d51804f1d986d931e85b8f8dad721") + version("0.3.0", sha256="129431a049ca5825443038ad5a37a86ba6d09b2618d5fe65d35f83136575afdb") + version("0.2.3", sha256="58a0f3bd5eadb588d7dc83f3d050aff8c8db639fc89e8d6553f9ce34fc2421a7") + version("0.2.2", sha256="194d38b57e50e3494482a7f94940b27f37a2bee8291f2574d64db342b981d819") + version("0.1.0", sha256="fd4f0f2a60b82a12a1d9f943f8893dc6fe770db493f8fae5ef6f7d0c439bebcc") + + # TODO: figure out gtest dependency and then set this default True. + variant("tests", default=False, description="Build tests") + variant("openmp", default=False, description="Build with OpenMP support") + variant("omptarget", default=False, description="Build with OpenMP Target support") + variant("sycl", default=False, description="Build with Sycl support") + + depends_on("c", type="build") + depends_on("cxx", type="build") + + with when("+cuda"): + depends_on("cub", when="^cuda@:10") + + depends_on("blt", type="build") + depends_on("blt@0.7.1:", type="build", when="@2025.09.0:") + depends_on("blt@0.7.0:", type="build", when="@2025.03.0:") + depends_on("blt@0.6.2:", type="build", when="@2024.02.1:") + depends_on("blt@0.6.1", type="build", when="@2024.02.0") + depends_on("blt@0.5.0:0.5.3", type="build", when="@2022.03.0:2023.06.0") + + patch("libstdc++-13-missing-header.patch", when="@:2022.10") + + patch("camp-rocm6.patch", when="@0.2.3 +rocm ^hip@6:") + + conflicts("^blt@:0.3.6", when="+rocm") + + conflicts("+omptarget +rocm") + conflicts("+sycl +omptarget") + conflicts("+sycl +rocm") + conflicts( + "+sycl", + when="@:2024.02.99", + msg="Support for SYCL was introduced in RAJA after 2024.02 release, " + "please use a newer release.", + ) + + def cmake_args(self): + spec = self.spec + + options = [] + + options.append("-DBLT_SOURCE_DIR={0}".format(spec["blt"].prefix)) + + options.append(self.define_from_variant("ENABLE_CUDA", "cuda")) + if spec.satisfies("+cuda"): + options.append("-DCUDA_TOOLKIT_ROOT_DIR={0}".format(spec["cuda"].prefix)) + + if not spec.satisfies("cuda_arch=none"): + cuda_arch = spec.variants["cuda_arch"].value + options.append("-DCMAKE_CUDA_ARCHITECTURES={0}".format(cuda_arch[0])) + options.append("-DCUDA_ARCH=sm_{0}".format(cuda_arch[0])) + flag = "-arch sm_{0}".format(cuda_arch[0]) + options.append("-DCMAKE_CUDA_FLAGS:STRING={0}".format(flag)) + + options.append(self.define_from_variant("ENABLE_HIP", "rocm")) + if spec.satisfies("+rocm"): + rocm_root = spec["llvm-amdgpu"].prefix + options.append(self.define("ROCM_PATH", rocm_root)) + + archs = ";".join(self.spec.variants["amdgpu_target"].value) + options.append("-DCMAKE_HIP_ARCHITECTURES={0}".format(archs)) + options.append("-DGPU_TARGETS={0}".format(archs)) + options.append("-DAMDGPU_TARGETS={0}".format(archs)) + + if spec.satisfies("+omptarget"): + options.append(cmake_cache_string("RAJA_DATA_ALIGN", 64)) + + options.append(self.define_from_variant("ENABLE_TESTS", "tests")) + options.append(self.define_from_variant("ENABLE_OPENMP", "openmp")) + options.append(self.define_from_variant("CAMP_ENABLE_TARGET_OPENMP", "omptarget")) + options.append(self.define_from_variant("ENABLE_SYCL", "sycl")) + + return options From 03961641938f92acf13db769c4c593c58161ca76 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Mon, 13 Apr 2026 09:32:57 -0700 Subject: [PATCH 12/33] Fix package testing paths --- .gitlab/jobs/matrix.yml | 2 +- .../llnl_raja/packages/camp/package.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitlab/jobs/matrix.yml b/.gitlab/jobs/matrix.yml index e77397a950..f537805765 100644 --- a/.gitlab/jobs/matrix.yml +++ b/.gitlab/jobs/matrix.yml @@ -39,5 +39,5 @@ clang_18_1_8_cuda_12_6_0: clang_18_1_8_cuda_13_1_1: variables: - SPEC: " ~shared +cuda cuda_arch=90 +tests %llvm@=18.1.8 ^cuda@13.1.1+allow-unsupported-compilers ^blt@develop ^camp@main" + SPEC: " ~shared +cuda cuda_arch=90 +tests %llvm@=18.1.8 ^cuda@13.1.1+allow-unsupported-compilers ^blt@develop ^camp@test" extends: .job_on_matrix diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py index dd6ca82bfe..1ed339a002 100644 --- a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py +++ b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py @@ -16,20 +16,20 @@ class Camp(CMakePackage, CudaPackage, ROCmPackage): type operations and tuples for C++ and cuda """ - #homepage = "https://github.com/LLNL/camp" - #git = "https://github.com/LLNL/camp.git" - #url = "https://github.com/LLNL/camp/archive/v0.1.0.tar.gz" - - # SGS Hacking for CUDA 13 testing - homepage = "https://github.com/smithsg/camp" - git = "https://github.com/smithsg/camp.git" - url = "https://github.com/LLNL/smithsg/archive/v0.1.0.tar.gz" + homepage = "https://github.com/LLNL/camp" + git = "https://github.com/LLNL/camp.git" + url = "https://github.com/LLNL/camp/archive/v0.1.0.tar.gz" maintainers("adrienbernede", "kab163", "trws") license("BSD-3-Clause") - version("main", branch="feature/smith84/cuda-13-support", submodules=False) + # SGS Hacking for CUDA 13 testing + version("test", + branch="feature/smith84/cuda-13-support", + git = "https://github.com/smithsg/camp.git", + submodules=False) + version("main", branch="main", submodules=False) version( "2025.12.0", tag="v2025.12.0", From ab463650778512875dcdfad06ad315cbcf608b73 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Tue, 14 Apr 2026 08:08:34 -0700 Subject: [PATCH 13/33] Temporary mod to use branch of CAMP --- .../llnl_raja/packages/camp/package.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py index 1ed339a002..7d3264df7f 100644 --- a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py +++ b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py @@ -24,17 +24,17 @@ class Camp(CMakePackage, CudaPackage, ROCmPackage): license("BSD-3-Clause") - # SGS Hacking for CUDA 13 testing - version("test", - branch="feature/smith84/cuda-13-support", - git = "https://github.com/smithsg/camp.git", - submodules=False) version("main", branch="main", submodules=False) version( "2025.12.0", - tag="v2025.12.0", - commit="a8caefa9f4c811b1a114b4ed2c9b681d40f12325", - submodules=False, + # SGS Hacking for CUDA 13 testing; redirect CAMP to temporary version with + # CUDA 13 modifications. + branch="feature/smith84/cuda-13-support", + git = "https://github.com/smithsg/camp.git", + submodules=False) + #tag="v2025.12.0", + #commit="a8caefa9f4c811b1a114b4ed2c9b681d40f12325", + #submodules=False, ) version( "2025.09.2", From 8ab7ebe444cfb798d9076a817560d3b8c98ff8e1 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Tue, 14 Apr 2026 08:33:15 -0700 Subject: [PATCH 14/33] Fixed typo --- .../spack_repo/llnl_raja/packages/camp/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py index 7d3264df7f..f945443da2 100644 --- a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py +++ b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py @@ -31,7 +31,7 @@ class Camp(CMakePackage, CudaPackage, ROCmPackage): # CUDA 13 modifications. branch="feature/smith84/cuda-13-support", git = "https://github.com/smithsg/camp.git", - submodules=False) + submodules=False, #tag="v2025.12.0", #commit="a8caefa9f4c811b1a114b4ed2c9b681d40f12325", #submodules=False, From fc0bee70336250289355be738f4ecacc2057632e Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Tue, 14 Apr 2026 09:10:26 -0700 Subject: [PATCH 15/33] Fix package URL --- .../spack_repo/llnl_raja/packages/camp/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py index f945443da2..4ab3c276d8 100644 --- a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py +++ b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py @@ -30,7 +30,7 @@ class Camp(CMakePackage, CudaPackage, ROCmPackage): # SGS Hacking for CUDA 13 testing; redirect CAMP to temporary version with # CUDA 13 modifications. branch="feature/smith84/cuda-13-support", - git = "https://github.com/smithsg/camp.git", + git = "https://github.com/smithsg84/camp.git", submodules=False, #tag="v2025.12.0", #commit="a8caefa9f4c811b1a114b4ed2c9b681d40f12325", From 647c70110c5ee98523e433dc131fa0855e1d3593 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Tue, 14 Apr 2026 09:14:19 -0700 Subject: [PATCH 16/33] Revert camp version --- .gitlab/jobs/matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/jobs/matrix.yml b/.gitlab/jobs/matrix.yml index f537805765..03d08d8040 100644 --- a/.gitlab/jobs/matrix.yml +++ b/.gitlab/jobs/matrix.yml @@ -39,5 +39,5 @@ clang_18_1_8_cuda_12_6_0: clang_18_1_8_cuda_13_1_1: variables: - SPEC: " ~shared +cuda cuda_arch=90 +tests %llvm@=18.1.8 ^cuda@13.1.1+allow-unsupported-compilers ^blt@develop ^camp@test" + SPEC: " ~shared +cuda cuda_arch=90 +tests %llvm@=18.1.8 ^cuda@13.1.1+allow-unsupported-compilers ^blt@develop" extends: .job_on_matrix From 87d308afb1535ab6c44f397e0dd84ae51845b42e Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Wed, 15 Apr 2026 08:49:05 -0700 Subject: [PATCH 17/33] Increase RAJA job allocation time on matrix --- .gitlab/custom-variables.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/custom-variables.yml b/.gitlab/custom-variables.yml index b79f52c80f..159b467901 100644 --- a/.gitlab/custom-variables.yml +++ b/.gitlab/custom-variables.yml @@ -31,7 +31,7 @@ variables: # Matrix (SLURM) allocation settings MATRIX_SHARED_ALLOC: "OFF" # Note: we repeat the reservation, helpful when jobs are manually re-triggered. - MATRIX_JOB_ALLOC: "--partition=pci --exclusive=user --time=20 --nodes=1" + MATRIX_JOB_ALLOC: "--partition=pci --exclusive=user --time=30 --nodes=1" # Project specific variants for matrix PROJECT_MATRIX_VARIANTS: "~shared +cuda cuda_arch=90 +tests" # Project specific deps for matrix From 67403426359e3485f43dc1b564d0f49f6b002860 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Thu, 7 May 2026 15:47:21 -0700 Subject: [PATCH 18/33] Update BLT and CAMP dependencies --- blt | 2 +- .../llnl_raja/packages/camp/camp-rocm6.patch | 15 -- .../camp/libstdc++-13-missing-header.patch | 24 --- .../llnl_raja/packages/camp/package.py | 161 ------------------ .../llnl_raja/packages/raja/package.py | 29 ++-- tpl/camp | 2 +- 6 files changed, 17 insertions(+), 216 deletions(-) delete mode 100644 scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/camp-rocm6.patch delete mode 100644 scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/libstdc++-13-missing-header.patch delete mode 100644 scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py diff --git a/blt b/blt index aaf5d1862c..f08f95e0f4 160000 --- a/blt +++ b/blt @@ -1 +1 @@ -Subproject commit aaf5d1862ce9a7f98ef29640ae82fd214621e286 +Subproject commit f08f95e0f49b1d53db8be2dd577d1cdbfd9e9f90 diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/camp-rocm6.patch b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/camp-rocm6.patch deleted file mode 100644 index dbb3fa0220..0000000000 --- a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/camp-rocm6.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -ruN spack-src/include/camp/resource/hip.hpp spack-src-patched/include/camp/resource/hip.hpp ---- spack-src/include/camp/resource/hip.hpp 2021-08-20 23:38:39.000000000 +0000 -+++ spack-src-patched/include/camp/resource/hip.hpp 2024-06-06 21:34:25.174477941 +0000 -@@ -111,7 +111,11 @@ - hipPointerAttribute_t a; - hipError_t status = hipPointerGetAttributes(&a, p); - if (status == hipSuccess) { -+#if (HIP_VERSION_MAJOR >= 6) -+ switch (a.type) { -+#else - switch (a.memoryType) { -+#endif - case hipMemoryTypeHost: - return MemoryAccess::Pinned; - case hipMemoryTypeDevice: diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/libstdc++-13-missing-header.patch b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/libstdc++-13-missing-header.patch deleted file mode 100644 index d3c642abe6..0000000000 --- a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/libstdc++-13-missing-header.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/include/camp/resource.hpp b/include/camp/resource.hpp -index 58df206..763aa20 100644 ---- a/include/camp/resource.hpp -+++ b/include/camp/resource.hpp -@@ -12,6 +12,7 @@ http://github.com/llnl/camp - #define __CAMP_RESOURCE_HPP - - #include -+#include - #include - #include - #include -diff --git a/include/camp/resource/host.hpp b/include/camp/resource/host.hpp -index c765175..4428c57 100644 ---- a/include/camp/resource/host.hpp -+++ b/include/camp/resource/host.hpp -@@ -13,6 +13,7 @@ http://github.com/llnl/camp - - #include "camp/resource/event.hpp" - #include "camp/resource/platform.hpp" -+#include - - namespace camp - { diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py deleted file mode 100644 index 4ab3c276d8..0000000000 --- a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/camp/package.py +++ /dev/null @@ -1,161 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack_repo.builtin.build_systems.cached_cmake import cmake_cache_string -from spack_repo.builtin.build_systems.cmake import CMakePackage -from spack_repo.builtin.build_systems.cuda import CudaPackage -from spack_repo.builtin.build_systems.rocm import ROCmPackage - -from spack.package import * - - -class Camp(CMakePackage, CudaPackage, ROCmPackage): - """ - Compiler agnostic metaprogramming library providing concepts, - type operations and tuples for C++ and cuda - """ - - homepage = "https://github.com/LLNL/camp" - git = "https://github.com/LLNL/camp.git" - url = "https://github.com/LLNL/camp/archive/v0.1.0.tar.gz" - - maintainers("adrienbernede", "kab163", "trws") - - license("BSD-3-Clause") - - version("main", branch="main", submodules=False) - version( - "2025.12.0", - # SGS Hacking for CUDA 13 testing; redirect CAMP to temporary version with - # CUDA 13 modifications. - branch="feature/smith84/cuda-13-support", - git = "https://github.com/smithsg84/camp.git", - submodules=False, - #tag="v2025.12.0", - #commit="a8caefa9f4c811b1a114b4ed2c9b681d40f12325", - #submodules=False, - ) - version( - "2025.09.2", - tag="v2025.09.2", - commit="4070ce93a802849d61037310a87c50cc24c9e498", - submodules=False, - ) - version( - "2025.09.0", - tag="v2025.09.0", - commit="b642f29b9d0eee9113bea2791958c29243063e5c", - submodules=False, - ) - version( - "2025.03.0", - tag="v2025.03.0", - commit="ee0a3069a7ae72da8bcea63c06260fad34901d43", - submodules=False, - ) - version( - "2024.07.0", - tag="v2024.07.0", - commit="0f07de4240c42e0b38a8d872a20440cb4b33d9f5", - submodules=False, - ) - version( - "2024.02.1", - tag="v2024.02.1", - commit="79c320fa09db987923b56884afdc9f82f4b70fc4", - submodules=False, - ) - version( - "2024.02.0", - tag="v2024.02.0", - commit="03c80a6c6ab4f97e76a52639563daec71435a277", - submodules=False, - ) - version( - "2023.06.0", - tag="v2023.06.0", - commit="ac34c25b722a06b138bc045d38bfa5e8fa3ec9c5", - submodules=False, - ) - version("2022.10.1", sha256="2d12f1a46f5a6d01880fc075cfbd332e2cf296816a7c1aa12d4ee5644d386f02") - version("2022.10.0", sha256="3561c3ef00bbcb61fe3183c53d49b110e54910f47e7fc689ad9ccce57e55d6b8") - version("2022.03.2", sha256="bc4aaeacfe8f2912e28f7a36fc731ab9e481bee15f2c6daf0cb208eed3f201eb") - version("2022.03.0", sha256="e9090d5ee191ea3a8e36b47a8fe78f3ac95d51804f1d986d931e85b8f8dad721") - version("0.3.0", sha256="129431a049ca5825443038ad5a37a86ba6d09b2618d5fe65d35f83136575afdb") - version("0.2.3", sha256="58a0f3bd5eadb588d7dc83f3d050aff8c8db639fc89e8d6553f9ce34fc2421a7") - version("0.2.2", sha256="194d38b57e50e3494482a7f94940b27f37a2bee8291f2574d64db342b981d819") - version("0.1.0", sha256="fd4f0f2a60b82a12a1d9f943f8893dc6fe770db493f8fae5ef6f7d0c439bebcc") - - # TODO: figure out gtest dependency and then set this default True. - variant("tests", default=False, description="Build tests") - variant("openmp", default=False, description="Build with OpenMP support") - variant("omptarget", default=False, description="Build with OpenMP Target support") - variant("sycl", default=False, description="Build with Sycl support") - - depends_on("c", type="build") - depends_on("cxx", type="build") - - with when("+cuda"): - depends_on("cub", when="^cuda@:10") - - depends_on("blt", type="build") - depends_on("blt@0.7.1:", type="build", when="@2025.09.0:") - depends_on("blt@0.7.0:", type="build", when="@2025.03.0:") - depends_on("blt@0.6.2:", type="build", when="@2024.02.1:") - depends_on("blt@0.6.1", type="build", when="@2024.02.0") - depends_on("blt@0.5.0:0.5.3", type="build", when="@2022.03.0:2023.06.0") - - patch("libstdc++-13-missing-header.patch", when="@:2022.10") - - patch("camp-rocm6.patch", when="@0.2.3 +rocm ^hip@6:") - - conflicts("^blt@:0.3.6", when="+rocm") - - conflicts("+omptarget +rocm") - conflicts("+sycl +omptarget") - conflicts("+sycl +rocm") - conflicts( - "+sycl", - when="@:2024.02.99", - msg="Support for SYCL was introduced in RAJA after 2024.02 release, " - "please use a newer release.", - ) - - def cmake_args(self): - spec = self.spec - - options = [] - - options.append("-DBLT_SOURCE_DIR={0}".format(spec["blt"].prefix)) - - options.append(self.define_from_variant("ENABLE_CUDA", "cuda")) - if spec.satisfies("+cuda"): - options.append("-DCUDA_TOOLKIT_ROOT_DIR={0}".format(spec["cuda"].prefix)) - - if not spec.satisfies("cuda_arch=none"): - cuda_arch = spec.variants["cuda_arch"].value - options.append("-DCMAKE_CUDA_ARCHITECTURES={0}".format(cuda_arch[0])) - options.append("-DCUDA_ARCH=sm_{0}".format(cuda_arch[0])) - flag = "-arch sm_{0}".format(cuda_arch[0]) - options.append("-DCMAKE_CUDA_FLAGS:STRING={0}".format(flag)) - - options.append(self.define_from_variant("ENABLE_HIP", "rocm")) - if spec.satisfies("+rocm"): - rocm_root = spec["llvm-amdgpu"].prefix - options.append(self.define("ROCM_PATH", rocm_root)) - - archs = ";".join(self.spec.variants["amdgpu_target"].value) - options.append("-DCMAKE_HIP_ARCHITECTURES={0}".format(archs)) - options.append("-DGPU_TARGETS={0}".format(archs)) - options.append("-DAMDGPU_TARGETS={0}".format(archs)) - - if spec.satisfies("+omptarget"): - options.append(cmake_cache_string("RAJA_DATA_ALIGN", 64)) - - options.append(self.define_from_variant("ENABLE_TESTS", "tests")) - options.append(self.define_from_variant("ENABLE_OPENMP", "openmp")) - options.append(self.define_from_variant("CAMP_ENABLE_TARGET_OPENMP", "omptarget")) - options.append(self.define_from_variant("ENABLE_SYCL", "sycl")) - - return options diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py index d8d8f54188..d03a12d277 100644 --- a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py +++ b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py @@ -4,6 +4,8 @@ import re import socket +from pathlib import Path +import os from spack_repo.builtin.build_systems.cached_cmake import ( CachedCMakePackage, @@ -252,12 +254,13 @@ class Raja(CachedCMakePackage, CudaPackage, ROCmPackage): variant( "cxxstd", - default="17", + default="20", values=("11", "14", "17", "20"), description="C++ standard to build with", ) conflicts("cxxstd=11", when="@0.14.0:") conflicts("cxxstd=14", when="@2025.09.0:") + conflicts("cxxstd=17", when="@2026.03.0:") conflicts("+sycl cxxstd=14", when="@2024.07.0:") depends_on("cxx", type="build") @@ -572,28 +575,26 @@ def initconfig_package_entries(self): def cmake_args(self): return [] - @property - def build_relpath(self): - """Relative path to the cmake build subdirectory.""" - return join_path("..", self.build_dirname) + + def build_test_cache_dir(self): + return join_path(install_test_root(self), "build") @run_after("install") def setup_build_tests(self): - """Copy the build test files after the package is installed to a - relative install test subdirectory for use during `spack test run`.""" - # Now copy the relative files - cache_extra_test_sources(self, self.build_relpath) + """Copy selected build-generated test files for `spack test run`.""" - # Ensure the path exists since relying on a relative path at the - # same level as the normal stage source path. - mkdirp(install_test_root(self)) + src = join_path(self.build_directory, "bin") + dst = join_path(self.build_test_cache_dir(), "bin") + + if os.path.isdir(src): + install_tree(src, dst) @property def _extra_tests_path(self): # TODO: The tests should be converted to re-build and run examples # TODO: using the installed libraries. - return join_path(install_test_root(self), self.build_relpath, "bin") - + return join_path(self.build_test_cache_dir(), "bin") + def run_example(self, exe, expected): """run and check outputs of the example""" with working_dir(self._extra_tests_path): diff --git a/tpl/camp b/tpl/camp index 8435e0d72a..36b7248724 160000 --- a/tpl/camp +++ b/tpl/camp @@ -1 +1 @@ -Subproject commit 8435e0d72aa5d1f39bb4bd9c5fda10980ab34d9f +Subproject commit 36b724872427cbea8f4aedab31da6af21d221cf3 From e8674eba9f7fc6bb7317437d1687d871f2d471c4 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Fri, 8 May 2026 09:57:25 -0700 Subject: [PATCH 19/33] Cleanup of temporary Spack package file --- .../spack_repo/llnl_raja/packages/raja/package.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py index d03a12d277..f0bbef1972 100644 --- a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py +++ b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py @@ -4,8 +4,8 @@ import re import socket -from pathlib import Path import os +from pathlib import Path from spack_repo.builtin.build_systems.cached_cmake import ( CachedCMakePackage, @@ -316,11 +316,14 @@ class Raja(CachedCMakePackage, CudaPackage, ROCmPackage): ) conflicts("+openmp", when="@:2022.03") + conflicts("^cuda@13:", when="@:2025.12.2 +cuda", msg="CUDA 13+ unsupported before 2025.12.3") with when("+cuda @0.12.0:"): depends_on("camp+cuda") for sm_ in CudaPackage.cuda_arch_values: depends_on("camp +cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) + + conflicts("+gpu-profiling", when="~cuda~rocm", msg="GPU profiling requires CUDA or ROCm") conflicts("+gpu-profiling +cuda", when="@:2022.02.99") conflicts("+gpu-profiling +rocm", when="@:2022.02.99") @@ -335,9 +338,6 @@ class Raja(CachedCMakePackage, CudaPackage, ROCmPackage): "please use a newer release.", ) - # https://github.com/spack/spack-packages/pull/2059#issuecomment-3443184517 - # SGS removing for testing with CUDA 13 - # conflicts("^cuda@13:", when="+cuda") def _get_sys_type(self, spec): sys_type = spec.architecture @@ -575,13 +575,13 @@ def initconfig_package_entries(self): def cmake_args(self): return [] - def build_test_cache_dir(self): + "Directory where stand-alone (smoke) tests are cached" return join_path(install_test_root(self), "build") @run_after("install") def setup_build_tests(self): - """Copy selected build-generated test files for `spack test run`.""" + """Copy selected build-generated test files for `spack test run` stand-alone (smoke) tests.""" src = join_path(self.build_directory, "bin") dst = join_path(self.build_test_cache_dir(), "bin") @@ -591,6 +591,7 @@ def setup_build_tests(self): @property def _extra_tests_path(self): + "Directory where stand-alone (smoke) test executables are cached." # TODO: The tests should be converted to re-build and run examples # TODO: using the installed libraries. return join_path(self.build_test_cache_dir(), "bin") From 52b97b6756eb32f0dd2e63693840e969fd2c84b0 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Wed, 13 May 2026 16:45:39 -0700 Subject: [PATCH 20/33] Working use-with-cmake test in both contexts and examples working in spack test run --- .../llnl_raja/packages/raja/package.py | 308 ++++++++++++++---- 1 file changed, 248 insertions(+), 60 deletions(-) diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py index f0bbef1972..e8372c2bdf 100644 --- a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py +++ b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py @@ -2,9 +2,11 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os import re +import shutil import socket -import os +import time from pathlib import Path from spack_repo.builtin.build_systems.cached_cmake import ( @@ -20,6 +22,13 @@ from spack.package import * +def print_tree(root_dir): + for dirpath, dirnames, filenames in os.walk(root_dir): + for d in dirnames: + print(os.path.join(dirpath, d)) + for f in filenames: + print(os.path.join(dirpath, f)) + # Starting with 2022.03.0, the only submodule we want to fetch is tpl/desul # since there is no package for it. Other RAJA submodules are defined as # dependencies. @@ -322,8 +331,6 @@ class Raja(CachedCMakePackage, CudaPackage, ROCmPackage): for sm_ in CudaPackage.cuda_arch_values: depends_on("camp +cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) - - conflicts("+gpu-profiling", when="~cuda~rocm", msg="GPU profiling requires CUDA or ROCm") conflicts("+gpu-profiling +cuda", when="@:2022.02.99") conflicts("+gpu-profiling +rocm", when="@:2022.02.99") @@ -575,71 +582,252 @@ def initconfig_package_entries(self): def cmake_args(self): return [] - def build_test_cache_dir(self): - "Directory where stand-alone (smoke) tests are cached" - return join_path(install_test_root(self), "build") - - @run_after("install") - def setup_build_tests(self): - """Copy selected build-generated test files for `spack test run` stand-alone (smoke) tests.""" + @run_after("build") + @on_package_attributes(run_tests=True) + def check_build(self): + with working_dir(self.build_directory): + print("Running RAJA Unit Tests...") + make("test") + + examples_src_dir = "examples" + using_with_cmake_dir = join_path("examples", "using-with-cmake") + + def _rewrite_host_config(self, path): + """Replace compiler wrappers in cached install-test files.""" + kwargs = {"backup": False, "ignore_absent": True} + compiler_paths = { + "CMAKE_C_COMPILER": getattr(self.compiler, "cc", None), + "CMAKE_CXX_COMPILER": getattr(self.compiler, "cxx", None), + "CMAKE_Fortran_COMPILER": getattr(self.compiler, "fc", None), + "CMAKE_CUDA_HOST_COMPILER": getattr(self.compiler, "cxx", None), + } + + for key, value in compiler_paths.items(): + if value: + filter_file( + rf"set\({key}.*\)", f'set({key} "{value}" CACHE PATH "")', path, **kwargs + ) - src = join_path(self.build_directory, "bin") - dst = join_path(self.build_test_cache_dir(), "bin") + def _using_with_cmake_source_dir(self): + tty.msg(f"SGS DEBUG _using_with_cmake_source_dir\n") + tty.msg(f"SGS DEBUG self.test_suite = {self.test_suite}\n") + tty.msg(f"SGS DEBUG self.prefix.examples.RAJA = {self.prefix.examples.RAJA}\n") + + if self.test_suite: + return join_path(self.test_suite.current_test_cache_dir, self.using_with_cmake_dir) + return join_path(self.stage.source_path, "test", "install", "using-with-cmake") + + # @run_after("install") + # def setup_install_tests(self): + # """Cache sources needed by standalone `spack test run`.""" + + # tty.msg(f"SGS DEBUG ******************************************************************\n") + # tty.msg(f"SGS DEBUG setup_install_tests\n") + # tty.msg(f"SGS DEBUG self.examples_src_dir={self.examples_src_dir}\n") + # tty.msg(f"SGS DEBUG install_test_root(self)={install_test_root(self)}\n") + # tty.msg(f"SGS DEBUG src_dir self.build_directory={self.build_directory}\n") + # tty.msg(f"SGS DEBUG dst_dir self.stage.source_path={self.stage.source_path}\n") + # tty.msg(f"SGS DEBUG cwd={os.getcwd()}\n") + # tty.msg(f"SGS DEBUG prefix={self.prefix}\n") + + # cache_extra_test_sources(self, [self.examples_src_dir]) + + # dst_dir = join_path(self.stage.source_path, self.using_with_cmake_dir) + # mkdirp(dst_dir) + + # src_dir = join_path(self.build_directory, self.using_with_cmake_dir) + + # shutil.rmtree(dst_dir, ignore_errors=True) + + # if os.path.exists(src_dir): + # install_tree(src_dir, dst_dir) + # self._rewrite_host_config(join_path(dst_dir, "host-config.cmake")) + # else: + # tty.msg(f"SGS DEBUG Can't install host-config.cmake\n") - if os.path.isdir(src): - install_tree(src, dst) + @run_after("install") + def setup_install_tests(self): + """Cache sources needed by standalone `spack test run`.""" + + tty.msg(f"SGS DEBUG ******************************************************************\n") + tty.msg(f"SGS DEBUG setup_install_tests\n") + tty.msg(f"SGS DEBUG self.examples_src_dir={self.examples_src_dir}\n") + tty.msg(f"SGS DEBUG install_test_root(self)={install_test_root(self)}\n") + tty.msg(f"SGS DEBUG src_dir self.build_directory={self.build_directory}\n") + tty.msg(f"SGS DEBUG dst_dir self.stage.source_path={self.stage.source_path}\n") + tty.msg(f"SGS DEBUG cwd={os.getcwd()}\n") + tty.msg(f"SGS DEBUG prefix={self.prefix}\n") + + tty.msg(f"SGS DEBUG Initial prefix tree\n") + print_tree(self.prefix) + + cache_extra_test_sources(self, [self.examples_src_dir]) + + src_dir = join_path(self.prefix, "examples", "RAJA", "using-with-cmake") + dst_dir = join_path(install_test_root(self), self.using_with_cmake_dir) + + tty.msg(f"SGS DEBUG Initial test_root tree\n") + print_tree(install_test_root(self)) + + if os.path.exists(src_dir): + shutil.rmtree(dst_dir, ignore_errors=True) + install_tree(src_dir, dst_dir) + self._rewrite_host_config(join_path(dst_dir, "host-config.cmake")) + else: + tty.msg(f"SGS DEBUG Can't install host-config.cmake\n") + + tty.msg(f"SGS DEBUG Post test_root tree\n") + print_tree(install_test_root(self)) + + def _run_common_check_install(self, test_dir): + + """build example with cmake and run""" + tty.msg(f"SGS DEBUG ******************************************************************\n") + tty.msg(f"SGS DEBUG _run_common_check_install\n") + tty.msg(f"SGS DEBUG test_dir={test_dir}\n") + tty.msg(f"SGS DEBUG install_test_root(self)={install_test_root(self)}\n") + tty.msg(f"SGS DEBUG cwd={os.getcwd()}\n") + + tty.msg(f"SGS DEBUG {test_dir} listing at start\n") + print_tree(test_dir) + + example_stage_dir = join_path(test_dir, "examples", "using-with-cmake") + with working_dir(join_path(example_stage_dir, "build"), create=True): + host_config = join_path("../", "host-config.cmake") + if not os.path.exists(host_config): + raise SkipTest(f"{os.path.abspath(host_config)} not found, cannot build example") + cmake_args = ["-C", host_config, "../"] + cmake = self.spec["cmake"].command + make_exe = which("make", required=True) + cmake(*cmake_args) + make_exe() + example = Executable("./using-with-cmake") + example() + make_exe("clean") + tty.msg(f"SGS DEBUG using-with-cmake was run") + + @run_after("install") + @on_package_attributes(run_tests=True) + def check_install(self): + tty.msg(f"SGS DEBUG ******************************************************************\n") + tty.msg(f"SGS DEBUG check_install\n") + + tty.msg(f"SGS DEBUG self.examples_src_dir={self.examples_src_dir}\n") + tty.msg(f"SGS DEBUG install_test_root(self)={install_test_root(self)}\n") + tty.msg(f"SGS DEBUG self.build_directory={self.build_directory}\n") + tty.msg(f"SGS DEBUG self.stage.source_path={self.stage.source_path}\n") + tty.msg(f"SGS DEBUG self.stage.path={self.stage.path}\n") + tty.msg(f"SGS DEBUG cwd={os.getcwd()}\n") + tty.msg(f"SGS DEBUG prefix={self.prefix}\n") + + src_dir=join_path(install_test_root(self)) + dst_dir=join_path(self.stage.path, "spack-test") + + if os.path.exists(src_dir): + install_tree(src_dir, dst_dir) + + tty.msg(f"SGS DEBUG {dst_dir} after copy\n") + print_tree(dst_dir) + + self._run_common_check_install(dst_dir) + else: + raise SkipTest(f"examples directory not found, cannot build example") + + def test_check_install(self): + tty.msg(f"SGS DEBUG ******************************************************************\n") + tty.msg(f"SGS DEBUG test_check_install\n") + + tty.msg(f"SGS DEBUG self.examples_src_dir={self.examples_src_dir}\n") + tty.msg(f"SGS DEBUG install_test_root(self)={install_test_root(self)}\n") + tty.msg(f"SGS DEBUG self.stage.source_path={self.stage.source_path}\n") + tty.msg(f"SGS DEBUG self.test_suite.current_test_cache_dir={self.test_suite.current_test_cache_dir}\n") + + cache_dir = self.test_suite.current_test_cache_dir + timestamp = int(time.time()) + save_dir = os.path.join("/tmp", f"SGS-DEBUG-{self.spec.name}-test-cache-{timestamp}") + + if cache_dir and os.path.isdir(cache_dir): + shutil.copytree(cache_dir, save_dir) + + self._run_common_check_install(self.test_suite.current_test_cache_dir) + + + def _write_example_cmakelists(self, path, exe, source): + with open(path, "w", encoding="utf-8") as f: + f.write( + "\n".join( + [ + "cmake_minimum_required(VERSION 3.23)", + "project(raja_package_test LANGUAGES CXX)", + "", + "if(NOT DEFINED RAJA_DIR OR NOT EXISTS ${RAJA_DIR}/lib/cmake/raja/raja-config.cmake)", + " message(FATAL_ERROR \"Missing required 'RAJA_DIR' variable pointing to an installed RAJA\")", + "endif()", + "", + "find_package(RAJA REQUIRED", + " NO_DEFAULT_PATH", + " PATHS ${RAJA_DIR}/lib/cmake/raja)", + "", + f"add_executable({exe} ../{source})", + f"target_link_libraries({exe} RAJA)", + "", + ] + ) + ) - @property - def _extra_tests_path(self): - "Directory where stand-alone (smoke) test executables are cached." - # TODO: The tests should be converted to re-build and run examples - # TODO: using the installed libraries. - return join_path(self.build_test_cache_dir(), "bin") - - def run_example(self, exe, expected): + def build_and_run_example(self, exe, expected): """run and check outputs of the example""" - with working_dir(self._extra_tests_path): - example = which(exe) - if example is None: + tty.msg(f"SGS DEBUG build_and_run_example\n") + + examples_dir = join_path(self.test_suite.current_test_cache_dir, self.examples_src_dir) + + tty.msg(f"SGS DEBUG install_test_root(self)={self.test_suite.current_test_cache_dir}\n") + + build_dir = join_path(examples_dir, f"build-{exe}") + with working_dir(build_dir, create=True): + cmake = self.spec["cmake"].command + make_exe = which("make", required=True) + host_config = join_path("../using-with-cmake", "host-config.cmake") + if not os.path.exists(host_config): + raise SkipTest("host-config.cmake not found, cannot build example") + self._write_example_cmakelists("CMakeLists.txt", exe, f"{exe}.cpp") + cmake_args = ["-C", host_config, "."] + cmake(*cmake_args) + make_exe() + exe_path = join_path(".", exe) + if not os.path.exists(exe_path): raise SkipTest(f"{exe} was not built") - - out = example(output=str.split, error=str.split) + example = Executable(exe_path) + out = example(output=str, error=str) check_outputs(expected, out) + make_exe("clean") + + def test_daxpy(self): + """check daxpy tutorial""" + self.build_and_run_example("tut_daxpy", [r"daxpy", r"result -- PASS"]) + + # TODO: this test seems to hang or take a long time? + # def test_matrix_multiply(self): + # """check batched matrix multiple tutorial""" + # self.build_and_run_example( + # "tut_matrix-multiply", [r"matrix multiplication", r"result -- PASS"] + # ) + + def test_launch_basic(self): + """check basic raja::launch tutorial""" + if "+cuda" in self.spec or "+rocm" in self.spec: + self.build_and_run_example( + "tut_launch_basic", [r"Running RAJA-Teams", r"result -- PASS"] + ) + else: + raise SkipTest("CUDA or ROCm support is required to run this example") - def test_line_of_sight(self): - """check line of sight example""" - self.run_example( - "ex5_line-of-sight_solution", - [r"C-style sequential", r"RAJA sequential", r"result -- PASS"], - ) - - def test_stencil_offset_layout(self): - """check stencil offset layout""" - self.run_example( - "ex6_stencil-offset-layout_solution", [r"RAJA Views \(permuted\)", r"result -- PASS"] - ) - - def test_tiled_matrix(self): - """check tiled matrix transpose""" - self.run_example( - "ex8_tiled-matrix-transpose_solution", - [r"C-version", r"RAJA sequential", r"result -- PASS"], - ) - - def test_dynamic_tile(self): - """check kernel dynamic tile""" - self.run_example("kernel-dynamic-tile", [r"Running index", r"(24,24)"]) - - def test_plugin_example(self): - """check plugin example""" - self.run_example("plugin-example", [r"Launching host kernel for the 10 time"]) - - def test_matrix_multiply(self): - """check batched matrix multiple tutorial""" - self.run_example( - "tut_batched-matrix-multiply", [r"batched matrix multiplication", r"result -- PASS"] + def test_halo_exchange(self): + """check halo exchange tutorial""" + self.build_and_run_example( + "tut_halo-exchange", [r"RAJA halo exchange example", r"result -- PASS"] ) def test_wave_equation(self): """check wave equation""" - self.run_example("wave-eqn", [r"Max Error = 2", r"Evolved solution to time"]) + self.build_and_run_example("wave-eqn", [r"Max Error = 2", r"Evolved solution to time"]) From e0360252dc474acc2dd225bde61da1bd5893d9a7 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Fri, 22 May 2026 15:14:47 -0700 Subject: [PATCH 21/33] Refix install so hosts-config.cmake is present when test are not built --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index df84df2d7c..f96a11a023 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -343,6 +343,12 @@ endif() if(RAJA_ENABLE_TESTS) add_subdirectory(test) +else() + # For Spack stand-alone tests need host config information for building simple + # examples even if full tests are not done. + configure_file( + test/install/using-with-cmake/host-config.cmake.in + ${PROJECT_BINARY_DIR}/examples/using-with-cmake/host-config.cmake) endif() if(RAJA_ENABLE_REPRODUCERS) From a30c0faea8fc367e4cca28ae0bfd8e3604d20621 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Fri, 22 May 2026 15:45:23 -0700 Subject: [PATCH 22/33] Reintegrate Cody changes --- .../llnl_raja/packages/raja/package.py | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py index e8372c2bdf..6abdacec54 100644 --- a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py +++ b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py @@ -276,6 +276,8 @@ class Raja(CachedCMakePackage, CudaPackage, ROCmPackage): depends_on("c", type="build") depends_on("blt", type="build") + # TODO(smith84): Edit the following line after the June 2026 RAJA suite release + depends_on("blt@0.7.2:", type="build", when="@develop") depends_on("blt@0.7.1:", type="build", when="@2025.09.0:") depends_on("blt@0.7.0:", type="build", when="@2025.03.0:") depends_on("blt@0.6.2:", type="build", when="@2024.02.1:") @@ -287,12 +289,15 @@ class Raja(CachedCMakePackage, CudaPackage, ROCmPackage): depends_on("blt@0.4.0:0.4.1", type="build", when="@0.13.0") depends_on("blt@0.3.6:0.4.1", type="build", when="@:0.12.0") conflicts("^blt@:0.3.6", when="+rocm") + conflicts("^blt@:0.7.1", when="+cuda ^cuda@13:", msg="CUDA 13+ requires BLT 0.7.2 or newer") depends_on("camp") depends_on("camp+openmp", when="+openmp") depends_on("camp+omptarget", when="+omptarget") depends_on("camp+sycl", when="+sycl") - depends_on("camp@2025.12:", when="@2025.12:") + # TODO(johnbowen42): Remove the following line after the June 2026 RAJA suite release + depends_on("camp@main commit=e75ab64c029aa27c80593715cb2a3ccad7453c8c", when="@develop") + depends_on("camp@2025.12", when="@2025.12.0:2025.12.2") depends_on("camp@2025.09", when="@2025.09") depends_on("camp@2025.03", when="@2025.03") depends_on("camp@2024.07", when="@2024.07") @@ -325,7 +330,6 @@ class Raja(CachedCMakePackage, CudaPackage, ROCmPackage): ) conflicts("+openmp", when="@:2022.03") - conflicts("^cuda@13:", when="@:2025.12.2 +cuda", msg="CUDA 13+ unsupported before 2025.12.3") with when("+cuda @0.12.0:"): depends_on("camp+cuda") for sm_ in CudaPackage.cuda_arch_values: @@ -345,6 +349,11 @@ class Raja(CachedCMakePackage, CudaPackage, ROCmPackage): "please use a newer release.", ) + conflicts( + "^cuda@13:", + when="@:2025.12.2 +cuda", + msg="RAJA versions up to and including 2025.12.2 do not support CUDA 13+", + ) def _get_sys_type(self, spec): sys_type = spec.architecture @@ -653,8 +662,8 @@ def setup_install_tests(self): tty.msg(f"SGS DEBUG setup_install_tests\n") tty.msg(f"SGS DEBUG self.examples_src_dir={self.examples_src_dir}\n") tty.msg(f"SGS DEBUG install_test_root(self)={install_test_root(self)}\n") - tty.msg(f"SGS DEBUG src_dir self.build_directory={self.build_directory}\n") - tty.msg(f"SGS DEBUG dst_dir self.stage.source_path={self.stage.source_path}\n") + tty.msg(f"SGS DEBUG self.build_directory={self.build_directory}\n") + tty.msg(f"SGS DEBUG self.stage.source_path={self.stage.source_path}\n") tty.msg(f"SGS DEBUG cwd={os.getcwd()}\n") tty.msg(f"SGS DEBUG prefix={self.prefix}\n") @@ -663,16 +672,20 @@ def setup_install_tests(self): cache_extra_test_sources(self, [self.examples_src_dir]) - src_dir = join_path(self.prefix, "examples", "RAJA", "using-with-cmake") + src_dir = join_path(self.stage.source_path, "test", "install", "using-with-cmake") dst_dir = join_path(install_test_root(self), self.using_with_cmake_dir) - tty.msg(f"SGS DEBUG Initial test_root tree\n") - print_tree(install_test_root(self)) - if os.path.exists(src_dir): shutil.rmtree(dst_dir, ignore_errors=True) install_tree(src_dir, dst_dir) self._rewrite_host_config(join_path(dst_dir, "host-config.cmake")) + + src_dir = join_path(self.build_directory, "examples", "using-with-cmake") + dst_dir = join_path(install_test_root(self), self.using_with_cmake_dir) + + if os.path.exists(src_dir): + install_tree(src_dir, dst_dir) + self._rewrite_host_config(join_path(dst_dir, "host-config.cmake")) else: tty.msg(f"SGS DEBUG Can't install host-config.cmake\n") From 3d99495fa27ade28f483119675bea505e74fc482 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Fri, 22 May 2026 16:33:01 -0700 Subject: [PATCH 23/33] Cleanup RAJA spack package --- .../llnl_raja/packages/raja/package.py | 126 ++---------------- 1 file changed, 14 insertions(+), 112 deletions(-) diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py index 6abdacec54..0708e11e8a 100644 --- a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py +++ b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py @@ -21,14 +21,6 @@ from spack.package import * - -def print_tree(root_dir): - for dirpath, dirnames, filenames in os.walk(root_dir): - for d in dirnames: - print(os.path.join(dirpath, d)) - for f in filenames: - print(os.path.join(dirpath, f)) - # Starting with 2022.03.0, the only submodule we want to fetch is tpl/desul # since there is no package for it. Other RAJA submodules are defined as # dependencies. @@ -594,6 +586,7 @@ def cmake_args(self): @run_after("build") @on_package_attributes(run_tests=True) def check_build(self): + """Run RAJA's unit test target after build when tests are enabled.""" with working_dir(self.build_directory): print("Running RAJA Unit Tests...") make("test") @@ -617,59 +610,10 @@ def _rewrite_host_config(self, path): rf"set\({key}.*\)", f'set({key} "{value}" CACHE PATH "")', path, **kwargs ) - def _using_with_cmake_source_dir(self): - tty.msg(f"SGS DEBUG _using_with_cmake_source_dir\n") - tty.msg(f"SGS DEBUG self.test_suite = {self.test_suite}\n") - tty.msg(f"SGS DEBUG self.prefix.examples.RAJA = {self.prefix.examples.RAJA}\n") - - if self.test_suite: - return join_path(self.test_suite.current_test_cache_dir, self.using_with_cmake_dir) - return join_path(self.stage.source_path, "test", "install", "using-with-cmake") - - # @run_after("install") - # def setup_install_tests(self): - # """Cache sources needed by standalone `spack test run`.""" - - # tty.msg(f"SGS DEBUG ******************************************************************\n") - # tty.msg(f"SGS DEBUG setup_install_tests\n") - # tty.msg(f"SGS DEBUG self.examples_src_dir={self.examples_src_dir}\n") - # tty.msg(f"SGS DEBUG install_test_root(self)={install_test_root(self)}\n") - # tty.msg(f"SGS DEBUG src_dir self.build_directory={self.build_directory}\n") - # tty.msg(f"SGS DEBUG dst_dir self.stage.source_path={self.stage.source_path}\n") - # tty.msg(f"SGS DEBUG cwd={os.getcwd()}\n") - # tty.msg(f"SGS DEBUG prefix={self.prefix}\n") - - # cache_extra_test_sources(self, [self.examples_src_dir]) - - # dst_dir = join_path(self.stage.source_path, self.using_with_cmake_dir) - # mkdirp(dst_dir) - - # src_dir = join_path(self.build_directory, self.using_with_cmake_dir) - - # shutil.rmtree(dst_dir, ignore_errors=True) - - # if os.path.exists(src_dir): - # install_tree(src_dir, dst_dir) - # self._rewrite_host_config(join_path(dst_dir, "host-config.cmake")) - # else: - # tty.msg(f"SGS DEBUG Can't install host-config.cmake\n") - @run_after("install") def setup_install_tests(self): - """Cache sources needed by standalone `spack test run`.""" - - tty.msg(f"SGS DEBUG ******************************************************************\n") - tty.msg(f"SGS DEBUG setup_install_tests\n") - tty.msg(f"SGS DEBUG self.examples_src_dir={self.examples_src_dir}\n") - tty.msg(f"SGS DEBUG install_test_root(self)={install_test_root(self)}\n") - tty.msg(f"SGS DEBUG self.build_directory={self.build_directory}\n") - tty.msg(f"SGS DEBUG self.stage.source_path={self.stage.source_path}\n") - tty.msg(f"SGS DEBUG cwd={os.getcwd()}\n") - tty.msg(f"SGS DEBUG prefix={self.prefix}\n") - - tty.msg(f"SGS DEBUG Initial prefix tree\n") - print_tree(self.prefix) - + """Install and cache standalone test sources, using staged or build outputs when available.""" + cache_extra_test_sources(self, [self.examples_src_dir]) src_dir = join_path(self.stage.source_path, "test", "install", "using-with-cmake") @@ -687,22 +631,10 @@ def setup_install_tests(self): install_tree(src_dir, dst_dir) self._rewrite_host_config(join_path(dst_dir, "host-config.cmake")) else: - tty.msg(f"SGS DEBUG Can't install host-config.cmake\n") - - tty.msg(f"SGS DEBUG Post test_root tree\n") - print_tree(install_test_root(self)) + tty.msg(f"Can't install host-config.cmake\n") def _run_common_check_install(self, test_dir): - - """build example with cmake and run""" - tty.msg(f"SGS DEBUG ******************************************************************\n") - tty.msg(f"SGS DEBUG _run_common_check_install\n") - tty.msg(f"SGS DEBUG test_dir={test_dir}\n") - tty.msg(f"SGS DEBUG install_test_root(self)={install_test_root(self)}\n") - tty.msg(f"SGS DEBUG cwd={os.getcwd()}\n") - - tty.msg(f"SGS DEBUG {test_dir} listing at start\n") - print_tree(test_dir) + """Verify that the using-with-cmake example can build against the installed RAJA package.""" example_stage_dir = join_path(test_dir, "examples", "using-with-cmake") with working_dir(join_path(example_stage_dir, "build"), create=True): @@ -717,54 +649,26 @@ def _run_common_check_install(self, test_dir): example = Executable("./using-with-cmake") example() make_exe("clean") - tty.msg(f"SGS DEBUG using-with-cmake was run") @run_after("install") @on_package_attributes(run_tests=True) def check_install(self): - tty.msg(f"SGS DEBUG ******************************************************************\n") - tty.msg(f"SGS DEBUG check_install\n") - - tty.msg(f"SGS DEBUG self.examples_src_dir={self.examples_src_dir}\n") - tty.msg(f"SGS DEBUG install_test_root(self)={install_test_root(self)}\n") - tty.msg(f"SGS DEBUG self.build_directory={self.build_directory}\n") - tty.msg(f"SGS DEBUG self.stage.source_path={self.stage.source_path}\n") - tty.msg(f"SGS DEBUG self.stage.path={self.stage.path}\n") - tty.msg(f"SGS DEBUG cwd={os.getcwd()}\n") - tty.msg(f"SGS DEBUG prefix={self.prefix}\n") - + """Installation-time verification that the using-with-cmake example can build against the installed RAJA package.""" + src_dir=join_path(install_test_root(self)) dst_dir=join_path(self.stage.path, "spack-test") if os.path.exists(src_dir): install_tree(src_dir, dst_dir) - - tty.msg(f"SGS DEBUG {dst_dir} after copy\n") - print_tree(dst_dir) - self._run_common_check_install(dst_dir) else: raise SkipTest(f"examples directory not found, cannot build example") def test_check_install(self): - tty.msg(f"SGS DEBUG ******************************************************************\n") - tty.msg(f"SGS DEBUG test_check_install\n") - - tty.msg(f"SGS DEBUG self.examples_src_dir={self.examples_src_dir}\n") - tty.msg(f"SGS DEBUG install_test_root(self)={install_test_root(self)}\n") - tty.msg(f"SGS DEBUG self.stage.source_path={self.stage.source_path}\n") - tty.msg(f"SGS DEBUG self.test_suite.current_test_cache_dir={self.test_suite.current_test_cache_dir}\n") - - cache_dir = self.test_suite.current_test_cache_dir - timestamp = int(time.time()) - save_dir = os.path.join("/tmp", f"SGS-DEBUG-{self.spec.name}-test-cache-{timestamp}") - - if cache_dir and os.path.isdir(cache_dir): - shutil.copytree(cache_dir, save_dir) + """Stand-alone verification that the using-with-cmake example can build against the installed RAJA package.""" self._run_common_check_install(self.test_suite.current_test_cache_dir) - def _write_example_cmakelists(self, path, exe, source): with open(path, "w", encoding="utf-8") as f: f.write( @@ -789,13 +693,10 @@ def _write_example_cmakelists(self, path, exe, source): ) def build_and_run_example(self, exe, expected): - """run and check outputs of the example""" - tty.msg(f"SGS DEBUG build_and_run_example\n") + """Build an example from the cached test sources and verify its output.""" examples_dir = join_path(self.test_suite.current_test_cache_dir, self.examples_src_dir) - tty.msg(f"SGS DEBUG install_test_root(self)={self.test_suite.current_test_cache_dir}\n") - build_dir = join_path(examples_dir, f"build-{exe}") with working_dir(build_dir, create=True): cmake = self.spec["cmake"].command @@ -816,10 +717,11 @@ def build_and_run_example(self, exe, expected): make_exe("clean") def test_daxpy(self): - """check daxpy tutorial""" + """Check daxpy tutorial""" self.build_and_run_example("tut_daxpy", [r"daxpy", r"result -- PASS"]) # TODO: this test seems to hang or take a long time? + # SGS 2026-05-22: Did not see hangs/long execution times on LC systems or Redhat workstation; clarify with Cody where this was occuring. # def test_matrix_multiply(self): # """check batched matrix multiple tutorial""" # self.build_and_run_example( @@ -827,7 +729,7 @@ def test_daxpy(self): # ) def test_launch_basic(self): - """check basic raja::launch tutorial""" + """Check basic raja::launch tutorial.""" if "+cuda" in self.spec or "+rocm" in self.spec: self.build_and_run_example( "tut_launch_basic", [r"Running RAJA-Teams", r"result -- PASS"] @@ -836,11 +738,11 @@ def test_launch_basic(self): raise SkipTest("CUDA or ROCm support is required to run this example") def test_halo_exchange(self): - """check halo exchange tutorial""" + """Check halo exchange tutorial.""" self.build_and_run_example( "tut_halo-exchange", [r"RAJA halo exchange example", r"result -- PASS"] ) def test_wave_equation(self): - """check wave equation""" + """Check wave equation.""" self.build_and_run_example("wave-eqn", [r"Max Error = 2", r"Evolved solution to time"]) From 43a6fa618cc44394eab87eb7c596f854ad2dc03f Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Wed, 24 Jun 2026 10:28:50 -0700 Subject: [PATCH 24/33] Remove temporary PR spack package files for updating cuda --- .uberenv_config.json | 2 +- .../spack_repo/llnl_raja/packages/.gitkeep | 0 .../llnl_raja/packages/raja/package.py | 748 ------------------ .../spack_repo/llnl_raja/repo.yaml | 3 - 4 files changed, 1 insertion(+), 752 deletions(-) delete mode 100644 scripts/pull-request-testing/spack_repo/llnl_raja/packages/.gitkeep delete mode 100644 scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py delete mode 100644 scripts/pull-request-testing/spack_repo/llnl_raja/repo.yaml diff --git a/.uberenv_config.json b/.uberenv_config.json index 6482699cc6..452aa08baf 100644 --- a/.uberenv_config.json +++ b/.uberenv_config.json @@ -6,6 +6,6 @@ "spack_url": "https://github.com/spack/spack.git", "spack_branch": "v1.1.1", "spack_configs_path": "scripts/radiuss-spack-configs", -"spack_packages_path": ["scripts/pull-request-testing/spack_repo/llnl_raja/packages", "scripts/radiuss-spack-configs/spack_repo/llnl_radiuss/packages"], +"spack_packages_path": "scripts/radiuss-spack-configs/spack_repo/llnl_radiuss/packages", "spack_setup_clingo": false } diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/.gitkeep b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py b/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py deleted file mode 100644 index 0708e11e8a..0000000000 --- a/scripts/pull-request-testing/spack_repo/llnl_raja/packages/raja/package.py +++ /dev/null @@ -1,748 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -import os -import re -import shutil -import socket -import time -from pathlib import Path - -from spack_repo.builtin.build_systems.cached_cmake import ( - CachedCMakePackage, - cmake_cache_option, - cmake_cache_path, - cmake_cache_string, -) -from spack_repo.builtin.build_systems.cuda import CudaPackage -from spack_repo.builtin.build_systems.rocm import ROCmPackage -from spack_repo.builtin.packages.blt.package import llnl_link_helpers - -from spack.package import * - -# Starting with 2022.03.0, the only submodule we want to fetch is tpl/desul -# since there is no package for it. Other RAJA submodules are defined as -# dependencies. -def submodules(package): - submodules = [] - submodules.append("tpl/desul") - return submodules - - -class Raja(CachedCMakePackage, CudaPackage, ROCmPackage): - """RAJA Parallel Framework.""" - - homepage = "https://github.com/LLNL/RAJA" - git = "https://github.com/LLNL/RAJA.git" - tags = ["radiuss", "e4s"] - - maintainers("adrienbernede", "davidbeckingsale", "kab163") - - license("BSD-3-Clause") - - version("develop", branch="develop", submodules=submodules) - version("main", branch="main", submodules=submodules) - version( - "2025.12.2", - tag="v2025.12.2", - commit="eca7c5015a5cf8bf7cc8ad1829fd36d3276ab274", - submodules=submodules, - ) - version( - "2025.12.1", - tag="v2025.12.1", - commit="3b8b59a1e9be2e1066c0d77372b3bf5956e6d6e2", - submodules=submodules, - ) - version( - "2025.12.0", - tag="v2025.12.0", - commit="e827035c630e71a9358e2f21c2f3cf6fd5fb6605", - submodules=submodules, - ) - version( - "2025.09.1", - tag="v2025.09.1", - commit="1e0756eda3c344da362e483afb9100ebd8137a2c", - submodules=submodules, - ) - version( - "2025.09.0", - tag="v2025.09.0", - commit="ca756788dbdd43fec2a3840389126ae94a905d5f", - submodules=submodules, - ) - version( - "2025.03.2", - tag="v2025.03.2", - commit="6e36a94380adbe88fed11a3213fc08461428ece0", - submodules=submodules, - ) - version( - "2025.03.1", - tag="v2025.03.1", - commit="ffa7b92377705aff855b4bf602e197ae4f8e8cc3", - submodules=submodules, - ) - version( - "2025.03.0", - tag="v2025.03.0", - commit="1d70abf171474d331f1409908bdf1b1c3fe19222", - submodules=submodules, - ) - version( - "2024.07.0", - tag="v2024.07.0", - commit="4d7fcba55ebc7cb972b7cc9f6778b48e43792ea1", - submodules=submodules, - ) - version( - "2024.02.2", - tag="v2024.02.2", - commit="593f756b14ac57ded33ee61d8d2292d4beb840e6", - submodules=submodules, - ) - version( - "2024.02.1", - tag="v2024.02.1", - commit="3ada0950b0774ec907d30a9eceaf6af7478b833b", - submodules=submodules, - ) - version( - "2024.02.0", - tag="v2024.02.0", - commit="82d1b926ada0fbb15a4a6e0adadc30c715cfda7b", - submodules=submodules, - ) - version( - "2023.06.1", - tag="v2023.06.1", - commit="9b5f61edf3aa1e6fdbc9a4b30828c81504639963", - submodules=submodules, - ) - version( - "2023.06.0", - tag="v2023.06.0", - commit="e330b2560747d5417cd7bd265fab3fb91d32ecbd", - submodules=submodules, - ) - version( - "2022.10.5", - tag="v2022.10.5", - commit="3774f51339459bbbdb77055aa23f82919b6335b6", - submodules=submodules, - ) - version( - "2022.10.4", - tag="v2022.10.4", - commit="c2a6b1740759ae3ae7c85b35e20dbffbe235355d", - submodules=submodules, - ) - version( - "2022.03.0", - tag="v2022.03.0", - commit="4351fe6a50bd579511a625b017c9e054885e7fd2", - submodules=submodules, - ) - version( - "0.14.0", tag="v0.14.0", commit="357933a42842dd91de5c1034204d937fce0a2a44", submodules=True - ) - version( - "0.13.0", tag="v0.13.0", commit="3047fa720132d19ee143b1fcdacaa72971f5988c", submodules=True - ) - version( - "0.12.1", tag="v0.12.1", commit="9cb6370bb2868e35ebba23cdce927f5f7f9da530", submodules=True - ) - version( - "0.12.0", tag="v0.12.0", commit="32d92e38da41cc8d4db25ec79b9884a73a0cb3a1", submodules=True - ) - version( - "0.11.0", tag="v0.11.0", commit="0502b9b69c4cb60aa0afbdf699b555c76cb18f22", submodules=True - ) - version( - "0.10.1", tag="v0.10.1", commit="be91e040130678b1350dbda56cc352433db758bd", submodules=True - ) - version( - "0.10.0", tag="v0.10.0", commit="53cb89cf788d28bc4ed2b4e6f75483fdd26024aa", submodules=True - ) - version( - "0.9.0", tag="v0.9.0", commit="df7ca1fa892b6ac4147c614d2d739d5022f63fc7", submodules=True - ) - version( - "0.8.0", tag="v0.8.0", commit="8d19a8c2cbac611de6f92ad8852b9f3454b27e63", submodules=True - ) - version( - "0.7.0", tag="v0.7.0", commit="caa33b371b586dfae3d8569caee91c5eddfd7b31", submodules=True - ) - version( - "0.6.0", tag="v0.6.0", commit="cc7a97e8b4e52c3de820c9dfacd358822a147871", submodules=True - ) - version( - "0.5.3", tag="v0.5.3", commit="1ca35c0ed2a43a3fa9c6cd70c5d25f16d88ecd8c", submodules=True - ) - version( - "0.5.2", tag="v0.5.2", commit="4d5c3d5d7f311838855f7010810610349e729f64", submodules=True - ) - version( - "0.5.1", tag="v0.5.1", commit="bf340abe5199d7e051520913c9a7a5de336b5820", submodules=True - ) - version( - "0.5.0", tag="v0.5.0", commit="9b539d84fdad049f65caeba836f41031f5baf4cc", submodules=True - ) - version( - "0.4.1", tag="v0.4.1", commit="3618cfe95d6a442fa50fbe7bfbcf654cf9f800b9", submodules=True - ) - version( - "0.4.0", tag="v0.4.0", commit="31b2a48192542c2da426885baa5af0ed57606b78", submodules=True - ) - - # export targets when building pre-2.4.0 release with BLT 0.4.0+ - patch( - "https://github.com/LLNL/RAJA/commit/eca1124ee4af380d6613adc6012c307d1fd4176b.patch?full_index=1", - sha256="12bb78c00b6683ad3e7fd4e3f87f9776bae074b722431b79696bc862816735ef", - when="@:0.13.0 ^blt@0.4:", - ) - - # Backward compatibility is stopped from ROCm 6.0 - # Future relase will have the change from PR https://github.com/LLNL/RAJA/pull/1568 - patch( - "https://github.com/LLNL/RAJA/commit/406eb8dee05a41eb32c421c375688a4863b60642.patch?full_index=1", - sha256="d9ce5ef038555cbccb330a9016b7be77e56ae0660583cba955dab9d0297a4b07", - when="^hip@6.0", - ) - - # Fix compilation issue reported by Intel from their new compiler version - patch( - "https://github.com/LLNL/RAJA/commit/3e831e034bd92daacf49f40b66459aefd6ea3972.patch?full_index=1", - sha256="c0548fc5220f24082fb2592d5b4e8b7c8c783b87906d5f0950d53953d25161f6", - when="@2024.02.1:2024.02.99 %oneapi@2025:", - ) - - variant("openmp", default=False, description="Build OpenMP backend") - variant("shared", default=False, description="Build shared libs") - variant("desul", default=False, description="Build desul atomics backend") - variant("vectorization", default=True, description="Build SIMD/SIMT intrinsics support") - variant( - "omptask", default=False, description="Build OpenMP task variants of internal algorithms" - ) - variant("omptarget", default=False, description="Build OpenMP on target device support") - variant("sycl", default=False, description="Build sycl backend") - variant("gpu-profiling", default=False, description="Enable GPU profiling") - - variant("plugins", default=False, description="Enable runtime plugins") - variant("caliper", default=False, description="Enable caliper support") - variant("examples", default=True, description="Build examples.") - variant("exercises", default=True, description="Build exercises.") - # TODO: figure out gtest dependency and then set this default True - # and remove the +tests conflict below. - variant("tests", default=False, description="Build tests") - - # we don't use variants to express the failing test, we only add a variant to - # define whether we want to run all the tests (including those known to fail) - # or only the passing ones. - variant( - "run-all-tests", - default=False, - description="Run all the tests, including those known to fail.", - ) - - variant( - "lowopttest", - default=False, - description="For developers, lowers optimization level to pass tests with some compilers", - ) - - variant( - "cxxstd", - default="20", - values=("11", "14", "17", "20"), - description="C++ standard to build with", - ) - conflicts("cxxstd=11", when="@0.14.0:") - conflicts("cxxstd=14", when="@2025.09.0:") - conflicts("cxxstd=17", when="@2026.03.0:") - conflicts("+sycl cxxstd=14", when="@2024.07.0:") - - depends_on("cxx", type="build") - depends_on("c", type="build") - - depends_on("blt", type="build") - # TODO(smith84): Edit the following line after the June 2026 RAJA suite release - depends_on("blt@0.7.2:", type="build", when="@develop") - depends_on("blt@0.7.1:", type="build", when="@2025.09.0:") - depends_on("blt@0.7.0:", type="build", when="@2025.03.0:") - depends_on("blt@0.6.2:", type="build", when="@2024.02.1:") - depends_on("blt@0.6.1", type="build", when="@2024.02.0") - depends_on("blt@0.5.3", type="build", when="@2023.06.0:2023.06.1") - depends_on("blt@0.5.2:0.5.3", type="build", when="@2022.10.5") - depends_on("blt@0.5.0:0.5.3", type="build", when="@0.14.1:2022.10.4") - depends_on("blt@0.4.1", type="build", when="@0.14.0") - depends_on("blt@0.4.0:0.4.1", type="build", when="@0.13.0") - depends_on("blt@0.3.6:0.4.1", type="build", when="@:0.12.0") - conflicts("^blt@:0.3.6", when="+rocm") - conflicts("^blt@:0.7.1", when="+cuda ^cuda@13:", msg="CUDA 13+ requires BLT 0.7.2 or newer") - - depends_on("camp") - depends_on("camp+openmp", when="+openmp") - depends_on("camp+omptarget", when="+omptarget") - depends_on("camp+sycl", when="+sycl") - # TODO(johnbowen42): Remove the following line after the June 2026 RAJA suite release - depends_on("camp@main commit=e75ab64c029aa27c80593715cb2a3ccad7453c8c", when="@develop") - depends_on("camp@2025.12", when="@2025.12.0:2025.12.2") - depends_on("camp@2025.09", when="@2025.09") - depends_on("camp@2025.03", when="@2025.03") - depends_on("camp@2024.07", when="@2024.07") - depends_on("camp@2024.02.1", when="@2024.02.1") - depends_on("camp@2024.02.0", when="@2024.02.0") - depends_on("camp@2023.06.0", when="@2023.06.0:2023.06.1") - depends_on("camp@2022.10.1:2023.06.0", when="@2022.10.3:2022.10.5") - depends_on("camp@2022.10.0:2023.06.0", when="@2022.10.0:2022.10.2") - depends_on("camp@2022.03.2", when="@2022.03.0:2022.03.1") - depends_on("camp@0.2.2:0.2.3", when="@0.14.0") - depends_on("camp@0.1.0", when="@0.10.0:0.13.0") - - depends_on("cmake@3.24:", when="@2025.09.0:", type="build") - depends_on("cmake@3.23:", when="@2024.07.0:2025.03.2", type="build") - depends_on("cmake@3.23:", when="@2022.10.0:2024.02.2+rocm", type="build") - depends_on("cmake@3.20:", when="@2022.10.0:2024.02.2", type="build") - depends_on("cmake@3.20:", when="@:2022.03+rocm", type="build") - depends_on("cmake@3.14:", when="@:2022.03", type="build") - - depends_on("llvm-openmp", when="+openmp %apple-clang") - - depends_on("caliper", when="+caliper") - - depends_on("rocprim", when="+rocm") - with when("+rocm @0.12.0:"): - depends_on("camp+rocm") - for arch in ROCmPackage.amdgpu_targets: - depends_on( - "camp+rocm amdgpu_target={0}".format(arch), when="amdgpu_target={0}".format(arch) - ) - conflicts("+openmp", when="@:2022.03") - - with when("+cuda @0.12.0:"): - depends_on("camp+cuda") - for sm_ in CudaPackage.cuda_arch_values: - depends_on("camp +cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) - - conflicts("+gpu-profiling", when="~cuda~rocm", msg="GPU profiling requires CUDA or ROCm") - conflicts("+gpu-profiling +cuda", when="@:2022.02.99") - conflicts("+gpu-profiling +rocm", when="@:2022.02.99") - - conflicts("+omptarget +rocm") - conflicts("+sycl +omptarget") - conflicts("+sycl +rocm") - conflicts( - "+sycl", - when="@:2024.02.99", - msg="Support for SYCL was introduced in RAJA after 2024.02 release, " - "please use a newer release.", - ) - - conflicts( - "^cuda@13:", - when="@:2025.12.2 +cuda", - msg="RAJA versions up to and including 2025.12.2 do not support CUDA 13+", - ) - - def _get_sys_type(self, spec): - sys_type = spec.architecture - if "SYS_TYPE" in env: - sys_type = env["SYS_TYPE"] - return sys_type - - @property - def libs(self): - shared = "+shared" in self.spec - return find_libraries("libRAJA", root=self.prefix, shared=shared, recursive=True) - - @property - def cache_name(self): - hostname = socket.gethostname() - if "SYS_TYPE" in env: - hostname = hostname.rstrip("1234567890") - return "{0}-{1}-{2}@{3}-{4}.cmake".format( - hostname, - self._get_sys_type(self.spec), - self.spec.compiler.name, - self.spec.compiler.version, - self.spec.dag_hash(8), - ) - - def initconfig_compiler_entries(self): - spec = self.spec - compiler = self.compiler - # Default entries are already defined in CachedCMakePackage, inherit them: - entries = super().initconfig_compiler_entries() - - if spec.satisfies("+rocm ^blt@:0.6"): - entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) - - llnl_link_helpers(entries, spec, compiler) - - return entries - - def initconfig_hardware_entries(self): - spec = self.spec - entries = super().initconfig_hardware_entries() - - entries.append("#------------------{0}".format("-" * 30)) - entries.append("# Package custom hardware settings") - entries.append("#------------------{0}\n".format("-" * 30)) - - entries.append(cmake_cache_option("ENABLE_OPENMP", spec.satisfies("+openmp"))) - entries.append(cmake_cache_option("ENABLE_CUDA", spec.satisfies("+cuda"))) - - if spec.satisfies("+cuda"): - # CUDA configuration from cuda_for_radiuss_projects - cuda_flags = [] - if not spec.satisfies("cuda_arch=none"): - cuda_archs = ";".join(spec.variants["cuda_arch"].value) - entries.append(cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", cuda_archs)) - - # gcc-toolchain support - gcc_toolchain_regex = re.compile(".*gcc-toolchain.*") - using_toolchain = list( - filter(gcc_toolchain_regex.match, spec.compiler_flags["cxxflags"]) - ) - if using_toolchain: - cuda_flags.append("-Xcompiler {}".format(using_toolchain[0])) - - if cuda_flags: - entries.append(cmake_cache_string("CMAKE_CUDA_FLAGS", " ".join(cuda_flags))) - - if spec.satisfies("+rocm"): - entries.append(cmake_cache_option("ENABLE_HIP", True)) - - # HIP configuration from hip_for_radiuss_projects - rocm_root = spec["llvm-amdgpu"].prefix - gcc_toolchain_regex = re.compile(".*gcc-toolchain.*") - using_toolchain = list( - filter(gcc_toolchain_regex.match, spec.compiler_flags["cxxflags"]) - ) - hip_link_flags = "" - - if using_toolchain: - gcc_prefix = using_toolchain[0] - entries.append( - cmake_cache_string("HIP_CLANG_FLAGS", "--gcc-toolchain={0}".format(gcc_prefix)) - ) - entries.append( - cmake_cache_string( - "CMAKE_EXE_LINKER_FLAGS", - hip_link_flags + " -Wl,-rpath={0}/lib64".format(gcc_prefix), - ) - ) - else: - entries.append( - cmake_cache_string( - "CMAKE_EXE_LINKER_FLAGS", "-Wl,-rpath={0}/llvm/lib/".format(rocm_root) - ) - ) - - hipcc_flags = [] - if self.spec.satisfies("^rocprim@7.0"): - hipcc_flags.append("-std=c++17") - if self.spec.satisfies("@2025.09.0:"): - hipcc_flags.append("-std=c++17") - elif self.spec.satisfies("@0.14.0:2025.09.0"): - hipcc_flags.append("-std=c++14") - entries.append(cmake_cache_string("HIP_HIPCC_FLAGS", " ".join(hipcc_flags))) - else: - entries.append(cmake_cache_option("ENABLE_HIP", False)) - - return entries - - @property - def cxx_std(self): - return self.spec.variants.get("cxxstd").value - - def initconfig_package_entries(self): - spec = self.spec - entries = [] - - option_prefix = "RAJA_" if spec.satisfies("@0.14.0:") else "" - - # TPL locations - entries.append("#------------------{0}".format("-" * 60)) - entries.append("# TPLs") - entries.append("#------------------{0}\n".format("-" * 60)) - - entries.append(cmake_cache_path("BLT_SOURCE_DIR", spec["blt"].prefix)) - if "camp" in self.spec: - entries.append(cmake_cache_path("camp_DIR", spec["camp"].prefix)) - - # Build options - entries.append("#------------------{0}".format("-" * 60)) - entries.append("# Build Options") - entries.append("#------------------{0}\n".format("-" * 60)) - - entries.append(cmake_cache_string("CMAKE_BUILD_TYPE", spec.variants["build_type"].value)) - entries.append(cmake_cache_option("BUILD_SHARED_LIBS", spec.satisfies("+shared"))) - - entries.append(cmake_cache_option("RAJA_ENABLE_DESUL_ATOMICS", spec.satisfies("+desul"))) - - entries.append( - cmake_cache_option("RAJA_ENABLE_VECTORIZATION", spec.satisfies("+vectorization")) - ) - - entries.append(cmake_cache_option("RAJA_ENABLE_OPENMP_TASK", spec.satisfies("+omptask"))) - - entries.append( - cmake_cache_option("RAJA_ENABLE_TARGET_OPENMP", spec.satisfies("+omptarget")) - ) - - entries.append(cmake_cache_option("RAJA_ENABLE_SYCL", spec.satisfies("+sycl"))) - entries.append( - cmake_cache_option("RAJA_ENABLE_NV_TOOLS_EXT", spec.satisfies("+gpu-profiling +cuda")) - ) - entries.append( - cmake_cache_option("RAJA_ENABLE_ROCTX", spec.satisfies("+gpu-profiling +rocm")) - ) - - if spec.satisfies("+lowopttest"): - entries.append(cmake_cache_string("CMAKE_CXX_FLAGS_RELEASE", "-O1")) - - # C++ standard - entries.append(cmake_cache_string("BLT_CXX_STD", f"c++{self.cxx_std}")) - - entries.append( - cmake_cache_option("RAJA_ENABLE_RUNTIME_PLUGINS", spec.satisfies("+plugins")) - ) - - if spec.satisfies("+omptarget"): - entries.append( - cmake_cache_string( - "BLT_OPENMP_COMPILE_FLAGS", "-fopenmp;-fopenmp-targets=nvptx64-nvidia-cuda" - ) - ) - entries.append( - cmake_cache_string( - "BLT_OPENMP_LINK_FLAGS", "-fopenmp;-fopenmp-targets=nvptx64-nvidia-cuda" - ) - ) - - entries.append( - cmake_cache_option( - "{}ENABLE_EXAMPLES".format(option_prefix), spec.satisfies("+examples") - ) - ) - if spec.satisfies("@0.14.0:"): - entries.append( - cmake_cache_option( - "{}ENABLE_EXERCISES".format(option_prefix), spec.satisfies("+exercises") - ) - ) - else: - entries.append(cmake_cache_option("ENABLE_EXERCISES", spec.satisfies("+exercises"))) - - # TODO: Treat the workaround when building tests with spack wrapper - # For now, removing it to test CI, which builds tests outside of wrapper. - # Work around spack adding -march=ppc64le to SPACK_TARGET_ARGS which - # is used by the spack compiler wrapper. This can go away when BLT - # removes -Werror from GTest flags - # - # if self.spec.satisfies("%clang target=ppc64le:") - # or (not self.run_tests and not spec.satisfies("+tests")): - if not self.run_tests and not spec.satisfies("+tests"): - entries.append(cmake_cache_option("ENABLE_TESTS", False)) - else: - entries.append(cmake_cache_option("ENABLE_TESTS", True)) - if not spec.satisfies("+run-all-tests"): - if spec.satisfies("%clang@12.0.0:13.9.999"): - entries.append( - cmake_cache_string( - "CTEST_CUSTOM_TESTS_IGNORE", - "test-algorithm-sort-OpenMP.exe;test-algorithm-stable-sort-OpenMP.exe", - ) - ) - excluded_tests = [ - "test-algorithm-sort-Cuda.exe", - "test-algorithm-stable-sort-Cuda.exe", - "test-algorithm-sort-OpenMP.exe", - "test-algorithm-stable-sort-OpenMP.exe", - ] - if spec.satisfies("+cuda %clang@12.0.0:13.9.999"): - entries.append( - cmake_cache_string("CTEST_CUSTOM_TESTS_IGNORE", ";".join(excluded_tests)) - ) - if spec.satisfies("+cuda %xl@16.1.1.12"): - entries.append( - cmake_cache_string( - "CTEST_CUSTOM_TESTS_IGNORE", - "test-algorithm-sort-Cuda.exe;test-algorithm-stable-sort-Cuda.exe", - ) - ) - - entries.append(cmake_cache_option("RAJA_HOST_CONFIG_LOADED", True)) - - return entries - - def cmake_args(self): - return [] - - @run_after("build") - @on_package_attributes(run_tests=True) - def check_build(self): - """Run RAJA's unit test target after build when tests are enabled.""" - with working_dir(self.build_directory): - print("Running RAJA Unit Tests...") - make("test") - - examples_src_dir = "examples" - using_with_cmake_dir = join_path("examples", "using-with-cmake") - - def _rewrite_host_config(self, path): - """Replace compiler wrappers in cached install-test files.""" - kwargs = {"backup": False, "ignore_absent": True} - compiler_paths = { - "CMAKE_C_COMPILER": getattr(self.compiler, "cc", None), - "CMAKE_CXX_COMPILER": getattr(self.compiler, "cxx", None), - "CMAKE_Fortran_COMPILER": getattr(self.compiler, "fc", None), - "CMAKE_CUDA_HOST_COMPILER": getattr(self.compiler, "cxx", None), - } - - for key, value in compiler_paths.items(): - if value: - filter_file( - rf"set\({key}.*\)", f'set({key} "{value}" CACHE PATH "")', path, **kwargs - ) - - @run_after("install") - def setup_install_tests(self): - """Install and cache standalone test sources, using staged or build outputs when available.""" - - cache_extra_test_sources(self, [self.examples_src_dir]) - - src_dir = join_path(self.stage.source_path, "test", "install", "using-with-cmake") - dst_dir = join_path(install_test_root(self), self.using_with_cmake_dir) - - if os.path.exists(src_dir): - shutil.rmtree(dst_dir, ignore_errors=True) - install_tree(src_dir, dst_dir) - self._rewrite_host_config(join_path(dst_dir, "host-config.cmake")) - - src_dir = join_path(self.build_directory, "examples", "using-with-cmake") - dst_dir = join_path(install_test_root(self), self.using_with_cmake_dir) - - if os.path.exists(src_dir): - install_tree(src_dir, dst_dir) - self._rewrite_host_config(join_path(dst_dir, "host-config.cmake")) - else: - tty.msg(f"Can't install host-config.cmake\n") - - def _run_common_check_install(self, test_dir): - """Verify that the using-with-cmake example can build against the installed RAJA package.""" - - example_stage_dir = join_path(test_dir, "examples", "using-with-cmake") - with working_dir(join_path(example_stage_dir, "build"), create=True): - host_config = join_path("../", "host-config.cmake") - if not os.path.exists(host_config): - raise SkipTest(f"{os.path.abspath(host_config)} not found, cannot build example") - cmake_args = ["-C", host_config, "../"] - cmake = self.spec["cmake"].command - make_exe = which("make", required=True) - cmake(*cmake_args) - make_exe() - example = Executable("./using-with-cmake") - example() - make_exe("clean") - - @run_after("install") - @on_package_attributes(run_tests=True) - def check_install(self): - """Installation-time verification that the using-with-cmake example can build against the installed RAJA package.""" - - src_dir=join_path(install_test_root(self)) - dst_dir=join_path(self.stage.path, "spack-test") - - if os.path.exists(src_dir): - install_tree(src_dir, dst_dir) - self._run_common_check_install(dst_dir) - else: - raise SkipTest(f"examples directory not found, cannot build example") - - def test_check_install(self): - """Stand-alone verification that the using-with-cmake example can build against the installed RAJA package.""" - - self._run_common_check_install(self.test_suite.current_test_cache_dir) - - def _write_example_cmakelists(self, path, exe, source): - with open(path, "w", encoding="utf-8") as f: - f.write( - "\n".join( - [ - "cmake_minimum_required(VERSION 3.23)", - "project(raja_package_test LANGUAGES CXX)", - "", - "if(NOT DEFINED RAJA_DIR OR NOT EXISTS ${RAJA_DIR}/lib/cmake/raja/raja-config.cmake)", - " message(FATAL_ERROR \"Missing required 'RAJA_DIR' variable pointing to an installed RAJA\")", - "endif()", - "", - "find_package(RAJA REQUIRED", - " NO_DEFAULT_PATH", - " PATHS ${RAJA_DIR}/lib/cmake/raja)", - "", - f"add_executable({exe} ../{source})", - f"target_link_libraries({exe} RAJA)", - "", - ] - ) - ) - - def build_and_run_example(self, exe, expected): - """Build an example from the cached test sources and verify its output.""" - - examples_dir = join_path(self.test_suite.current_test_cache_dir, self.examples_src_dir) - - build_dir = join_path(examples_dir, f"build-{exe}") - with working_dir(build_dir, create=True): - cmake = self.spec["cmake"].command - make_exe = which("make", required=True) - host_config = join_path("../using-with-cmake", "host-config.cmake") - if not os.path.exists(host_config): - raise SkipTest("host-config.cmake not found, cannot build example") - self._write_example_cmakelists("CMakeLists.txt", exe, f"{exe}.cpp") - cmake_args = ["-C", host_config, "."] - cmake(*cmake_args) - make_exe() - exe_path = join_path(".", exe) - if not os.path.exists(exe_path): - raise SkipTest(f"{exe} was not built") - example = Executable(exe_path) - out = example(output=str, error=str) - check_outputs(expected, out) - make_exe("clean") - - def test_daxpy(self): - """Check daxpy tutorial""" - self.build_and_run_example("tut_daxpy", [r"daxpy", r"result -- PASS"]) - - # TODO: this test seems to hang or take a long time? - # SGS 2026-05-22: Did not see hangs/long execution times on LC systems or Redhat workstation; clarify with Cody where this was occuring. - # def test_matrix_multiply(self): - # """check batched matrix multiple tutorial""" - # self.build_and_run_example( - # "tut_matrix-multiply", [r"matrix multiplication", r"result -- PASS"] - # ) - - def test_launch_basic(self): - """Check basic raja::launch tutorial.""" - if "+cuda" in self.spec or "+rocm" in self.spec: - self.build_and_run_example( - "tut_launch_basic", [r"Running RAJA-Teams", r"result -- PASS"] - ) - else: - raise SkipTest("CUDA or ROCm support is required to run this example") - - def test_halo_exchange(self): - """Check halo exchange tutorial.""" - self.build_and_run_example( - "tut_halo-exchange", [r"RAJA halo exchange example", r"result -- PASS"] - ) - - def test_wave_equation(self): - """Check wave equation.""" - self.build_and_run_example("wave-eqn", [r"Max Error = 2", r"Evolved solution to time"]) diff --git a/scripts/pull-request-testing/spack_repo/llnl_raja/repo.yaml b/scripts/pull-request-testing/spack_repo/llnl_raja/repo.yaml deleted file mode 100644 index 1b9a844d50..0000000000 --- a/scripts/pull-request-testing/spack_repo/llnl_raja/repo.yaml +++ /dev/null @@ -1,3 +0,0 @@ -repo: - namespace: 'llnl_raja' - api: v2.0 From 2277bb9ac0c898e26dc25bbcdb7ea853cfa3d2a8 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Wed, 24 Jun 2026 10:50:20 -0700 Subject: [PATCH 25/33] Raja spack package was updated to use latest BLT release --- .gitlab/jobs/matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/jobs/matrix.yml b/.gitlab/jobs/matrix.yml index 03d08d8040..96c1c88e0c 100644 --- a/.gitlab/jobs/matrix.yml +++ b/.gitlab/jobs/matrix.yml @@ -39,5 +39,5 @@ clang_18_1_8_cuda_12_6_0: clang_18_1_8_cuda_13_1_1: variables: - SPEC: " ~shared +cuda cuda_arch=90 +tests %llvm@=18.1.8 ^cuda@13.1.1+allow-unsupported-compilers ^blt@develop" + SPEC: " ~shared +cuda cuda_arch=90 +tests %llvm@=18.1.8 ^cuda@13.1.1+allow-unsupported-compilers" extends: .job_on_matrix From 951e0582f027dc198c622f20991180a8f5898a7a Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Wed, 24 Jun 2026 11:20:34 -0700 Subject: [PATCH 26/33] Update radius-spack-configs --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 6ebe196e46..3a7d108251 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 6ebe196e46bac4d56cf1517ec62f5852fce43bdc +Subproject commit 3a7d108251fa3d7c014a4b74bf22d8cf181411ee From bb9b6b8e789ff838c844a58461ba49663ddf5a15 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Wed, 24 Jun 2026 11:46:53 -0700 Subject: [PATCH 27/33] Trigger CI pipeline From 3f39c6b983a02978f950557e2cd60f7fde1ccadd Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Wed, 24 Jun 2026 13:29:40 -0700 Subject: [PATCH 28/33] Need current spack-packages for CUDA 13 support --- .uberenv_config.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.uberenv_config.json b/.uberenv_config.json index 452aa08baf..ba853df7b3 100644 --- a/.uberenv_config.json +++ b/.uberenv_config.json @@ -5,6 +5,7 @@ "package_source_dir" : "../..", "spack_url": "https://github.com/spack/spack.git", "spack_branch": "v1.1.1", +"spack_packages_commit": "4d3d0f8ee5ffd6f099727f46ec704f3f4ee98e5c", "spack_configs_path": "scripts/radiuss-spack-configs", "spack_packages_path": "scripts/radiuss-spack-configs/spack_repo/llnl_radiuss/packages", "spack_setup_clingo": false From bb6ff01180e0ec073a13d90603a9d886c668c8a1 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Thu, 25 Jun 2026 10:06:09 -0700 Subject: [PATCH 29/33] Remove spack-packages commit hash from uberenv and move to radius-spack-configs env --- .uberenv_config.json | 1 - scripts/radiuss-spack-configs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.uberenv_config.json b/.uberenv_config.json index ba853df7b3..452aa08baf 100644 --- a/.uberenv_config.json +++ b/.uberenv_config.json @@ -5,7 +5,6 @@ "package_source_dir" : "../..", "spack_url": "https://github.com/spack/spack.git", "spack_branch": "v1.1.1", -"spack_packages_commit": "4d3d0f8ee5ffd6f099727f46ec704f3f4ee98e5c", "spack_configs_path": "scripts/radiuss-spack-configs", "spack_packages_path": "scripts/radiuss-spack-configs/spack_repo/llnl_radiuss/packages", "spack_setup_clingo": false diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 3a7d108251..84c0ff3036 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 3a7d108251fa3d7c014a4b74bf22d8cf181411ee +Subproject commit 84c0ff3036df98525cfc0d66d2ea465edc334ff5 From e56d07ba7c60edd28a59d8216c26d39712c9d40b Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Fri, 26 Jun 2026 09:01:19 -0700 Subject: [PATCH 30/33] Revert temporaroy testing radiuss-spack-configs fork to main repository --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 84c0ff3036..5a73b91c06 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 84c0ff3036df98525cfc0d66d2ea465edc334ff5 +Subproject commit 5a73b91c06724ff089c13db1a3d197b5ea9d5c0c From 7e76aaf28be0966f80de78fa396058ba04fc05c5 Mon Sep 17 00:00:00 2001 From: Rich Hornung Date: Wed, 1 Jul 2026 12:25:38 -0700 Subject: [PATCH 31/33] Squash compiler warnings for CUDA/HIP builds; routines do not need host-device --- include/RAJA/pattern/thread.hpp | 5 +++-- include/RAJA/policy/openmp/thread.hpp | 8 ++++---- include/RAJA/policy/sequential/thread.hpp | 4 ++-- include/RAJA/policy/thread_auto.hpp | 6 +++--- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/RAJA/pattern/thread.hpp b/include/RAJA/pattern/thread.hpp index 4a269c1e98..ccfb3ebc26 100644 --- a/include/RAJA/pattern/thread.hpp +++ b/include/RAJA/pattern/thread.hpp @@ -28,6 +28,7 @@ namespace RAJA { + /*! * \file * Thread operation functions in the namespace RAJA::thread @@ -74,7 +75,7 @@ namespace RAJA * @return Maximum number of threads */ template -RAJA_INLINE RAJA_HOST_DEVICE int get_max_threads() +RAJA_INLINE int get_max_threads() { return RAJA::get_max_threads(Policy {}); } @@ -87,7 +88,7 @@ RAJA_INLINE RAJA_HOST_DEVICE int get_max_threads() * @return Current thread number */ template -RAJA_INLINE RAJA_HOST_DEVICE int get_thread_num() +RAJA_INLINE int get_thread_num() { return RAJA::get_thread_num(Policy {}); } diff --git a/include/RAJA/policy/openmp/thread.hpp b/include/RAJA/policy/openmp/thread.hpp index 0ec536339c..285827909f 100644 --- a/include/RAJA/policy/openmp/thread.hpp +++ b/include/RAJA/policy/openmp/thread.hpp @@ -32,18 +32,18 @@ namespace RAJA { template<> -RAJA_HOST_DEVICE RAJA_INLINE int get_max_threads(omp_thread) +RAJA_INLINE int get_max_threads(omp_thread) { return omp_get_max_threads(); } template<> -RAJA_HOST_DEVICE RAJA_INLINE int get_thread_num(omp_thread) +RAJA_INLINE int get_thread_num(omp_thread) { return omp_get_thread_num(); } } // namespace RAJA -#endif // RAJA_ENABLE_OPENMP -#endif // guard +#endif // RAJA_OPENMP_ACTIVE +#endif // header file include guard diff --git a/include/RAJA/policy/sequential/thread.hpp b/include/RAJA/policy/sequential/thread.hpp index d48961420a..393e1fd242 100644 --- a/include/RAJA/policy/sequential/thread.hpp +++ b/include/RAJA/policy/sequential/thread.hpp @@ -29,13 +29,13 @@ namespace RAJA { template<> -RAJA_HOST_DEVICE RAJA_INLINE int get_max_threads(seq_thread) +RAJA_INLINE int get_max_threads(seq_thread) { return 1; } template<> -RAJA_HOST_DEVICE RAJA_INLINE int get_thread_num(seq_thread) +RAJA_INLINE int get_thread_num(seq_thread) { return 0; } diff --git a/include/RAJA/policy/thread_auto.hpp b/include/RAJA/policy/thread_auto.hpp index 301f50f055..1612ae8ff0 100644 --- a/include/RAJA/policy/thread_auto.hpp +++ b/include/RAJA/policy/thread_auto.hpp @@ -52,11 +52,11 @@ using active_auto_thread = RAJA::seq_thread; } // namespace detail template -RAJA_HOST_DEVICE RAJA_INLINE int get_max_threads(AtomicPolicy); +RAJA_INLINE int get_max_threads(AtomicPolicy); template -RAJA_HOST_DEVICE RAJA_INLINE int get_thread_num(AtomicPolicy); +RAJA_INLINE int get_thread_num(AtomicPolicy); } // namespace RAJA -#endif +#endif // header file include guard From f6f8fa8c5735fd89ccf43d11d7d8ed01a22dc248 Mon Sep 17 00:00:00 2001 From: Rich Hornung Date: Wed, 1 Jul 2026 12:27:00 -0700 Subject: [PATCH 32/33] Squash more compiler warnings --- include/RAJA/util/math.hpp | 5 ++++- test/unit/util/test-fraction.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/RAJA/util/math.hpp b/include/RAJA/util/math.hpp index fbb1ac76b1..c9e560ace9 100644 --- a/include/RAJA/util/math.hpp +++ b/include/RAJA/util/math.hpp @@ -84,7 +84,10 @@ RAJA_HOST_DEVICE RAJA_INLINE constexpr T next_pow2(T n) noexcept template::value>* = nullptr> RAJA_HOST_DEVICE RAJA_INLINE constexpr T prev_pow2(T n) noexcept { - if (n < 0) return 0; + if constexpr (std::is_signed_v) + { + if (n < 0) return 0; + } for (size_t s = 1; s < CHAR_BIT * sizeof(T); s *= 2) { n |= n >> s; diff --git a/test/unit/util/test-fraction.cpp b/test/unit/util/test-fraction.cpp index 5bbf898598..dd77cf9bda 100644 --- a/test/unit/util/test-fraction.cpp +++ b/test/unit/util/test-fraction.cpp @@ -32,7 +32,7 @@ void testFractionMultiplyTypesValues() IntegerType(double(numerator) / double(denominator) * double(101))); // Test where naive algorithm causes overflow, when within precision of double - if /*constexpr*/ (sizeof(IntegerType) < sizeof(double)) { + if constexpr (sizeof(IntegerType) < sizeof(double)) { static constexpr IntegerType max = std::numeric_limits::max(); static constexpr IntegerType val = (numerator > denominator) ? From 5edf7e619931f1c9cf66a21bbeec1aa61a3b7110 Mon Sep 17 00:00:00 2001 From: Rich Hornung Date: Wed, 1 Jul 2026 12:27:34 -0700 Subject: [PATCH 33/33] Reove errant double quote --- scripts/lc-builds/toss4_cce_omptarget.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lc-builds/toss4_cce_omptarget.sh b/scripts/lc-builds/toss4_cce_omptarget.sh index 14d8a3b275..f4a2b0b384 100755 --- a/scripts/lc-builds/toss4_cce_omptarget.sh +++ b/scripts/lc-builds/toss4_cce_omptarget.sh @@ -22,7 +22,7 @@ if [[ $# -lt 2 ]]; then echo "For example: " echo " toss4_cce_omptarget.sh 20.0.0-magic gfx942 [3.27.4]" echo "If no CMake version is provided, version ${DEFAULT_CMAKE_VER} will be used." - exit 1" + exit 1 fi COMP_VER=$1