Stokhos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | List of all members
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.

Definition at line 95 of file Stokhos_MemoryTraits.hpp.

Member Function Documentation

◆ alloc()

static 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.

Definition at line 122 of file Stokhos_MemoryTraits.hpp.

◆ free()

static KOKKOS_INLINE_FUNCTION void Stokhos::MemoryTraits< Kokkos::HostSpace >::free ( void * ptr)
inlinestatic

Free memory allocated by alloc()

Definition at line 145 of file Stokhos_MemoryTraits.hpp.

Member Data Documentation

◆ Alignment

const unsigned Stokhos::MemoryTraits< Kokkos::HostSpace >::Alignment = 8
static

Bytes to which memory allocations are aligned.

Definition at line 109 of file Stokhos_MemoryTraits.hpp.


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