-
Notifications
You must be signed in to change notification settings - Fork 50
Kokkos Comparison
Cabana is intended to be used alongside Kokkos and extends it in many ways. Kokkos is intended for scientific computing in general, while Cabana is focused on particle applications.
This section is intended to highlight subtle differences between Kokkos and Cabana.
The Cabana::AoSoA
extends the Kokkos::View
with an additional vector length dimension. This means that an AoSoA of particles has a rank one higher than an equivalent View, with an extra extent()
equal to the chosen vector length. The size()
function is intended to be used rather than directly using extent()
in most cases.
Some Cabana algorithms explicitly require Cabana::AoSoA
or Cabana::slice
; this is planned to be extended to also include Kokkos::Views
for better flexibility in the future.
In addition, calling resize()
on a Cabana::AoSoA
will only reallocate memory and copy if additional space is needed and will not reduce capacity to match the exact size requested unless shrinkToFit()
is called. This is in contrast to the Kokkos::View
, which does not retain unused space on a resize
Cabana - A Co-Designed Library for Exascale Particle Simulations