CPU memory

Typedefs

using ext1d_d = Kokkos::extents<int, dyn>
using ext2d_d = Kokkos::extents<int, dyn, dyn>
using ext3d_d = Kokkos::extents<int, dyn, dyn, dyn>
using ext1d_t = Kokkos::dextents<int, 1>
using ext2d_t = Kokkos::dextents<int, 2>
using ext3d_t = Kokkos::dextents<int, 3>
using mdspan_1d_double = Kokkos::mdspan<double, ext1d_t>
using mdspan_2d_double = Kokkos::mdspan<double, ext2d_t>
using mdspan_3d_double = Kokkos::mdspan<double, ext3d_t>
using mdspan_1d_int = Kokkos::mdspan<int, ext1d_t>
using mdspan_2d_int = Kokkos::mdspan<int, ext2d_t>
using mdspan_3d_int = Kokkos::mdspan<int, ext3d_t>
using cpu_memview_policy = cpu_mdspan_impl

Variables

constexpr auto dyn = Kokkos::dynamic_extent
class cpu_mdspan_impl
#include <cpu_memory.hpp>

CPU mdspan memory view policy.

It defines the policy to allocate/deallocate arrays and create Kokkos mdspan objects.

Public Static Functions

static inline mdspan_1d_double memview(double *data, int nlevs)

Create a 1D mdspan object from double pointer.

If a NULL pointer is provided, an empty mdspan is created (size 0)

static inline mdspan_2d_double memview(double *data, int nblocks, int nproma)

Create a 2D mdspan object from double pointer.

If a NULL pointer is provided, an empty mdspan is created (size 0)

static inline mdspan_3d_double memview(double *data, int nblocks, int nlevs, int nproma)

Create a 3D mdspan object from double pointer.

If a NULL pointer is provided, an empty mdspan is created (size 0)

static inline mdspan_2d_int memview(int *data, int nblocks, int nproma)

Create a 2D mdspan object from int pointer.

If a NULL pointer is provided, an empty mdspan is created (size 0)

static inline mdspan_3d_int memview(int *data, int nblocks, int nlevs, int nproma)

Create a 3D mdspan object from int pointer.

If a NULL pointer is provided, an empty mdspan is created (size 0)

static inline mdspan_1d_double memview_malloc(double *field, int dim1)

Allocate memory and create a 1D mdspan object from double pointer.

static inline mdspan_2d_double memview_malloc(double *field, int dim1, int dim2)

Allocate memory and create a 2D mdspan object from double pointer.

static inline mdspan_3d_double memview_malloc(double *field, int dim1, int dim2, int dim3)

Allocate memory and create a 3D mdspan object from double pointer.

static inline mdspan_1d_int memview_malloc(int *field, int dim1)

Allocate memory and create a 1D mdspan object from int pointer.

static inline mdspan_2d_int memview_malloc(int *field, int dim1, int dim2)

Allocate memory and create a 2D mdspan object from int pointer.

static inline mdspan_3d_int memview_malloc(int *field, int dim1, int dim2, int dim3)

Allocate memory and create a 3D mdspan object from int pointer.

static inline void memview_free(double *field)

Free memory from double pointer.

static inline void memview_free(int *field)

Free memory from int pointer.