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 );
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:145
static constexpr ALLOC_MODE sharedAllocMode()
How to allocate shared memory segments.
Definition: reference/config.hpp:150
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
Collects a series of implementation choices corresponding to some given backend.
Definition: base/config.hpp:387
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:452