├── .dockerignore ├── docs ├── sphinx │ ├── .gitignore │ ├── user_guide │ │ ├── figures │ │ │ ├── jacobi.png │ │ │ ├── IndexSet.png │ │ │ ├── gsboard.png │ │ │ ├── vectorET.png │ │ │ ├── vertexsum.jpg │ │ │ ├── ListSegment.png │ │ │ ├── redblackGS.png │ │ │ ├── CUDA_profiling.png │ │ │ ├── Hatchet_tree.png │ │ │ ├── ROCM_profiling.png │ │ │ ├── RangeSegment.png │ │ │ ├── index_set_fig.png │ │ │ ├── vertexsum_color.png │ │ │ └── RangeStrideSegment.png │ │ ├── app_considerations.rst │ │ ├── cook_book.rst │ │ ├── CMakeLists.txt │ │ ├── features.rst │ │ └── index.rst │ ├── dev_guide │ │ ├── figures │ │ │ ├── PR-Workflow.png │ │ │ ├── RAJA-Gitlab-Files.png │ │ │ ├── RAJA-Gitlab-Workflow2.png │ │ │ └── git-workflow-gitflow2.png │ │ └── index.rst │ └── raja_license.rst ├── requirements.txt ├── CMakeLists.txt ├── doxygen │ └── CMakeLists.txt └── Licenses │ └── rocprim-license.txt ├── suppressions.asan ├── travis-data ├── intel2016.lic.enc └── docker │ ├── ubuntu-clang-base │ ├── Dockerfile │ └── generic-setup.sh │ ├── hip │ ├── Dockerfile │ └── generic-setup.sh │ ├── bionic-base │ ├── Dockerfile │ └── generic-setup-18.04.sh │ ├── nvcc8 │ ├── Dockerfile │ └── generic-setup.sh │ ├── nvcc9 │ ├── Dockerfile │ └── generic-setup.sh │ ├── nvcc10 │ ├── Dockerfile │ └── generic-setup-18.04.sh │ ├── clang9 │ └── Dockerfile │ ├── clang5 │ └── Dockerfile │ ├── clang6 │ └── Dockerfile │ ├── clang4 │ └── Dockerfile │ ├── gcc49 │ └── Dockerfile │ ├── gcc5 │ └── Dockerfile │ ├── gcc6 │ └── Dockerfile │ ├── gcc7 │ └── Dockerfile │ ├── gcc8 │ └── Dockerfile │ ├── build-all.sh │ ├── icc18 │ └── Dockerfile │ ├── icc16 │ ├── Dockerfile │ └── generic-setup.sh │ └── generic-setup.sh ├── share └── raja │ ├── logo │ ├── RAJA_LOGO_Color.png │ └── RAJA_LOGO_CMYK_White_Background_large.png │ └── pkg-config │ └── RAJA.pc.in ├── .gitignore ├── codecov.yml ├── appveyor.yml ├── exercises ├── supervisord.conf └── user-data.sh ├── test ├── old-tests │ ├── CMakeLists.txt │ └── unit │ │ ├── cpu │ │ ├── CMakeLists.txt │ │ └── test-synchronize.cpp │ │ ├── cuda │ │ ├── CMakeLists.txt │ │ └── test-synchronize.cpp │ │ └── CMakeLists.txt ├── unit │ ├── hip │ │ └── CMakeLists.txt │ ├── internal │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ ├── index │ │ └── CMakeLists.txt │ ├── util │ │ ├── CMakeLists.txt │ │ └── operator │ │ │ └── CMakeLists.txt │ ├── view-layout │ │ └── CMakeLists.txt │ ├── reducer │ │ ├── test-reducer-reset-seq.cpp │ │ ├── test-reducer-reset-hip.cpp │ │ ├── test-reducer-reset-cuda.cpp │ │ ├── test-reducer-reset-openmp.cpp │ │ └── test-reducer-reset-openmp-target.cpp │ ├── atomic │ │ └── CMakeLists.txt │ ├── indexing │ │ └── CMakeLists.txt │ ├── workgroup │ │ └── test-workgroup-WorkStorage.cpp.in │ ├── algorithm │ │ ├── test-algorithm-sort.cpp.in │ │ ├── test-algorithm-stable-sort.cpp.in │ │ └── test-algorithm-util-sort.cpp.in │ └── resource │ │ └── test-resource.cpp.in ├── functional │ ├── indexset-build │ │ └── CMakeLists.txt │ ├── tensor │ │ ├── CMakeLists.txt │ │ └── vector │ │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ ├── dynamic_forall │ │ ├── CMakeLists.txt │ │ ├── segment │ │ │ └── CMakeLists.txt │ │ └── resource-segment │ │ │ └── CMakeLists.txt │ ├── launch │ │ ├── nested_tile_direct │ │ │ └── CMakeLists.txt │ │ ├── nested_tile_loop │ │ │ └── CMakeLists.txt │ │ ├── run-time-switch │ │ │ ├── CMakeLists.txt │ │ │ └── test-launch.cpp.in │ │ ├── tile_icount_tcount_loop │ │ │ └── CMakeLists.txt │ │ ├── nested_tile_direct_unchecked │ │ │ └── CMakeLists.txt │ │ ├── tile_icount_tcount_direct │ │ │ └── CMakeLists.txt │ │ ├── tile_icount_tcount_direct_unchecked │ │ │ └── CMakeLists.txt │ │ ├── nested_loop │ │ │ └── CMakeLists.txt │ │ ├── nested_direct │ │ │ └── CMakeLists.txt │ │ ├── segment │ │ │ └── CMakeLists.txt │ │ └── nested_direct_unchecked │ │ │ └── CMakeLists.txt │ ├── util │ │ └── CMakeLists.txt │ ├── forall │ │ ├── atomic-basic │ │ │ └── CMakeLists.txt │ │ ├── region │ │ │ └── CMakeLists.txt │ │ ├── segment │ │ │ └── CMakeLists.txt │ │ ├── resource-segment │ │ │ └── CMakeLists.txt │ │ ├── indexset │ │ │ └── CMakeLists.txt │ │ ├── segment-view │ │ │ └── CMakeLists.txt │ │ └── indexset-view │ │ │ └── CMakeLists.txt │ └── kernel │ │ ├── basic-single-icount-loop │ │ └── CMakeLists.txt │ │ └── nested-loop-segment-types │ │ └── CMakeLists.txt ├── CMakeLists.txt ├── include │ ├── RAJA_test-kernel-tile-size.hpp │ ├── RAJA_test-base.hpp │ ├── RAJA_test-abs.hpp │ ├── RAJA_test-reduceloc-types.hpp │ ├── RAJA_test-atomic-types.hpp │ ├── RAJA_test-plugin-launchpol.hpp │ ├── RAJA_test-dynamic-forall.hpp │ └── RAJA_test-reduce-types.hpp ├── CTestCustom.cmake ├── integration │ ├── test_plugin_kokkos.cpp │ ├── test_plugin_dynamic.cpp │ ├── test_plugin_old_dynamic.cpp │ ├── plugin_for_test_dynamic.cpp │ ├── plugin_old_for_test_dynamic.cpp │ ├── plugin_for_test_kokkos.cpp │ └── plugin │ │ ├── tests │ │ └── counter.hpp │ │ └── test-plugin-forall.cpp.in └── install │ ├── CMakeLists.txt │ └── using-with-cmake │ ├── CMakeLists.txt │ └── using-with-cmake.cpp ├── .uberenv_config.json ├── RELEASE ├── reproducers ├── clangcuda │ └── CMakeLists.txt ├── CMakeLists.txt └── openmp-target │ ├── CMakeLists.txt │ └── reproducer-openmptarget-issue3.cpp ├── .gitmodules ├── cmake ├── SetupBasics.cmake └── thirdparty │ ├── FindCUB.cmake │ ├── FindSphinx.cmake │ └── FindRoctracer.cmake ├── include └── RAJA │ ├── pattern │ ├── params │ │ └── kernel_name.hpp │ ├── kernel │ │ ├── internal.hpp │ │ └── Collapse.hpp │ └── tensor │ │ ├── ScalarRegister.hpp │ │ └── VectorRegister.hpp │ ├── policy │ ├── openmp_target │ │ ├── kernel.hpp │ │ ├── WorkGroup.hpp │ │ └── params │ │ │ └── kernel_name.hpp │ ├── desul.hpp │ ├── tensor │ │ └── arch │ │ │ ├── scalar.hpp │ │ │ ├── hip.hpp │ │ │ ├── cuda.hpp │ │ │ ├── avx.hpp │ │ │ ├── avx2.hpp │ │ │ └── avx512.hpp │ ├── hip │ │ └── WorkGroup.hpp │ ├── cuda │ │ └── WorkGroup.hpp │ ├── openmp │ │ ├── kernel.hpp │ │ ├── WorkGroup.hpp │ │ ├── params │ │ │ └── kernel_name.hpp │ │ └── synchronize.hpp │ ├── sequential │ │ ├── kernel.hpp │ │ ├── WorkGroup.hpp │ │ ├── params │ │ │ └── kernel_name.hpp │ │ ├── region.hpp │ │ └── thread.hpp │ ├── tensor.hpp │ ├── simd │ │ └── params │ │ │ ├── kernel_name.hpp │ │ │ └── reduce.hpp │ ├── sycl │ │ └── params │ │ │ └── kernel_name.hpp │ └── simd.hpp │ └── util │ ├── PluginOptions.hpp │ ├── PluginLinker.hpp │ ├── sycl_compat.hpp │ └── PluginContext.hpp ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── PULL_REQUEST_TEMPLATE.md ├── scripts ├── ubuntu-builds │ ├── ubuntu_hipcc.sh │ ├── ubuntu_nvcc10_gcc8.sh │ ├── ubuntu_gcc.sh │ └── ubuntu_clang.sh ├── setup-hooks.sh ├── install_llvm.sh ├── macos-builds │ └── apple_clang10.0.0.sh ├── make_release_tarball.sh ├── alcf-builds │ ├── cooley_clang5.0.sh │ ├── cooley_gcc7.1.0.sh │ ├── dpcpp.cuda.sh │ ├── theta_intel18.sh │ ├── cooley_nvcc9.1_clang4.0.sh │ └── sycl.sh └── travis_build_and_test.sh ├── examples ├── plugin │ ├── test-plugin.cpp │ ├── test-plugin-dynamic.cpp │ └── CMakeLists.txt └── kernel-dynamic-tile.cpp ├── docker └── Dockerfile ├── host-configs ├── lc-builds │ └── toss4 │ │ ├── icpc_X.cmake │ │ ├── cce_omptarget_X.cmake │ │ ├── gcc_X.cmake │ │ ├── icpc-classic_X.cmake │ │ ├── clang_X.cmake │ │ ├── clang_X_asan.cmake │ │ ├── clang_X_ubsan.cmake │ │ ├── nvcc_gcc_X.cmake │ │ ├── icpx_X.cmake │ │ ├── hip_3_X.cmake │ │ └── nvcc_clang_X.cmake ├── ubuntu-builds │ ├── gcc_X.cmake │ ├── clang_X.cmake │ └── nvcc_gcc_X.cmake ├── macos-builds │ └── clang_X.cmake └── alcf-builds │ ├── cooley_clang5_0.cmake │ ├── cooley_gcc7_1_0.cmake │ └── theta_intel18_0.cmake ├── benchmark └── CMakeLists.txt ├── src ├── PluginStrategy.cpp └── DepGraphNode.cpp ├── .readthedocs.yml └── NOTICE /.dockerignore: -------------------------------------------------------------------------------- 1 | Dockerfile 2 | -------------------------------------------------------------------------------- /docs/sphinx/.gitignore: -------------------------------------------------------------------------------- 1 | package_list.rst 2 | command_index.rst 3 | _build 4 | -------------------------------------------------------------------------------- /suppressions.asan: -------------------------------------------------------------------------------- 1 | # Library that isn’t built by us 2 | leak:libxlsmp.so.1 3 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | docutils 2 | sphinx==6.2.1 3 | sphinx-rtd-theme==1.2.2 4 | -------------------------------------------------------------------------------- /travis-data/intel2016.lic.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/travis-data/intel2016.lic.enc -------------------------------------------------------------------------------- /share/raja/logo/RAJA_LOGO_Color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/share/raja/logo/RAJA_LOGO_Color.png -------------------------------------------------------------------------------- /docs/sphinx/user_guide/figures/jacobi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/user_guide/figures/jacobi.png -------------------------------------------------------------------------------- /docs/sphinx/user_guide/figures/IndexSet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/user_guide/figures/IndexSet.png -------------------------------------------------------------------------------- /docs/sphinx/user_guide/figures/gsboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/user_guide/figures/gsboard.png -------------------------------------------------------------------------------- /docs/sphinx/user_guide/figures/vectorET.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/user_guide/figures/vectorET.png -------------------------------------------------------------------------------- /docs/sphinx/user_guide/figures/vertexsum.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/user_guide/figures/vertexsum.jpg -------------------------------------------------------------------------------- /docs/sphinx/dev_guide/figures/PR-Workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/dev_guide/figures/PR-Workflow.png -------------------------------------------------------------------------------- /docs/sphinx/user_guide/figures/ListSegment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/user_guide/figures/ListSegment.png -------------------------------------------------------------------------------- /docs/sphinx/user_guide/figures/redblackGS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/user_guide/figures/redblackGS.png -------------------------------------------------------------------------------- /docs/sphinx/user_guide/figures/CUDA_profiling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/user_guide/figures/CUDA_profiling.png -------------------------------------------------------------------------------- /docs/sphinx/user_guide/figures/Hatchet_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/user_guide/figures/Hatchet_tree.png -------------------------------------------------------------------------------- /docs/sphinx/user_guide/figures/ROCM_profiling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/user_guide/figures/ROCM_profiling.png -------------------------------------------------------------------------------- /docs/sphinx/user_guide/figures/RangeSegment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/user_guide/figures/RangeSegment.png -------------------------------------------------------------------------------- /docs/sphinx/user_guide/figures/index_set_fig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/user_guide/figures/index_set_fig.png -------------------------------------------------------------------------------- /docs/sphinx/dev_guide/figures/RAJA-Gitlab-Files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/dev_guide/figures/RAJA-Gitlab-Files.png -------------------------------------------------------------------------------- /docs/sphinx/user_guide/figures/vertexsum_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/user_guide/figures/vertexsum_color.png -------------------------------------------------------------------------------- /docs/sphinx/user_guide/figures/RangeStrideSegment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/user_guide/figures/RangeStrideSegment.png -------------------------------------------------------------------------------- /docs/sphinx/dev_guide/figures/RAJA-Gitlab-Workflow2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/dev_guide/figures/RAJA-Gitlab-Workflow2.png -------------------------------------------------------------------------------- /docs/sphinx/dev_guide/figures/git-workflow-gitflow2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/docs/sphinx/dev_guide/figures/git-workflow-gitflow2.png -------------------------------------------------------------------------------- /share/raja/logo/RAJA_LOGO_CMYK_White_Background_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/RAJA/HEAD/share/raja/logo/RAJA_LOGO_CMYK_White_Background_large.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .cache 2 | .idea 3 | *.sync-conflict-* 4 | *.pyc 5 | *.o 6 | *.a 7 | *.exe 8 | *.gch 9 | /*.sublime-* 10 | /build/ 11 | /build_*/ 12 | /build-*/ 13 | /install/ 14 | /install_*/ 15 | /install-*/ 16 | /Debug/ 17 | *.swp 18 | *.orig 19 | -------------------------------------------------------------------------------- /travis-data/docker/ubuntu-clang-base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | LABEL maintainer="Tom Scogland " 4 | 5 | ADD generic-setup.sh /root/generic-setup.sh 6 | 7 | RUN /root/generic-setup.sh 8 | 9 | USER raja 10 | WORKDIR /home/raja 11 | -------------------------------------------------------------------------------- /travis-data/docker/hip/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rocm/dev-ubuntu-16.04:3.5.1 2 | 3 | LABEL maintainer="David Beckingsale " 4 | 5 | ADD generic-setup.sh /root/generic-setup.sh 6 | 7 | RUN sudo /root/generic-setup.sh 8 | 9 | USER raja 10 | WORKDIR /home/raja 11 | -------------------------------------------------------------------------------- /travis-data/docker/bionic-base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | 3 | LABEL maintainer="Tom Scogland " 4 | 5 | ADD generic-setup-18.04.sh /root/generic-setup-18.04.sh 6 | 7 | RUN /root/generic-setup-18.04.sh 8 | 9 | USER raja 10 | WORKDIR /home/raja 11 | 12 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - "test/" 3 | 4 | coverage: 5 | precision: 3 6 | range: "97...100" 7 | status: 8 | project: 9 | default: 10 | threshold: 1 11 | 12 | parsers: 13 | gcov: 14 | branch_detection: 15 | conditional: no 16 | loop: no 17 | method: no 18 | macro: no 19 | -------------------------------------------------------------------------------- /travis-data/docker/nvcc8/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nvidia/cuda:8.0-devel-ubuntu16.04 2 | 3 | LABEL maintainer="Tom Scogland " 4 | 5 | ENV CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-8.0 6 | 7 | ADD generic-setup.sh /root/generic-setup.sh 8 | 9 | RUN /root/generic-setup.sh 10 | 11 | USER raja 12 | WORKDIR /home/raja 13 | -------------------------------------------------------------------------------- /travis-data/docker/nvcc9/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nvidia/cuda:9.2-devel-ubuntu16.04 2 | 3 | LABEL maintainer="Tom Scogland " 4 | 5 | ENV CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-9.1 6 | 7 | ADD generic-setup.sh /root/generic-setup.sh 8 | 9 | RUN /root/generic-setup.sh 10 | 11 | USER raja 12 | WORKDIR /home/raja 13 | -------------------------------------------------------------------------------- /travis-data/docker/nvcc10/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nvidia/cuda:10.2-devel-ubuntu18.04 2 | 3 | LABEL maintainer="Tom Scogland " 4 | 5 | ENV CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.2 6 | 7 | ADD generic-setup-18.04.sh /root/generic-setup-18.04.sh 8 | 9 | RUN /root/generic-setup-18.04.sh 10 | 11 | USER raja 12 | WORKDIR /home/raja 13 | -------------------------------------------------------------------------------- /share/raja/pkg-config/RAJA.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_PREFIX@/lib 2 | includedir=@CMAKE_INSTALL_PREFIX@/include 3 | 4 | Name: @CMAKE_PROJECT_NAME@ 5 | Description: RAJA Portability Layer 6 | Version: @RAJA_VERSION_MAJOR@.@RAJA_VERSION_MINOR@.@RAJA_VERSION_PATCHLEVEL@ 7 | Libs: -rdynamic ${libdir}/libRAJA.a @PRIVATE_LIBS@ 8 | Cflags: @PC_C_FLAGS@ -I${includedir} 9 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | skip_branch_with_pr: true 3 | image: 4 | - Visual Studio 2019 5 | build_script: 6 | - cmd: >- 7 | git submodule init 8 | 9 | git submodule update 10 | 11 | mkdir build 12 | 13 | cd build 14 | 15 | cmake ../ 16 | 17 | cmake --build . --config Release 18 | test_script: 19 | - cmd: ctest -VV -C Release 20 | -------------------------------------------------------------------------------- /travis-data/docker/clang9/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rajaorg/compiler:ubuntu18.04-base 2 | 3 | LABEL maintainer="Tom Scogland " 4 | RUN \ 5 | sudo apt-get -qq install -y --no-install-recommends clang-9 libc++-9-dev libomp-9-dev 6 | 7 | RUN \ 8 | sudo apt-get -qq install -y --no-install-recommends nvidia-cuda-toolkit 9 | 10 | USER raja 11 | WORKDIR /home/raja 12 | -------------------------------------------------------------------------------- /exercises/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon = true 3 | user = XXX 4 | logfile = /tmp/supervisord.log 5 | 6 | [program:openvscode-server] 7 | environment=HOME="/home/XXX",USER="XXX" 8 | redirect_stderr = true 9 | stdout_logfile = /var/log/openvscode-server.log 10 | command = /opt/archives/openvscode-server-v1.69.1-linux-x64/bin/openvscode-server --without-connection-token --host 0.0.0.0 11 | -------------------------------------------------------------------------------- /test/old-tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | add_subdirectory(unit) 9 | -------------------------------------------------------------------------------- /travis-data/docker/bionic-base/generic-setup-18.04.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -x 4 | 5 | 6 | apt-get -qq update 7 | apt-get -qq install -y --no-install-recommends wget cmake python-dev python-pip build-essential sudo git vim dh-autoreconf ninja-build ca-certificates libtbb-dev 8 | 9 | useradd -ms /bin/bash raja 10 | printf "raja:raja" | chpasswd 11 | adduser raja sudo 12 | printf "raja ALL= NOPASSWD: ALL\\n" >> /etc/sudoers 13 | -------------------------------------------------------------------------------- /.uberenv_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "package_name" : "raja", 3 | "package_version" : "develop", 4 | "package_final_phase" : "initconfig", 5 | "package_source_dir" : "../..", 6 | "spack_url": "https://github.com/spack/spack.git", 7 | "spack_branch": "v1.0.2", 8 | "spack_configs_path": "scripts/radiuss-spack-configs", 9 | "spack_packages_path": "scripts/radiuss-spack-configs/spack_repo/llnl_radiuss/packages", 10 | "spack_setup_clingo": false 11 | } 12 | -------------------------------------------------------------------------------- /RELEASE: -------------------------------------------------------------------------------- 1 | ******************************************************************************* 2 | 3 | RAJA: ................................, version 2025.12.0 4 | 5 | Copyright (c) 2016-25, Lawrence Livermore National Security, LLC. 6 | Produced at the Lawrence Livermore National Laboratory. 7 | All rights reserved. See details in the RAJA/LICENSE file. 8 | 9 | Unlimited Open Source - BSD Distribution 10 | LLNL-CODE-689114 11 | OCEC-16-063 12 | 13 | -------------------------------------------------------------------------------- /exercises/user-data.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | yum update -y 4 | amazon-linux-extras install docker 5 | systemctl start docer 6 | systemctl enable docker 7 | 8 | wget https://raw.githubusercontent.com/LLNL/RAJA/task/tut-reorg-aws/exercises/Dockerfile 9 | wget https://raw.githubusercontent.com/LLNL/RAJA/task/tut-reorg-aws/exercises/supervisord.conf 10 | 11 | env DOCKER_BUILDKIT=1 docker build . -t raja-aws-tut 12 | docker run --init --gpus all -p 3000:3000 raja-aws-tut 13 | -------------------------------------------------------------------------------- /test/unit/hip/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | raja_add_test( 9 | NAME test-hip-synchronize 10 | SOURCES test-synchronize.cpp) 11 | -------------------------------------------------------------------------------- /docs/sphinx/user_guide/app_considerations.rst: -------------------------------------------------------------------------------- 1 | .. ## 2 | .. ## Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | .. ## and RAJA project contributors. See the RAJA/LICENSE file 4 | .. ## for details. 5 | .. ## 6 | .. ## SPDX-License-Identifier: (BSD-3-Clause) 7 | .. ## 8 | 9 | .. _app-considerations-label: 10 | 11 | *************************** 12 | Application Considerations 13 | *************************** 14 | 15 | .. warning:: **Comming soon!! Stay tuned.** 16 | -------------------------------------------------------------------------------- /test/old-tests/unit/cpu/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | raja_add_test( 9 | NAME test-synchronize 10 | SOURCES test-synchronize.cpp) 11 | -------------------------------------------------------------------------------- /test/old-tests/unit/cuda/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | raja_add_test( 9 | NAME test-cuda-synchronize 10 | SOURCES test-synchronize.cpp) 11 | -------------------------------------------------------------------------------- /reproducers/clangcuda/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | raja_add_reproducer( 9 | NAME reproducer-clangcuda-shuffle 10 | SOURCES reproducer-shuffle.cpp) 11 | -------------------------------------------------------------------------------- /test/functional/indexset-build/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | raja_add_test( 9 | NAME test-aligned-indexset 10 | SOURCES test-aligned-indexset.cpp) 11 | 12 | -------------------------------------------------------------------------------- /travis-data/docker/clang5/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rajaorg/compiler:ubuntu-clang-base 2 | 3 | LABEL maintainer="Tom Scogland " 4 | ENV llvmtar=clang+llvm-5.0.1-x86_64-linux-gnu-ubuntu-16.04 5 | ENV tarext=.tar.xz 6 | RUN \ 7 | wget -q --no-check-certificate http://releases.llvm.org/5.0.1/${llvmtar}${tarext} \ 8 | && tar xf ${llvmtar}${tarext} \ 9 | && sudo cp -fR ${llvmtar}/* /usr \ 10 | && rm -rf ${llvmtar} \ 11 | && rm ${llvmtar}${tarext} 12 | 13 | USER raja 14 | WORKDIR /home/raja 15 | -------------------------------------------------------------------------------- /travis-data/docker/clang6/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rajaorg/compiler:ubuntu-clang-base 2 | 3 | LABEL maintainer="Tom Scogland " 4 | ENV llvmtar=clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-14.04 5 | ENV tarext=.tar.xz 6 | RUN \ 7 | wget -q --no-check-certificate http://releases.llvm.org/6.0.0/${llvmtar}${tarext} \ 8 | && tar xf ${llvmtar}${tarext} \ 9 | && sudo cp -fR ${llvmtar}/* /usr \ 10 | && rm -rf ${llvmtar} \ 11 | && rm ${llvmtar}${tarext} 12 | 13 | USER raja 14 | WORKDIR /home/raja 15 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "blt"] 2 | path = blt 3 | url = https://github.com/LLNL/blt.git 4 | [submodule "include/camp"] 5 | path = tpl/camp 6 | url = https://github.com/llnl/camp 7 | [submodule "scripts/radiuss-spack-configs"] 8 | path = scripts/radiuss-spack-configs 9 | url = https://github.com/LLNL/radiuss-spack-configs 10 | [submodule "scripts/uberenv"] 11 | path = scripts/uberenv 12 | url = https://github.com/LLNL/uberenv.git 13 | [submodule "tpl/desul"] 14 | path = tpl/desul 15 | url = https://github.com/desul/desul.git 16 | -------------------------------------------------------------------------------- /reproducers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ################################################################################ 7 | 8 | if(RAJA_ENABLE_CLANG_CUDA) 9 | add_subdirectory(clangcuda) 10 | endif(RAJA_ENABLE_CLANG_CUDA) 11 | 12 | add_subdirectory(openmp-target) 13 | -------------------------------------------------------------------------------- /travis-data/docker/clang4/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rajaorg/compiler:ubuntu-clang-base 2 | 3 | LABEL maintainer="Tom Scogland " 4 | ENV llvmver=4.0.0 5 | ENV llvmtar=clang+llvm-4.0.0-x86_64-linux-gnu-ubuntu-16.04 6 | ENV tarext=.tar.xz 7 | RUN \ 8 | wget -q --no-check-certificate http://releases.llvm.org/${llvmver}/${llvmtar}${tarext} \ 9 | && tar xf ${llvmtar}${tarext} \ 10 | && sudo cp -fR ${llvmtar}/* /usr \ 11 | && rm -rf ${llvmtar} \ 12 | && rm ${llvmtar}${tarext} 13 | 14 | USER raja 15 | WORKDIR /home/raja 16 | -------------------------------------------------------------------------------- /test/unit/internal/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | raja_add_test( 9 | NAME test-iterators 10 | SOURCES test-iterators.cpp) 11 | 12 | raja_add_test( 13 | NAME test-rajavec 14 | SOURCES test-rajavec.cpp) 15 | 16 | -------------------------------------------------------------------------------- /cmake/SetupBasics.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and other RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | if(NOT CMAKE_BUILD_TYPE) 9 | set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, \ 10 | options are: Debug Release RelWithDebInfo" FORCE) 11 | endif(NOT CMAKE_BUILD_TYPE) 12 | -------------------------------------------------------------------------------- /test/functional/tensor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set( TENSOR_ELEMENT_TYPES int32_t int64_t float double ) 9 | 10 | add_subdirectory(register) 11 | add_subdirectory(vector) 12 | add_subdirectory(matrix) 13 | 14 | 15 | unset( TENSOR_ELEMENT_TYPES ) 16 | -------------------------------------------------------------------------------- /include/RAJA/pattern/params/kernel_name.hpp: -------------------------------------------------------------------------------- 1 | #ifndef RAJA_KERNEL_NAME_HPP 2 | #define RAJA_KERNEL_NAME_HPP 3 | 4 | #include "RAJA/pattern/params/params_base.hpp" 5 | 6 | namespace RAJA 7 | { 8 | namespace detail 9 | { 10 | 11 | struct Name : public RAJA::expt::detail::ForallParamBase 12 | { 13 | RAJA_HOST_DEVICE Name() {} 14 | 15 | explicit Name(const char* name_in) : name(name_in) {} 16 | 17 | const char* name; 18 | }; 19 | 20 | } // namespace detail 21 | 22 | inline auto Name(const char* n) { return detail::Name(n); } 23 | 24 | 25 | } // namespace RAJA 26 | 27 | 28 | #endif // KERNEL_NAME_HPP 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | **Describe the bug** 8 | 9 | A clear and concise description of what the bug is: 10 | 11 | **To Reproduce** 12 | 13 | Steps to reproduce the behavior: 14 | 15 | **Expected behavior** 16 | 17 | A clear and concise description of what you expected to happen: 18 | 19 | **Compilers & Libraries (please complete the following information):** 20 | - Compiler & version: [e.g. GCC 4.9.3]: 21 | - CUDA version (if applicable): 22 | 23 | **Additional context** 24 | 25 | Add any other context about the problem here. 26 | -------------------------------------------------------------------------------- /travis-data/docker/gcc49/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rajaorg/compiler:ubuntu-clang-base 2 | 3 | LABEL maintainer="Tom Scogland " 4 | RUN \ 5 | sudo apt-get -qq install -y --no-install-recommends \ 6 | g++-4.9 \ 7 | g++-4.9-multilib \ 8 | && sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 100 \ 9 | && sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 100 \ 10 | && sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-4.9 100 \ 11 | && sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-4.9 100 12 | 13 | USER raja 14 | WORKDIR /home/raja 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | 9 | A clear and concise description of what the problem is. 10 | 11 | **Describe the solution you'd like** 12 | 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you've considered** 16 | 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | 21 | Add any other context or information about the feature request here. 22 | 23 | -------------------------------------------------------------------------------- /travis-data/docker/gcc5/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rajaorg/compiler:ubuntu-clang-base 2 | 3 | LABEL maintainer="Tom Scogland " 4 | ENV gccver=5 5 | 6 | RUN \ 7 | sudo apt-get -qq install -y --no-install-recommends \ 8 | g++-${gccver} \ 9 | && sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${gccver} 100 \ 10 | && sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${gccver} 100 \ 11 | && sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-${gccver} 100 \ 12 | && sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-${gccver} 100 13 | 14 | USER raja 15 | WORKDIR /home/raja 16 | -------------------------------------------------------------------------------- /travis-data/docker/gcc6/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rajaorg/compiler:ubuntu-clang-base 2 | 3 | LABEL maintainer="Tom Scogland " 4 | ENV gccver=6 5 | 6 | RUN \ 7 | sudo apt-get -qq install -y --no-install-recommends \ 8 | g++-${gccver} \ 9 | && sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${gccver} 100 \ 10 | && sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${gccver} 100 \ 11 | && sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-${gccver} 100 \ 12 | && sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-${gccver} 100 13 | 14 | USER raja 15 | WORKDIR /home/raja 16 | -------------------------------------------------------------------------------- /travis-data/docker/gcc7/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rajaorg/compiler:ubuntu-clang-base 2 | 3 | LABEL maintainer="Tom Scogland " 4 | ENV gccver=7 5 | 6 | RUN \ 7 | sudo apt-get -qq install -y --no-install-recommends \ 8 | g++-${gccver} \ 9 | && sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${gccver} 100 \ 10 | && sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${gccver} 100 \ 11 | && sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-${gccver} 100 \ 12 | && sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-${gccver} 100 13 | 14 | USER raja 15 | WORKDIR /home/raja 16 | -------------------------------------------------------------------------------- /test/old-tests/unit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | raja_add_test( 9 | NAME test-sharedmem 10 | SOURCES test-sharedmem.cpp) 11 | 12 | raja_add_test( 13 | NAME test-simd 14 | SOURCES test-simd.cpp) 15 | 16 | add_subdirectory(cpu) 17 | 18 | if(RAJA_ENABLE_CUDA) 19 | add_subdirectory(cuda) 20 | endif(RAJA_ENABLE_CUDA) 21 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | - This PR is a (refactoring, bugfix, feature, something else) 4 | - It does the following (modify list as needed): 5 | - Modifies/refactors (class or method) (how?) 6 | - Fixes (issue number(s)) 7 | - Adds (specific feature) at the request of (project or person) 8 | 9 | # Design review (for API changes or additions---delete if unneeded) 10 | 11 | On (date), we reviewed this PR. We discussed the design ideas: 12 | 13 | 1. First idea or goal 14 | 2. Second idea 15 | 3. Third idea 16 | 17 | This PR implements 1. and 3. It leaves out 2. for the following reasons 18 | 19 | - (impractical) 20 | - (too big) 21 | - (not a good idea anyway) 22 | -------------------------------------------------------------------------------- /test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | include_directories(include) 9 | 10 | add_subdirectory(integration) 11 | 12 | add_subdirectory(functional) 13 | 14 | add_subdirectory(unit) 15 | 16 | add_subdirectory(old-tests) 17 | 18 | add_subdirectory(install) 19 | 20 | configure_file(${PROJECT_SOURCE_DIR}/test/CTestCustom.cmake ${CMAKE_BINARY_DIR}) 21 | -------------------------------------------------------------------------------- /include/RAJA/policy/openmp_target/kernel.hpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | #ifndef RAJA_policy_openmp_target_kernel_HPP 9 | #define RAJA_policy_openmp_target_kernel_HPP 10 | 11 | #include "RAJA/policy/openmp_target/kernel/Collapse.hpp" 12 | #include "RAJA/policy/openmp_target/kernel/For.hpp" 13 | 14 | #endif // closing endif for header file include guard 15 | -------------------------------------------------------------------------------- /test/include/RAJA_test-kernel-tile-size.hpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | // 9 | // Defines tile sizes for kernel tests. 10 | // 11 | 12 | #ifndef __RAJA_test_kernel_tile_size_HPP__ 13 | #define __RAJA_test_kernel_tile_size_HPP__ 14 | 15 | constexpr int tile_dim_x = 16; 16 | constexpr int tile_dim_y = 16; 17 | 18 | #endif // __RAJA_test_kernel_tile_size_HPP__ 19 | -------------------------------------------------------------------------------- /scripts/ubuntu-builds/ubuntu_hipcc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 5 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 6 | # 7 | # SPDX-License-Identifier: (BSD-3-Clause) 8 | ############################################################################### 9 | 10 | BUILD_SUFFIX=ubuntu-hipcc 11 | 12 | rm -rf build_${BUILD_SUFFIX} >/dev/null 13 | mkdir build_${BUILD_SUFFIX} && cd build_${BUILD_SUFFIX} 14 | 15 | cmake \ 16 | -DCMAKE_BUILD_TYPE=Debug \ 17 | -DBLT_CXX_STD=c++17 \ 18 | -C ../host-configs/ubuntu-builds/hip.cmake \ 19 | .. 20 | -------------------------------------------------------------------------------- /examples/plugin/test-plugin.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | #include "RAJA/RAJA.hpp" 9 | 10 | int main(int RAJA_UNUSED_ARG(argc), char** RAJA_UNUSED_ARG(argv[])) 11 | { 12 | double* a = new double[10]; 13 | 14 | for (int ii = 0; ii < 10; ii++) 15 | { 16 | RAJA::forall(RAJA::RangeSegment(0, 10), [=](int i) { 17 | a[i] = 0; 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/CTestCustom.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # You may add here the list of tests to be ignored. 9 | # By default, we populate that list with the content of the corresponding 10 | # variable. This variable is usually defined in a hostconfig file generated 11 | # for a specific machine, e.g. by Spack. 12 | 13 | set(CTEST_CUSTOM_TESTS_IGNORE 14 | ${CTEST_CUSTOM_TESTS_IGNORE} 15 | ) 16 | 17 | -------------------------------------------------------------------------------- /test/unit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | add_subdirectory(index) 9 | add_subdirectory(internal) 10 | add_subdirectory(util) 11 | add_subdirectory(reducer) 12 | add_subdirectory(multi_reducer) 13 | add_subdirectory(resource) 14 | add_subdirectory(atomic) 15 | add_subdirectory(view-layout) 16 | add_subdirectory(algorithm) 17 | add_subdirectory(workgroup) 18 | add_subdirectory(indexing) 19 | -------------------------------------------------------------------------------- /travis-data/docker/gcc8/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rajaorg/compiler:bionic-base 2 | 3 | LABEL maintainer="Tom Scogland " 4 | ENV gccver=8 5 | 6 | RUN sudo apt-get -qq update \ 7 | && sudo apt-get -qq install -y --no-install-recommends \ 8 | g++-${gccver} gcc-8-offload-nvptx \ 9 | && sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${gccver} 100 \ 10 | && sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${gccver} 100 \ 11 | && sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-${gccver} 100 \ 12 | && sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-${gccver} 100 \ 13 | && sudo rm -rf /var/lib/apt/lists/* 14 | 15 | USER raja 16 | WORKDIR /home/raja 17 | -------------------------------------------------------------------------------- /test/integration/test_plugin_kokkos.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | #include "RAJA/RAJA.hpp" 9 | #include "gtest/gtest.h" 10 | 11 | TEST(PluginTestKokkos, Exception) 12 | { 13 | int* a = new int[10]; 14 | 15 | ASSERT_ANY_THROW({ 16 | RAJA::forall(RAJA::RangeSegment(0, 10), 17 | [=](int i) { a[i] = 0; }); 18 | }); 19 | 20 | delete[] a; 21 | } 22 | -------------------------------------------------------------------------------- /scripts/setup-hooks.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 5 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 6 | # 7 | # SPDX-License-Identifier: (BSD-3-Clause) 8 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 9 | 10 | #------------------------------------------------------------------------------ 11 | # This script installs client-side hooks 12 | #------------------------------------------------------------------------------ 13 | basedir=`git rev-parse --show-toplevel` 14 | hooksdir="$basedir/.git/hooks/" 15 | cp -v $basedir/scripts/githooks/pre-commit $hooksdir 16 | -------------------------------------------------------------------------------- /travis-data/docker/build-all.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | if (( $# == 0 )) ; then 4 | dockerfiles=(**/Dockerfile) 5 | else 6 | dockerfiles=($@) 7 | fi 8 | 9 | all_images="${compiler_images} ubuntu-clang-base" 10 | 11 | function build-tag () { 12 | echo building $2 and tagging with $1 13 | docker build --tag $1 $2 14 | } 15 | 16 | build-tag rajaorg/compiler:ubuntu-clang-base ubuntu-clang-base 17 | 18 | for df in ${dockerfiles} ; do 19 | imgname=${df:h} 20 | imgpath=rajaorg/compiler:$imgname 21 | [[ ${imgname} == 'ubuntu-clang-base' ]] && continue 22 | build-tag $imgpath $imgname 23 | 24 | echo pushing $imgpath 25 | docker push $imgpath 26 | done 27 | 28 | for img in $all_images ; do 29 | # docker push rajaorg/compiler:$img 30 | done 31 | -------------------------------------------------------------------------------- /test/install/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | configure_file( 9 | using-with-cmake/host-config.cmake.in 10 | ${PROJECT_BINARY_DIR}/examples/using-with-cmake/host-config.cmake) 11 | 12 | install( FILES 13 | using-with-cmake/CMakeLists.txt 14 | using-with-cmake/using-with-cmake.cpp 15 | ${PROJECT_BINARY_DIR}/examples/using-with-cmake/host-config.cmake 16 | DESTINATION examples/RAJA/using-with-cmake) 17 | -------------------------------------------------------------------------------- /test/functional/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | add_subdirectory(forall) 9 | 10 | add_subdirectory(dynamic_forall) 11 | 12 | add_subdirectory(indexset-build) 13 | 14 | add_subdirectory(kernel) 15 | 16 | add_subdirectory(scan) 17 | 18 | add_subdirectory(workgroup) 19 | 20 | add_subdirectory(launch) 21 | 22 | if (RAJA_ENABLE_VECTORIZATION) 23 | add_subdirectory(tensor) 24 | endif() 25 | 26 | add_subdirectory(util) 27 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | #Builds and installs RAJA using the gcc8 compiler 10 | # 11 | 12 | FROM rajaorg/compiler:gcc8 13 | MAINTAINER RAJA Development Team 14 | 15 | COPY --chown=raja:raja . /home/raja/workspace 16 | 17 | WORKDIR /home/raja/workspace 18 | 19 | RUN mkdir build && cd build && cmake -DENABLE_CUDA=OFF .. 20 | 21 | RUN cd build && sudo make -j 3 && sudo make install 22 | 23 | CMD ["bash"] 24 | -------------------------------------------------------------------------------- /docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | if (RAJA_ENABLE_DOCUMENTATION) 9 | if (SPHINX_FOUND) 10 | blt_add_sphinx_target( raja_docs ) 11 | endif() 12 | 13 | if (DOXYGEN_FOUND) 14 | add_subdirectory(doxygen) 15 | endif() 16 | 17 | if ( NOT SPHINX_FOUND AND NOT DOXGEN_FOUND) 18 | message(WARNING "RAJA_ENABLE_DOCUMENTATION=On, but Sphinx or Doxygen not found. \ 19 | Documentation won't be built.") 20 | endif () 21 | endif() 22 | -------------------------------------------------------------------------------- /host-configs/lc-builds/toss4/icpc_X.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_ICC" CACHE STRING "") 9 | 10 | set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -ansi-alias -diag-disable cpu-dispatch" CACHE STRING "") 11 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -march=native -ansi-alias -diag-disable cpu-dispatch" CACHE STRING "") 12 | set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "") 13 | 14 | set(RAJA_HOST_CONFIG_LOADED On CACHE BOOL "") 15 | -------------------------------------------------------------------------------- /test/integration/test_plugin_dynamic.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | #include "RAJA/RAJA.hpp" 8 | #include "gtest/gtest.h" 9 | 10 | TEST(PluginTestDynamic, Exception) 11 | { 12 | RAJA::util::init_plugins("../../lib/libdynamic_plugin.so"); 13 | int* a = new int[10]; 14 | 15 | ASSERT_ANY_THROW({ 16 | RAJA::forall(RAJA::RangeSegment(0, 10), 17 | [=](int i) { a[i] = 0; }); 18 | }); 19 | 20 | delete[] a; 21 | } 22 | -------------------------------------------------------------------------------- /examples/plugin/test-plugin-dynamic.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | #include "RAJA/RAJA.hpp" 9 | #include 10 | 11 | int main(int RAJA_UNUSED_ARG(argc), char **RAJA_UNUSED_ARG(argv[])) 12 | { 13 | RAJA::util::init_plugins("../lib/libtimer_plugin.so"); 14 | 15 | double *a = new double[10]; 16 | for (int i = 0; i < 4; i++) 17 | { 18 | RAJA::forall(RAJA::RangeSegment(0, 10), [=](int i) { 19 | a[i] = 0; 20 | }); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /scripts/install_llvm.sh: -------------------------------------------------------------------------------- 1 | export LLVM_PATH=${HOME}/llvm/ 2 | export PATH=${LLVM_PATH}/bin:${PATH} 3 | export LD_LIBRARY_PATH=${LLVM_PATH}/lib:${LD_LIBRARY_PATH} 4 | [[ -z ${DOWNLOAD_URL+x} ]] && export DOWNLOAD_URL=http://releases.llvm.org/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-14.04.tar.xz 5 | export TARFILE=${HOME}/download/llvm-${LLVM_VERSION}.tar.xz 6 | if ! [[ -x "${LLVM_PATH}/bin/clang++" ]]; then 7 | if ! [[ -f ${TARFILE} ]]; then 8 | echo "curl -o ${TARFILE} ${DOWNLOAD_URL}" 9 | curl -o ${TARFILE} ${DOWNLOAD_URL} 10 | fi 11 | tar xf ${TARFILE} -C ${HOME}/llvm --strip-components 1 12 | ln -s ${LLVM_PATH}/bin/clang++ ${LLVM_PATH}/bin/clang++-${LLVM_VERSION} 13 | ln -s ${LLVM_PATH}/bin/clang ${LLVM_PATH}/bin/clang-${LLVM_VERSION} 14 | fi 15 | 16 | -------------------------------------------------------------------------------- /test/integration/test_plugin_old_dynamic.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | #include "RAJA/RAJA.hpp" 8 | #include "gtest/gtest.h" 9 | 10 | TEST(PluginTestDynamic, Exception) 11 | { 12 | RAJA::util::init_plugins("../../lib/libdynamic_plugin_old.so"); 13 | int* a = new int[10]; 14 | 15 | ASSERT_ANY_THROW({ 16 | RAJA::forall(RAJA::RangeSegment(0, 10), 17 | [=](int i) { a[i] = 0; }); 18 | }); 19 | 20 | delete[] a; 21 | } 22 | -------------------------------------------------------------------------------- /cmake/thirdparty/FindCUB.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and other RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | include (FindPackageHandleStandardArgs) 9 | 10 | find_path(CUB_INCLUDE_DIRS 11 | NAMES cub/cub.cuh 12 | HINTS 13 | ${CUB_DIR}/ 14 | ${CUB_DIR}/include 15 | ${CUDA_TOOLKIT_ROOT_DIR}/include) 16 | 17 | find_package_handle_standard_args( 18 | CUB 19 | DEFAULT_MSG 20 | CUB_INCLUDE_DIRS) 21 | 22 | if (CUB_INCLUDE_DIRS) 23 | set(CUB_FOUND True) 24 | else () 25 | set(CUB_FOUND False) 26 | endif() 27 | -------------------------------------------------------------------------------- /cmake/thirdparty/FindSphinx.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and other RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | find_program(SPHINX_EXECUTABLE 9 | NAMES sphinx-build sphinx-build2 10 | DOC "Path to sphinx-build executable") 11 | 12 | # Handle REQUIRED and QUIET arguments 13 | # this will also set SPHINX_FOUND to true if SPHINX_EXECUTABLE exists 14 | include(FindPackageHandleStandardArgs) 15 | find_package_handle_standard_args(Sphinx 16 | "Failed to locate sphinx-build executable" 17 | SPHINX_EXECUTABLE) 18 | -------------------------------------------------------------------------------- /test/functional/dynamic_forall/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | list(APPEND DYNAMIC_BACKENDS Sequential) 9 | 10 | if(RAJA_ENABLE_OPENMP) 11 | list(APPEND DYNAMIC_BACKENDS OpenMP) 12 | endif() 13 | 14 | if(RAJA_ENABLE_CUDA) 15 | list(APPEND DYNAMIC_BACKENDS Cuda) 16 | endif() 17 | 18 | if(RAJA_ENABLE_HIP) 19 | list(APPEND DYNAMIC_BACKENDS Hip) 20 | endif() 21 | 22 | add_subdirectory(segment) 23 | 24 | add_subdirectory(resource-segment) 25 | 26 | unset( DYNAMIC_BACKENDS ) 27 | -------------------------------------------------------------------------------- /test/integration/plugin_for_test_dynamic.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | #include "RAJA/util/PluginStrategy.hpp" 8 | 9 | #include 10 | 11 | class ExceptionPlugin : 12 | public RAJA::util::PluginStrategy 13 | { 14 | public: 15 | void preLaunch(const RAJA::util::PluginContext& RAJA_UNUSED_ARG(p)) override { 16 | throw std::runtime_error("preLaunch"); 17 | } 18 | }; 19 | 20 | extern "C" RAJA::util::PluginStrategy *RAJAGetPlugin() 21 | { 22 | return new ExceptionPlugin; 23 | } 24 | -------------------------------------------------------------------------------- /test/integration/plugin_old_for_test_dynamic.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | #include "RAJA/util/PluginStrategy.hpp" 8 | 9 | #include 10 | 11 | class ExceptionPlugin : 12 | public RAJA::util::PluginStrategy 13 | { 14 | public: 15 | void preLaunch(const RAJA::util::PluginContext& RAJA_UNUSED_ARG(p)) override { 16 | throw std::runtime_error("preLaunch"); 17 | } 18 | }; 19 | 20 | extern "C" RAJA::util::PluginStrategy *getPlugin() 21 | { 22 | return new ExceptionPlugin; 23 | } 24 | -------------------------------------------------------------------------------- /host-configs/lc-builds/toss4/cce_omptarget_X.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_CLANG" CACHE STRING "") 9 | 10 | set(CMAKE_CXX_FLAGS_RELEASE "-O3 -haccel=amd_${HIP_ARCH}" CACHE STRING "") 11 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -haccel=amd_${HIP_ARCH}" CACHE STRING "") 12 | set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -haccel=amd_${HIP_ARCH}" CACHE STRING "") 13 | 14 | # hcpu flag needs more experimentation, can cause runtime vectorization failures. 15 | # -hcpu=x86-genoa 16 | -------------------------------------------------------------------------------- /benchmark/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | if (RAJA_ENABLE_CUDA) 9 | raja_add_benchmark( 10 | NAME benchmark-host-device-lambda 11 | SOURCES host-device-lambda-benchmark.cpp) 12 | endif() 13 | 14 | if (RAJA_ENABLE_DESUL) 15 | raja_add_benchmark( 16 | NAME benchmark-atomic 17 | SOURCES benchmark-atomic.cpp) 18 | endif() 19 | 20 | raja_add_benchmark( 21 | NAME ltimes 22 | SOURCES ltimes.cpp) 23 | 24 | raja_add_benchmark( 25 | NAME raja_view_blur 26 | SOURCES raja_view_blur.cpp) 27 | -------------------------------------------------------------------------------- /scripts/macos-builds/apple_clang10.0.0.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 5 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 6 | # 7 | # SPDX-License-Identifier: (BSD-3-Clause) 8 | ############################################################################### 9 | 10 | BUILD_SUFFIX=macos_apple-clang 11 | 12 | rm -rf build_${BUILD_SUFFIX} 2>/dev/null 13 | mkdir build_${BUILD_SUFFIX} && cd build_${BUILD_SUFFIX} 14 | 15 | cmake \ 16 | -DCMAKE_BUILD_TYPE=Release \ 17 | -DCMAKE_CXX_COMPILER=/usr/bin/clang++ \ 18 | -C ../host-configs/macos-builds/clang_X.cmake \ 19 | -DENABLE_OPENMP=Off \ 20 | -DCMAKE_INSTALL_PREFIX=../install_${BUILD_SUFFIX} \ 21 | "$@" \ 22 | .. 23 | -------------------------------------------------------------------------------- /test/unit/index/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | raja_add_test( 9 | NAME test-indexset 10 | SOURCES test-indexset.cpp) 11 | 12 | raja_add_test( 13 | NAME test-indexvalue 14 | SOURCES test-indexvalue.cpp) 15 | 16 | raja_add_test( 17 | NAME test-listsegment 18 | SOURCES test-listsegment.cpp) 19 | 20 | raja_add_test( 21 | NAME test-rangesegment 22 | SOURCES test-rangesegment.cpp) 23 | 24 | raja_add_test( 25 | NAME test-rangestridesegment 26 | SOURCES test-rangestridesegment.cpp) 27 | -------------------------------------------------------------------------------- /docs/sphinx/dev_guide/index.rst: -------------------------------------------------------------------------------- 1 | .. ## 2 | .. ## Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | .. ## and RAJA project contributors. See the RAJA/LICENSE file 4 | .. ## for details. 5 | .. ## 6 | .. ## SPDX-License-Identifier: (BSD-3-Clause) 7 | .. ## 8 | 9 | .. developer_guide: 10 | 11 | #################### 12 | RAJA Developer Guide 13 | #################### 14 | 15 | The RAJA Developer Guide documents software development processes 16 | followed by the RAJA project. The main goal of the guide is to ensure 17 | all project contributors understand the key elements of the processes so 18 | that they are consistently applied. 19 | 20 | .. toctree:: 21 | :maxdepth: 1 22 | 23 | contributing 24 | branch_development 25 | build_configurations 26 | ci 27 | ci_tasks 28 | tests 29 | release_process 30 | versioning 31 | -------------------------------------------------------------------------------- /test/old-tests/unit/cpu/test-synchronize.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | #include "RAJA/RAJA.hpp" 9 | #include "gtest/gtest.h" 10 | 11 | #if defined(RAJA_ENABLE_OPENMP) 12 | 13 | TEST(SynchronizeTest, omp) 14 | { 15 | 16 | double test_val = 0.0; 17 | 18 | #pragma omp parallel shared(test_val) 19 | { 20 | if (omp_get_thread_num() == 0) { 21 | test_val = 5.0; 22 | } 23 | 24 | RAJA::synchronize(); 25 | 26 | EXPECT_EQ(test_val, 5.0); 27 | } 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /docs/sphinx/raja_license.rst: -------------------------------------------------------------------------------- 1 | .. ## 2 | .. ## Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | .. ## and RAJA project contributors. See the RAJA/LICENSE file 4 | .. ## for details. 5 | .. ## 6 | .. ## SPDX-License-Identifier: (BSD-3-Clause) 7 | .. ## 8 | 9 | .. _raja-copyright: 10 | 11 | ====================================== 12 | RAJA Copyright and License Information 13 | ====================================== 14 | 15 | Copyright (c) 2016-25, Lawrence Livermore National Security, LLC. 16 | 17 | Produced at the Lawrence Livermore National Laboratory. 18 | 19 | All rights reserved. See additional details below. 20 | 21 | Unlimited Open Source - BSD Distribution 22 | 23 | LLNL-CODE-689114 24 | 25 | OCEC-16-063 26 | 27 | 28 | RAJA License 29 | ------------ 30 | 31 | .. include:: ../../LICENSE 32 | 33 | .. include:: ../../NOTICE 34 | 35 | -------------------------------------------------------------------------------- /host-configs/lc-builds/toss4/gcc_X.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_GNU" CACHE STRING "") 9 | 10 | set(COMMON_OPT_FLAGS "-Ofast -march=native") 11 | ##set(COMMON_OPT_FLAGS "-Ofast -march=native -finline-functions -finline-limit=20000") 12 | 13 | set(CMAKE_CXX_FLAGS_RELEASE "${COMMON_OPT_FLAGS}" CACHE STRING "") 14 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${COMMON_OPT_FLAGS} -g" CACHE STRING "") 15 | set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "") 16 | 17 | set(RAJA_HOST_CONFIG_LOADED On CACHE BOOL "") 18 | -------------------------------------------------------------------------------- /reproducers/openmp-target/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | raja_add_reproducer( 9 | NAME reproducer-openmptarget 10 | SOURCES reproducer-openmptarget.cpp) 11 | 12 | raja_add_reproducer( 13 | NAME reproducer-openmptarget-issue1 14 | SOURCES reproducer-openmptarget-issue1.cpp) 15 | 16 | raja_add_reproducer( 17 | NAME reproducer-openmptarget-issue2 18 | SOURCES reproducer-openmptarget-issue2.cpp) 19 | 20 | raja_add_reproducer( 21 | NAME reproducer-openmptarget-issue3 22 | SOURCES reproducer-openmptarget-issue3.cpp) 23 | 24 | -------------------------------------------------------------------------------- /include/RAJA/util/PluginOptions.hpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | #ifndef RAJA_Plugin_Options_HPP 9 | #define RAJA_Plugin_Options_HPP 10 | 11 | #include 12 | 13 | namespace RAJA 14 | { 15 | namespace util 16 | { 17 | 18 | struct PluginOptions 19 | { 20 | PluginOptions(const std::string& newstr) : str(newstr) {}; 21 | 22 | std::string str; 23 | }; 24 | 25 | inline PluginOptions make_options(const std::string& newstr) 26 | { 27 | return PluginOptions {newstr}; 28 | } 29 | 30 | } // namespace util 31 | } // namespace RAJA 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /test/include/RAJA_test-base.hpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | // 9 | // Fundamental includes and structs used throughout RAJA tests. 10 | // 11 | 12 | #ifndef __RAJA_test_base_HPP__ 13 | #define __RAJA_test_base_HPP__ 14 | 15 | #include "RAJA/RAJA.hpp" 16 | 17 | #include "RAJA_gtest.hpp" 18 | 19 | // 20 | // Unroll types for gtest testing::Types 21 | // 22 | template 23 | struct Test; 24 | 25 | template 26 | struct Test> { 27 | using Types = ::testing::Types; 28 | }; 29 | 30 | 31 | #endif // __RAJA_test_base_HPP__ 32 | -------------------------------------------------------------------------------- /docs/sphinx/user_guide/cook_book.rst: -------------------------------------------------------------------------------- 1 | .. ## 2 | .. ## Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | .. ## and RAJA project contributors. See the RAJA/LICENSE file 4 | .. ## for details. 5 | .. ## 6 | .. ## SPDX-License-Identifier: (BSD-3-Clause) 7 | .. ## 8 | 9 | .. _cook-book-label: 10 | 11 | ************************ 12 | RAJA Cook Book 13 | ************************ 14 | 15 | The following sections show common use case patterns and the recommended 16 | RAJA features and policies to use with them. They are intended 17 | to provide users with complete beyond usage examples beyond what can be found in other parts of the RAJA User Guide. In particular, the examples and discussion provide guidance on RAJA execution policy selection to improve performance of user application codes. 18 | 19 | .. toctree:: 20 | :maxdepth: 2 21 | 22 | cook_book/reduction 23 | cook_book/multi-reduction 24 | 25 | -------------------------------------------------------------------------------- /host-configs/ubuntu-builds/gcc_X.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_GNU" CACHE STRING "") 9 | 10 | set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -finline-functions -finline-limit=20000" CACHE STRING "") 11 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Ofast -g -finline-functions -finline-limit=20000" CACHE STRING "") 12 | set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "") 13 | 14 | set(RAJA_RANGE_ALIGN 4 CACHE STRING "") 15 | set(RAJA_RANGE_MIN_LENGTH 32 CACHE STRING "") 16 | set(RAJA_DATA_ALIGN 64 CACHE STRING "") 17 | 18 | set(RAJA_HOST_CONFIG_LOADED On CACHE BOOL "") 19 | -------------------------------------------------------------------------------- /host-configs/ubuntu-builds/clang_X.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_CLANG" CACHE STRING "") 9 | 10 | set(CMAKE_CXX_FLAGS_RELEASE "-O3 -msse4.2 -funroll-loops -finline-functions" CACHE STRING "") 11 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -msse4.2 -funroll-loops -finline-functions" CACHE STRING "") 12 | set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "") 13 | 14 | set(RAJA_RANGE_ALIGN 4 CACHE STRING "") 15 | set(RAJA_RANGE_MIN_LENGTH 32 CACHE STRING "") 16 | set(RAJA_DATA_ALIGN 64 CACHE STRING "") 17 | 18 | set(RAJA_HOST_CONFIG_LOADED On CACHE BOOL "") 19 | -------------------------------------------------------------------------------- /test/install/using-with-cmake/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | cmake_minimum_required(VERSION 3.23) 9 | 10 | project(using_with_cmake) 11 | 12 | if(NOT DEFINED RAJA_DIR OR NOT EXISTS ${RAJA_DIR}/lib/cmake/raja/raja-config.cmake) 13 | message(FATAL_ERROR "Missing required 'RAJA_DIR' variable pointing to an installed RAJA") 14 | endif() 15 | 16 | find_package(RAJA REQUIRED 17 | NO_DEFAULT_PATH 18 | PATHS ${RAJA_DIR}/lib/cmake/raja) 19 | 20 | add_executable(using-with-cmake using-with-cmake.cpp) 21 | target_link_libraries(using-with-cmake RAJA) 22 | 23 | -------------------------------------------------------------------------------- /test/unit/util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | raja_add_test( 9 | NAME test-float-limits 10 | SOURCES test-float-limits.cpp) 11 | 12 | raja_add_test( 13 | NAME test-integral-limits 14 | SOURCES test-integral-limits.cpp) 15 | 16 | raja_add_test( 17 | NAME test-timer 18 | SOURCES test-timer.cpp) 19 | 20 | raja_add_test( 21 | NAME test-span 22 | SOURCES test-span.cpp) 23 | 24 | raja_add_test( 25 | NAME test-fraction 26 | SOURCES test-fraction.cpp) 27 | 28 | raja_add_test( 29 | NAME test-math 30 | SOURCES test-math.cpp) 31 | 32 | add_subdirectory(operator) 33 | -------------------------------------------------------------------------------- /test/unit/util/operator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | raja_add_test( 9 | NAME test-operators-math 10 | SOURCES test-operators-math.cpp) 11 | 12 | raja_add_test( 13 | NAME test-operators-logical 14 | SOURCES test-operators-logical.cpp) 15 | 16 | raja_add_test( 17 | NAME test-operators-equivalence 18 | SOURCES test-operators-equivalence.cpp) 19 | 20 | raja_add_test( 21 | NAME test-operators-bitwise-modulus 22 | SOURCES test-operators-bitwise-modulus.cpp) 23 | 24 | raja_add_test( 25 | NAME test-operators-identity 26 | SOURCES test-operators-identity.cpp) 27 | 28 | -------------------------------------------------------------------------------- /test/unit/view-layout/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | raja_add_test( 9 | NAME test-standard-layout 10 | SOURCES test-standard-layout.cpp) 11 | 12 | raja_add_test( 13 | NAME test-typedlayout 14 | SOURCES test-typedlayout.cpp) 15 | 16 | raja_add_test( 17 | NAME test-typedview 18 | SOURCES test-typedview.cpp) 19 | 20 | raja_add_test( 21 | NAME test-makelayout 22 | SOURCES test-makelayout.cpp) 23 | 24 | raja_add_test( 25 | NAME test-multiview 26 | SOURCES test-multiview.cpp) 27 | 28 | raja_add_test( 29 | NAME test-indexlayout 30 | SOURCES test-indexlayout.cpp) 31 | -------------------------------------------------------------------------------- /host-configs/lc-builds/toss4/icpc-classic_X.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_ICC" CACHE STRING "") 9 | 10 | set(COMMON_FLAGS "-gxx-name=/usr/tce/packages/gcc/gcc-10.3.1/bin/g++") 11 | 12 | set(CMAKE_CXX_FLAGS_RELEASE "${COMMON_FLAGS} -O3 -march=native -ansi-alias -diag-disable cpu-dispatch" CACHE STRING "") 13 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${COMMON_FLAGS} -O3 -g -march=native -ansi-alias -diag-disable cpu-dispatch" CACHE STRING "") 14 | set(CMAKE_CXX_FLAGS_DEBUG "${COMMON_FLAGS} -O0 -g" CACHE STRING "") 15 | 16 | set(RAJA_HOST_CONFIG_LOADED On CACHE BOOL "") 17 | -------------------------------------------------------------------------------- /host-configs/macos-builds/clang_X.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_CLANG" CACHE STRING "") 9 | 10 | set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -funroll-loops -finline-functions" CACHE STRING "") 11 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -march=native -funroll-loops -finline-functions" CACHE STRING "") 12 | set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "") 13 | 14 | set(RAJA_RANGE_ALIGN 4 CACHE STRING "") 15 | set(RAJA_RANGE_MIN_LENGTH 32 CACHE STRING "") 16 | set(RAJA_DATA_ALIGN 64 CACHE STRING "") 17 | 18 | set(RAJA_HOST_CONFIG_LOADED On CACHE BOOL "") 19 | -------------------------------------------------------------------------------- /host-configs/lc-builds/toss4/clang_X.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_CLANG" CACHE STRING "") 9 | 10 | set(CMAKE_CXX_FLAGS_RELEASE "--gcc-toolchain=/usr/tce/packages/gcc/gcc-10.3.1 -O3 -march=native -funroll-loops -finline-functions" CACHE STRING "") 11 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "--gcc-toolchain=/usr/tce/packages/gcc/gcc-10.3.1 -O3 -g -march=native -funroll-loops -finline-functions" CACHE STRING "") 12 | set(CMAKE_CXX_FLAGS_DEBUG "--gcc-toolchain=/usr/tce/packages/gcc/gcc-10.3.1 -O0 -g" CACHE STRING "") 13 | 14 | set(RAJA_HOST_CONFIG_LOADED On CACHE BOOL "") 15 | -------------------------------------------------------------------------------- /include/RAJA/policy/desul.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file containing RAJA headers for NVCC CUDA execution. 7 | * 8 | * These methods work only on platforms that support CUDA. 9 | * 10 | ****************************************************************************** 11 | */ 12 | 13 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 14 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 15 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 16 | // 17 | // SPDX-License-Identifier: (BSD-3-Clause) 18 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 19 | 20 | #ifndef RAJA_desul_HPP 21 | #define RAJA_desul_HPP 22 | 23 | #include "RAJA/policy/desul/atomic.hpp" 24 | 25 | #endif // closing endif for header file include guard 26 | -------------------------------------------------------------------------------- /include/RAJA/policy/tensor/arch/scalar.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file containing RAJA simd policy definitions. 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | 19 | #ifndef RAJA_policy_tensor_arch_scalar_HPP 20 | #define RAJA_policy_tensor_arch_scalar_HPP 21 | 22 | 23 | #include 24 | #include 25 | 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /include/RAJA/policy/hip/WorkGroup.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file containing RAJA Dispatcher and WorkRunner constructs. 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | #ifndef RAJA_hip_WorkGroup_HPP 19 | #define RAJA_hip_WorkGroup_HPP 20 | 21 | #include "RAJA/policy/hip/WorkGroup/Dispatcher.hpp" 22 | #include "RAJA/policy/hip/WorkGroup/WorkRunner.hpp" 23 | 24 | #endif // closing endif for header file include guard 25 | -------------------------------------------------------------------------------- /include/RAJA/policy/cuda/WorkGroup.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file containing RAJA Dispatcher and WorkRunner constructs. 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | #ifndef RAJA_cuda_WorkGroup_HPP 19 | #define RAJA_cuda_WorkGroup_HPP 20 | 21 | #include "RAJA/policy/cuda/WorkGroup/Dispatcher.hpp" 22 | #include "RAJA/policy/cuda/WorkGroup/WorkRunner.hpp" 23 | 24 | #endif // closing endif for header file include guard 25 | -------------------------------------------------------------------------------- /include/RAJA/policy/openmp/kernel.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief RAJA header file for OpenMP collapse constructs. 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | 19 | #ifndef RAJA_policy_openmp_kernel_HPP 20 | #define RAJA_policy_openmp_kernel_HPP 21 | 22 | #include "RAJA/policy/openmp/kernel/Collapse.hpp" 23 | #include "RAJA/policy/openmp/kernel/OmpSyncThreads.hpp" 24 | 25 | #endif // closing endif for header file include guard 26 | -------------------------------------------------------------------------------- /include/RAJA/policy/openmp/WorkGroup.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file containing RAJA Dispatcher and WorkRunner constructs. 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | #ifndef RAJA_openmp_WorkGroup_HPP 19 | #define RAJA_openmp_WorkGroup_HPP 20 | 21 | #include "RAJA/policy/openmp/WorkGroup/Dispatcher.hpp" 22 | #include "RAJA/policy/openmp/WorkGroup/WorkRunner.hpp" 23 | 24 | #endif // closing endif for header file include guard 25 | -------------------------------------------------------------------------------- /test/include/RAJA_test-abs.hpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | #ifndef __RAJA_test_abs_HPP__ 9 | #define __RAJA_test_abs_HPP__ 10 | 11 | #include "RAJA/RAJA.hpp" 12 | #include "camp/camp.hpp" 13 | 14 | #include 15 | 16 | namespace RAJA { 17 | 18 | template 19 | camp::concepts::enable_if_t > 20 | test_abs(T&& val) { 21 | return std::fabs(val); 22 | } 23 | 24 | template 25 | camp::concepts::enable_if_t > 26 | test_abs(T&& val) { 27 | return std::abs(val); 28 | } 29 | 30 | } // namespace RAJA 31 | 32 | #endif // __RAJA_test_abs_HPP__ 33 | -------------------------------------------------------------------------------- /travis-data/docker/nvcc10/generic-setup-18.04.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -x 4 | 5 | 6 | apt-get -qq update 7 | apt-get -qq install -y --no-install-recommends wget 8 | wget "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x60C317803A41BA51845E371A1E9377A2BA9EF27F" -O out && apt-key add out && rm out 9 | echo deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic main >> /etc/apt/sources.list 10 | echo deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic main >> /etc/apt/sources.list 11 | apt-get -qq update 12 | apt-get -qq install -y --no-install-recommends cmake python-dev build-essential sudo git vim dh-autoreconf ninja-build ca-certificates libtbb-dev 13 | 14 | wget -q --no-check-certificate https://bootstrap.pypa.io/get-pip.py 15 | python get-pip.py 16 | rm get-pip.py 17 | pip install -q -U pip 18 | useradd -ms /bin/bash raja 19 | printf "raja:raja" | chpasswd 20 | adduser raja sudo 21 | printf "raja ALL= NOPASSWD: ALL\\n" >> /etc/sudoers 22 | -------------------------------------------------------------------------------- /test/install/using-with-cmake/using-with-cmake.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | #include "RAJA/RAJA.hpp" 8 | 9 | 10 | int main(int RAJA_UNUSED_ARG(argc), char** RAJA_UNUSED_ARG(argv)) 11 | { 12 | constexpr std::size_t N{1024}; 13 | 14 | double* a = new double[N]; 15 | double* b = new double[N]; 16 | double c = 3.14159; 17 | 18 | for (std::size_t i = 0; i < N; i++) { 19 | a[i] = 1.0; 20 | b[i] = 2.0; 21 | } 22 | 23 | RAJA::forall( 24 | RAJA::RangeSegment(0, N), 25 | [=] RAJA_HOST_DEVICE (std::size_t i) { 26 | a[i] += b[i] * c; 27 | } 28 | ); 29 | 30 | delete[] a; 31 | delete[] b; 32 | } 33 | -------------------------------------------------------------------------------- /include/RAJA/policy/sequential/kernel.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief RAJA header file for sequential collapse and reduce constructs. 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | 19 | #ifndef RAJA_policy_sequential_kernel_HPP 20 | #define RAJA_policy_sequential_kernel_HPP 21 | 22 | #include "RAJA/policy/sequential/kernel/Collapse.hpp" 23 | #include "RAJA/policy/sequential/kernel/Reduce.hpp" 24 | 25 | #endif // closing endif for header file include guard 26 | -------------------------------------------------------------------------------- /include/RAJA/policy/tensor.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file containing RAJA headers for SIMD segment execution. 7 | * 8 | * These methods work on all platforms. 9 | * 10 | ****************************************************************************** 11 | */ 12 | 13 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 14 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 15 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 16 | // 17 | // SPDX-License-Identifier: (BSD-3-Clause) 18 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 19 | 20 | #ifndef RAJA_policy_tensor_HPP 21 | #define RAJA_policy_tensor_HPP 22 | 23 | #include "RAJA/policy/tensor/arch_impl.hpp" 24 | #include "RAJA/policy/tensor/policy.hpp" 25 | 26 | #endif // closing endif for header file include guard 27 | -------------------------------------------------------------------------------- /include/RAJA/policy/sequential/WorkGroup.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file containing RAJA Dispatcher and WorkRunner constructs. 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | #ifndef RAJA_sequential_WorkGroup_HPP 19 | #define RAJA_sequential_WorkGroup_HPP 20 | 21 | #include "RAJA/policy/sequential/WorkGroup/Dispatcher.hpp" 22 | #include "RAJA/policy/sequential/WorkGroup/WorkRunner.hpp" 23 | 24 | #endif // closing endif for header file include guard 25 | -------------------------------------------------------------------------------- /include/RAJA/policy/tensor/arch/hip.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file containing RAJA simd policy definitions. 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | #ifdef RAJA_ENABLE_HIP 19 | 20 | 21 | #ifndef RAJA_policy_tensor_arch_hip_HPP 22 | #define RAJA_policy_tensor_arch_hip_HPP 23 | 24 | #include 25 | #include 26 | 27 | 28 | #endif 29 | 30 | 31 | #endif // RAJA_ENABLE_CUDA 32 | -------------------------------------------------------------------------------- /scripts/ubuntu-builds/ubuntu_nvcc10_gcc8.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 5 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 6 | # 7 | # SPDX-License-Identifier: (BSD-3-Clause) 8 | ############################################################################### 9 | 10 | BUILD_SUFFIX=ubuntu-nvcc10-gcc8 11 | 12 | rm -rf build_${BUILD_SUFFIX} >/dev/null 13 | mkdir build_${BUILD_SUFFIX} && cd build_${BUILD_SUFFIX} 14 | 15 | cmake \ 16 | -DCMAKE_BUILD_TYPE=Release \ 17 | -DCMAKE_C_COMPILER=/usr/bin/gcc-8 \ 18 | -DCMAKE_CXX_COMPILER=/usr/bin/g++-8 \ 19 | -DBLT_CXX_STD=c++17 \ 20 | -C ../host-configs/ubuntu-builds/nvcc_gcc_X.cmake \ 21 | -DENABLE_OPENMP=On \ 22 | -DENABLE_CUDA=On \ 23 | -DCMAKE_CUDA_COMPILER=/usr/bin/nvcc \ 24 | -DCUDA_ARCH=sm_70 \ 25 | -DCMAKE_INSTALL_PREFIX=../install_${BUILD_SUFFIX} \ 26 | "$@" \ 27 | .. 28 | -------------------------------------------------------------------------------- /include/RAJA/policy/openmp_target/WorkGroup.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file containing RAJA Dispatcher and WorkRunner constructs. 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | #ifndef RAJA_openmp_target_WorkGroup_HPP 19 | #define RAJA_openmp_target_WorkGroup_HPP 20 | 21 | #include "RAJA/policy/openmp_target/WorkGroup/Dispatcher.hpp" 22 | #include "RAJA/policy/openmp_target/WorkGroup/WorkRunner.hpp" 23 | 24 | #endif // closing endif for header file include guard 25 | -------------------------------------------------------------------------------- /include/RAJA/policy/tensor/arch/cuda.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file containing RAJA simd policy definitions. 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | #ifdef RAJA_ENABLE_CUDA 19 | 20 | 21 | #ifndef RAJA_policy_tensor_arch_cuda_HPP 22 | #define RAJA_policy_tensor_arch_cuda_HPP 23 | 24 | #include 25 | #include 26 | 27 | 28 | #endif 29 | 30 | 31 | #endif // RAJA_ENABLE_CUDA 32 | -------------------------------------------------------------------------------- /docs/doxygen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and other RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | #------------------------------------------------------------------------------ 9 | # Doxygen documentation targets 10 | #------------------------------------------------------------------------------ 11 | 12 | blt_add_doxygen_target( raja_doxygen ) 13 | 14 | # Required directory for doxygen to generate output to 15 | add_custom_target( build_doxygen_output_dir 16 | ALL 17 | COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/html 18 | ) 19 | 20 | add_dependencies( raja_doxygen build_doxygen_output_dir ) 21 | 22 | add_dependencies(raja_docs 23 | raja_doxygen) 24 | -------------------------------------------------------------------------------- /src/PluginStrategy.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | #include "RAJA/util/PluginStrategy.hpp" 9 | 10 | RAJA_INSTANTIATE_REGISTRY(PluginRegistry); 11 | 12 | namespace RAJA 13 | { 14 | namespace util 15 | { 16 | 17 | PluginStrategy::PluginStrategy() = default; 18 | 19 | void PluginStrategy::init(const PluginOptions&) {} 20 | 21 | void PluginStrategy::preCapture(const PluginContext&) {} 22 | 23 | void PluginStrategy::postCapture(const PluginContext&) {} 24 | 25 | void PluginStrategy::preLaunch(const PluginContext&) {} 26 | 27 | void PluginStrategy::postLaunch(const PluginContext&) {} 28 | 29 | void PluginStrategy::finalize() {} 30 | 31 | } // namespace util 32 | } // namespace RAJA 33 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | # Required 6 | version: 2 7 | 8 | # Set the version of Python and other tools you might need 9 | build: 10 | os: ubuntu-22.04 11 | tools: 12 | python: "3.11" 13 | apt_packages: 14 | - ghostscript 15 | - texlive-full 16 | 17 | ## 18 | ## Code for debugging directory structure in readthedocs 19 | ## to fix broken links, etc. 20 | ## 21 | # Print tree 22 | #build: 23 | # os: ubuntu-20.04 24 | # apt_packages: 25 | # - tree 26 | # tools: 27 | # python: "3.7" 28 | # jobs: 29 | # post_build: 30 | # - tree -J 31 | 32 | # Build documentation in the docs/ directory with Sphinx 33 | sphinx: 34 | configuration: docs/conf.py 35 | 36 | # Optionally build docs in add'l formats such as PDF and ePub 37 | #formats: all 38 | 39 | # Set requirements needed to build the docs 40 | python: 41 | install: 42 | - requirements: docs/requirements.txt 43 | -------------------------------------------------------------------------------- /test/unit/reducer/test-reducer-reset-seq.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | /// 9 | /// Source file containing tests for RAJA reducer reset. 10 | /// 11 | 12 | #include "tests/test-reducer-reset.hpp" 13 | 14 | using SequentialReducerResetTypes = 15 | Test< camp::cartesian_product< SequentialReducerPolicyList, 16 | DataTypeList, 17 | HostResourceList, 18 | SequentialUnitTestPolicyList > >::Types; 19 | 20 | 21 | INSTANTIATE_TYPED_TEST_SUITE_P(SequentialResetTest, 22 | ReducerResetUnitTest, 23 | SequentialReducerResetTypes); 24 | 25 | -------------------------------------------------------------------------------- /test/functional/launch/nested_tile_direct/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # Generate tests for each enabled RAJA back-end. 10 | # 11 | # 12 | 13 | foreach( BACKEND ${LAUNCH_BACKENDS} ) 14 | configure_file( test-launch-nested-tile-direct.cpp.in 15 | test-launch-nested-Tile-Direct-${BACKEND}.cpp ) 16 | raja_add_test( NAME test-launch-nested-Tile-Direct-${BACKEND} 17 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-launch-nested-Tile-Direct-${BACKEND}.cpp ) 18 | 19 | target_include_directories(test-launch-nested-Tile-Direct-${BACKEND}.exe 20 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 21 | endforeach() 22 | 23 | -------------------------------------------------------------------------------- /test/unit/reducer/test-reducer-reset-hip.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | /// 9 | /// Source file containing tests for RAJA reducer reset. 10 | /// 11 | 12 | #include "tests/test-reducer-reset.hpp" 13 | 14 | #if defined(RAJA_ENABLE_HIP) 15 | using HipReducerResetTypes = 16 | Test< camp::cartesian_product< HipReducerPolicyList, 17 | DataTypeList, 18 | HipResourceList, 19 | HipUnitTestPolicyList > >::Types; 20 | 21 | 22 | INSTANTIATE_TYPED_TEST_SUITE_P(HipResetTest, 23 | ReducerResetUnitTest, 24 | HipReducerResetTypes); 25 | #endif 26 | -------------------------------------------------------------------------------- /include/RAJA/policy/tensor/arch/avx.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file containing SIMD abstractions for AVX 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | #ifdef __AVX__ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | 27 | #endif // __AVX__ 28 | -------------------------------------------------------------------------------- /test/unit/reducer/test-reducer-reset-cuda.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | /// 9 | /// Source file containing tests for RAJA reducer reset. 10 | /// 11 | 12 | #include "tests/test-reducer-reset.hpp" 13 | 14 | #if defined(RAJA_ENABLE_CUDA) 15 | using CudaReducerResetTypes = 16 | Test< camp::cartesian_product< CudaReducerPolicyList, 17 | DataTypeList, 18 | CudaResourceList, 19 | CudaUnitTestPolicyList > >::Types; 20 | 21 | 22 | INSTANTIATE_TYPED_TEST_SUITE_P(CudaResetTest, 23 | ReducerResetUnitTest, 24 | CudaReducerResetTypes); 25 | #endif 26 | -------------------------------------------------------------------------------- /include/RAJA/util/PluginLinker.hpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | #ifndef RAJA_Plugin_Linker_HPP 9 | #define RAJA_Plugin_Linker_HPP 10 | 11 | #include "RAJA/util/RuntimePluginLoader.hpp" 12 | #include "RAJA/util/KokkosPluginLoader.hpp" 13 | #include "RAJA/util/CaliperPlugin.hpp" 14 | 15 | namespace 16 | { 17 | namespace anonymous_RAJA 18 | { 19 | struct pluginLinker 20 | { 21 | inline pluginLinker() 22 | { 23 | (void)RAJA::util::linkRuntimePluginLoader(); 24 | (void)RAJA::util::linkKokkosPluginLoader(); 25 | #if defined(RAJA_ENABLE_CALIPER) 26 | (void)RAJA::util::linkCaliperPlugin(); 27 | #endif 28 | } 29 | } pluginLinker; 30 | } // namespace anonymous_RAJA 31 | } // namespace 32 | #endif 33 | -------------------------------------------------------------------------------- /scripts/make_release_tarball.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 5 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 6 | # 7 | # SPDX-License-Identifier: (BSD-3-Clause) 8 | ############################################################################### 9 | 10 | TAR_CMD=`which tar` 11 | VERSION=`git describe --tags` 12 | 13 | git archive --prefix=RAJA-${VERSION}/ -o RAJA-${VERSION}.tar HEAD 2> /dev/null 14 | 15 | echo "Running git archive submodules..." 16 | 17 | p=`pwd` && (echo .; git submodule foreach --recursive) | while read entering path; do 18 | temp="${path%\'}"; 19 | temp="${temp#\'}"; 20 | path=$temp; 21 | [ "$path" = "" ] && continue; 22 | (cd $path && git archive --prefix=RAJA-${VERSION}/$path/ HEAD > $p/tmp.tar && ${TAR_CMD} --concatenate --file=$p/RAJA-${VERSION}.tar $p/tmp.tar && rm $p/tmp.tar); 23 | done 24 | 25 | gzip RAJA-${VERSION}.tar 26 | -------------------------------------------------------------------------------- /test/functional/launch/nested_tile_loop/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # Generate tests for each enabled RAJA back-end. 10 | # 11 | # 12 | 13 | foreach( BACKEND ${LAUNCH_BACKENDS} ) 14 | configure_file( test-launch-nested-tile-loop.cpp.in 15 | test-launch-nested-Tile-Loop-${BACKEND}.cpp ) 16 | raja_add_test( NAME test-launch-nested-Tile-Loop-${BACKEND} 17 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-launch-nested-Tile-Loop-${BACKEND}.cpp ) 18 | 19 | target_include_directories(test-launch-nested-Tile-Loop-${BACKEND}.exe 20 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 21 | endforeach() 22 | 23 | unset( NESTEDTYPES ) 24 | -------------------------------------------------------------------------------- /include/RAJA/policy/tensor/arch/avx2.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file containing SIMD abstractions for AVX2 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | #ifdef __AVX2__ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | 27 | #endif // __AVX2__ 28 | -------------------------------------------------------------------------------- /examples/plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ################################################################################ 7 | 8 | if(RAJA_ENABLE_CALIPER) 9 | raja_add_executable( 10 | NAME raja-forall-caliper 11 | SOURCES raja-forall-caliper.cpp) 12 | raja_add_executable( 13 | NAME raja-launch-caliper 14 | SOURCES raja-launch-caliper.cpp) 15 | endif() 16 | 17 | raja_add_executable( 18 | NAME plugin-example 19 | SOURCES test-plugin.cpp counter-plugin.cpp) 20 | 21 | if (RAJA_ENABLE_RUNTIME_PLUGINS) 22 | raja_add_executable( 23 | NAME plugin-example-dynamic 24 | SOURCES test-plugin-dynamic.cpp) 25 | 26 | raja_add_plugin_library(NAME timer_plugin 27 | SHARED TRUE 28 | SOURCES timer-plugin.cpp) 29 | endif () 30 | -------------------------------------------------------------------------------- /test/unit/reducer/test-reducer-reset-openmp.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | /// 9 | /// Source file containing tests for RAJA reducer reset. 10 | /// 11 | 12 | #include "tests/test-reducer-reset.hpp" 13 | 14 | #if defined(RAJA_ENABLE_OPENMP) 15 | using OpenMPReducerResetTypes = 16 | Test< camp::cartesian_product< OpenMPReducerPolicyList, 17 | DataTypeList, 18 | HostResourceList, 19 | SequentialUnitTestPolicyList > >::Types; 20 | 21 | 22 | INSTANTIATE_TYPED_TEST_SUITE_P(OpenMPResetTest, 23 | ReducerResetUnitTest, 24 | OpenMPReducerResetTypes); 25 | #endif 26 | -------------------------------------------------------------------------------- /travis-data/docker/icc18/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rajaorg/compiler:ubuntu-clang-base 2 | 3 | LABEL maintainer="Tom Scogland " 4 | 5 | RUN mkdir /home/raja/intel 6 | ADD silent.cfg /home/raja/intel/silent.cfg 7 | ADD ./parallel_studio_xe_2018_update3_professional_edition /home/raja/intel/parallel_studio 8 | 9 | # apparently cpio is required or the install fails as though it ran out of disk... yay... 10 | RUN sudo apt-get install cpio 11 | RUN cd /home/raja/intel \ 12 | && mkdir downloads tmp \ 13 | && sudo /home/raja/intel/parallel_studio/install.sh -s /home/raja/intel/silent.cfg -D /home/raja/intel/downloads -t /home/raja/intel/tmp \ 14 | && sudo rm -rf /home/raja/intel /opt/intel/ism/db /opt/intel/licenses 15 | 16 | # last line removes the license and serial references, 17 | # this is REQUIRED, and since the installer likes to echo 18 | # the serial into log files, nuking everything this way 19 | # is basically the way to go 20 | 21 | # usage requires a directory with a valid license file to 22 | # be volume mounted to /opt/intel/licenses 23 | 24 | -------------------------------------------------------------------------------- /host-configs/lc-builds/toss4/clang_X_asan.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_CLANG" CACHE STRING "") 9 | 10 | set(CMAKE_CXX_FLAGS_RELEASE "--gcc-toolchain=/usr/tce/packages/gcc/gcc-10.3.1 -O3 -march=native -funroll-loops -finline-functions -fsanitize=address -fno-omit-frame-pointer" CACHE STRING "") 11 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "--gcc-toolchain=/usr/tce/packages/gcc/gcc-10.3.1 -O3 -g -march=native -funroll-loops -finline-functions -fsanitize=address -fno-omit-frame-pointer" CACHE STRING "") 12 | set(CMAKE_CXX_FLAGS_DEBUG "--gcc-toolchain=/usr/tce/packages/gcc/gcc-10.3.1 -O0 -g -fsanitize=address -fno-omit-frame-pointer" CACHE STRING "") 13 | 14 | set(RAJA_HOST_CONFIG_LOADED On CACHE BOOL "") 15 | -------------------------------------------------------------------------------- /test/functional/util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | raja_add_test( 9 | NAME test-CombiningAdapter-1D 10 | SOURCES test-CombiningAdapter-1D.cpp) 11 | 12 | raja_add_test( 13 | NAME test-CombiningAdapter-2D 14 | SOURCES test-CombiningAdapter-2D.cpp) 15 | 16 | raja_add_test( 17 | NAME test-CombiningAdapter-3D 18 | SOURCES test-CombiningAdapter-3D.cpp) 19 | 20 | raja_add_test( 21 | NAME test-PermutedCombiningAdapter-1D 22 | SOURCES test-PermutedCombiningAdapter-1D.cpp) 23 | 24 | raja_add_test( 25 | NAME test-PermutedCombiningAdapter-2D 26 | SOURCES test-PermutedCombiningAdapter-2D.cpp) 27 | 28 | raja_add_test( 29 | NAME test-PermutedCombiningAdapter-3D 30 | SOURCES test-PermutedCombiningAdapter-3D.cpp) 31 | -------------------------------------------------------------------------------- /test/integration/plugin_for_test_kokkos.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | #include "RAJA/RAJA.hpp" 9 | 10 | #include 11 | 12 | extern "C" void kokkosp_init_library(const int RAJA_UNUSED_ARG(loadSeq), 13 | const uint64_t RAJA_UNUSED_ARG(interfaceVer), 14 | const uint32_t RAJA_UNUSED_ARG(devInfoCount), 15 | void* RAJA_UNUSED_ARG(deviceInfo)) {} 16 | 17 | extern "C" void kokkosp_begin_parallel_for(const char* RAJA_UNUSED_ARG(name), 18 | const uint32_t RAJA_UNUSED_ARG(devID), 19 | uint64_t* RAJA_UNUSED_ARG(kID)) { 20 | throw std::runtime_error("preLaunch"); 21 | } 22 | 23 | extern "C" void kokkosp_end_parallel_for(const uint64_t RAJA_UNUSED_ARG(kID)) {} 24 | 25 | extern "C" void kokkosp_finalize_library() {} 26 | -------------------------------------------------------------------------------- /cmake/thirdparty/FindRoctracer.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and other RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | ############################################################################### 9 | 10 | # Find ROCTracer libraries/headers 11 | 12 | find_path(ROCTX_PREFIX 13 | NAMES include/roctracer/roctx.h 14 | ) 15 | 16 | find_library(ROCTX_LIBRARIES 17 | NAMES roctx64 18 | HINTS ${ROCTX_PREFIX}/lib 19 | ) 20 | 21 | find_path(ROCTX_INCLUDE_DIRS 22 | NAMES roctx.h 23 | HINTS ${ROCTX_PREFIX}/include/roctracer 24 | ) 25 | 26 | include(FindPackageHandleStandardArgs) 27 | 28 | find_package_handle_standard_args(ROCTX 29 | DEFAULT_MSG 30 | ROCTX_LIBRARIES 31 | ROCTX_INCLUDE_DIRS 32 | ) 33 | 34 | mark_as_advanced( 35 | ROCTX_INCLUDE_DIRS 36 | ROCTX_LIBRARIES 37 | ) 38 | -------------------------------------------------------------------------------- /travis-data/docker/icc16/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rajaorg/compiler:ubuntu-clang-base 2 | 3 | LABEL maintainer="Tom Scogland " 4 | 5 | RUN mkdir /home/raja/intel 6 | ADD silent.cfg /home/raja/intel/silent.cfg 7 | 8 | ENV NAME=parallel_studio_xe_2016_update3_online.sh 9 | # apparently cpio is required or the install fails as though it ran out of disk... yay... 10 | RUN cd intel \ 11 | && sudo apt-get install cpio \ 12 | && wget -q -O ${NAME} 'http://registrationcenter-download.intel.com/akdlm/irc_nas/9061/parallel_studio_xe_2016_update3_online.sh' \ 13 | && chmod +x ${NAME} \ 14 | && mkdir downloads tmp \ 15 | && sudo ./${NAME} -s silent.cfg -D downloads -t tmp \ 16 | && sudo rm -rf /home/raja/intel /opt/intel/ism/db /opt/intel/licenses 17 | # last line removes the license and serial references, 18 | # this is REQUIRED, and since the installer likes to echo 19 | # the serial into log files, nuking everything this way 20 | # is basically the way to go 21 | 22 | # usage requires a directory with a valid license file to 23 | # be volume mounted to /opt/intel/licenses 24 | -------------------------------------------------------------------------------- /host-configs/alcf-builds/cooley_clang5_0.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_CLANG" CACHE STRING "") 9 | 10 | set(CMAKE_CXX_COMPILER "/soft/compilers/llvm/5.0/bin/clang++" CACHE PATH "") 11 | set(CMAKE_C_COMPILER "/soft/compilers/llvm/5.0/bin/clang" CACHE PATH "") 12 | 13 | set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3" CACHE STRING "") 14 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3" CACHE STRING "") 15 | set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g" CACHE STRING "") 16 | 17 | set(RAJA_RANGE_ALIGN 4 CACHE INT "") 18 | set(RAJA_RANGE_MIN_LENGTH 32 CACHE INT "") 19 | set(RAJA_DATA_ALIGN 64 CACHE INT "") 20 | 21 | set(RAJA_HOST_CONFIG_LOADED On CACHE Bool "") 22 | -------------------------------------------------------------------------------- /host-configs/alcf-builds/cooley_gcc7_1_0.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_GNU" CACHE STRING "") 9 | 10 | set(CMAKE_CXX_COMPILER "/soft/compilers/gcc/7.1.0/bin/g++" CACHE PATH "") 11 | set(CMAKE_C_COMPILER "/soft/compilers/gcc/7.1.0/bin/gcc" CACHE PATH "") 12 | 13 | set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -finline-functions -finline-limit=20000" CACHE STRING "") 14 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Ofast -g -finline-functions -finline-limit=20000" CACHE STRING "") 15 | set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "") 16 | 17 | set(RAJA_RANGE_ALIGN 4 CACHE INT "") 18 | set(RAJA_RANGE_MIN_LENGTH 32 CACHE INT "") 19 | set(RAJA_DATA_ALIGN 64 CACHE INT "") 20 | 21 | set(RAJA_HOST_CONFIG_LOADED On CACHE Bool "") 22 | -------------------------------------------------------------------------------- /include/RAJA/pattern/kernel/internal.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file for loop kernel internals. 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | #ifndef RAJA_pattern_kernel_internal_HPP 19 | #define RAJA_pattern_kernel_internal_HPP 20 | 21 | 22 | #include "RAJA/pattern/kernel/internal/LoopData.hpp" 23 | #include "RAJA/pattern/kernel/internal/LoopTypes.hpp" 24 | #include "RAJA/pattern/kernel/internal/Statement.hpp" 25 | #include "RAJA/pattern/kernel/internal/StatementList.hpp" 26 | 27 | 28 | #endif /* RAJA_pattern_kernel_internal_HPP */ 29 | -------------------------------------------------------------------------------- /include/RAJA/policy/simd/params/kernel_name.hpp: -------------------------------------------------------------------------------- 1 | #ifndef SIMD_KERNELNAME_HPP 2 | #define SIMD_KERNELNAME_HPP 3 | 4 | #include "RAJA/pattern/params/kernel_name.hpp" 5 | 6 | namespace RAJA 7 | { 8 | namespace expt 9 | { 10 | namespace detail 11 | { 12 | 13 | // Init 14 | template 15 | camp::concepts::enable_if> param_init( 16 | EXEC_POL const&, 17 | RAJA::detail::Name&) 18 | { 19 | // TODO: Define kernel naming 20 | } 21 | 22 | // Combine 23 | template 24 | RAJA_HOST_DEVICE camp::concepts::enable_if< 25 | std::is_same> 26 | param_combine(EXEC_POL const&, RAJA::detail::Name&, T) 27 | {} 28 | 29 | // Resolve 30 | template 31 | camp::concepts::enable_if> 32 | param_resolve(EXEC_POL const&, RAJA::detail::Name&) 33 | { 34 | // TODO: Define kernel naming 35 | } 36 | 37 | } // namespace detail 38 | } // namespace expt 39 | } // namespace RAJA 40 | 41 | 42 | #endif // NEW_REDUCE_SIMD_REDUCE_HPP 43 | -------------------------------------------------------------------------------- /test/functional/forall/atomic-basic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # Generate tests for each enabled RAJA back-end. 10 | # 11 | # Note: FORALL_ATOMIC_BACKENDS is defined in ../CMakeLists.txt 12 | # 13 | foreach( ATOMIC_BACKEND ${FORALL_ATOMIC_BACKENDS} ) 14 | configure_file( test-forall-atomic-basic.cpp.in 15 | test-forall-atomic-basic-${ATOMIC_BACKEND}.cpp ) 16 | raja_add_test( NAME test-forall-atomic-basic-${ATOMIC_BACKEND} 17 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-forall-atomic-basic-${ATOMIC_BACKEND}.cpp ) 18 | 19 | target_include_directories(test-forall-atomic-basic-${ATOMIC_BACKEND}.exe 20 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 21 | endforeach() 22 | -------------------------------------------------------------------------------- /include/RAJA/policy/sequential/params/kernel_name.hpp: -------------------------------------------------------------------------------- 1 | #ifndef SEQ_KERNELNAME_HPP 2 | #define SEQ_KERNELNAME_HPP 3 | 4 | #include "RAJA/pattern/params/kernel_name.hpp" 5 | 6 | namespace RAJA 7 | { 8 | namespace expt 9 | { 10 | namespace detail 11 | { 12 | 13 | // Init 14 | template 15 | camp::concepts::enable_if> param_init( 16 | EXEC_POL const&, 17 | RAJA::detail::Name&) 18 | { 19 | // TODO: Define kernel naming 20 | } 21 | 22 | // Combine 23 | template 24 | RAJA_HOST_DEVICE camp::concepts::enable_if< 25 | std::is_same> 26 | param_combine(EXEC_POL const&, RAJA::detail::Name&, T) 27 | {} 28 | 29 | // Resolve 30 | template 31 | camp::concepts::enable_if> param_resolve( 32 | EXEC_POL const&, 33 | RAJA::detail::Name&) 34 | { 35 | // TODO: Define kernel naming 36 | } 37 | 38 | } // namespace detail 39 | } // namespace expt 40 | } // namespace RAJA 41 | 42 | 43 | #endif // NEW_REDUCE_SEQ_REDUCE_HPP 44 | -------------------------------------------------------------------------------- /test/functional/launch/run-time-switch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # List of segment types for generating test files. 10 | # 11 | set(TEST_TYPES BasicShared) 12 | 13 | foreach( BACKEND ${LAUNCH_BACKENDS} ) 14 | foreach( TESTTYPE ${TEST_TYPES} ) 15 | configure_file( test-launch.cpp.in 16 | test-launch-${TESTTYPE}-${BACKEND}.cpp ) 17 | raja_add_test( NAME test-launch-${TESTTYPE}-${BACKEND} 18 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-launch-${TESTTYPE}-${BACKEND}.cpp ) 19 | 20 | target_include_directories(test-launch-${TESTTYPE}-${BACKEND}.exe 21 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 22 | endforeach() 23 | endforeach() 24 | 25 | unset( TEST_TYPES ) 26 | -------------------------------------------------------------------------------- /test/functional/launch/tile_icount_tcount_loop/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # Generate tests for each enabled RAJA back-end. 10 | # 11 | # 12 | 13 | foreach( BACKEND ${LAUNCH_BACKENDS} ) 14 | configure_file( test-launch-nested-tile-icount-tcount-loop.cpp.in 15 | test-launch-nested-Tile-iCount-tCount-Loop-${BACKEND}.cpp ) 16 | raja_add_test( NAME test-launch-nested-Tile-iCount-tCount-Loop-${BACKEND} 17 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-launch-nested-Tile-iCount-tCount-Loop-${BACKEND}.cpp ) 18 | 19 | target_include_directories(test-launch-nested-Tile-iCount-tCount-Loop-${BACKEND}.exe 20 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 21 | endforeach() 22 | 23 | -------------------------------------------------------------------------------- /test/integration/plugin/tests/counter.hpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | #ifndef RAJA_counter_HPP 8 | #define RAJA_counter_HPP 9 | 10 | 11 | struct CounterData 12 | { 13 | RAJA::Platform capture_platform_active = RAJA::Platform::undefined; 14 | int capture_counter_pre = 0; 15 | int capture_counter_post = 0; 16 | RAJA::Platform launch_platform_active = RAJA::Platform::undefined; 17 | int launch_counter_pre = 0; 18 | int launch_counter_post = 0; 19 | }; 20 | 21 | // note the use of a pointer here to allow different types of memory 22 | // to be used 23 | extern CounterData* plugin_test_data; 24 | 25 | extern camp::resources::Resource* plugin_test_resource; 26 | 27 | #endif // RAJA_counter_HPP 28 | -------------------------------------------------------------------------------- /test/include/RAJA_test-reduceloc-types.hpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | // 9 | // Custom index type used for loc reductions. 10 | // 11 | 12 | #ifndef __RAJA_test_reduceloc_types_HPP__ 13 | #define __RAJA_test_reduceloc_types_HPP__ 14 | 15 | #include "RAJA/RAJA.hpp" 16 | #include "RAJA/util/types.hpp" 17 | #include "camp/list.hpp" 18 | 19 | struct Index2D { 20 | RAJA::Index_type idx, idy; 21 | constexpr Index2D() : idx(-1), idy(-1) {} 22 | constexpr Index2D(RAJA::Index_type init) : idx(init), idy(init) {} 23 | constexpr Index2D(RAJA::Index_type ix, RAJA::Index_type iy) : idx(ix), idy(iy) {} 24 | template 25 | RAJA_HOST_DEVICE void operator=(T rhs) { idx = rhs; idx = rhs; } 26 | }; 27 | 28 | #endif // __RAJA_test_reduceloc_types_HPP__ 29 | -------------------------------------------------------------------------------- /test/unit/reducer/test-reducer-reset-openmp-target.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | /// 9 | /// Source file containing tests for RAJA reducer reset. 10 | /// 11 | 12 | #include "tests/test-reducer-reset.hpp" 13 | 14 | #if defined(RAJA_ENABLE_TARGET_OPENMP) 15 | using OpenMPTargetReducerResetTypes = 16 | Test< camp::cartesian_product< OpenMPTargetReducerPolicyList, 17 | DataTypeList, 18 | OpenMPTargetResourceList, 19 | SequentialUnitTestPolicyList > >::Types; 20 | 21 | 22 | INSTANTIATE_TYPED_TEST_SUITE_P(OpenMPTargetResetTest, 23 | ReducerResetUnitTest, 24 | OpenMPTargetReducerResetTypes); 25 | #endif 26 | -------------------------------------------------------------------------------- /docs/sphinx/user_guide/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(SPHINX_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build") 9 | set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html") 10 | 11 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/conf.py" 12 | "${SPHINX_BUILD_DIR}/conf.py" 13 | @ONLY) 14 | 15 | add_custom_target(raja-userguide-sphinx 16 | ${SPHINX_EXECUTABLE} 17 | -q -b html 18 | -c "${SPHINX_BUILD_DIR}" 19 | "${CMAKE_CURRENT_SOURCE_DIR}" 20 | "${SPHINX_HTML_DIR}" 21 | COMMENT "Building HTML user documentation with Sphinx") 22 | 23 | install(DIRECTORY "${SPHINX_HTML_DIR}" 24 | DESTINATION "docs/user_guide/sphinx/" OPTIONAL) 25 | 26 | add_dependencies(raja-docs 27 | raja-userguide-sphinx) 28 | -------------------------------------------------------------------------------- /docs/sphinx/user_guide/features.rst: -------------------------------------------------------------------------------- 1 | .. ## 2 | .. ## Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | .. ## and RAJA project contributors. See the RAJA/LICENSE file 4 | .. ## for details. 5 | .. ## 6 | .. ## SPDX-License-Identifier: (BSD-3-Clause) 7 | .. ## 8 | 9 | .. _features-label: 10 | 11 | ************************ 12 | RAJA Features 13 | ************************ 14 | 15 | The following sections describe the main RAJA features. They are intended 16 | to introduce users to the features and basic usage and also to provide 17 | a syntax reference guide. The sections contain links to RAJA tutorial 18 | materials that provide detailed examples of usage. 19 | 20 | .. toctree:: 21 | :maxdepth: 2 22 | 23 | feature/loop_basic 24 | feature/policies 25 | feature/iteration_spaces 26 | feature/view 27 | feature/reduction 28 | feature/multi-reduction 29 | feature/atomic 30 | feature/scan 31 | feature/sort 32 | feature/resource 33 | feature/local_array 34 | feature/tiling 35 | feature/workgroup 36 | feature/vectorization 37 | feature/plugins 38 | 39 | -------------------------------------------------------------------------------- /test/functional/kernel/basic-single-icount-loop/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # Generate tests for each enabled RAJA back-end. 10 | # 11 | # Note: KERNEL_BACKENDS is defined in ../CMakeLists.txt 12 | # 13 | 14 | foreach( BACKEND ${KERNEL_BACKENDS} ) 15 | configure_file( test-kernel-basic-single-icount-loop.cpp.in 16 | test-kernel-basic-single-icount-loop-${BACKEND}.cpp ) 17 | raja_add_test( NAME test-kernel-basic-single-icount-loop-${BACKEND} 18 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-kernel-basic-single-icount-loop-${BACKEND}.cpp ) 19 | target_include_directories(test-kernel-basic-single-icount-loop-${BACKEND}.exe 20 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 21 | endforeach() 22 | -------------------------------------------------------------------------------- /test/functional/launch/nested_tile_direct_unchecked/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-24, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # Generate tests for each enabled RAJA back-end. 10 | # 11 | # 12 | 13 | foreach( BACKEND ${LAUNCH_DIRECT_UNCHECKED_BACKENDS} ) 14 | configure_file( test-launch-nested-tile-direct-unchecked.cpp.in 15 | test-launch-nested-Tile-DirectUnchecked-${BACKEND}.cpp ) 16 | raja_add_test( NAME test-launch-nested-Tile-DirectUnchecked-${BACKEND} 17 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-launch-nested-Tile-DirectUnchecked-${BACKEND}.cpp ) 18 | 19 | target_include_directories(test-launch-nested-Tile-DirectUnchecked-${BACKEND}.exe 20 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 21 | endforeach() 22 | 23 | -------------------------------------------------------------------------------- /test/functional/launch/tile_icount_tcount_direct/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # Generate tests for each enabled RAJA back-end. 10 | # 11 | # 12 | 13 | foreach( BACKEND ${LAUNCH_BACKENDS} ) 14 | configure_file( test-launch-nested-tile-icount-tcount-direct.cpp.in 15 | test-launch-nested-Tile-iCount-tCount-Direct-${BACKEND}.cpp ) 16 | raja_add_test( NAME test-launch-nested-Tile-iCount-tCount-Direct-${BACKEND} 17 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-launch-nested-Tile-iCount-tCount-Direct-${BACKEND}.cpp ) 18 | 19 | target_include_directories(test-launch-nested-Tile-iCount-tCount-Direct-${BACKEND}.exe 20 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 21 | endforeach() 22 | 23 | -------------------------------------------------------------------------------- /include/RAJA/util/sycl_compat.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief RAJA header file for handling different SYCL header include paths 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | #ifndef RAJA_util_sycl_compat_HPP 19 | #define RAJA_util_sycl_compat_HPP 20 | 21 | #if defined(RAJA_SYCL_ACTIVE) 22 | #if (__INTEL_CLANG_COMPILER && __INTEL_CLANG_COMPILER < 20230000) 23 | // older version, use legacy header locations 24 | #include 25 | #else 26 | // SYCL 2020 standard header 27 | #include 28 | #endif 29 | #endif 30 | 31 | #endif // RAJA_util_sycl_compat_HPP 32 | -------------------------------------------------------------------------------- /test/unit/atomic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | raja_add_test( 9 | NAME test-atomic-incdec 10 | SOURCES test-atomic-incdec.cpp) 11 | 12 | raja_add_test( 13 | NAME test-atomic-ref-constructor 14 | SOURCES test-atomic-ref-constructor.cpp) 15 | 16 | raja_add_test( 17 | NAME test-atomic-ref-accessors 18 | SOURCES test-atomic-ref-accessors.cpp) 19 | 20 | raja_add_test( 21 | NAME test-atomic-ref-exchanges 22 | SOURCES test-atomic-ref-exchanges.cpp) 23 | 24 | raja_add_test( 25 | NAME test-atomic-ref-addsub 26 | SOURCES test-atomic-ref-addsub.cpp) 27 | 28 | raja_add_test( 29 | NAME test-atomic-ref-minmax 30 | SOURCES test-atomic-ref-minmax.cpp) 31 | 32 | raja_add_test( 33 | NAME test-atomic-ref-bitwise 34 | SOURCES test-atomic-ref-bitwise.cpp) 35 | -------------------------------------------------------------------------------- /host-configs/lc-builds/toss4/clang_X_ubsan.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_CLANG" CACHE STRING "") 9 | 10 | set(CMAKE_CXX_FLAGS_RELEASE "--gcc-toolchain=/usr/tce/packages/gcc/gcc-10.3.1 -O3 -march=native -funroll-loops -finline-functions -fsanitize=undefined -fno-omit-frame-pointer -fsanitize=integer" CACHE STRING "") 11 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "--gcc-toolchain=/usr/tce/packages/gcc/gcc-10.3.1 -O3 -g -march=native -funroll-loops -finline-functions -fsanitize=undefined -fno-omit-frame-pointer -fsanitize=integer" CACHE STRING "") 12 | set(CMAKE_CXX_FLAGS_DEBUG "--gcc-toolchain=/usr/tce/packages/gcc/gcc-10.3.1 -O0 -g -fsanitize=undefined -fno-omit-frame-pointer -fsanitize=integer" CACHE STRING "") 13 | 14 | set(RAJA_HOST_CONFIG_LOADED On CACHE BOOL "") 15 | -------------------------------------------------------------------------------- /include/RAJA/policy/sycl/params/kernel_name.hpp: -------------------------------------------------------------------------------- 1 | #ifndef SYCL_KERNELNAME_HPP 2 | #define SYCL_KERNELNAME_HPP 3 | 4 | #include "RAJA/pattern/params/kernel_name.hpp" 5 | 6 | namespace RAJA 7 | { 8 | namespace expt 9 | { 10 | namespace detail 11 | { 12 | 13 | #if defined(RAJA_ENABLE_SYCL) 14 | 15 | // Init 16 | template 17 | camp::concepts::enable_if> 18 | param_init(EXEC_POL const&, RAJA::detail::Name&) 19 | { 20 | // TODO: Define kernel naming 21 | } 22 | 23 | // Combine 24 | template 25 | camp::concepts::enable_if> 26 | SYCL_EXTERNAL param_combine(EXEC_POL const&, RAJA::detail::Name&, T) 27 | {} 28 | 29 | // Resolve 30 | template 31 | camp::concepts::enable_if> 32 | param_resolve(EXEC_POL const&, RAJA::detail::Name&) 33 | { 34 | // TODO: Define kernel naming 35 | } 36 | 37 | #endif 38 | 39 | } // namespace detail 40 | } // namespace expt 41 | } // namespace RAJA 42 | 43 | 44 | #endif // NEW_REDUCE_SYCL_REDUCE_HPP 45 | -------------------------------------------------------------------------------- /include/RAJA/policy/tensor/arch/avx512.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file containing SIMD abstractions for AVX512 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | // Check if the base AVX512 instructions are present 19 | #ifdef __AVX512F__ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | 28 | #endif // __AVX512F__ 29 | -------------------------------------------------------------------------------- /test/old-tests/unit/cuda/test-synchronize.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | #include "RAJA/RAJA.hpp" 9 | #include "gtest/gtest.h" 10 | 11 | #include "RAJA_gtest.hpp" 12 | 13 | GPU_TEST(SynchronizeTest, CUDA) 14 | { 15 | 16 | double* managed_data; 17 | CAMP_CUDA_API_INVOKE_AND_CHECK(cudaMallocManaged, &managed_data, sizeof(double) * 50); 18 | 19 | RAJA::forall>( RAJA::RangeSegment(0, 50), 20 | [=] RAJA_HOST_DEVICE(RAJA::Index_type i) { 21 | managed_data[i] = 1.0 * i; 22 | }); 23 | RAJA::synchronize(); 24 | 25 | RAJA::forall( RAJA::RangeSegment(0, 50), 26 | [=](RAJA::Index_type i) { 27 | EXPECT_EQ(managed_data[i], 1.0 * i); 28 | }); 29 | 30 | CAMP_CUDA_API_INVOKE_AND_CHECK(cudaFree, managed_data); 31 | } 32 | -------------------------------------------------------------------------------- /scripts/alcf-builds/cooley_clang5.0.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 5 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 6 | # 7 | # SPDX-License-Identifier: (BSD-3-Clause) 8 | ############################################################################### 9 | 10 | ## 11 | ## Execute these commands before running this script to build RAJA. 12 | ## 13 | ## First grab a node to compile and run your code: 14 | ## 15 | ## > qsub -I -n 1 -A -t <# minutes> -q debug 16 | ## 17 | ## Then set up your build environment. 18 | ## 19 | ## > soft add +cmake-3.9.1 20 | ## > soft add +clang-5.0 21 | ## 22 | 23 | BUILD_SUFFIX=alcf-cooley-clang5.0 24 | 25 | rm -rf build_${BUILD_SUFFIX} 2>/dev/null 26 | mkdir build_${BUILD_SUFFIX} && cd build_${BUILD_SUFFIX} 27 | 28 | cmake \ 29 | -DCMAKE_BUILD_TYPE=Release \ 30 | -C ../host-configs/alcf-builds/cooley_clang5_0.cmake \ 31 | -DENABLE_OPENMP=On \ 32 | -DCMAKE_INSTALL_PREFIX=../install_${BUILD_SUFFIX} \ 33 | "$@" \ 34 | .. 35 | -------------------------------------------------------------------------------- /scripts/alcf-builds/cooley_gcc7.1.0.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 5 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 6 | # 7 | # SPDX-License-Identifier: (BSD-3-Clause) 8 | ############################################################################### 9 | 10 | ## 11 | ## Execute these commands before running this script to build RAJA. 12 | ## 13 | ## First grab a node to compile and run your code: 14 | ## 15 | ## > qsub -I -n 1 -A -t <# minutes> -q debug 16 | ## 17 | ## Then set up your build environment. 18 | ## 19 | ## > soft add +cmake-3.9.1 20 | ## > soft add +gcc-7.1.0 21 | ## 22 | 23 | BUILD_SUFFIX=alcf-cooley-gcc7.1.0 24 | 25 | rm -rf build_${BUILD_SUFFIX} 2>/dev/null 26 | mkdir build_${BUILD_SUFFIX} && cd build_${BUILD_SUFFIX} 27 | 28 | cmake \ 29 | -DCMAKE_BUILD_TYPE=Release \ 30 | -C ../host-configs/alcf-builds/cooley_gcc7_1_0.cmake \ 31 | -DENABLE_OPENMP=On \ 32 | -DCMAKE_INSTALL_PREFIX=../install_${BUILD_SUFFIX} \ 33 | "$@" \ 34 | .. 35 | -------------------------------------------------------------------------------- /test/functional/dynamic_forall/segment/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # List of segment types for generating test files. 10 | # 11 | set(SEGTYPE RangeSegment) 12 | 13 | foreach( BACKEND ${DYNAMIC_BACKENDS} ) 14 | foreach( TESTTYPE ${SEGTYPE} ) 15 | configure_file( test-dynamic-forall-segments.cpp.in 16 | test-dynamic-forall-segments-${SEGTYPE}-${BACKEND}.cpp ) 17 | raja_add_test( NAME test-dynamic-forall-segments-${SEGTYPE}-${BACKEND} 18 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-dynamic-forall-segments-${SEGTYPE}-${BACKEND}.cpp ) 19 | 20 | target_include_directories(test-dynamic-forall-segments-${SEGTYPE}-${BACKEND}.exe 21 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 22 | endforeach() 23 | endforeach() 24 | 25 | unset( SEGTYPE ) 26 | -------------------------------------------------------------------------------- /scripts/travis_build_and_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 5 | # and other RAJA project contributors. See the RAJA/LICENSE file for details. 6 | # 7 | # SPDX-License-Identifier: (BSD-3-Clause) 8 | ############################################################################### 9 | 10 | function or_die () { 11 | "$@" 12 | local status=$? 13 | if [[ $status != 0 ]] ; then 14 | echo ERROR $status command: $@ 15 | exit $status 16 | fi 17 | } 18 | 19 | # source ~/.bashrc 20 | # cd ${TRAVIS_BUILD_DIR} 21 | [[ -d /opt/intel ]] && . /opt/intel/bin/compilervars.sh intel64 22 | or_die mkdir travis-build 23 | cd travis-build 24 | if [[ "$DO_BUILD" == "yes" ]] ; then 25 | or_die cmake -DCMAKE_CXX_COMPILER="${COMPILER}" ${CMAKE_EXTRA_FLAGS} ../ 26 | if [[ ${CMAKE_EXTRA_FLAGS} == *COVERAGE* ]] ; then 27 | or_die make -j 3 28 | else 29 | or_die make -j 3 VERBOSE=1 30 | fi 31 | if [[ "${DO_TEST}" == "yes" ]] ; then 32 | or_die ctest -V 33 | fi 34 | fi 35 | 36 | exit 0 37 | -------------------------------------------------------------------------------- /test/functional/forall/region/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | list(APPEND FORALL_REGION_BACKENDS Sequential) 9 | 10 | if(RAJA_ENABLE_OPENMP) 11 | list(APPEND FORALL_REGION_BACKENDS OpenMP) 12 | endif() 13 | 14 | 15 | # 16 | # Generate tests for each enabled RAJA back-end. 17 | # 18 | foreach( REGION_BACKEND ${FORALL_REGION_BACKENDS} ) 19 | configure_file( test-forall-region.cpp.in 20 | test-forall-region-${REGION_BACKEND}.cpp ) 21 | raja_add_test( NAME test-forall-region-${REGION_BACKEND} 22 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-forall-region-${REGION_BACKEND}.cpp ) 23 | 24 | target_include_directories(test-forall-region-${REGION_BACKEND}.exe 25 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 26 | endforeach() 27 | 28 | unset( FORALL_REGION_BACKENDS ) 29 | -------------------------------------------------------------------------------- /test/include/RAJA_test-atomic-types.hpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | // 9 | // Type list for testing RAJA atomics. 10 | // 11 | // Note that in the type lists, a subset of types is used by default. 12 | // For more comprehensive type testing define the macro RAJA_TEST_EXHAUSTIVE. 13 | // 14 | 15 | #ifndef __RAJA_test_atomic_types_HPP__ 16 | #define __RAJA_test_atomic_types_HPP__ 17 | 18 | #include "RAJA/RAJA.hpp" 19 | #include "camp/list.hpp" 20 | 21 | // 22 | // Atomic data types 23 | // 24 | using AtomicDataTypeList = 25 | camp::list< RAJA::Index_type, 26 | int, 27 | #if defined(RAJA_TEST_EXHAUSTIVE) 28 | unsigned int, 29 | long long, 30 | unsigned long long, 31 | float, 32 | #endif 33 | double >; 34 | 35 | #endif // __RAJA_test_atomic_types_HPP__ 36 | -------------------------------------------------------------------------------- /test/functional/launch/tile_icount_tcount_direct_unchecked/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-24, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # Generate tests for each enabled RAJA back-end. 10 | # 11 | # 12 | 13 | foreach( BACKEND ${LAUNCH_DIRECT_UNCHECKED_BACKENDS} ) 14 | configure_file( test-launch-nested-tile-icount-tcount-direct-unchecked.cpp.in 15 | test-launch-nested-Tile-iCount-tCount-DirectUnchecked-${BACKEND}.cpp ) 16 | raja_add_test( NAME test-launch-nested-Tile-iCount-tCount-DirectUnchecked-${BACKEND} 17 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-launch-nested-Tile-iCount-tCount-DirectUnchecked-${BACKEND}.cpp ) 18 | 19 | target_include_directories(test-launch-nested-Tile-iCount-tCount-DirectUnchecked-${BACKEND}.exe 20 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 21 | endforeach() 22 | 23 | -------------------------------------------------------------------------------- /test/unit/indexing/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(INDEXING_BACKENDS "") 9 | 10 | if(RAJA_ENABLE_CUDA) 11 | list(APPEND INDEXING_BACKENDS Cuda) 12 | endif() 13 | 14 | if(RAJA_ENABLE_HIP) 15 | list(APPEND INDEXING_BACKENDS Hip) 16 | endif() 17 | 18 | # 19 | # Generate tests for each enabled RAJA back-end. 20 | # 21 | foreach( INDEXING_BACKEND ${INDEXING_BACKENDS} ) 22 | configure_file( test-indexing-global.cpp.in 23 | test-indexing-global-${INDEXING_BACKEND}.cpp ) 24 | raja_add_test( NAME test-indexing-global-${INDEXING_BACKEND} 25 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-indexing-global-${INDEXING_BACKEND}.cpp ) 26 | 27 | target_include_directories(test-indexing-global-${INDEXING_BACKEND}.exe 28 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 29 | endforeach() 30 | -------------------------------------------------------------------------------- /include/RAJA/policy/openmp/params/kernel_name.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENMP_KERNELNAME_HPP 2 | #define OPENMP_KERNELNAME_HPP 3 | 4 | #include "RAJA/pattern/params/kernel_name.hpp" 5 | 6 | namespace RAJA 7 | { 8 | namespace expt 9 | { 10 | namespace detail 11 | { 12 | 13 | #if defined(RAJA_ENABLE_OPENMP) 14 | 15 | // Init 16 | template 17 | camp::concepts::enable_if> 18 | param_init(EXEC_POL const&, RAJA::detail::Name&) 19 | { 20 | // TODO: Define kernel naming 21 | } 22 | 23 | // Combine 24 | template 25 | camp::concepts::enable_if> 26 | param_combine(EXEC_POL const&, 27 | RAJA::detail::Name&, 28 | T& /*place holder argument*/) 29 | {} 30 | 31 | // Resolve 32 | template 33 | camp::concepts::enable_if> 34 | param_resolve(EXEC_POL const&, RAJA::detail::Name&) 35 | { 36 | // TODO: Define kernel naming 37 | } 38 | 39 | #endif 40 | 41 | } // namespace detail 42 | } // namespace expt 43 | } // namespace RAJA 44 | 45 | 46 | #endif // NEW_REDUCE_SEQ_REDUCE_HPP 47 | -------------------------------------------------------------------------------- /include/RAJA/policy/openmp/synchronize.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file for OpenMP synchronization. 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | #ifndef RAJA_synchronize_openmp_HPP 19 | #define RAJA_synchronize_openmp_HPP 20 | 21 | namespace RAJA 22 | { 23 | 24 | namespace policy 25 | { 26 | 27 | namespace omp 28 | { 29 | 30 | /*! 31 | * \brief Synchronize all OpenMP threads and tasks. 32 | */ 33 | RAJA_INLINE 34 | void synchronize_impl(const omp_synchronize&) 35 | { 36 | #pragma omp barrier 37 | } 38 | 39 | 40 | } // end of namespace omp 41 | } // namespace policy 42 | } // end of namespace RAJA 43 | 44 | #endif // RAJA_synchronize_openmp_HPP 45 | -------------------------------------------------------------------------------- /host-configs/lc-builds/toss4/nvcc_gcc_X.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_GNU" CACHE STRING "") 9 | 10 | set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -finline-functions" CACHE STRING "") 11 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Ofast -g -finline-functions" CACHE STRING "") 12 | set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "") 13 | 14 | set(HOST_OPT_FLAGS "-Xcompiler -O3 -Xcompiler -finline-functions ") 15 | 16 | if(ENABLE_OPENMP) 17 | set(HOST_OPT_FLAGS "${HOST_OPT_FLAGS} -Xcompiler -fopenmp") 18 | endif() 19 | 20 | set(CMAKE_CUDA_FLAGS_RELEASE "-O3 ${HOST_OPT_FLAGS}" CACHE STRING "") 21 | set(CMAKE_CUDA_FLAGS_DEBUG "-g -G -O0" CACHE STRING "") 22 | set(CMAKE_CUDA_FLAGS_RELWITHDEBINFO "-g -lineinfo -O3 ${HOST_OPT_FLAGS}" CACHE STRING "") 23 | 24 | set(RAJA_DATA_ALIGN 64 CACHE STRING "") 25 | 26 | set(RAJA_HOST_CONFIG_LOADED On CACHE BOOL "") 27 | -------------------------------------------------------------------------------- /docs/Licenses/rocprim-license.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /examples/kernel-dynamic-tile.cpp: -------------------------------------------------------------------------------- 1 | #include "RAJA/RAJA.hpp" 2 | 3 | int main(int RAJA_UNUSED_ARG(argc), char **RAJA_UNUSED_ARG(argv[])) 4 | { 5 | std::cout << "\n\nRAJA dynamic_tile example...\n\n"; 6 | 7 | //Using policy = KernelPolicy, seq_exec, …>>; 8 | //RAJA::kernel_param( 9 | // make_tuple(RangeSegment(0,N)), 10 | // make_tuple(32), // param 0 is referenced by tile_dynamic 11 | // [=](int i, int tile_size){ 12 | // 13 | // }); 14 | 15 | using namespace RAJA; 16 | 17 | kernel_param< 18 | KernelPolicy< 19 | statement::Tile<1, tile_dynamic<1>, seq_exec, 20 | statement::Tile<0, tile_dynamic<0>, seq_exec, 21 | statement::For<1, seq_exec, 22 | statement::For<0, seq_exec, statement::Lambda<0>> 23 | > 24 | > 25 | > 26 | > 27 | >(make_tuple(RangeSegment{0,25}, RangeSegment{0,25}), 28 | make_tuple(TileSize{5}, TileSize{10}), 29 | //make_tuple(TileSize(10)), // not sure we need this, good for static_assert 30 | [=](int i, int j, TileSize x, TileSize y){ 31 | std::cout << "Running index (" << i << "," << j << ") of " << x.size << "x" << y.size << " tile." << std::endl; 32 | }); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /host-configs/ubuntu-builds/nvcc_gcc_X.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_GNU" CACHE STRING "") 9 | 10 | set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -finline-functions" CACHE STRING "") 11 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Ofast -g -finline-functions" CACHE STRING "") 12 | set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "") 13 | 14 | set(HOST_OPT_FLAGS "-Xcompiler -O3 -Xcompiler -finline-functions -Xcompiler -fopenmp") 15 | 16 | set(CMAKE_CUDA_FLAGS_RELEASE "-O3 ${HOST_OPT_FLAGS}" CACHE STRING "") 17 | set(CMAKE_CUDA_FLAGS_DEBUG "-g -G -O0" CACHE STRING "") 18 | set(CMAKE_CUDA_FLAGS_RELWITHDEBINFO "-g -lineinfo -O3 ${HOST_OPT_FLAGS}" CACHE STRING "") 19 | 20 | set(RAJA_RANGE_ALIGN 4 CACHE STRING "") 21 | set(RAJA_RANGE_MIN_LENGTH 32 CACHE STRING "") 22 | set(RAJA_DATA_ALIGN 64 CACHE STRING "") 23 | 24 | set(RAJA_HOST_CONFIG_LOADED On CACHE BOOL "") 25 | -------------------------------------------------------------------------------- /test/functional/launch/nested_loop/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # List of segment types for generating test files. 10 | # 11 | set(NESTEDTYPES Loop) 12 | 13 | # 14 | # Generate tests for each enabled RAJA back-end. 15 | # 16 | # 17 | 18 | foreach( BACKEND ${LAUNCH_BACKENDS} ) 19 | foreach( NESTEDTYPES ${NESTEDTYPES} ) 20 | configure_file( test-launch-nested.cpp.in 21 | test-launch-nested-${NESTEDTYPES}-${BACKEND}.cpp ) 22 | raja_add_test( NAME test-launch-nested-${NESTEDTYPES}-${BACKEND} 23 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-launch-nested-${NESTEDTYPES}-${BACKEND}.cpp ) 24 | 25 | target_include_directories(test-launch-nested-${NESTEDTYPES}-${BACKEND}.exe 26 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 27 | endforeach() 28 | endforeach() 29 | 30 | unset( NESTEDTYPES ) 31 | -------------------------------------------------------------------------------- /host-configs/lc-builds/toss4/icpx_X.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_ICC" CACHE STRING "") 9 | 10 | ##set(COMMON_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-10.3.1") 11 | set(COMMON_OPT_FLAGS "-march=native -finline-functions -fp-model=precise") 12 | #set(COMMON_OPT_FLAGS "-march=native -finline-functions") 13 | 14 | ##set(CMAKE_CXX_FLAGS_RELEASE "${COMMON_FLAGS} -O3 ${COMMON_OPT_FLAGS}" CACHE STRING "") 15 | ##set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${COMMON_FLAGS} -O3 -g ${COMMON_OPT_FLAGS}" CACHE STRING "") 16 | ##set(CMAKE_CXX_FLAGS_DEBUG "${COMMON_FLAGS} -O0 -g" CACHE STRING "") 17 | 18 | set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${COMMON_OPT_FLAGS}" CACHE STRING "") 19 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g ${COMMON_OPT_FLAGS}" "") 20 | set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "") 21 | 22 | set(RAJA_HOST_CONFIG_LOADED On CACHE BOOL "") 23 | -------------------------------------------------------------------------------- /include/RAJA/policy/sequential/region.hpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | #ifndef RAJA_region_sequential_HPP 9 | #define RAJA_region_sequential_HPP 10 | 11 | namespace RAJA 12 | { 13 | namespace policy 14 | { 15 | namespace sequential 16 | { 17 | 18 | /*! 19 | * \brief RAJA::region implementation for sequential 20 | * 21 | * Generates sequential region 22 | * 23 | * \code 24 | * 25 | * RAJA::region([=](){ 26 | * 27 | * // region body - may contain multiple loops 28 | * 29 | * }); 30 | * 31 | * \endcode 32 | * 33 | * \tparam Policy region policy 34 | * 35 | */ 36 | 37 | template 38 | RAJA_INLINE void region_impl(const seq_region&, Func&& body) 39 | { 40 | body(); 41 | } 42 | 43 | } // namespace sequential 44 | 45 | } // namespace policy 46 | 47 | } // namespace RAJA 48 | 49 | #endif // closing endif for header file include guard 50 | -------------------------------------------------------------------------------- /reproducers/openmp-target/reproducer-openmptarget-issue3.cpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | /* 9 | * Reproducer for compile error when using random number generators 10 | * 11 | * Compile lines that error 12 | * 13 | * /usr/tce/packages/clang/clang-10.0.1-gcc-8.3.1/bin/clang++ -std=c++14 -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -o reproducer-openmptarget-issue3.cpp.o -c reproducer-openmptarget-issue3.cpp 14 | * 15 | * /usr/tce/packages/clang/clang-10.0.1/bin/clang++ -std=c++14 -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -o reproducer-openmptarget-issue3.cpp.o -c reproducer-openmptarget-issue3.cpp 16 | */ 17 | 18 | #include 19 | 20 | int main(int, char **) 21 | { 22 | std::default_random_engine gen; 23 | std::uniform_real_distribution dist(0.0, 1.0); 24 | 25 | double dval = dist(gen); 26 | 27 | return (dval > 1.0 || dval < 0.0) ? 1 : 0; 28 | } 29 | -------------------------------------------------------------------------------- /test/functional/dynamic_forall/resource-segment/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # List of segment types for generating test files. 10 | # 11 | set(SEGTYPE RangeSegment) 12 | 13 | foreach( BACKEND ${DYNAMIC_BACKENDS} ) 14 | foreach( TESTTYPE ${SEGTYPE} ) 15 | configure_file( test-dynamic-forall-resource-segments.cpp.in 16 | test-dynamic-forall-resource-segments-${SEGTYPE}-${BACKEND}.cpp ) 17 | raja_add_test( NAME test-dynamic-forall-resource-segments-${SEGTYPE}-${BACKEND} 18 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-dynamic-forall-resource-segments-${SEGTYPE}-${BACKEND}.cpp ) 19 | 20 | target_include_directories(test-dynamic-forall-resource-segments-${SEGTYPE}-${BACKEND}.exe 21 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 22 | endforeach() 23 | endforeach() 24 | 25 | unset( SEGTYPE ) 26 | -------------------------------------------------------------------------------- /test/functional/launch/nested_direct/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # List of segment types for generating test files. 10 | # 11 | set(NESTEDTYPES Direct) 12 | 13 | # 14 | # Generate tests for each enabled RAJA back-end. 15 | # 16 | # 17 | 18 | foreach( BACKEND ${LAUNCH_BACKENDS} ) 19 | foreach( NESTEDTYPES ${NESTEDTYPES} ) 20 | configure_file( test-launch-nested.cpp.in 21 | test-launch-nested-${NESTEDTYPES}-${BACKEND}.cpp ) 22 | raja_add_test( NAME test-launch-nested-${NESTEDTYPES}-${BACKEND} 23 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-launch-nested-${NESTEDTYPES}-${BACKEND}.cpp ) 24 | 25 | target_include_directories(test-launch-nested-${NESTEDTYPES}-${BACKEND}.exe 26 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 27 | endforeach() 28 | endforeach() 29 | 30 | unset( NESTEDTYPES ) 31 | -------------------------------------------------------------------------------- /include/RAJA/policy/simd.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file containing RAJA headers for SIMD segment execution. 7 | * 8 | * These methods work on all platforms. 9 | * 10 | ****************************************************************************** 11 | */ 12 | 13 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 14 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 15 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 16 | // 17 | // SPDX-License-Identifier: (BSD-3-Clause) 18 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 19 | 20 | #ifndef RAJA_simd_HPP 21 | #define RAJA_simd_HPP 22 | 23 | #include "RAJA/policy/simd/forall.hpp" 24 | #include "RAJA/policy/simd/policy.hpp" 25 | #include "RAJA/policy/sequential/launch.hpp" 26 | #include "RAJA/policy/simd/kernel/For.hpp" 27 | #include "RAJA/policy/simd/kernel/ForICount.hpp" 28 | #include "RAJA/policy/simd/params/reduce.hpp" 29 | #include "RAJA/policy/simd/params/kernel_name.hpp" 30 | 31 | #endif // closing endif for header file include guard 32 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Additional BSD Notice 2 | 3 | 1. This notice is required to be provided under our contract with the U.S. 4 | Department of Energy (DOE). This work was produced at Lawrence Livermore 5 | National Laboratory under Contract No. DE-AC52-07NA27344 with the DOE. 6 | 7 | 2. Neither the United States Government nor Lawrence Livermore National 8 | Security, LLC nor any of their employees, makes any warranty, express or 9 | implied, or assumes any liability or responsibility for the accuracy, 10 | completeness, or usefulness of any information, apparatus, product, or process 11 | disclosed, or represents that its use would not infringe privately-owned rights. 12 | 13 | 3. Also, reference herein to any specific commercial products, process, or 14 | services by trade name, trademark, manufacturer or otherwise does not 15 | necessarily constitute or imply its endorsement, recommendation, or favoring by 16 | the United States Government or Lawrence Livermore National Security, LLC. The 17 | views and opinions of authors expressed herein do not necessarily state or 18 | reflect those of the United States Government or Lawrence Livermore National 19 | Security, LLC, and shall not be used for advertising or product endorsement 20 | purposes. 21 | -------------------------------------------------------------------------------- /host-configs/lc-builds/toss4/hip_3_X.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_CLANG" CACHE STRING "") 9 | 10 | set(CMAKE_CXX_FLAGS_RELEASE "-O2" CACHE STRING "") 11 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g" CACHE STRING "") 12 | set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "") 13 | 14 | set(HIP_COMMON_OPT_FLAGS ) 15 | set(HIP_COMMON_DEBUG_FLAGS) 16 | set(HOST_OPT_FLAGS) 17 | 18 | if(CMAKE_BUILD_TYPE MATCHES Release) 19 | set(RAJA_HIPCC_FLAGS "-fPIC -O2 ${HIP_COMMON_OPT_FLAGS} ${HOST_OPT_FLAGS}" CACHE STRING "") 20 | elseif(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo) 21 | set(RAJA_HIPCC_FLAGS "-fPIC -g -O2 ${HIP_COMMON_OPT_FLAGS} ${HOST_OPT_FLAGS}" CACHE STRING "") 22 | elseif(CMAKE_BUILD_TYPE MATCHES Debug) 23 | set(RAJA_HIPCC_FLAGS "-fPIC -g -O0 ${HIP_COMMON_DEBUG_FLAGS}" CACHE STRING "") 24 | endif() 25 | 26 | set(RAJA_HOST_CONFIG_LOADED On CACHE BOOL "") 27 | -------------------------------------------------------------------------------- /scripts/alcf-builds/dpcpp.cuda.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## 4 | ## Copyright (c) 2017-19, Lawrence Livermore National Security, LLC. 5 | ## 6 | ## Produced at the Lawrence Livermore National Laboratory. 7 | ## 8 | ## LLNL-CODE-738930 9 | ## 10 | ## All rights reserved. 11 | ## 12 | ## This file is part of the RAJA Performance Suite. 13 | ## 14 | ## For details about use and distribution, please read RAJAPerf/LICENSE. 15 | ## 16 | 17 | BUILD_SUFFIX=sycl 18 | : ${BUILD_TYPE:=RelWithDebInfo} 19 | RAJA_HOSTCONFIG=../host-configs/alcf-builds/dpcpp.cuda.cmake 20 | 21 | rm -rf build_${BUILD_SUFFIX}_${USER} >/dev/null 22 | mkdir build_${BUILD_SUFFIX}_${USER} && cd build_${BUILD_SUFFIX}_${USER} 23 | 24 | DATE=$(printf '%(%Y-%m-%d)T\n' -1) 25 | 26 | ## NOTE: RAJA tests are turned off due to compilation issues. 27 | 28 | cmake \ 29 | -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ 30 | -C ${RAJA_HOSTCONFIG} \ 31 | -DENABLE_OPENMP=Off \ 32 | -DENABLE_CUDA=Off \ 33 | -DRAJA_ENABLE_TARGET_OPENMP=Off \ 34 | -DENABLE_ALL_WARNINGS=Off \ 35 | -DRAJA_ENABLE_SYCL=On \ 36 | -DCMAKE_LINKER=clang++ \ 37 | -DCMAKE_CXX_STANDARD=17 \ 38 | -DENABLE_TESTS=Off \ 39 | -DENABLE_EXAMPLES=On \ 40 | "$@" \ 41 | .. 42 | 43 | make -j 8 44 | 45 | -------------------------------------------------------------------------------- /travis-data/docker/generic-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -x 4 | 5 | 6 | apt-get -qq update 7 | apt-get -qq install -y --no-install-recommends wget 8 | wget "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x60C317803A41BA51845E371A1E9377A2BA9EF27F" -O out && apt-key add out && rm out 9 | echo deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main >> /etc/apt/sources.list 10 | echo deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main >> /etc/apt/sources.list 11 | apt-get -qq update 12 | apt-get -qq install -y --no-install-recommends python-dev build-essential sudo git vim dh-autoreconf ninja-build ca-certificates libtbb-dev 13 | 14 | wget -q --no-check-certificate https://cmake.org/files/v3.10/cmake-3.10.1-Linux-x86_64.tar.gz 15 | tar -xzf cmake-3.10.1-Linux-x86_64.tar.gz 16 | cp -fR cmake-3.10.1-Linux-x86_64/* /usr 17 | rm -rf cmake-3.10.1-Linux-x86_64 18 | rm cmake-3.10.1-Linux-x86_64.tar.gz 19 | wget -q --no-check-certificate https://bootstrap.pypa.io/get-pip.py 20 | python get-pip.py 21 | rm get-pip.py 22 | pip install -q -U pip 23 | useradd -ms /bin/bash raja 24 | printf "raja:raja" | chpasswd 25 | adduser raja sudo 26 | printf "raja ALL= NOPASSWD: ALL\\n" >> /etc/sudoers 27 | -------------------------------------------------------------------------------- /travis-data/docker/hip/generic-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -x 4 | 5 | 6 | apt-get -qq update 7 | apt-get -qq install -y --no-install-recommends wget 8 | wget "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x60C317803A41BA51845E371A1E9377A2BA9EF27F" -O out && apt-key add out && rm out 9 | echo deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main >> /etc/apt/sources.list 10 | echo deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main >> /etc/apt/sources.list 11 | apt-get -qq update 12 | apt-get -qq install -y --no-install-recommends python-dev build-essential sudo git vim dh-autoreconf ninja-build ca-certificates libtbb-dev 13 | 14 | wget -q --no-check-certificate https://cmake.org/files/v3.10/cmake-3.10.1-Linux-x86_64.tar.gz 15 | tar -xzf cmake-3.10.1-Linux-x86_64.tar.gz 16 | cp -fR cmake-3.10.1-Linux-x86_64/* /usr 17 | rm -rf cmake-3.10.1-Linux-x86_64 18 | rm cmake-3.10.1-Linux-x86_64.tar.gz 19 | wget -q --no-check-certificate https://bootstrap.pypa.io/get-pip.py 20 | python get-pip.py 21 | rm get-pip.py 22 | pip install -q -U pip 23 | useradd -ms /bin/bash raja 24 | printf "raja:raja" | chpasswd 25 | adduser raja sudo 26 | printf "raja ALL= NOPASSWD: ALL\\n" >> /etc/sudoers 27 | -------------------------------------------------------------------------------- /host-configs/lc-builds/toss4/nvcc_clang_X.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_CLANG" CACHE STRING "") 9 | 10 | set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -funroll-loops -finline-functions" CACHE STRING "") 11 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -march=native -funroll-loops -finline-functions" CACHE STRING "") 12 | set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "") 13 | 14 | set(HOST_OPT_FLAGS "-Xcompiler -O3 ") 15 | 16 | if(ENABLE_OPENMP) 17 | set(HOST_OPT_FLAGS "${HOST_OPT_FLAGS} -Xcompiler -fopenmp") 18 | endif() 19 | 20 | set(CMAKE_CUDA_FLAGS_RELEASE "-O3 ${HOST_OPT_FLAGS}" CACHE STRING "") 21 | set(CMAKE_CUDA_FLAGS_DEBUG "-g -G -O0" CACHE STRING "") 22 | set(CMAKE_CUDA_FLAGS_RELWITHDEBINFO "-g -lineinfo -O3 ${HOST_OPT_FLAGS}" CACHE STRING "") 23 | 24 | set(RAJA_DATA_ALIGN 64 CACHE STRING "") 25 | 26 | set(RAJA_HOST_CONFIG_LOADED On CACHE BOOL "") 27 | -------------------------------------------------------------------------------- /test/unit/workgroup/test-workgroup-WorkStorage.cpp.in: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | /// 9 | /// Source file containing tests for RAJA workgroup workstorage. 10 | /// 11 | 12 | #include "test-workgroup-WorkStorage-@SUBTESTNAME@.hpp" 13 | 14 | using @BACKEND@BasicWorkGroupWorkStorage@SUBTESTNAME@Types = 15 | Test< camp::cartesian_product< @BACKEND@StoragePolicyList, 16 | @DISPATCHER@DispatchTyperList, 17 | WorkStorageAllocatorList > >::Types; 18 | 19 | REGISTER_TYPED_TEST_SUITE_P(WorkGroupBasicWorkStorage@SUBTESTNAME@UnitTest, 20 | BasicWorkGroupWorkStorage@SUBTESTNAME@); 21 | 22 | INSTANTIATE_TYPED_TEST_SUITE_P(@BACKEND@BasicTest, 23 | WorkGroupBasicWorkStorage@SUBTESTNAME@UnitTest, 24 | @BACKEND@BasicWorkGroupWorkStorage@SUBTESTNAME@Types); 25 | -------------------------------------------------------------------------------- /travis-data/docker/icc16/generic-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -x 4 | 5 | 6 | apt-get -qq update 7 | apt-get -qq install -y --no-install-recommends wget 8 | wget "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x60C317803A41BA51845E371A1E9377A2BA9EF27F" -O out && apt-key add out && rm out 9 | echo deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main >> /etc/apt/sources.list 10 | echo deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main >> /etc/apt/sources.list 11 | apt-get -qq update 12 | apt-get -qq install -y --no-install-recommends python-dev build-essential sudo git vim dh-autoreconf ninja-build ca-certificates libtbb-dev 13 | 14 | wget -q --no-check-certificate https://cmake.org/files/v3.10/cmake-3.10.1-Linux-x86_64.tar.gz 15 | tar -xzf cmake-3.10.1-Linux-x86_64.tar.gz 16 | cp -fR cmake-3.10.1-Linux-x86_64/* /usr 17 | rm -rf cmake-3.10.1-Linux-x86_64 18 | rm cmake-3.10.1-Linux-x86_64.tar.gz 19 | wget -q --no-check-certificate https://bootstrap.pypa.io/get-pip.py 20 | python get-pip.py 21 | rm get-pip.py 22 | pip install -q -U pip 23 | useradd -ms /bin/bash raja 24 | printf "raja:raja" | chpasswd 25 | adduser raja sudo 26 | printf "raja ALL= NOPASSWD: ALL\\n" >> /etc/sudoers 27 | -------------------------------------------------------------------------------- /travis-data/docker/nvcc8/generic-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -x 4 | 5 | 6 | apt-get -qq update 7 | apt-get -qq install -y --no-install-recommends wget 8 | wget "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x60C317803A41BA51845E371A1E9377A2BA9EF27F" -O out && apt-key add out && rm out 9 | echo deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main >> /etc/apt/sources.list 10 | echo deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main >> /etc/apt/sources.list 11 | apt-get -qq update 12 | apt-get -qq install -y --no-install-recommends python-dev build-essential sudo git vim dh-autoreconf ninja-build ca-certificates libtbb-dev 13 | 14 | wget -q --no-check-certificate https://cmake.org/files/v3.10/cmake-3.10.1-Linux-x86_64.tar.gz 15 | tar -xzf cmake-3.10.1-Linux-x86_64.tar.gz 16 | cp -fR cmake-3.10.1-Linux-x86_64/* /usr 17 | rm -rf cmake-3.10.1-Linux-x86_64 18 | rm cmake-3.10.1-Linux-x86_64.tar.gz 19 | wget -q --no-check-certificate https://bootstrap.pypa.io/get-pip.py 20 | python get-pip.py 21 | rm get-pip.py 22 | pip install -q -U pip 23 | useradd -ms /bin/bash raja 24 | printf "raja:raja" | chpasswd 25 | adduser raja sudo 26 | printf "raja ALL= NOPASSWD: ALL\\n" >> /etc/sudoers 27 | -------------------------------------------------------------------------------- /travis-data/docker/nvcc9/generic-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -x 4 | 5 | 6 | apt-get -qq update 7 | apt-get -qq install -y --no-install-recommends wget 8 | wget "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x60C317803A41BA51845E371A1E9377A2BA9EF27F" -O out && apt-key add out && rm out 9 | echo deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main >> /etc/apt/sources.list 10 | echo deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main >> /etc/apt/sources.list 11 | apt-get -qq update 12 | apt-get -qq install -y --no-install-recommends python-dev build-essential sudo git vim dh-autoreconf ninja-build ca-certificates libtbb-dev 13 | 14 | wget -q --no-check-certificate https://cmake.org/files/v3.10/cmake-3.10.1-Linux-x86_64.tar.gz 15 | tar -xzf cmake-3.10.1-Linux-x86_64.tar.gz 16 | cp -fR cmake-3.10.1-Linux-x86_64/* /usr 17 | rm -rf cmake-3.10.1-Linux-x86_64 18 | rm cmake-3.10.1-Linux-x86_64.tar.gz 19 | wget -q --no-check-certificate https://bootstrap.pypa.io/get-pip.py 20 | python get-pip.py 21 | rm get-pip.py 22 | pip install -q -U pip 23 | useradd -ms /bin/bash raja 24 | printf "raja:raja" | chpasswd 25 | adduser raja sudo 26 | printf "raja ALL= NOPASSWD: ALL\\n" >> /etc/sudoers 27 | -------------------------------------------------------------------------------- /include/RAJA/policy/openmp_target/params/kernel_name.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENMP_TARGET_KERNELNAME_HPP 2 | #define OPENMP_TARGET_KERNELNAME_HPP 3 | 4 | #include "RAJA/pattern/params/kernel_name.hpp" 5 | 6 | namespace RAJA 7 | { 8 | namespace expt 9 | { 10 | namespace detail 11 | { 12 | 13 | #if defined(RAJA_ENABLE_TARGET_OPENMP) 14 | 15 | // Init 16 | template 17 | camp::concepts::enable_if> 18 | param_init(EXEC_POL const&, RAJA::detail::Name&) 19 | { 20 | // TODO: Define kernel naming 21 | } 22 | 23 | // Combine 24 | template 25 | camp::concepts::enable_if> 26 | param_combine(EXEC_POL const&, 27 | RAJA::detail::Name&, 28 | T& /*place holder argument*/) 29 | {} 30 | 31 | // Resolve 32 | template 33 | camp::concepts::enable_if> 34 | param_resolve(EXEC_POL const&, RAJA::detail::Name&) 35 | { 36 | // TODO: Define kernel naming 37 | } 38 | 39 | #endif 40 | 41 | } // namespace detail 42 | } // namespace expt 43 | } // namespace RAJA 44 | 45 | 46 | #endif // NEW_REDUCE_SEQ_REDUCE_HPP 47 | -------------------------------------------------------------------------------- /scripts/alcf-builds/theta_intel18.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 5 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 6 | # 7 | # SPDX-License-Identifier: (BSD-3-Clause) 8 | ############################################################################### 9 | 10 | ## 11 | ## Execute these commands before running this script to build RAJA. 12 | ## 13 | ## First grab a node to compile and run your code: 14 | ## 15 | ## > qsub -I -n 1 -A -t <# minutes> -q debug-cache-quad 16 | ## 17 | ## Then set up your build environment. 18 | ## 19 | ## module load intel/18.0.0.128 20 | ## module load cmake/3.9.1 21 | ## 22 | ## Example of running an executable: 23 | ## 24 | ## "aprun ./main" 25 | 26 | BUILD_SUFFIX=alcf-theta-intel18.0 27 | 28 | rm -rf build_${BUILD_SUFFIX} 2>/dev/null 29 | mkdir build_${BUILD_SUFFIX} && cd build_${BUILD_SUFFIX} 30 | 31 | cmake \ 32 | -DCMAKE_BUILD_TYPE=Release \ 33 | -C ../host-configs/alcf-builds/theta_intel18_0.cmake \ 34 | -DENABLE_OPENMP=On \ 35 | -DCMAKE_INSTALL_PREFIX=../install_${BUILD_SUFFIX} \ 36 | "$@" \ 37 | .. 38 | -------------------------------------------------------------------------------- /test/functional/launch/segment/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # List of segment types for generating test files. 10 | # 11 | set(SEGTYPES ListSegment RangeSegment RangeStrideSegment) 12 | 13 | 14 | # 15 | # Generate tests for each enabled RAJA back-end. 16 | # 17 | # 18 | 19 | foreach( BACKEND ${LAUNCH_BACKENDS} ) 20 | foreach( SEGTYPES ${SEGTYPES} ) 21 | configure_file( test-launch-segment.cpp.in 22 | test-launch-segment-${SEGTYPES}-${BACKEND}.cpp ) 23 | raja_add_test( NAME test-launch-segment-${SEGTYPES}-${BACKEND} 24 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-launch-segment-${SEGTYPES}-${BACKEND}.cpp ) 25 | 26 | target_include_directories(test-launch-segment-${SEGTYPES}-${BACKEND}.exe 27 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 28 | endforeach() 29 | endforeach() 30 | 31 | unset( SEGTYPES ) 32 | -------------------------------------------------------------------------------- /travis-data/docker/ubuntu-clang-base/generic-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -x 4 | 5 | 6 | apt-get -qq update 7 | apt-get -qq install -y --no-install-recommends wget 8 | wget "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x60C317803A41BA51845E371A1E9377A2BA9EF27F" -O out && apt-key add out && rm out 9 | echo deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main >> /etc/apt/sources.list 10 | echo deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main >> /etc/apt/sources.list 11 | apt-get -qq update 12 | apt-get -qq install -y --no-install-recommends python-dev build-essential sudo git vim dh-autoreconf ninja-build ca-certificates libtbb-dev 13 | 14 | wget -q --no-check-certificate https://cmake.org/files/v3.10/cmake-3.10.1-Linux-x86_64.tar.gz 15 | tar -xzf cmake-3.10.1-Linux-x86_64.tar.gz 16 | cp -fR cmake-3.10.1-Linux-x86_64/* /usr 17 | rm -rf cmake-3.10.1-Linux-x86_64 18 | rm cmake-3.10.1-Linux-x86_64.tar.gz 19 | wget -q --no-check-certificate https://bootstrap.pypa.io/get-pip.py 20 | python get-pip.py 21 | rm get-pip.py 22 | pip install -q -U pip 23 | useradd -ms /bin/bash raja 24 | printf "raja:raja" | chpasswd 25 | adduser raja sudo 26 | printf "raja ALL= NOPASSWD: ALL\\n" >> /etc/sudoers 27 | -------------------------------------------------------------------------------- /host-configs/alcf-builds/theta_intel18_0.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | set(RAJA_COMPILER "RAJA_COMPILER_ICC" CACHE STRING "") 9 | 10 | set (CMAKE_CXX_STANDARD 11) 11 | 12 | set(CMAKE_CXX_COMPILER "/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/icpc" CACHE PATH "") 13 | set(CMAKE_C_COMPILER "/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/icc" CACHE PATH "") 14 | 15 | set(CMAKE_CXX_FLAGS_RELEASE "${COMMON_FLAGS} -O3 -unroll-aggressive -finline-functions -xMIC-AVX512" CACHE STRING "") 16 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${COMMON_FLAGS} -O3 -g -unroll-aggressive -finline-functions -xMIC-AVX512" CACHE STRING "") 17 | set(CMAKE_CXX_FLAGS_DEBUG "${COMMON_FLAGS} -O0 -g" CACHE STRING "") 18 | 19 | set(RAJA_RANGE_ALIGN 4 CACHE INT "") 20 | set(RAJA_RANGE_MIN_LENGTH 32 CACHE INT "") 21 | set(RAJA_DATA_ALIGN 64 CACHE INT "") 22 | 23 | set(RAJA_HOST_CONFIG_LOADED On CACHE Bool "") 24 | -------------------------------------------------------------------------------- /include/RAJA/policy/sequential/thread.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief RAJA header file defining sequential thread operations. 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | #ifndef RAJA_policy_sequential_thread_HPP 19 | #define RAJA_policy_sequential_thread_HPP 20 | 21 | #include "RAJA/config.hpp" 22 | 23 | #include "RAJA/util/macros.hpp" 24 | 25 | #include "RAJA/policy/thread_auto.hpp" 26 | 27 | namespace RAJA 28 | { 29 | template<> 30 | RAJA_HOST_DEVICE RAJA_INLINE int get_max_threads(seq_thread) 31 | { 32 | return 1; 33 | } 34 | 35 | template<> 36 | RAJA_HOST_DEVICE RAJA_INLINE int get_thread_num(seq_thread) 37 | { 38 | return 0; 39 | } 40 | 41 | } // namespace RAJA 42 | 43 | 44 | #endif // guard 45 | -------------------------------------------------------------------------------- /scripts/ubuntu-builds/ubuntu_gcc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 5 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 6 | # 7 | # SPDX-License-Identifier: (BSD-3-Clause) 8 | ############################################################################### 9 | 10 | if [ "$1" == "" ]; then 11 | echo 12 | echo "You must pass a compiler version number to script. For example," 13 | echo " ubuntu_gcc.sh 8" 14 | exit 15 | fi 16 | 17 | COMP_VER=$1 18 | shift 1 19 | 20 | BUILD_SUFFIX=ubuntu-gcc-${COMP_VER} 21 | 22 | echo 23 | echo "Creating build directory ${BUILD_SUFFIX} and generating configuration in it" 24 | echo 25 | 26 | rm -rf build_${BUILD_SUFFIX} 2>/dev/null 27 | mkdir build_${BUILD_SUFFIX} && cd build_${BUILD_SUFFIX} 28 | 29 | cmake \ 30 | -DCMAKE_BUILD_TYPE=Release \ 31 | -DCMAKE_C_COMPILER=/usr/bin/gcc-${COMP_VER} \ 32 | -DCMAKE_CXX_COMPILER=/usr/bin/g++-${COMP_VER} \ 33 | -DBLT_CXX_STD=c++17 \ 34 | -C ../host-configs/ubuntu-builds/gcc_X.cmake \ 35 | -DENABLE_OPENMP=On \ 36 | -DCMAKE_INSTALL_PREFIX=../install_${BUILD_SUFFIX} \ 37 | "$@" \ 38 | .. 39 | -------------------------------------------------------------------------------- /test/functional/forall/segment/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # List of segment types for generating test files. 10 | # 11 | set(SEGTYPES ListSegment RangeSegment RangeStrideSegment) 12 | 13 | # 14 | # Generate tests for each enabled RAJA back-end. 15 | # 16 | # Note: FORALL_BACKENDS is defined in ../CMakeLists.txt 17 | # 18 | foreach( BACKEND ${FORALL_BACKENDS} ) 19 | foreach( SEGTYPE ${SEGTYPES} ) 20 | configure_file( test-forall-segment.cpp.in 21 | test-forall-${SEGTYPE}-${BACKEND}.cpp ) 22 | raja_add_test( NAME test-forall-${SEGTYPE}-${BACKEND} 23 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-forall-${SEGTYPE}-${BACKEND}.cpp ) 24 | 25 | target_include_directories(test-forall-${SEGTYPE}-${BACKEND}.exe 26 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 27 | endforeach() 28 | endforeach() 29 | 30 | unset( SEGTYPES ) 31 | -------------------------------------------------------------------------------- /test/functional/kernel/nested-loop-segment-types/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # Generate tests for each enabled RAJA back-end. 10 | # 11 | # Note: KERNEL_BACKENDS is defined in ../CMakeLists.txt 12 | # 13 | 14 | # 15 | # Eventually, enable SYCL tests when we know they work 16 | # 17 | if(RAJA_ENABLE_SYCL) 18 | list(REMOVE_ITEM KERNEL_BACKENDS Sycl) 19 | endif() 20 | 21 | foreach( BACKEND ${KERNEL_BACKENDS} ) 22 | configure_file( test-kernel-nested-loop-segments.cpp.in 23 | test-kernel-nested-loop-segments-${BACKEND}.cpp ) 24 | raja_add_test( NAME test-kernel-nested-loop-segments-${BACKEND} 25 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-kernel-nested-loop-segments-${BACKEND}.cpp ) 26 | 27 | target_include_directories(test-kernel-nested-loop-segments-${BACKEND}.exe 28 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 29 | endforeach() 30 | -------------------------------------------------------------------------------- /test/functional/launch/nested_direct_unchecked/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-24, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # List of segment types for generating test files. 10 | # 11 | set(NESTEDTYPES DirectUnchecked) 12 | 13 | # 14 | # Generate tests for each enabled RAJA back-end. 15 | # 16 | # 17 | 18 | foreach( BACKEND ${LAUNCH_DIRECT_UNCHECKED_BACKENDS} ) 19 | foreach( NESTEDTYPES ${NESTEDTYPES} ) 20 | configure_file( test-launch-nested.cpp.in 21 | test-launch-nested-${NESTEDTYPES}-${BACKEND}.cpp ) 22 | raja_add_test( NAME test-launch-nested-${NESTEDTYPES}-${BACKEND} 23 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-launch-nested-${NESTEDTYPES}-${BACKEND}.cpp ) 24 | 25 | target_include_directories(test-launch-nested-${NESTEDTYPES}-${BACKEND}.exe 26 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 27 | endforeach() 28 | endforeach() 29 | 30 | unset( NESTEDTYPES ) 31 | -------------------------------------------------------------------------------- /include/RAJA/pattern/kernel/Collapse.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file for kernel statement collapse struct. 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | 19 | #ifndef RAJA_pattern_kernel_Collapse_HPP 20 | #define RAJA_pattern_kernel_Collapse_HPP 21 | 22 | namespace RAJA 23 | { 24 | 25 | namespace statement 26 | { 27 | 28 | 29 | template 30 | struct Collapse : public internal::ForList, 31 | public internal::CollapseBase, 32 | public internal::Statement 33 | {}; 34 | 35 | 36 | } // namespace statement 37 | } // end namespace RAJA 38 | 39 | 40 | #endif /* RAJA_pattern_kernel_HPP */ 41 | -------------------------------------------------------------------------------- /include/RAJA/pattern/tensor/ScalarRegister.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file containing RAJA simd policy definitions. 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | #ifndef RAJA_policy_tensor_scalarregister_HPP 19 | #define RAJA_policy_tensor_scalarregister_HPP 20 | 21 | #include "RAJA/config.hpp" 22 | #include "RAJA/pattern/tensor/VectorRegister.hpp" 23 | #include "RAJA/policy/tensor/arch.hpp" 24 | 25 | namespace RAJA 26 | { 27 | namespace expt 28 | { 29 | 30 | // Convenience to describe ScalarTensors 31 | template 32 | using ScalarRegister = 33 | TensorRegister>; 34 | 35 | 36 | } // namespace expt 37 | } // namespace RAJA 38 | 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /scripts/ubuntu-builds/ubuntu_clang.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 5 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 6 | # 7 | # SPDX-License-Identifier: (BSD-3-Clause) 8 | ############################################################################### 9 | 10 | if [ "$1" == "" ]; then 11 | echo 12 | echo "You must pass a compiler version number to script. For example," 13 | echo " ubuntu_clang.sh 10" 14 | exit 15 | fi 16 | 17 | COMP_VER=$1 18 | shift 1 19 | 20 | BUILD_SUFFIX=ubuntu-clang-${COMP_VER} 21 | 22 | echo 23 | echo "Creating build directory ${BUILD_SUFFIX} and generating configuration in it" 24 | echo 25 | 26 | rm -rf build_${BUILD_SUFFIX} 2>/dev/null 27 | mkdir build_${BUILD_SUFFIX} && cd build_${BUILD_SUFFIX} 28 | 29 | cmake \ 30 | -DCMAKE_BUILD_TYPE=Release \ 31 | -DCMAKE_C_COMPILER=/usr/bin/clang-${COMP_VER} \ 32 | -DCMAKE_CXX_COMPILER=/usr/bin/clang++-${COMP_VER} \ 33 | -DBLT_CXX_STD=c++17 \ 34 | -C ../host-configs/ubuntu-builds/clang_X.cmake \ 35 | -DENABLE_OPENMP=On \ 36 | -DCMAKE_INSTALL_PREFIX=../install_${BUILD_SUFFIX} \ 37 | "$@" \ 38 | .. 39 | -------------------------------------------------------------------------------- /scripts/alcf-builds/cooley_nvcc9.1_clang4.0.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 5 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 6 | # 7 | # SPDX-License-Identifier: (BSD-3-Clause) 8 | ############################################################################### 9 | 10 | ## 11 | ## Execute these commands before running this script to build RAJA. 12 | ## 13 | ## First grab a node to compile and run your code: 14 | ## 15 | ## > qsub -I -n 1 -A -t <# minutes> -q debug 16 | ## 17 | ## Then set up your build environment. 18 | ## 19 | ## > soft add +cmake-3.9.1 20 | ## > soft add +clang-4.0 21 | ## > soft add +cuda-9.1 22 | ## 23 | 24 | BUILD_SUFFIX=alcf-cooley-nvcc9.1_clang4.0 25 | 26 | rm -rf build_${BUILD_SUFFIX} 2>/dev/null 27 | mkdir build_${BUILD_SUFFIX} && cd build_${BUILD_SUFFIX} 28 | 29 | cmake \ 30 | -DCMAKE_BUILD_TYPE=Release \ 31 | -C ../host-configs/alcf-builds/cooley_nvcc_clang4_0.cmake \ 32 | -DENABLE_OPENMP=On \ 33 | -DENABLE_CUDA=On \ 34 | -DCUDA_TOOLKIT_ROOT_DIR=/soft/visualization/cuda-9.1 \ 35 | -DCMAKE_INSTALL_PREFIX=../install_${BUILD_SUFFIX} \ 36 | "$@" \ 37 | .. 38 | -------------------------------------------------------------------------------- /test/functional/tensor/vector/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | 9 | set(TENSOR_VECTOR_TESTS 10 | CtorGetSet 11 | MinMax 12 | SumDot 13 | FmaFms 14 | ForallVectorRef1d 15 | ForallVectorRef2d 16 | ) 17 | 18 | 19 | # 20 | # Generate tensor register tests for each element type, and each register policy 21 | # 22 | foreach( TENSOR_ELEMENT_TYPE ${TENSOR_ELEMENT_TYPES} ) 23 | foreach( TENSOR_VECTOR_TEST ${TENSOR_VECTOR_TESTS} ) 24 | 25 | set(TEST_NAME test-tensor-vector-${TENSOR_ELEMENT_TYPE}-${TENSOR_VECTOR_TEST}) 26 | 27 | configure_file( test-tensor-vector.cpp.in ${TEST_NAME}.cpp ) 28 | 29 | raja_add_test( NAME ${TEST_NAME} SOURCES ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}.cpp ) 30 | 31 | target_include_directories(${TEST_NAME}.exe PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 32 | 33 | unset( TEST_NAME ) 34 | 35 | endforeach() 36 | endforeach() 37 | 38 | unset( TENSOR_VECTOR_TESTS ) 39 | -------------------------------------------------------------------------------- /test/functional/launch/run-time-switch/test-launch.cpp.in: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | // 9 | // test/include headers 10 | // 11 | #include "RAJA_test-base.hpp" 12 | #include "RAJA_test-camp.hpp" 13 | 14 | #include "RAJA_test-launch-runtime-execpol.hpp" 15 | 16 | #include "RAJA_test-forall-data.hpp" 17 | 18 | // 19 | // Header for tests in ./tests directory 20 | // 21 | // Note: CMake adds ./tests as an include dir for these tests. 22 | // 23 | #include "test-launch-@TESTTYPE@.hpp" 24 | 25 | 26 | // 27 | // Cartesian product of types used in parameterized tests 28 | // 29 | using @BACKEND@LaunchTypes = 30 | Test< camp::cartesian_product<@BACKEND@ResourceList, 31 | @BACKEND@_launch_policies>>::Types; 32 | 33 | // 34 | // Instantiate parameterized test 35 | // 36 | INSTANTIATE_TYPED_TEST_SUITE_P(@BACKEND@, 37 | Launch@TESTTYPE@Test, 38 | @BACKEND@LaunchTypes); 39 | -------------------------------------------------------------------------------- /include/RAJA/util/PluginContext.hpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | #ifndef RAJA_plugin_context_HPP 9 | #define RAJA_plugin_context_HPP 10 | 11 | #include 12 | 13 | #include "RAJA/policy/PolicyBase.hpp" 14 | #include "RAJA/internal/get_platform.hpp" 15 | 16 | namespace RAJA 17 | { 18 | namespace util 19 | { 20 | 21 | class KokkosPluginLoader; 22 | 23 | struct PluginContext 24 | { 25 | public: 26 | PluginContext(const Platform p, std::string&& name) 27 | : platform(p), 28 | kernel_name(std::move(name)) 29 | {} 30 | 31 | Platform platform; 32 | std::string kernel_name; 33 | 34 | private: 35 | mutable uint64_t kID; 36 | 37 | friend class KokkosPluginLoader; 38 | }; 39 | 40 | template 41 | PluginContext make_context(std::string&& name) 42 | { 43 | return PluginContext {detail::get_platform::value, std::move(name)}; 44 | } 45 | 46 | } // namespace util 47 | } // namespace RAJA 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /test/include/RAJA_test-plugin-launchpol.hpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | // 9 | // Kernel execution policy lists used throughout plugin tests 10 | // 11 | 12 | #ifndef __RAJA_test_plugin_launchpol_HPP__ 13 | #define __RAJA_test_plugin_launchpol_HPP__ 14 | 15 | #include "RAJA/RAJA.hpp" 16 | 17 | #include "camp/list.hpp" 18 | 19 | // Sequential execution policy types 20 | using SequentialPluginLaunchExecPols = camp::list>; 21 | 22 | #if defined(RAJA_ENABLE_OPENMP) 23 | using OpenMPPluginLaunchExecPols = camp::list>; 24 | #endif 25 | 26 | #if defined(RAJA_ENABLE_CUDA) 27 | using CudaPluginLaunchExecPols = camp::list>>; 28 | #endif 29 | 30 | #if defined(RAJA_ENABLE_HIP) 31 | using HipPluginLaunchExecPols = camp::list>>; 32 | 33 | #endif 34 | 35 | #endif // __RAJA_test_plugin_kernelpol_HPP__ 36 | -------------------------------------------------------------------------------- /include/RAJA/pattern/tensor/VectorRegister.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Header file containing RAJA simd policy definitions. 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | #ifndef RAJA_policy_tensor_vectorregister_HPP 19 | #define RAJA_policy_tensor_vectorregister_HPP 20 | 21 | #include "RAJA/config.hpp" 22 | 23 | namespace RAJA 24 | { 25 | namespace expt 26 | { 27 | // Convenience to describe VectorTensors 28 | template::s_num_elem> 31 | using VectorRegister = 32 | TensorRegister>; 33 | } // namespace expt 34 | 35 | } // namespace RAJA 36 | 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /test/functional/forall/resource-segment/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # List of segment types for generating test files. 10 | # 11 | set(SEGTYPES ListSegment RangeSegment RangeStrideSegment) 12 | 13 | # 14 | # Generate tests for each enabled RAJA back-end. 15 | # 16 | # Note: FORALL_BACKENDS is defined in ../CMakeLists.txt 17 | # 18 | foreach( BACKEND ${FORALL_BACKENDS} ) 19 | foreach( SEGTYPE ${SEGTYPES} ) 20 | configure_file( test-forall-resource-segment.cpp.in 21 | test-forall-resource-${SEGTYPE}-${BACKEND}.cpp ) 22 | raja_add_test( NAME test-forall-resource-${SEGTYPE}-${BACKEND} 23 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-forall-resource-${SEGTYPE}-${BACKEND}.cpp ) 24 | 25 | target_include_directories(test-forall-resource-${SEGTYPE}-${BACKEND}.exe 26 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 27 | endforeach() 28 | endforeach() 29 | 30 | unset( SEGTYPES ) 31 | -------------------------------------------------------------------------------- /test/unit/algorithm/test-algorithm-sort.cpp.in: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | // 9 | // test/include headers 10 | // 11 | #include "RAJA_test-base.hpp" 12 | #include "RAJA_test-camp.hpp" 13 | 14 | // 15 | // Header for tests in ./tests directory 16 | // 17 | // Note: CMake adds ./tests as an include dir for these tests. 18 | // 19 | #include "test-algorithm-sort.hpp" 20 | 21 | 22 | // 23 | // Cartesian product of types used in parameterized tests 24 | // 25 | using @SORT_BACKEND@SortTypes = 26 | Test< camp::cartesian_product<@SORT_BACKEND@SortSorters, 27 | @SORT_BACKEND@ResourceList, 28 | SortKeyTypeList, 29 | SortMaxNListDefault > >::Types; 30 | 31 | // 32 | // Instantiate parameterized test 33 | // 34 | INSTANTIATE_TYPED_TEST_SUITE_P( @SORT_BACKEND@Test, 35 | SortUnitTest, 36 | @SORT_BACKEND@SortTypes ); 37 | -------------------------------------------------------------------------------- /test/functional/forall/indexset/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # List of indexset test types for generating test files. 10 | # 11 | set(INDEXSETTESTTYPES IndexSet IcountIndexSet) 12 | 13 | # 14 | # Generate tests for each enabled RAJA back-end. 15 | # 16 | # Note: FORALL_BACKENDS is defined in ../CMakeLists.txt 17 | # 18 | foreach( BACKEND ${FORALL_BACKENDS} ) 19 | foreach( INDEXSETTESTTYPE ${INDEXSETTESTTYPES} ) 20 | configure_file( test-forall-indexset.cpp.in 21 | test-forall-${INDEXSETTESTTYPE}-${BACKEND}.cpp ) 22 | raja_add_test( NAME test-forall-${INDEXSETTESTTYPE}-${BACKEND} 23 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-forall-${INDEXSETTESTTYPE}-${BACKEND}.cpp ) 24 | 25 | target_include_directories(test-forall-${INDEXSETTESTTYPE}-${BACKEND}.exe 26 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 27 | endforeach() 28 | endforeach() 29 | 30 | unset( INDEXSETTESTTYPES ) 31 | -------------------------------------------------------------------------------- /test/include/RAJA_test-dynamic-forall.hpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | // 9 | // Execution policy lists used throughout dynamic forall tests 10 | // 11 | 12 | #ifndef __RAJA_test_dynamic_execpol_HPP__ 13 | #define __RAJA_test_dynamic_execpol_HPP__ 14 | 15 | #include "RAJA/RAJA.hpp" 16 | #include "camp/list.hpp" 17 | 18 | using policy_list = camp::list 25 | ,RAJA::cuda_exec<512> 26 | #endif 27 | #if defined(RAJA_ENABLE_HIP) 28 | ,RAJA::hip_exec<256> 29 | ,RAJA::hip_exec<512> 30 | #endif 31 | >>; 32 | 33 | 34 | #endif // __RAJA_test_dynamic_execpol_HPP__ 35 | -------------------------------------------------------------------------------- /scripts/alcf-builds/sycl.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## 4 | ## Copyright (c) 2017-19, Lawrence Livermore National Security, LLC. 5 | ## 6 | ## Produced at the Lawrence Livermore National Laboratory. 7 | ## 8 | ## LLNL-CODE-738930 9 | ## 10 | ## All rights reserved. 11 | ## 12 | ## This file is part of the RAJA Performance Suite. 13 | ## 14 | ## For details about use and distribution, please read RAJAPerf/LICENSE. 15 | ## 16 | 17 | BUILD_SUFFIX=sycl 18 | : ${BUILD_TYPE:=RelWithDebInfo} 19 | RAJA_HOSTCONFIG=../host-configs/alcf-builds/sycl.cmake 20 | 21 | rm -rf build_${BUILD_SUFFIX}_${USER} >/dev/null 22 | mkdir build_${BUILD_SUFFIX}_${USER} && cd build_${BUILD_SUFFIX}_${USER} 23 | 24 | DATE=$(printf '%(%Y-%m-%d)T\n' -1) 25 | 26 | ## NOTE: RAJA tests are turned off due to compilation issues. 27 | 28 | cmake \ 29 | -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ 30 | -C ${RAJA_HOSTCONFIG} \ 31 | -DENABLE_OPENMP=Off \ 32 | -DENABLE_CUDA=Off \ 33 | -DRAJA_ENABLE_TARGET_OPENMP=Off \ 34 | -DENABLE_ALL_WARNINGS=Off \ 35 | -DRAJA_ENABLE_SYCL=On \ 36 | -DCMAKE_LINKER=clang++ \ 37 | -DCMAKE_CXX_STANDARD=17 \ 38 | -DBLT_CXX_STD=c++17 \ 39 | -DENABLE_TESTS=On \ 40 | -DENABLE_EXAMPLES=On \ 41 | "$@" \ 42 | .. 43 | 44 | make -j 8 45 | 46 | #-DCMAKE_INSTALL_PREFIX=/home/bhomerding/install/raja.${DATE} \ 47 | -------------------------------------------------------------------------------- /include/RAJA/policy/simd/params/reduce.hpp: -------------------------------------------------------------------------------- 1 | #ifndef NEW_REDUCE_SIMD_REDUCE_HPP 2 | #define NEW_REDUCE_SIMD_REDUCE_HPP 3 | 4 | #include "RAJA/pattern/params/reducer.hpp" 5 | 6 | namespace RAJA 7 | { 8 | namespace expt 9 | { 10 | namespace detail 11 | { 12 | 13 | // Init 14 | template 15 | camp::concepts::enable_if> param_init( 16 | EXEC_POL const&, 17 | Reducer& red) 18 | { 19 | red.m_valop.val = OP::identity(); 20 | } 21 | 22 | // Combine 23 | template 24 | camp::concepts::enable_if> 25 | param_combine(EXEC_POL const&, 26 | Reducer& out, 27 | const Reducer& in) 28 | { 29 | out.m_valop.val = OP {}(out.m_valop.val, in.m_valop.val); 30 | } 31 | 32 | // Resolve 33 | template 34 | camp::concepts::enable_if> 35 | param_resolve(EXEC_POL const&, Reducer& red) 36 | { 37 | red.combineTarget(red.m_valop.val); 38 | } 39 | 40 | } // namespace detail 41 | } // namespace expt 42 | } // namespace RAJA 43 | 44 | #endif // NEW_REDUCE_SIMD_REDUCE_HPP 45 | -------------------------------------------------------------------------------- /test/functional/forall/segment-view/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # List of segment types for generating test files. 10 | # 11 | set(SEGVIEWTYPES ListSegmentView RangeSegmentView RangeSegment2DView RangeStrideSegmentView) 12 | 13 | # 14 | # Generate tests for each enabled RAJA back-end. 15 | # 16 | # Note: FORALL_BACKENDS is defined in ../CMakeLists.txt 17 | # 18 | foreach( BACKEND ${FORALL_BACKENDS} ) 19 | foreach( SEGVIEWTYPE ${SEGVIEWTYPES} ) 20 | configure_file( test-forall-segment-view.cpp.in 21 | test-forall-${SEGVIEWTYPE}-${BACKEND}.cpp ) 22 | raja_add_test( NAME test-forall-${SEGVIEWTYPE}-${BACKEND} 23 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-forall-${SEGVIEWTYPE}-${BACKEND}.cpp ) 24 | 25 | target_include_directories(test-forall-${SEGVIEWTYPE}-${BACKEND}.exe 26 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 27 | endforeach() 28 | endforeach() 29 | 30 | unset( SEGVIEWTYPES ) 31 | -------------------------------------------------------------------------------- /docs/sphinx/user_guide/index.rst: -------------------------------------------------------------------------------- 1 | .. ## 2 | .. ## Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | .. ## and RAJA project contributors. See the RAJA/LICENSE file 4 | .. ## for details. 5 | .. ## 6 | .. ## SPDX-License-Identifier: (BSD-3-Clause) 7 | .. ## 8 | 9 | 10 | ################ 11 | RAJA User Guide 12 | ################ 13 | 14 | If you have some familiarity with RAJA and want to get up and running quickly, 15 | check out :ref:`getting_started-label`. This guide contains information 16 | about accessing the RAJA code, building it, and basic RAJA usage. 17 | 18 | If you are completely new to RAJA, please check out the :ref:`tutorial-label`. 19 | It contains a discussion of essential C++ concepts and will walk you 20 | through a sequence of code examples that show how to use key RAJA features. 21 | 22 | See :ref:`features-label` for a complete, high-level description of RAJA 23 | features (like a reference guide). 24 | 25 | Additional information about things to think about when considering whether 26 | to use RAJA in an application can be found in :ref:`app-considerations-label`. 27 | 28 | .. toctree:: 29 | :maxdepth: 3 30 | 31 | getting_started 32 | using_raja 33 | config_options 34 | features 35 | cook_book 36 | profiling_with_caliper 37 | app_considerations 38 | tutorial 39 | -------------------------------------------------------------------------------- /test/unit/resource/test-resource.cpp.in: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | // 9 | // test/include headers 10 | // 11 | #include "RAJA_test-base.hpp" 12 | #include "RAJA_test-camp.hpp" 13 | #include "RAJA_test-index-types.hpp" 14 | 15 | #include "RAJA_test-forall-data.hpp" 16 | #include "RAJA_test-forall-async-execpol.hpp" 17 | 18 | 19 | // 20 | // Header for tests in ./tests directory 21 | // 22 | // Note: CMake adds ./tests as an include dir for these tests. 23 | // 24 | #include "test-resource-@TESTTYPE@.hpp" 25 | 26 | 27 | // 28 | // Cartesian product of types used in parameterized tests 29 | // 30 | using @BACKEND@ResourceTypes = 31 | Test< camp::cartesian_product<@BACKEND@ResourceList, 32 | @BACKEND@AsyncForallExecPols>>::Types; 33 | 34 | // 35 | // Instantiate parameterized test 36 | // 37 | INSTANTIATE_TYPED_TEST_SUITE_P(@BACKEND@, 38 | Resource@TESTTYPE@Test, 39 | @BACKEND@ResourceTypes); 40 | -------------------------------------------------------------------------------- /test/functional/forall/indexset-view/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | # and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | # 5 | # SPDX-License-Identifier: (BSD-3-Clause) 6 | ############################################################################### 7 | 8 | # 9 | # List of indexset test types for generating test files. 10 | # 11 | set(INDEXSETTESTTYPES IndexSetView IcountIndexSetView) 12 | 13 | # 14 | # Generate tests for each enabled RAJA back-end. 15 | # 16 | # Note: FORALL_BACKENDS is defined in ../CMakeLists.txt 17 | # 18 | 19 | foreach( BACKEND ${FORALL_BACKENDS} ) 20 | foreach( INDEXSETTESTTYPE ${INDEXSETTESTTYPES} ) 21 | configure_file( test-forall-indexset-view.cpp.in 22 | test-forall-${INDEXSETTESTTYPE}-${BACKEND}.cpp ) 23 | raja_add_test( NAME test-forall-${INDEXSETTESTTYPE}-${BACKEND} 24 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test-forall-${INDEXSETTESTTYPE}-${BACKEND}.cpp ) 25 | 26 | target_include_directories(test-forall-${INDEXSETTESTTYPE}-${BACKEND}.exe 27 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) 28 | endforeach() 29 | endforeach() 30 | 31 | unset( INDEXSETTESTTYPES ) 32 | -------------------------------------------------------------------------------- /test/integration/plugin/test-plugin-forall.cpp.in: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | // 9 | // test/include headers 10 | // 11 | #include "RAJA_test-base.hpp" 12 | #include "RAJA_test-camp.hpp" 13 | #include "RAJA_test-platform.hpp" 14 | 15 | #include "RAJA_test-forall-execpol.hpp" 16 | 17 | // 18 | // Header for tests in ./tests directory 19 | // 20 | // Note: CMake adds ./tests as an include dir for these tests. 21 | // 22 | #include "test-plugin-forall.hpp" 23 | 24 | 25 | // 26 | // Cartesian product of types used in parameterized tests 27 | // 28 | using @BACKEND@PluginForallTypes = 29 | Test< camp::cartesian_product<@BACKEND@ForallExecPols, 30 | @BACKEND@ResourceList, 31 | @BACKEND@PlatformList > >::Types; 32 | 33 | // 34 | // Instantiate parameterized test 35 | // 36 | INSTANTIATE_TYPED_TEST_SUITE_P(@BACKEND@, 37 | PluginForallTest, 38 | @BACKEND@PluginForallTypes); 39 | -------------------------------------------------------------------------------- /src/DepGraphNode.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | ****************************************************************************** 3 | * 4 | * \file 5 | * 6 | * \brief Implementation file for dependency graph node class. 7 | * 8 | ****************************************************************************** 9 | */ 10 | 11 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 12 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 13 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 14 | // 15 | // SPDX-License-Identifier: (BSD-3-Clause) 16 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 17 | 18 | #include 19 | #include 20 | 21 | #include "RAJA/internal/DepGraphNode.hpp" 22 | 23 | namespace RAJA 24 | { 25 | 26 | void DepGraphNode::print(std::ostream& os) const 27 | { 28 | os << "DepGraphNode : sem, reload value = " << m_semaphore_value << " , " 29 | << m_semaphore_reload_value << std::endl; 30 | 31 | os << " num dep tasks = " << m_num_dep_tasks; 32 | if (m_num_dep_tasks > 0) 33 | { 34 | os << " ( "; 35 | for (int jj = 0; jj < m_num_dep_tasks; ++jj) 36 | { 37 | os << m_dep_task[jj] << " "; 38 | } 39 | os << " )"; 40 | } 41 | os << std::endl; 42 | } 43 | 44 | } // namespace RAJA 45 | -------------------------------------------------------------------------------- /test/unit/algorithm/test-algorithm-stable-sort.cpp.in: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | // 9 | // test/include headers 10 | // 11 | #include "RAJA_test-base.hpp" 12 | #include "RAJA_test-camp.hpp" 13 | 14 | // 15 | // Header for tests in ./tests directory 16 | // 17 | // Note: CMake adds ./tests as an include dir for these tests. 18 | // 19 | #include "test-algorithm-stable-sort.hpp" 20 | 21 | 22 | // 23 | // Cartesian product of types used in parameterized tests 24 | // 25 | using @SORT_BACKEND@StableSortTypes = 26 | Test< camp::cartesian_product<@SORT_BACKEND@StableSortSorters, 27 | @SORT_BACKEND@ResourceList, 28 | SortKeyTypeList, 29 | SortMaxNListDefault > >::Types; 30 | 31 | // 32 | // Instantiate parameterized test 33 | // 34 | INSTANTIATE_TYPED_TEST_SUITE_P( @SORT_BACKEND@Test, 35 | SortUnitTest, 36 | @SORT_BACKEND@StableSortTypes ); 37 | -------------------------------------------------------------------------------- /test/unit/algorithm/test-algorithm-util-sort.cpp.in: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | // 9 | // test/include headers 10 | // 11 | #include "RAJA_test-base.hpp" 12 | #include "RAJA_test-camp.hpp" 13 | 14 | // 15 | // Header for tests in ./tests directory 16 | // 17 | // Note: CMake adds ./tests as an include dir for these tests. 18 | // 19 | #include "test-algorithm-util-sort.hpp" 20 | 21 | 22 | // 23 | // Cartesian product of types used in parameterized tests 24 | // 25 | using @ALG_BACKEND@@UTIL_ALG@SortTypes = 26 | Test< camp::cartesian_product<@ALG_BACKEND@@UTIL_ALG@SortSorters, 27 | @ALG_BACKEND@ResourceList, 28 | SortKeyTypeList, 29 | SortMaxNList@ALG_SIZE@ > >::Types; 30 | 31 | // 32 | // Instantiate parameterized test 33 | // 34 | INSTANTIATE_TYPED_TEST_SUITE_P( @ALG_BACKEND@, 35 | SortUnitTest, 36 | @ALG_BACKEND@@UTIL_ALG@SortTypes ); 37 | -------------------------------------------------------------------------------- /test/include/RAJA_test-reduce-types.hpp: -------------------------------------------------------------------------------- 1 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 2 | // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC 3 | // and RAJA project contributors. See the RAJA/LICENSE file for details. 4 | // 5 | // SPDX-License-Identifier: (BSD-3-Clause) 6 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// 7 | 8 | // 9 | // Types and type lists for reductions used throughout RAJA tests. 10 | // 11 | // Note that in the type lists, a subset of types is used by default. 12 | // For more comprehensive type testing define the macro RAJA_TEST_EXHAUSTIVE. 13 | // 14 | 15 | #ifndef __RAJA_test_reduce_types_HPP__ 16 | #define __RAJA_test_reduce_types_HPP__ 17 | 18 | #include "RAJA/RAJA.hpp" 19 | #include "camp/list.hpp" 20 | 21 | // Switch to control testing old vs new reducer interface 22 | using UseParamReduce = camp::list; 23 | using UseCaptureReduce = camp::list; 24 | 25 | // 26 | // Reduce data types 27 | // 28 | using ReduceDataTypeList = 29 | camp::list< int, 30 | #if defined(RAJA_TEST_EXHAUSTIVE) 31 | unsigned, 32 | long long, 33 | unsigned long long, 34 | #endif 35 | float, 36 | double >; 37 | 38 | #endif // __RAJA_test_reduce_types_HPP__ 39 | --------------------------------------------------------------------------------