-
Notifications
You must be signed in to change notification settings - Fork 50
Core Sorting and Binning
Sam Reeve edited this page May 18, 2023
·
2 revisions
Cabana AoSoA objects can be sorted, binned, and permuted based on a variety of user-defined parameters.
Header File: Cabana_Sort.hpp
using DataTypes = Cabana::MemberTypes<double,int>;
using DeviceType = Kokkos::Device<Kokkos::Serial, Kokkos::HostSpace>;
Cabana::AoSoA<DataTypes,DeviceType> aosoa( num_tuple );
// Create keys
auto keys = slice<1>( aosoa );
// Sort
auto sort_data = Cabana::sortByKey( keys );
Cabana::permute( sort_data, aosoa );
// Bin
int num_bin = 2;
auto bin_data = Cabana::binByKey( keys, num_bin );
Cabana::permute( bin_data, aosoa );
This is part of the Programming Guide series
Cabana - A Co-Designed Library for Exascale Particle Simulations