Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into better-nbtable-layout
Browse files Browse the repository at this point in the history
  • Loading branch information
fthaler committed Jun 18, 2024
2 parents 458055f + 3b6c32a commit 2764b2f
Show file tree
Hide file tree
Showing 15 changed files with 87,403 additions and 86,085 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/cmake-configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
container: ghcr.io/gridtools/gridtools-base:clang-${{ matrix.version }}
strategy:
matrix:
version: [9, 10]
version: [12, 16, 17, 18]
cuda-mode: [AUTO, Clang-CUDA, NVCC-CUDA]
steps:
- uses: actions/checkout@v2
Expand All @@ -38,10 +38,11 @@ jobs:
clang-cuda:
runs-on: ubuntu-latest
container: ghcr.io/gridtools/gridtools-base:clang-${{ matrix.version }}-cuda-11
container: ghcr.io/gridtools/gridtools-base:clang-${{ matrix.clang_version }}-cuda-${{ matrix.cuda_version }}
strategy:
matrix:
version: [11, 12]
clang_version: [17]
cuda_version: [12.5]
cuda-mode: [AUTO, Clang-CUDA, NVCC-CUDA]
steps:
- uses: actions/checkout@v2
Expand All @@ -62,7 +63,7 @@ jobs:
container: ghcr.io/gridtools/gridtools-base:gcc-${{ matrix.version }}
strategy:
matrix:
version: [8, 9, 10, 11]
version: [8, 11, 12, 13]
steps:
- uses: actions/checkout@v2
- name: CMake version
Expand All @@ -78,7 +79,18 @@ jobs:
gcc-nvcc:
runs-on: ubuntu-latest
container: ghcr.io/gridtools/gridtools-base:gcc-10-cuda-11
container: ghcr.io/gridtools/gridtools-base:gcc-${{ matrix.gcc_version }}-cuda-${{ matrix.cuda_version }}
strategy:
matrix:
gcc_version: [10, 11, 12]
cuda_version: [11.8, "12.0", 12.2]
exclude:
- gcc_version: 12
cuda_version: 11.8
- gcc_version: 11
cuda_version: 11.8
- gcc_version: 11
cuda_version: 12.2
steps:
- uses: actions/checkout@v2
- name: CMake version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
container: ghcr.io/gridtools/gridtools-base:${{ matrix.compiler }}
strategy:
matrix:
compiler: [gcc-8, gcc-9, gcc-10, gcc-11, gcc-12, gcc-13, clang-11, clang-12, clang-13, clang-14, clang-15, clang-16, clang-14-cuda-11, gcc-10-cuda-11.8, gcc-11-cuda-12.0, gcc-12-cuda-12.1, gcc-12-cuda-12.2, gcc-12-cuda-12.3, base-hip, gcc-10-hpx, nvhpc-23.3, nvhpc-23.9]
compiler: [gcc-8, gcc-9, gcc-10, gcc-11, gcc-12, gcc-13, clang-11, clang-12, clang-13, clang-14, clang-15, clang-16, clang-14-cuda-11, gcc-10-cuda-11.8, gcc-11-cuda-12.0, gcc-12-cuda-12.3, gcc-12-cuda-12.4, base-hip, gcc-10-hpx, nvhpc-23.3, nvhpc-23.9]
build_type: [debug, release]
exclude:
- compiler: gcc-8
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ else()
endif()
endif()

set(REQUIRED_BOOST_VERSION 1.65.1)
set(REQUIRED_BOOST_VERSION 1.73)
find_package(Boost ${REQUIRED_BOOST_VERSION} REQUIRED)

# setup main gridtools target
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CUDAHOSTCXX=`which g++` # full path to the C++ compiler to be used as CUDA host

##### Requirements
- C++17 compiler (see also list of tested compilers)
- Boost headers (1.77 or later)
- Boost headers (1.73 or later)
- CMake (3.18.1 or later)
- CUDA Toolkit (11.0 or later, optional)
- MPI (optional, CUDA-aware MPI for the GPU communication module `gcl_gpu`)
Expand Down
4 changes: 2 additions & 2 deletions include/gridtools/common/defs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ namespace gridtools {
#define GT_NVCC_DIAG_POP_SUPPRESS(x)
#endif

#if defined(__NVCC__) && (__CUDACC_VER_MAJOR__ == 12 && __CUDACC_VER_MINOR__ >= 1 && __CUDACC_VER_MINOR__ <= 3)
// enables workaround for CTAD/constexpr issues in CUDA 12.1, 12.2, 12.3 (https://github.com/GridTools/gridtools/issues/1766)
#if defined(__NVCC__) && (__CUDACC_VER_MAJOR__ == 12 && __CUDACC_VER_MINOR__ >= 1 && __CUDACC_VER_MINOR__ <= 4)
// enables workaround for CTAD/constexpr issues in CUDA 12.1, 12.2, 12.3, 12.4 (https://github.com/GridTools/gridtools/issues/1766)
#define GT_NVCC_WORKAROUND_1766 1
#else
#define GT_NVCC_WORKAROUND_1766 0
Expand Down
18 changes: 9 additions & 9 deletions include/gridtools/storage/adapter/nanobind_adapter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@
namespace gridtools {
namespace nanobind_sid_adapter_impl_ {

// Use nanobind::any for dynamic stride, use an integral value for static stride.
template <std::size_t... Values>
using stride_spec = std::index_sequence<Values...>;
// Use `-1` for dynamic stride, use an integral value for static stride.
template <nanobind::ssize_t... Values>
using stride_spec = std::integer_sequence<nanobind::ssize_t, Values...>;

template <class IndexSequence>
struct dynamic_strides_helper;

template <std::size_t... Indices>
struct dynamic_strides_helper<std::index_sequence<Indices...>> {
using type = stride_spec<(void(Indices), nanobind::any)...>;
using type = stride_spec<(void(Indices), -1)...>;
};

template <std::size_t N>
using fully_dynamic_strides = typename dynamic_strides_helper<std::make_index_sequence<N>>::type;

template <std::size_t SpecValue>
template <nanobind::ssize_t SpecValue>
auto select_static_stride_value(std::size_t dyn_value) {
if constexpr (SpecValue == nanobind::any) {
if constexpr (SpecValue == -1) {
return dyn_value;
} else {
if (SpecValue != dyn_value) {
Expand All @@ -52,20 +52,20 @@ namespace gridtools {
}
}

template <std::size_t... SpecValues, std::size_t... IndexValues>
template <nanobind::ssize_t... SpecValues, std::size_t... IndexValues>
auto select_static_strides_helper(
stride_spec<SpecValues...>, const std::size_t *dyn_values, std::index_sequence<IndexValues...>) {

return gridtools::tuple{select_static_stride_value<SpecValues>(dyn_values[IndexValues])...};
}

template <std::size_t... SpecValues>
template <nanobind::ssize_t... SpecValues>
auto select_static_strides(stride_spec<SpecValues...> spec, const std::size_t *dyn_values) {
return select_static_strides_helper(spec, dyn_values, std::make_index_sequence<sizeof...(SpecValues)>{});
}

template <class T,
std::size_t... Sizes,
nanobind::ssize_t... Sizes,
class... Args,
class Strides = fully_dynamic_strides<sizeof...(Sizes)>,
class StridesKind = sid::unknown_kind>
Expand Down
Loading

0 comments on commit 2764b2f

Please sign in to comment.