QDP++
qdp_allocator.h
Go to the documentation of this file.
1// -*- C++ -*-
2
6
7#ifndef QDP_ALLOCATOR
8#define QDP_ALLOCATOR
9
10#include "qdp_config.h"
11#include "qdp_singleton.h"
20namespace QDP
21{
22 namespace Allocator
23 {
24
26
27 } // namespace Allocator
28
29 // Memory movement hints
30 namespace Hints
31 {
32
34
45 template<typename T>
46 inline
47 void moveToFastMemoryHint(T& x, bool copy=false) {}
48
50
61 template<typename T>
62 inline
63 void revertFromFastMemoryHint(T& x, bool copy=false) {}
64
65 } // namespace Hints
66
67} // namespace QDP
68
69
70// Now include the allocator.h-s and turn into singleton as approprite.
71#ifdef QDP_USE_TBBPOOL_ALLOCATOR
72#include "qdp_pool_allocator.h"
73namespace QDP {
74 namespace Allocator {
75 using theQDPAllocator = SingletonHolder<QDP::Allocator::QDPPoolAllocator,
76 QDP::CreateStatic,
77 QDP::NoDestroy,
78 QDP::SingleThreaded>;
79 }
80}
81#else
82// Include the default specialisation
84namespace QDP {
85 namespace Allocator {
90 }
91 }
92#endif
93
94
95#endif
SingletonHolder< QDP::Allocator::QDPDefaultAllocator, QDP::CreateStatic, QDP::NoDestroy, QDP::SingleThreaded > theQDPAllocator
void moveToFastMemoryHint(T &x, bool copy=false)
Hint to move a generic object of type T to fast memory.
void revertFromFastMemoryHint(T &x, bool copy=false)
Hint to return a generic object of type T from fast memory.
Yet another random number generator.
Default memory allocator for QDP.
Default memory allocator for QDP.
Singleton support.