CUSP
Loading...
Searching...
No Matches
multiply.h
Go to the documentation of this file.
1/*
2 * Copyright 2008-2014 NVIDIA Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
21#pragma once
22
23#include <cusp/detail/config.h>
24#include <cusp/detail/execution_policy.h>
25
26namespace cusp
27{
28
36template <typename DerivedPolicy,
37 typename LinearOperator,
38 typename MatrixOrVector1,
39 typename MatrixOrVector2>
40void multiply(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
41 const LinearOperator& A,
42 const MatrixOrVector1& B,
43 MatrixOrVector2& C);
98template <typename LinearOperator,
99 typename MatrixOrVector1,
100 typename MatrixOrVector2>
101void multiply(const LinearOperator& A,
102 const MatrixOrVector1& B,
103 MatrixOrVector2& C);
104
106template <typename DerivedPolicy,
107 typename LinearOperator,
108 typename MatrixOrVector1,
109 typename MatrixOrVector2,
110 typename UnaryFunction,
111 typename BinaryFunction1,
112 typename BinaryFunction2>
113void multiply(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
114 const LinearOperator& A,
115 const MatrixOrVector1& B,
116 MatrixOrVector2& C,
117 UnaryFunction initialize,
118 BinaryFunction1 combine,
119 BinaryFunction2 reduce);
187template <typename LinearOperator,
188 typename MatrixOrVector1,
189 typename MatrixOrVector2,
190 typename UnaryFunction,
191 typename BinaryFunction1,
192 typename BinaryFunction2>
193void multiply(const LinearOperator& A,
194 const MatrixOrVector1& B,
195 MatrixOrVector2& C,
196 UnaryFunction initialize,
197 BinaryFunction1 combine,
198 BinaryFunction2 reduce);
199
201template <typename DerivedPolicy,
202 typename LinearOperator,
203 typename MatrixOrVector1,
204 typename MatrixOrVector2,
205 typename UnaryFunction,
206 typename BinaryFunction1,
207 typename BinaryFunction2>
208void generalized_spgemm(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
209 const LinearOperator& A,
210 const MatrixOrVector1& B,
211 MatrixOrVector2& C,
212 UnaryFunction initialize,
213 BinaryFunction1 combine,
214 BinaryFunction2 reduce);
286template <typename LinearOperator,
287 typename MatrixOrVector1,
288 typename MatrixOrVector2,
289 typename UnaryFunction,
290 typename BinaryFunction1,
291 typename BinaryFunction2>
292void generalized_spgemm(const LinearOperator& A,
293 const MatrixOrVector1& B,
294 MatrixOrVector2& C,
295 UnaryFunction initialize,
296 BinaryFunction1 combine,
297 BinaryFunction2 reduce);
298
300template <typename DerivedPolicy,
301 typename LinearOperator,
302 typename Vector1,
303 typename Vector2,
304 typename Vector3,
305 typename BinaryFunction1,
306 typename BinaryFunction2>
307void generalized_spmv(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
308 const LinearOperator& A,
309 const Vector1& x,
310 const Vector2& y,
311 Vector3& z,
312 BinaryFunction1 combine,
313 BinaryFunction2 reduce);
379template <typename LinearOperator,
380 typename Vector1,
381 typename Vector2,
382 typename Vector3,
383 typename BinaryFunction1,
384 typename BinaryFunction2>
385void generalized_spmv(const LinearOperator& A,
386 const Vector1& x,
387 const Vector2& y,
388 Vector3& z,
389 BinaryFunction1 combine,
390 BinaryFunction2 reduce);
394} // end namespace cusp
395
396#include <cusp/detail/multiply.inl>
397
void multiply(const LinearOperator &A, const MatrixOrVector1 &B, MatrixOrVector2 &C)
Implements matrix-matrix and matrix-vector multiplication.
void generalized_spmv(const LinearOperator &A, const Vector1 &x, const Vector2 &y, Vector3 &z, BinaryFunction1 combine, BinaryFunction2 reduce)
Implements generalized matrix-vector multiplication.
void generalized_spgemm(const LinearOperator &A, const MatrixOrVector1 &B, MatrixOrVector2 &C, UnaryFunction initialize, BinaryFunction1 combine, BinaryFunction2 reduce)
Implements generalized matrix-matrix multiplication.