vSMC
vSMC: Scalable Monte Carlo
Classes | Namespaces | Macros | Typedefs
aligned_memory.hpp File Reference
#include <vsmc/internal/config.h>
#include <vsmc/internal/assert.hpp>
#include <cstddef>
#include <cstdlib>
#include <memory>
#include <new>
#include <type_traits>
#include <vector>
#include <stdlib.h>
#include <tbb/scalable_allocator.h>
#include <mkl_service.h>

Go to the source code of this file.

Classes

class  vsmc::AlignedAllocator< T, Alignment, Memory >
 Aligned allocator. More...
 
class  vsmc::AlignedAllocator< T, Alignment, Memory >::rebind< U >
 
class  vsmc::AlignedMemoryMKL
 Aligned memory using Intel MKL mkl_malloc and mkl_free More...
 
class  vsmc::AlignedMemorySTD
 Aligned memory using std::malloc and std::free More...
 
class  vsmc::AlignedMemorySYS
 Aligned memory using native system aligned memory allocation. More...
 
class  vsmc::AlignedMemoryTBB
 Aligned memory using Intel TBB scalable_aligned_malloc and scalable_aligned_free. More...
 

Namespaces

 vsmc
 

Macros

#define VSMC_ALIGNED_MEMORY_TYPE   ::vsmc::AlignedMemoryTBB
 Default AlignedMemory type. More...
 
#define VSMC_ALIGNMENT   32
 Defualt alignment. More...
 
#define VSMC_RUNTIME_ASSERT_UTILITY_ALIGNED_MEMORY
 
#define VSMC_RUNTIME_ASSERT_UTILITY_ALIGNED_MEMORY_POWER_OF_TWO(alignment)
 
#define VSMC_RUNTIME_ASSERT_UTILITY_ALIGNED_MEMORY_SIZEOF_VOID(alignemnt)
 
#define VSMC_STATIC_ASSERT_UTILITY_ALIGNED_MEMORY
 
#define VSMC_STATIC_ASSERT_UTILITY_ALIGNED_MEMORY_POWER_OF_TWO(Alignment)
 
#define VSMC_STATIC_ASSERT_UTILITY_ALIGNED_MEMORY_SIZEOF_VOID(Alignemnt)
 

Typedefs

using vsmc::AlignedMemory = ::vsmc::AlignedMemoryTBB
 Default AlignedMemory type. More...
 
template<typename T >
using vsmc::AlignedVector = std::vector< T, AlignedAllocator< T >>
 Vector type using AlignedAllocator. More...
 
template<typename T >
using vsmc::Allocator = typename std::conditional< std::is_scalar< T >::value, AlignedAllocator< T >, std::allocator< T >>::type
 AlignedAllocator for scalar type and std::allocator for others. More...
 
template<typename T >
using vsmc::Vector = typename std::conditional< std::is_scalar< T >::value, std::vector< T, AlignedAllocator< T >>, std::vector< T >>::type
 AlignedVector for scalar type and std::vector for others. More...
 

Macro Definition Documentation

#define VSMC_RUNTIME_ASSERT_UTILITY_ALIGNED_MEMORY
Value:
VSMC_RUNTIME_ASSERT_UTILITY_ALIGNED_MEMORY_SIZEOF_VOID(alignment);
#define VSMC_RUNTIME_ASSERT_UTILITY_ALIGNED_MEMORY_POWER_OF_TWO(alignment)

Definition at line 101 of file aligned_memory.hpp.

#define VSMC_RUNTIME_ASSERT_UTILITY_ALIGNED_MEMORY_POWER_OF_TWO (   alignment)
Value:
(alignment != 0 && (alignment & (alignment - 1)) == 0), \
"**aligned_malloc** USED WITH ALIGNMENT NOT A POWER OF TWO")
#define VSMC_RUNTIME_ASSERT(cond, msg)
Definition: assert.hpp:55

Definition at line 92 of file aligned_memory.hpp.

#define VSMC_RUNTIME_ASSERT_UTILITY_ALIGNED_MEMORY_SIZEOF_VOID (   alignemnt)
Value:
VSMC_RUNTIME_ASSERT((alignment >= sizeof(void *)), \
"**aligned_malloc** USED WITH ALIGNMENT LESS THAN sizeof(void *)")
#define VSMC_RUNTIME_ASSERT(cond, msg)
Definition: assert.hpp:55

Definition at line 97 of file aligned_memory.hpp.

#define VSMC_STATIC_ASSERT_UTILITY_ALIGNED_MEMORY
Value:
VSMC_STATIC_ASSERT_UTILITY_ALIGNED_MEMORY_SIZEOF_VOID(Alignment);
#define VSMC_STATIC_ASSERT_UTILITY_ALIGNED_MEMORY_POWER_OF_TWO(Alignment)

Definition at line 88 of file aligned_memory.hpp.

#define VSMC_STATIC_ASSERT_UTILITY_ALIGNED_MEMORY_POWER_OF_TWO (   Alignment)
Value:
(Alignment != 0 && (Alignment & (Alignment - 1)) == 0), \
"**AlignedAllocator** USED WITH Alignment NOT A POWER OF TWO")
#define VSMC_STATIC_ASSERT(cond, msg)
Definition: assert.hpp:42

Definition at line 79 of file aligned_memory.hpp.

#define VSMC_STATIC_ASSERT_UTILITY_ALIGNED_MEMORY_SIZEOF_VOID (   Alignemnt)
Value:
VSMC_STATIC_ASSERT((Alignment >= sizeof(void *)), \
"**AlginedAllocator** USED WITH Alignment LESS THAN sizeof(void *)")
#define VSMC_STATIC_ASSERT(cond, msg)
Definition: assert.hpp:42

Definition at line 84 of file aligned_memory.hpp.