-
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.
Some Cabana algorithms explicitly require Cabana::AoSoA
or Cabana::Slice
; this is planned to be extended to also include Kokkos::View
for better flexibility in the future.
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 AoSoA::size()
and Slice::size()
functions are intended to be used rather than directly using extent()
in most cases.
For the same reason, the Slice::rank
member variable is not equal to the underlying View::rank
(it includes the extra vector length dimension). If needed, the Slice::viewRank()
provides the actual rank of the underlying View
.
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