Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2b27955
Update to BLT v0.6.1
adayton1 Feb 12, 2024
8fd1033
Use new way of exporting tpls
adayton1 Feb 13, 2024
ac1bef5
Remove BLT_EXPORT_THIRDPARTY
adayton1 Feb 13, 2024
11400cb
Use branch of radiuss-spack-configs to fix spack builds
adayton1 Feb 13, 2024
253ca00
Merge branch 'develop' into feature/dayton8/blt_0_6_1
adayton1 Feb 14, 2024
051c297
Merge branch 'develop' into feature/dayton8/blt_0_6_1
adayton1 Feb 14, 2024
be7444d
Merge branch 'develop' into feature/dayton8/blt_0_6_1
adayton1 Feb 14, 2024
eb8126c
Fix to avoid requiring newer spack
adayton1 Feb 14, 2024
9e8b59e
Update to RAJA v2024.02.0
adayton1 Feb 14, 2024
5082f89
Update to Umpire 2024.02.0 RC
adayton1 Feb 14, 2024
09d1a9e
Update to newer hip in Dockerfile
adayton1 Feb 14, 2024
eb61e85
Clean up CHAI CMake
adayton1 Feb 15, 2024
191909d
More CMake clean up
adayton1 Feb 15, 2024
89a9d07
More clean up
adayton1 Feb 15, 2024
9c66309
Add install tests
adayton1 Feb 15, 2024
27ceba9
Resolve merge conflicts
adayton1 Feb 19, 2024
d661be6
Fix bad merge
adayton1 Feb 19, 2024
0dc557d
Add install test
adayton1 Feb 20, 2024
15c3287
CI fixes
adayton1 Feb 20, 2024
e90de08
Raise time limits
adayton1 Feb 20, 2024
2bfe401
Pick up umpire changes
adayton1 Feb 20, 2024
2b3762d
Fix build warnings
adayton1 Feb 20, 2024
762176b
Exclude gcc 4.9.3 implicit directories
adayton1 Feb 20, 2024
614fbbf
Fix install tests
adayton1 Feb 21, 2024
c8d2764
Update to Umpire v2024.02.0
adayton1 Feb 23, 2024
430868f
Update to umpire release
adayton1 Feb 23, 2024
901b4ef
Update radiuss spack configs
adayton1 Feb 23, 2024
ecf4386
Fix for fmt in umpire spack recipe
adayton1 Feb 23, 2024
ac1af0a
Add a file with release notes
adayton1 Feb 29, 2024
b71726e
Turn off Docker nvcc10 build
adayton1 Mar 1, 2024
b97fb9a
Allow failure for the job using libcpp
adayton1 Mar 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitlab/custom-jobs-and-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ variables:

# Corona
# Arguments for top level allocation
CORONA_SHARED_ALLOC: "--exclusive --time-limit=7m --nodes=1"
CORONA_SHARED_ALLOC: "--exclusive --time-limit=9m --nodes=1"
# Arguments for job level allocation
CORONA_JOB_ALLOC: "--nodes=1 --begin-time=+5s"
# Project specific variants for corona
Expand All @@ -46,7 +46,7 @@ variables:

# Tioga
# Arguments for top level allocation
TIOGA_SHARED_ALLOC: "--exclusive --time-limit=14m --nodes=1"
TIOGA_SHARED_ALLOC: "--exclusive --time-limit=16m --nodes=1"
# Arguments for job level allocation
TIOGA_JOB_ALLOC: "--nodes=1 --begin-time=+5s"
# Project specific variants for tioga
Expand Down
1 change: 1 addition & 0 deletions .gitlab/jobs/lassen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ clang_12_0_1_libcpp:
extends: .job_on_lassen
variables:
SPEC: "~shared +raja tests=basic %clang@12.0.1 cflags==\"-DGTEST_HAS_CXXABI_H_=0\" cxxflags==\"-stdlib=libc++ -DGTEST_HAS_CXXABI_H_=0\""
allow_failure: true

clang_12_0_1_gcc_8_3_1_memleak:
extends: .job_on_lassen
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ RUN . /opt/spack/share/spack/setup-env.sh && spack load cuda && \
cmake -DCMAKE_CXX_COMPILER=g++ -DENABLE_CUDA=On .. && \
make -j 16

FROM ghcr.io/rse-ops/hip-ubuntu-22.04:hip-4.3.1 AS hip
FROM ghcr.io/rse-ops/hip-ubuntu-22.04:hip-5.1.3 AS hip
ENV GTEST_COLOR=1
ENV HCC_AMDGPU_TARGET=gfx900
COPY . /home/chai/workspace
WORKDIR /home/chai/workspace/build
RUN . /opt/spack/share/spack/setup-env.sh && spack load hip llvm-amdgpu && \
cmake -DBLT_EXPORT_THIRDPARTY=On -DENABLE_WARNINGS_AS_ERRORS=Off -DCHAI_ENABLE_MANAGED_PTR=Off -DCMAKE_CXX_COMPILER=amdclang++ -DCMAKE_C_COMPILER=amdclang -DENABLE_HIP=On .. && \
make -j 16 VERBOSE=1
cmake -DENABLE_WARNINGS_AS_ERRORS=Off -DCHAI_ENABLE_MANAGED_PTR=Off -DCMAKE_CXX_COMPILER=amdclang++ -DCMAKE_C_COMPILER=amdclang -DENABLE_HIP=On .. && \
make -j 16 VERBOSE=1
27 changes: 27 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[comment]: # (#################################################################)
[comment]: # (Copyright 2016-24, Lawrence Livermore National Security, LLC)
[comment]: # (and CHAI project contributors. See the CHAI LICENSE file for)
[comment]: # (details.)
[comment]: #
[comment]: # (# SPDX-License-Identifier: BSD-3-Clause)
[comment]: # (#################################################################)

# CHAI Software Release Notes

Notes describing significant changes in each CHAI release are documented
in this file.

The format of this file is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [Unreleased] - Release date yyyy-mm-dd

### Added
- Support for APUs with a single memory space. To use, configure with -DCHAI\_DISABLE\_RM=ON -DCHAI\_GPU\_THIN\_ALLOCATE=ON.

### Changed
- Moved installed CMake targets from share/chai/cmake to lib/cmake/chai to be consistent with other libraries in the RAJA Portability Suite
- Improved dependency handling during the build of CHAI and when it is imported into another library/application
- Removed ArrayManager::enableDeviceSynchronization and ArrayManager::disableDeviceSynchronization. Instead, use the environment variables for device synchronization after all kernels (e.g. CUDA\_LAUNCH\_BLOCKING or HIP\_LAUNCH\_BLOCKING)

### Fixed
- Use free instead of realloc when the size is 0 (fixes a warning from valgrind)
6 changes: 1 addition & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ jobs:
docker_target: clang12
clang13:
docker_target: clang13
nvcc10:
docker_target: nvcc10
hip:
docker_target: hip
pool:
vmImage: 'ubuntu-latest'
variables:
Expand All @@ -37,7 +33,7 @@ jobs:
- script: |
CID=$(docker create llnl/chai:$(Build.BuildId))
echo ${CID}
docker cp ${CID}:/home/axom/workspace/build local-build
docker cp ${CID}:/home/chai/workspace/build local-build
docker rm ${CID}
displayName: 'Copy test artifacts'
condition: ne( variables['docker_target'], 'nvcc')
Expand Down
2 changes: 1 addition & 1 deletion blt
Submodule blt updated 190 files
2 changes: 2 additions & 0 deletions cmake/chai-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ set(CHAI_PACKAGE_PREFIX_DIR ${PACKAGE_PREFIX_DIR})

include(CMakeFindDependencyMacro)

include("${CMAKE_CURRENT_LIST_DIR}/BLTSetupTargets.cmake")

if (NOT TARGET umpire)
find_dependency(umpire CONFIG NO_DEFAULT_PATH PATHS
${umpire_DIR}
Expand Down
4 changes: 2 additions & 2 deletions examples/managed_ptr_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ int main(int CHAI_UNUSED_ARG(argc), char** CHAI_UNUSED_ARG(argv))
chai::managed_ptr<TestBase> derived = chai::make_managed<TestDerived>(42);

// chai::managed_ptr can be accessed on the host
forall(sequential(), 0, 1, [=] CHAI_HOST (int i) {
forall(sequential(), 0, 1, [=] CHAI_HOST (int) {
printf("Result of virtual function call on host: %d\n", derived->getValue());
});

#if defined(CHAI_GPUCC)
// chai::managed_ptr can be accessed on the device
forall(gpu(), 0, 1, [=] CHAI_DEVICE (int i) {
forall(gpu(), 0, 1, [=] CHAI_DEVICE (int) {
printf("Result of virtual function call on device: %d\n", derived->getValue());
});
#endif
Expand Down
18 changes: 14 additions & 4 deletions scripts/gitlab/build_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ then

if [[ -z ${spec} ]]
then
echo "SPEC is undefined, aborting..."
echo "[Error]: SPEC is undefined, aborting..."
exit 1
fi

Expand Down Expand Up @@ -178,6 +178,7 @@ then
then
module unload rocm
fi

$cmake_exe \
-C ${hostconfig_path} \
-DCMAKE_INSTALL_PREFIX=${install_dir} \
Expand Down Expand Up @@ -238,9 +239,18 @@ then

if [[ ! -d ${install_dir} ]]
then
echo "[Error]: install directory not found : ${install_dir}" && exit 1
else
echo "[Information]: No testing of installation implemented..."
echo "[Error]: Install directory not found : ${install_dir}" && exit 1
fi

cd ${install_dir}/examples/chai/using-with-cmake
mkdir build && cd build

if ! $cmake_exe -C ../host-config.cmake ..; then
echo "[Error]: Running $cmake_exe for using-with-cmake test" && exit 1
fi

if ! make; then
echo "[Error]: Running make for using-with-cmake test" && exit 1
fi

echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
Expand Down
5 changes: 0 additions & 5 deletions src/chai/ArrayManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,11 +510,6 @@ class ArrayManager
*/
bool m_callbacks_active;

/*!
* Whether or not to synchronize on device after every CHAI kernel.
*/
bool m_device_synchronize = false;

/*!
* Whether or not a synchronize has been performed since the launch of the last
* GPU context
Expand Down
2 changes: 2 additions & 0 deletions src/chai/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,5 @@ install(
ARCHIVE DESTINATION lib)

install(EXPORT chai-targets DESTINATION lib/cmake/chai)

blt_install_tpl_setups(DESTINATION lib/cmake/chai)
2 changes: 1 addition & 1 deletion src/tpl/raja
Submodule raja updated 1027 files
2 changes: 1 addition & 1 deletion src/tpl/umpire
Submodule umpire updated 465 files
3 changes: 2 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#
# SPDX-License-Identifier: BSD-3-Clause
##############################################################################
add_subdirectory(unit)

add_subdirectory(install)
add_subdirectory(unit)
add_subdirectory(integration)
16 changes: 16 additions & 0 deletions tests/install/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
###############################################################################
# Copyright (c) 2016-24, Lawrence Livermore National Security, LLC
# and CHAI project contributors. See the CHAI LICENSE file for details.
#
# SPDX-License-Identifier: (BSD-3-Clause)
###############################################################################

configure_file(
using-with-cmake/host-config.cmake.in
${PROJECT_BINARY_DIR}/examples/using-with-cmake/host-config.cmake)

install( FILES
using-with-cmake/CMakeLists.txt
using-with-cmake/using-with-cmake.cpp
${PROJECT_BINARY_DIR}/examples/using-with-cmake/host-config.cmake
DESTINATION examples/chai/using-with-cmake)
51 changes: 51 additions & 0 deletions tests/install/using-with-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
###############################################################################
# Copyright (c) 2016-24, Lawrence Livermore National Security, LLC
# and CHAI project contributors. See the CHAI LICENSE file for details.
#
# SPDX-License-Identifier: (BSD-3-Clause)
###############################################################################

if (ENABLE_HIP)
cmake_minimum_required(VERSION 3.23)
else()
cmake_minimum_required(VERSION 3.20)
endif()

project(using_with_cmake)

if (ENABLE_CUDA)
enable_language(CUDA)
endif()

if (ENABLE_HIP)
if (NOT ROCM_PATH)
find_path(ROCM_PATH
hip
ENV{ROCM_DIR}
ENV{ROCM_PATH}
ENV{HIP_PATH}
${HIP_PATH}/..
${HIP_ROOT_DIR}/../
${ROCM_ROOT_DIR}
/opt/rocm)
endif()

set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${ROCM_PATH}")
find_package(hip REQUIRED CONFIG PATHS ${ROCM_PATH})
endif()

find_package(chai CONFIG REQUIRED NO_DEFAULT_PATH PATHS ${chai_DIR} ${CHAI_DIR})

# Remove implicitly added link directories added by CMake that are problematic when
# the default system libraries are older than the ones used by the compiler
if (BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE)
list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_DIRECTORIES
${BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE})
list(REMOVE_ITEM CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES
${BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE})
list(REMOVE_ITEM CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES
${BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE})
endif ()

add_executable(using-with-cmake using-with-cmake.cpp)
target_link_libraries(using-with-cmake chai)
54 changes: 54 additions & 0 deletions tests/install/using-with-cmake/host-config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
###############################################################################
# Copyright (c) 2016-24, Lawrence Livermore National Security, LLC
# and CHAI project contributors. See the CHAI LICENSE file for details.
#
# SPDX-License-Identifier: (BSD-3-Clause)
###############################################################################

# Config related to compiler
set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@" CACHE PATH "")
set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@" CACHE PATH "")
set(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@" CACHE PATH "")
set(CMAKE_CXX_STANDARD "@CMAKE_CXX_STANDARD@" CACHE STRING "")

set(CMAKE_C_FLAGS "@CMAKE_C_FLAGS@" CACHE STRING "")
set(CMAKE_CXX_FLAGS "@CMAKE_CXX_FLAGS@" CACHE STRING "")
set(CMAKE_Fortran_FLAGS "@CMAKE_Fortran_FLAGS@" CACHE STRING "")
set(CMAKE_EXE_LINKER_FLAGS "@CMAKE_EXE_LINKER_FLAGS@" CACHE STRING "")

set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE CACHE BOOL "")

set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "@BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE@" CACHE STRING "")

# MPI
set(ENABLE_MPI @ENABLE_MPI@ CACHE BOOL "")
set(MPI_C_COMPILER "@MPI_C_COMPILER@" CACHE PATH "")
set(MPI_CXX_COMPILER "@MPI_CXX_COMPILER@" CACHE PATH "")
set(MPI_Fortran_COMPILER "@MPI_Fortran_COMPILER@" CACHE PATH "")
set(MPIEXEC_EXECUTABLE "@MPIEXEC_EXECUTABLE@" CACHE PATH "")
set(MPIEXEC_NUMPROC_FLAG "@MPIEXEC_NUMPROC_FLAG@" CACHE STRING "")

# CUDA
set(ENABLE_CUDA @ENABLE_CUDA@ CACHE BOOL "")

if(ENABLE_CUDA)
set(CUDA_TOOLKIT_ROOT_DIR "@CUDA_TOOLKIT_ROOT_DIR@" CACHE PATH "")
set(CMAKE_CUDA_COMPILER "@CMAKE_CUDA_COMPILER@" CACHE PATH "")
set(CMAKE_CUDA_STANDARD "@CMAKE_CUDA_STANDARD@" CACHE STRING "")
set(CMAKE_CUDA_HOST_COMPILER "@CMAKE_CUDA_HOST_COMPILER@" CACHE PATH "")
set(CMAKE_CUDA_SEPARABLE_COMPILATION @CMAKE_CUDA_SEPARABLE_COMPILATION@ CACHE BOOL "")
set(CMAKE_CUDA_ARCHITECTURES "@CMAKE_CUDA_ARCHITECTURES@" CACHE STRING "")
set(CMAKE_CUDA_FLAGS "@CMAKE_CUDA_FLAGS@" CACHE STRING "")
endif()

# HIP
set(ENABLE_HIP @ENABLE_HIP@ CACHE BOOL "")

if(ENABLE_HIP)
set(HIP_ROOT_DIR "@HIP_ROOT_DIR@" CACHE PATH "")
set(HIP_CLANG_PATH "@HIP_CLANG_PATH@" CACHE PATH "")
set(CMAKE_HIP_ARCHITECTURES "@CMAKE_HIP_ARCHITECTURES@" CACHE STRING "")
set(CMAKE_EXE_LINKER_FLAGS "@CMAKE_EXE_LINKER_FLAGS@" CACHE STRING "")
endif()

set(CHAI_DIR "@CMAKE_INSTALL_PREFIX@" CACHE PATH "")
21 changes: 21 additions & 0 deletions tests/install/using-with-cmake/using-with-cmake.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Copyright (c) 2016-24, Lawrence Livermore National Security, LLC
// and CHAI project contributors. See the CHAI LICENSE file for details.
//
// SPDX-License-Identifier: (BSD-3-Clause)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

#include "chai/ManagedArray.hpp"
#include <cstddef>

int main(int, char**)
{
constexpr std::size_t N{1024};
chai::ManagedArray<std::size_t> a(N);

for (std::size_t i = 0; i < N; i++) {
a[i] = i;
}

a.free();
}