Skip to content

Commit

Permalink
Require c++ 20 and use class lambda for force models
Browse files Browse the repository at this point in the history
  • Loading branch information
streeve committed Jul 23, 2024
1 parent b29d902 commit 45d0c32
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
-DCMAKE_INSTALL_PREFIX=$HOME/kokkos \
-DCMAKE_CXX_STANDARD=20 \
-DKokkos_ENABLE_${{ matrix.backend }}=ON \
-DKokkos_ENABLE_HWLOC=ON
cmake --build build --parallel 2
Expand Down Expand Up @@ -148,6 +149,7 @@ jobs:
run: |
cmake -B build \
-DCMAKE_INSTALL_PREFIX=$HOME/kokkos \
-DCMAKE_CXX_STANDARD=20 \
-DKokkos_ENABLE_HIP=ON \
-DKokkos_ARCH_VEGA908=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
Expand Down Expand Up @@ -230,6 +232,7 @@ jobs:
run: |
cmake -B build \
-DCMAKE_INSTALL_PREFIX=$HOME/kokkos \
-DCMAKE_CXX_STANDARD=20 \
-DKokkos_ENABLE_CUDA=ON \
-DKokkos_ARCH_VOLTA72=ON \
-DKokkos_ENABLE_CUDA_LAMBDA=ON \
Expand Down
2 changes: 1 addition & 1 deletion src/CabanaPD_ForceModels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct BaseForceModel
, num_types( _delta.size() )
{
max_delta = 0;
auto init_func = KOKKOS_LAMBDA( const int i, double& max )
auto init_func = KOKKOS_CLASS_LAMBDA( const int i, double& max )
{
delta( i ) = _delta[i];
if ( delta( i ) > max )
Expand Down
8 changes: 4 additions & 4 deletions src/force/CabanaPD_ForceModels_PMB.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct ForceModel<PMB, Elastic, TemperatureIndependent, ParticleType>
void setParameters( const ArrayType& _K )
{
// Initialize self interaction parameters.
auto init_self_func = KOKKOS_LAMBDA( const int i )
auto init_self_func = KOKKOS_CLASS_LAMBDA( const int i )
{
K( i ) = _K[i];
c( i, i ) = micromodulus( i );
Expand All @@ -102,7 +102,7 @@ struct ForceModel<PMB, Elastic, TemperatureIndependent, ParticleType>
Kokkos::fence();

// Initialize cross-terms.
auto init_cross_func = KOKKOS_LAMBDA( const int i )
auto init_cross_func = KOKKOS_CLASS_LAMBDA( const int i )
{
for ( std::size_t j = i; j < num_types; j++ )
c( i, j ) = ( micromodulus( i ) + micromodulus( j ) ) / 2.0;
Expand Down Expand Up @@ -217,7 +217,7 @@ struct ForceModel<PMB, Fracture, TemperatureIndependent, ParticleType>
void setParameters( const ArrayType& _G0 )
{
// Initialize self interaction parameters.
auto init_self_func = KOKKOS_LAMBDA( const int i )
auto init_self_func = KOKKOS_CLASS_LAMBDA( const int i )
{
G0( i ) = _G0[i];
s0( i, i ) = criticalStretch( i );
Expand All @@ -230,7 +230,7 @@ struct ForceModel<PMB, Fracture, TemperatureIndependent, ParticleType>
Kokkos::fence();

// Initialize cross-terms.
auto init_cross_func = KOKKOS_LAMBDA( const int i )
auto init_cross_func = KOKKOS_CLASS_LAMBDA( const int i )
{
for ( std::size_t j = i; j < num_types; j++ )
{
Expand Down

0 comments on commit 45d0c32

Please sign in to comment.