Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2d neighbors #755

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 24 additions & 24 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
cxx: ['g++', 'clang++']
backend: ['OPENMP', 'SERIAL']
cmake_build_type: ['Debug', 'Release']
kokkos_ver: ['4.1.00']
kokkos_ver: ['4.4.01']
bounds_check: ['OFF']
arborx: ['OFF']
heffte: ['OFF' ]
Expand All @@ -42,7 +42,7 @@ jobs:
cxx: 'g++'
backend: 'THREADS'
cmake_build_type: 'Debug'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'OFF'
heffte: 'OFF'
hypre: 'OFF'
Expand All @@ -52,7 +52,7 @@ jobs:
cxx: 'icpx'
backend: 'OPENMP'
cmake_build_type: 'Release'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'OFF'
heffte: 'OFF'
hypre: 'OFF'
Expand All @@ -61,7 +61,7 @@ jobs:
cxx: 'icpx'
backend: 'OPENMP'
cmake_build_type: 'Debug'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'OFF'
heffte: 'OFF'
hypre: 'OFF'
Expand All @@ -70,7 +70,7 @@ jobs:
cxx: 'icpx'
backend: 'SERIAL'
cmake_build_type: 'Release'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'OFF'
heffte: 'OFF'
hypre: 'OFF'
Expand All @@ -79,7 +79,7 @@ jobs:
cxx: 'icpx'
backend: 'SERIAL'
cmake_build_type: 'Debug'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'OFF'
heffte: 'OFF'
hypre: 'OFF'
Expand All @@ -88,7 +88,7 @@ jobs:
cxx: 'icpx'
backend: 'SERIAL'
cmake_build_type: 'Debug'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'OFF'
heffte: 'MKL'
hypre: 'OFF'
Expand All @@ -98,7 +98,7 @@ jobs:
cxx: 'g++'
backend: 'OPENMP'
cmake_build_type: 'Release'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'OFF'
heffte: 'OFF'
hypre: 'OFF'
Expand All @@ -109,7 +109,7 @@ jobs:
cxx: 'clang++'
backend: 'OPENMP'
cmake_build_type: 'Release'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'OFF'
heffte: 'OFF'
hypre: 'OFF'
Expand All @@ -118,7 +118,7 @@ jobs:
cxx: 'g++'
cmake_build_type: 'Release'
backend: 'OPENMP'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'OFF'
heffte: 'OFF'
hypre: 'OFF'
Expand All @@ -127,7 +127,7 @@ jobs:
cxx: 'clang++'
backend: 'OPENMP'
cmake_build_type: 'Release'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'OFF'
heffte: 'OFF'
hypre: 'OFF'
Expand All @@ -137,7 +137,7 @@ jobs:
cxx: 'g++'
cmake_build_type: 'Release'
backend: 'OPENMP'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'OFF'
heffte: 'OFF'
hypre: 'OFF'
Expand All @@ -146,7 +146,7 @@ jobs:
cxx: 'clang++'
backend: 'OPENMP'
cmake_build_type: 'Release'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'OFF'
heffte: 'OFF'
hypre: 'OFF'
Expand All @@ -155,7 +155,7 @@ jobs:
cxx: 'g++'
backend: 'OPENMP'
cmake_build_type: 'Debug'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'ArborX'
heffte: 'OFF'
hypre: 'OFF'
Expand All @@ -164,7 +164,7 @@ jobs:
cxx: 'g++'
backend: 'OPENMP'
cmake_build_type: 'Release'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'ArborX'
heffte: 'OFF'
hypre: 'OFF'
Expand All @@ -173,7 +173,7 @@ jobs:
cxx: 'g++'
backend: 'OPENMP'
cmake_build_type: 'Release'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'OFF'
heffte: 'FFTW'
hypre: 'OFF'
Expand All @@ -182,7 +182,7 @@ jobs:
cxx: 'g++'
backend: 'OPENMP'
cmake_build_type: 'Release'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'OFF'
heffte: 'OFF'
hypre: 'OFF'
Expand All @@ -192,7 +192,7 @@ jobs:
cxx: 'g++'
backend: 'OPENMP'
cmake_build_type: 'Debug'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'OFF'
heffte: 'OFF'
hypre: 'HYPRE'
Expand All @@ -201,7 +201,7 @@ jobs:
cxx: 'g++'
backend: 'OPENMP'
cmake_build_type: 'Debug'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'OFF'
heffte: 'OFF'
hypre: 'OFF'
Expand All @@ -211,7 +211,7 @@ jobs:
cxx: 'g++'
backend: 'OPENMP'
cmake_build_type: 'Debug'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'OFF'
heffte: 'OFF'
hypre: 'OFF'
Expand All @@ -221,7 +221,7 @@ jobs:
cxx: 'g++'
backend: 'OPENMP'
cmake_build_type: 'Debug'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'ArborX'
heffte: 'FFTW'
hypre: 'HYPRE'
Expand All @@ -234,7 +234,7 @@ jobs:
cxx: 'g++'
backend: 'OPENMP'
cmake_build_type: 'Debug'
kokkos_ver: '4.1.00'
kokkos_ver: '4.4.01'
arborx: 'ArborX'
heffte: 'FFTW'
hypre: 'HYPRE'
Expand Down Expand Up @@ -484,7 +484,7 @@ jobs:
matrix:
cxx: ['hipcc']
cmake_build_type: ['Debug']
kokkos_ver: ['4.2.00']
kokkos_ver: ['4.4.01']
runs-on: ubuntu-20.04
container: ghcr.io/ecp-copa/ci-containers/rocm:latest
steps:
Expand Down Expand Up @@ -568,7 +568,7 @@ jobs:
matrix:
cxx: ['nvcc']
cmake_build_type: ['Release']
kokkos_ver: ['4.1.00']
kokkos_ver: ['4.4.01']
runs-on: ubuntu-20.04
container: ghcr.io/ecp-copa/ci-containers/cuda:12.2.0
steps:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# Dependencies
#------------------------------------------------------------------------------#
# find kokkos
find_package(Kokkos 4.1 REQUIRED)
find_package(Kokkos 4.4 REQUIRED)

# set supported kokkos devices
set(CABANA_SUPPORTED_DEVICES SERIAL THREADS OPENMP CUDA HIP SYCL OPENMPTARGET)
Expand Down
2 changes: 1 addition & 1 deletion benchmark/core/Cabana_LinkedCellPerformance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void performanceTest( std::ostream& stream, const std::string& test_prefix,
double sort_delta[3] = { cutoff, cutoff, cutoff };
double grid_min[3] = { x_min[p], x_min[p], x_min[p] };
double grid_max[3] = { x_max[p], x_max[p], x_max[p] };
auto linked_cell_list = Cabana::createLinkedCellList<memory_space>(
auto linked_cell_list = Cabana::createLinkedCellList(
x, sort_delta, grid_min, grid_max );

// Setup for neighbor iteration.
Expand Down
2 changes: 1 addition & 1 deletion benchmark/core/Cabana_NeighborArborXPerformance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void performanceTest( std::ostream& stream, const std::string& test_prefix,
double cutoff = cutoff_ratios.front();
double sort_delta[3] = { cutoff, cutoff, cutoff };
auto x = Cabana::slice<0>( aosoas[p], "position" );
auto linked_cell_list = Cabana::createLinkedCellList<memory_space>(
auto linked_cell_list = Cabana::createLinkedCellList(
x, sort_delta, grid_min, grid_max );
Cabana::permute( linked_cell_list, aosoas[p] );
}
Expand Down
2 changes: 1 addition & 1 deletion benchmark/core/Cabana_NeighborVerletPerformance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void performanceTest( std::ostream& stream, const std::string& test_prefix,
// in cells the size of the smallest cutoff distance.
double cutoff = cutoff_ratios.front();
double sort_delta[3] = { cutoff, cutoff, cutoff };
auto linked_cell_list = Cabana::createLinkedCellList<memory_space>(
auto linked_cell_list = Cabana::createLinkedCellList(
x, sort_delta, grid_min, grid_max );
Cabana::permute( linked_cell_list, aosoas[p] );
}
Expand Down
18 changes: 17 additions & 1 deletion core/src/Cabana_Experimental_NeighborList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,34 @@ struct AccessTraits<Positions, PrimitivesTag,
using memory_space = typename Positions::memory_space;
//! Size type.
using size_type = typename Positions::size_type;
//! Position array data type.
using data_type = typename Positions::data_type;
//! Spatial dimension.
static constexpr std::size_t num_space_dim =
Cabana::arraySize( data_type{} );

//! Get number of particles.
static KOKKOS_FUNCTION size_type size( Positions const& x )
{
return Cabana::size( x );
}
//! Get the particle at the index.
static KOKKOS_FUNCTION Point get( Positions const& x, size_type i )
template <std::size_t NSD = num_space_dim>
static KOKKOS_FUNCTION std::enable_if_t<3 == NSD, Point>
get( Positions const& x, size_type i )
{
return { static_cast<float>( x( i, 0 ) ),
static_cast<float>( x( i, 1 ) ),
static_cast<float>( x( i, 2 ) ) };
}
//! Get the particle at the index.
template <std::size_t NSD = num_space_dim>
static KOKKOS_FUNCTION std::enable_if_t<2 == NSD, Point>
get( Positions const& x, size_type i )
{
return { static_cast<float>( x( i, 0 ) ),
static_cast<float>( x( i, 1 ) ) };
}
};
//! Neighbor access trait.
template <typename Positions>
Expand Down
Loading
Loading