vSMC
vSMC: Scalable Monte Carlo
Classes | Namespaces | Macros | Typedefs | Functions
aligned_memory.hpp File Reference
#include <vsmc/internal/assert.hpp>
#include <vsmc/internal/config.h>
#include <cstddef>
#include <cstdlib>
#include <limits>
#include <memory>
#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::AlignedAllocator< const void, Alignment, Memory >
 
class  vsmc::AlignedAllocator< void, Alignment, Memory >
 
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)
 

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, AlignedVector< T >, std::vector< T >>::type
 AlignedVector for scalar type and std::vector for others. More...
 

Functions

template<typename T1 , typename T2 , std::size_t Alignment, typename Memory >
bool vsmc::operator!= (const AlignedAllocator< T1, Alignment, Memory > &, const AlignedAllocator< T2, Alignment, Memory > &)
 
template<typename T1 , typename T2 , std::size_t Alignment, typename Memory >
bool vsmc::operator== (const AlignedAllocator< T1, Alignment, Memory > &, const AlignedAllocator< T2, Alignment, Memory > &)
 

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 87 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:53

Definition at line 78 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:53

Definition at line 83 of file aligned_memory.hpp.