ALP User Documentation  0.8.preview
Algebraic Programming User Documentation
nonblocking/config.hpp
Go to the documentation of this file.
1 
2 /*
3  * Copyright 2021 Huawei Technologies Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
27 #ifndef _H_GRB_NONBLOCKING_CONFIG
28 #define _H_GRB_NONBLOCKING_CONFIG
29 
32 
33 
34 namespace grb {
35 
46  namespace config {
47 
53  class PIPELINE {
54 
55  public:
56 
64  static constexpr const size_t max_pipelines = 4;
65 
76  static constexpr const size_t max_containers = 16;
77 
85  static constexpr const size_t max_depth = 16;
86 
95  static constexpr const size_t max_tiles = 1 << 16;
96 
101  static constexpr const bool warn_if_exceeded = true;
102 
107  static constexpr const bool warn_if_not_native = true;
108 
109  };
110 
118 
119  public:
120 
127  static constexpr const size_t MIN_TILE_SIZE = 512;
128 
134  static constexpr const double L1_CACHE_USAGE_PERCENTAGE = 0.98;
135 
136  };
137 
153  template<>
155 
156  public:
157 
162  static constexpr ALLOC_MODE defaultAllocMode() {
163  return ALLOC_MODE::ALIGNED;
164  }
165 
170  static constexpr ALLOC_MODE sharedAllocMode() {
172  }
173 
182  static constexpr Backend coordinatesBackend() {
183  return nonblocking;
184  }
185 
192  static constexpr bool fixedVectorCapacities() {
193  return true;
194  }
195 
196  };
197 
198  } // namespace config
199 
202 } // namespace grb
203 
204 #endif // end ``_H_GRB_NONBLOCKING_CONFIG''
205 
Allocation via numa_alloc_interleaved.
Definition: reference/config.hpp:60
static constexpr const double L1_CACHE_USAGE_PERCENTAGE
The L1 cache size is assumed to be a bit smaller than the actual size to take into account any data t...
Definition: nonblocking/config.hpp:134
static constexpr const bool warn_if_not_native
When true, calling a fake nonblocking primitive for a first time will emit a warning to the standard ...
Definition: nonblocking/config.hpp:107
ALLOC_MODE
The memory allocation modes implemented in the grb::reference and the grb::reference_omp backends.
Definition: reference/config.hpp:54
static constexpr const size_t MIN_TILE_SIZE
The minimum tile size that may be automatically selected by the analytic model.
Definition: nonblocking/config.hpp:127
static constexpr const size_t max_tiles
Pipelines are constructed with default space for this many tiles.
Definition: nonblocking/config.hpp:95
Configuration parameters relating to the analytic model employed by the nonblocking backend.
Definition: nonblocking/config.hpp:117
Collects a series of implementation choices corresponding to some given backend.
Definition: base/config.hpp:387
The threaded nonblocking implementation.
Definition: backends.hpp:76
Contains the configuration parameters for the reference and reference_omp backends.
static constexpr const size_t max_depth
Pipelines are constructed with default space for this many stages.
Definition: nonblocking/config.hpp:85
static constexpr const bool warn_if_exceeded
Emit a warning to standard error stream if the default pipeline capacities are exceeded.
Definition: nonblocking/config.hpp:101
Backend
A collection of all backends.
Definition: backends.hpp:49
static constexpr const size_t max_containers
Pipelines are constructed with default space for this many containers.
Definition: nonblocking/config.hpp:76
The ALP/GraphBLAS namespace.
Definition: graphblas.hpp:477
static constexpr ALLOC_MODE defaultAllocMode()
A private memory segment shall never be accessed by threads other than the thread who allocates it.
Definition: nonblocking/config.hpp:162
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 const size_t max_pipelines
How many independent pipelines any ALP algorithm may concurrently expose.
Definition: nonblocking/config.hpp:64
Configuration parameters relating to the pipeline data structure.
Definition: nonblocking/config.hpp:53
static constexpr ALLOC_MODE sharedAllocMode()
For the nonblocking backend, a shared memory-segment should use interleaved alloc so that any thread ...
Definition: nonblocking/config.hpp:170