Skip to content

Kokkos Comparison

Sam Reeve edited this page Mar 17, 2022 · 2 revisions

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.

Size vs. Extent

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.

Resizing

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

Clone this wiki locally