ALP User Documentation  0.8.preview
Algebraic Programming User Documentation
bsp1d/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_BSP1D_CONFIG
28 #define _H_GRB_BSP1D_CONFIG
29 
30 #include <assert.h>
31 
33 
34 // if not defined, we set the backend of the BSP1D implementation to the
35 // reference implementation
36 #ifndef _GRB_BSP1D_BACKEND
37  #pragma message "_GRB_BSP1D_BACKEND was not set-- auto-selecting reference"
38  #define _GRB_BSP1D_BACKEND reference
39 #endif
40 
41 
42 namespace grb {
43 
44  namespace config {
45 
64  template<>
65  class IMPLEMENTATION< BSP1D > {
66 
67  private:
68 
74  static bool set;
75 
81  static grb::config::ALLOC_MODE mode;
82 
88  static void deduce() noexcept;
89 
90 
91  public:
92 
96  static constexpr ALLOC_MODE defaultAllocMode() {
98  }
99 
106  static constexpr bool fixedVectorCapacities() {
108  }
109 
127  static grb::config::ALLOC_MODE sharedAllocMode() noexcept;
128 
134  static constexpr Backend coordinatesBackend() {
135  return IMPLEMENTATION< _GRB_BSP1D_BACKEND >::coordinatesBackend();
136  }
137 
138  };
139 
142  } // namespace config
143 
144 } // namespace grb
145 
146 #endif // end ``_H_GRB_BSP1D_CONFIG''
147 
RC set(Vector< DataType, backend, Coords > &x, const T val, const Phase &phase=EXECUTE, const typename std::enable_if< !grb::is_object< DataType >::value &&!grb::is_object< T >::value, void >::type *const =nullptr) noexcept
Sets all elements of a vector to the given value.
Definition: io.hpp:858
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 ALLOC_MODE defaultAllocMode()
Definition: bsp1d/config.hpp:96
Contains the configuration parameters for the reference and reference_omp backends.
Backend
A collection of all backends.
Definition: backends.hpp:49
The ALP/GraphBLAS namespace.
Definition: graphblas.hpp:477
static constexpr ALLOC_MODE sharedAllocMode()
Defines how shared memory regions are allocated.
Allocation via posix_memalign.
Definition: reference/config.hpp:57
A parallel implementation based on a row-wise 1D data distribution, implemented using LPF.
Definition: backends.hpp:113