Stokhos Development
Loading...
Searching...
No Matches
Stokhos::MemoryTraits< Kokkos::HostSpace > Struct Reference

Specialization of MemoryTraits for host memory spaces. More...

#include <Stokhos_MemoryTraits.hpp>

Static Public Member Functions

static KOKKOS_INLINE_FUNCTION void * alloc (const size_t size)
 Allocate aligned memory.
static KOKKOS_INLINE_FUNCTION void free (void *ptr)
 Free memory allocated by alloc().

Static Public Attributes

static const unsigned Alignment = 8
 Bytes to which memory allocations are aligned.

Detailed Description

Specialization of MemoryTraits for host memory spaces.

Member Function Documentation

◆ alloc()

KOKKOS_INLINE_FUNCTION void * Stokhos::MemoryTraits< Kokkos::HostSpace >::alloc ( const size_t size)
inlinestatic

Allocate aligned memory.

Note: We don't use mm_malloc or posix_memalign, because even though this implementation is host-only, it is potentially callable from host functions marked as device functions (via the KOKKOS_INLINE_FUNCTION maco).

Also, we can't call new/delete as we may replace those with a version that calls this.

References Alignment.


The documentation for this struct was generated from the following file: