28 #ifndef _H_GRB_REFERENCE_CONFIG 29 #define _H_GRB_REFERENCE_CONFIG 96 template< Backend backend >
101 "Instantiating for non-reference backend" );
160 static constexpr
bool fixedVectorCapacities() {
172 static constexpr
size_t vectorBufferSize(
const size_t,
const size_t ) {
181 static constexpr
Backend coordinatesBackend() {
214 static constexpr
size_t minVectorBufferChunksize() {
215 return CACHE_LINE_SIZE::value();
232 static constexpr
size_t absVectorBufferSize() {
252 static constexpr
double relVectorBufferSize() {
281 static constexpr
Backend coordinatesBackend() {
291 static constexpr
bool fixedVectorCapacities() {
311 static inline size_t vectorBufferSize(
const size_t n,
const size_t T ) {
313 if( absVectorBufferSize() > 0 ) {
315 ret = absVectorBufferSize();
317 constexpr
const double factor = relVectorBufferSize();
318 static_assert( factor > 0,
"Configuration error" );
321 ret = std::max( ret, T * minVectorBufferChunksize() );
324 ret += T - ( ret % T );
326 ret = std::max( 2 * T, ret );
327 assert( ret % T == 0 );
339 #endif // end ``_H_GRB_REFERENCE_CONFIG'' Allocation via numa_alloc_interleaved.
Definition: reference/config.hpp:60
static constexpr size_t distance()
The prefetch distance used during level-2 and level-3 operations.
Definition: reference/config.hpp:117
static constexpr ALLOC_MODE defaultAllocMode()
A private memory segment shall never be accessed by threads other than the thread who allocates it.
Definition: reference/config.hpp:263
static constexpr ALLOC_MODE sharedAllocMode()
For the reference_omp backend, a shared memory-segment should use interleaved alloc so that any threa...
Definition: reference/config.hpp:271
ALLOC_MODE
The memory allocation modes implemented in the grb::reference and the grb::reference_omp backends.
Definition: reference/config.hpp:54
Collects a series of implementation choices corresponding to some given backend.
Definition: base/config.hpp:387
static constexpr bool enabled()
Whether prefetching is enabled.
Definition: reference/config.hpp:108
The threaded reference implementation.
Definition: backends.hpp:62
The sequential reference implementation.
Definition: backends.hpp:55
Backend
A collection of all backends.
Definition: backends.hpp:49
The ALP/GraphBLAS namespace.
Definition: graphblas.hpp:477
std::string toString(const ALLOC_MODE mode)
Converts instances of grb::config::ALLOC_MODE to a descriptive lower-case string.
static constexpr ALLOC_MODE sharedAllocMode()
How to allocate shared memory segments.
Definition: reference/config.hpp:150
Defines both configuration parameters effective for all backends, as well as defines structured ways ...
Allocation via posix_memalign.
Definition: reference/config.hpp:57
static constexpr ALLOC_MODE defaultAllocMode()
How to allocate private memory segments.
Definition: reference/config.hpp:145
Default prefetching settings for reference and reference_omp backends.
Definition: reference/config.hpp:97