28#ifndef _H_GRB_REFERENCE_CONFIG
29#define _H_GRB_REFERENCE_CONFIG
96 template< Backend backend >
101 "Instantiating for non-reference backend" );
152 static constexpr bool fixedVectorCapacities() {
164 static constexpr size_t vectorBufferSize(
const size_t,
const size_t ) {
173 static constexpr Backend coordinatesBackend() {
198 static constexpr size_t minVectorBufferChunksize() {
199 return CACHE_LINE_SIZE::value();
216 static constexpr size_t absVectorBufferSize() {
236 static constexpr double relVectorBufferSize() {
265 static constexpr Backend coordinatesBackend() {
275 static constexpr bool fixedVectorCapacities() {
295 static inline size_t vectorBufferSize(
const size_t n,
const size_t T ) {
297 if( absVectorBufferSize() > 0 ) {
299 ret = absVectorBufferSize();
301 constexpr const double factor = relVectorBufferSize();
302 static_assert( factor > 0,
"Configuration error" );
305 ret = std::max( ret, T * minVectorBufferChunksize() );
308 ret += T - ( ret % T );
310 ret = std::max( 2 * T, ret );
311 assert( ret % T == 0 );
Defines both configuration parameters effective for all backends, as well as defines structured ways ...
static constexpr ALLOC_MODE defaultAllocMode()
How to allocate private memory segments.
Definition: reference/config.hpp:137
static constexpr ALLOC_MODE sharedAllocMode()
How to allocate shared memory segments.
Definition: reference/config.hpp:142
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:247
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:255
Default prefetching settings for reference and reference_omp backends.
Definition: reference/config.hpp:97
static constexpr size_t distance()
The prefetch distance used during level-2 and level-3 operations.
Definition: reference/config.hpp:117
static constexpr bool enabled()
Whether prefetching is enabled.
Definition: reference/config.hpp:108
Backend
A collection of all backends.
Definition: backends.hpp:46
@ reference
The sequential reference implementation.
Definition: backends.hpp:52
@ reference_omp
The threaded reference implementation.
Definition: backends.hpp:59
std::string toString(const ALLOC_MODE mode)
Converts instances of grb::config::ALLOC_MODE to a descriptive lower-case string.
ALLOC_MODE
The memory allocation modes implemented in the grb::reference and the grb::reference_omp backends.
Definition: reference/config.hpp:54
@ ALIGNED
Allocation via posix_memalign.
Definition: reference/config.hpp:57
@ INTERLEAVED
Allocation via numa_alloc_interleaved.
Definition: reference/config.hpp:60
The ALP/GraphBLAS namespace.
Definition: graphblas.hpp:450