Stokhos  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Static Public Member Functions | Static Public Attributes | List of all members
Stokhos::MemoryTraits< Kokkos::HostSpace > Struct Template 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. More...
 
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

template<>
struct Stokhos::MemoryTraits< Kokkos::HostSpace >

Specialization of MemoryTraits for host memory spaces.

Member Function Documentation

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.

References Stokhos::MemoryTraits< MemorySpace >::Alignment.


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