ALP User Documentation 0.7.alpha
Algebraic Programming User Documentation
Loading...
Searching...
No Matches
blas3.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
26#ifndef _H_GRB_BLAS3_BASE
27#define _H_GRB_BLAS3_BASE
28
30#include <graphblas/phase.hpp>
31
32#include "matrix.hpp"
33#include "vector.hpp"
34
35
36namespace grb {
37
87 template<
89 typename OutputType, typename InputType1, typename InputType2,
90 typename CIT, typename RIT, typename NIT,
91 class Semiring,
92 Backend backend
93 >
98 const Semiring &ring = Semiring(),
99 const Phase &phase = EXECUTE
100 ) {
101#ifdef _DEBUG
102 std::cerr << "Selected backend does not implement grb::mxm "
103 << "(semiring version)\n";
104#endif
105#ifndef NDEBUG
106 const bool selected_backend_does_not_support_mxm = false;
107 assert( selected_backend_does_not_support_mxm );
108#endif
109 (void) C;
110 (void) A;
111 (void) B;
112 (void) ring;
113 (void) phase;
114 // this is the generic stub implementation
115 return UNSUPPORTED;
116 }
117
175 template<
177 typename OutputType, typename InputType1, typename InputType2,
178 typename InputType3, typename RIT, typename CIT, typename NIT,
179 Backend backend, typename Coords
180 >
186 const Phase &phase = EXECUTE
187 ) {
188 (void) x;
189 (void) y;
190 (void) z;
191 (void) phase;
192#ifdef _DEBUG
193 std::cerr << "Selected backend does not implement grb::zip (vectors into "
194 << "matrices, non-void)\n";
195#endif
196#ifndef NDEBUG
197 const bool selected_backend_does_not_support_zip_from_vectors_to_matrix
198 = false;
199 assert( selected_backend_does_not_support_zip_from_vectors_to_matrix );
200#endif
201 const RC ret = grb::clear( A );
202 return ret == SUCCESS ? UNSUPPORTED : ret;
203 }
204
217 template<
219 typename InputType1, typename InputType2, typename InputType3,
220 typename RIT, typename CIT, typename NIT,
221 Backend backend, typename Coords
222 >
227 const Phase &phase = EXECUTE
228 ) {
229 (void) x;
230 (void) y;
231 (void) phase;
232#ifdef _DEBUG
233 std::cerr << "Selected backend does not implement grb::zip (vectors into "
234 << "matrices, void)\n";
235#endif
236#ifndef NDEBUG
237 const bool selected_backend_does_not_support_zip_from_vectors_to_void_matrix
238 = false;
239 assert( selected_backend_does_not_support_zip_from_vectors_to_void_matrix );
240#endif
241 const RC ret = grb::clear( A );
242 return ret == SUCCESS ? UNSUPPORTED : ret;
243 }
244
249} // namespace grb
250
251#endif // end _H_GRB_BLAS3_BASE
252
This file contains a register of all backends that are either implemented, under implementation,...
An ALP/GraphBLAS matrix.
Definition: matrix.hpp:71
A generalised semiring.
Definition: semiring.hpp:186
A GraphBLAS vector.
Definition: vector.hpp:64
RC mxm(Matrix< OutputType, backend, CIT, RIT, NIT > &C, const Matrix< InputType1, backend, CIT, RIT, NIT > &A, const Matrix< InputType2, backend, CIT, RIT, NIT > &B, const Semiring &ring=Semiring(), const Phase &phase=EXECUTE)
Unmasked and in-place sparse matrix–sparse matrix multiplication (SpMSpM), .
Definition: blas3.hpp:94
RC zip(Matrix< OutputType, backend, RIT, CIT, NIT > &A, const Vector< InputType1, backend, Coords > &x, const Vector< InputType2, backend, Coords > &y, const Vector< InputType3, backend, Coords > &z, const Phase &phase=EXECUTE)
The grb::zip merges three vectors into a matrix.
Definition: blas3.hpp:181
RC clear(Vector< DataType, backend, Coords > &x) noexcept
Clears a given vector of all nonzeroes.
Definition: io.hpp:574
Backend
A collection of all backends.
Definition: backends.hpp:46
Specifies the ALP/GraphBLAS matrix container.
static constexpr Descriptor no_operation
Indicates no additional pre- or post-processing on any of the GraphBLAS function arguments.
Definition: descriptors.hpp:63
The ALP/GraphBLAS namespace.
Definition: graphblas.hpp:450
RC
Return codes of ALP primitives.
Definition: rc.hpp:47
@ SUCCESS
Indicates the primitive has executed successfully.
Definition: rc.hpp:54
@ UNSUPPORTED
Indicates that the execution of the requested primitive with the given arguments is not supported by ...
Definition: rc.hpp:129
unsigned int Descriptor
Descriptors indicate pre- or post-processing for some or all of the arguments to an ALP/GraphBLAS cal...
Definition: descriptors.hpp:54
Phase
Primitives with sparse ALP/GraphBLAS output containers may run into the issue where an appropriate gr...
Definition: phase.hpp:152
@ EXECUTE
Speculatively assumes that the output container of the requested operation has enough capacity to com...
Definition: phase.hpp:257
Defines the various phases an ALP/GraphBLAS primitive may be executed with.
Specifies the ALP/GraphBLAS vector container.