ViennaCL - The Vienna Computing Library  1.7.0
Free open-source GPU-accelerated linear algebra and solver library.
blas3.hpp
Go to the documentation of this file.
1 #ifndef VIENNACL_SRC_BLAS3_HPP
2 #define VIENNACL_SRC_BLAS3_HPP
3 
4 /* =========================================================================
5  Copyright (c) 2010-2014, Institute for Microelectronics,
6  Institute for Analysis and Scientific Computing,
7  TU Wien.
8  Portions of this software are copyright by UChicago Argonne, LLC.
9 
10  -----------------
11  ViennaCL - The Vienna Computing Library
12  -----------------
13 
14  Project Head: Karl Rupp rupp@iue.tuwien.ac.at
15 
16  (A list of authors and contributors can be found in the PDF manual)
17 
18  License: MIT (X11), see file LICENSE in the base directory
19 ============================================================================= */
20 
21 // include necessary system headers
22 #include <iostream>
23 
24 #include "viennacl.hpp"
25 #include "viennacl_private.hpp"
26 
27 //include basic scalar and vector types of ViennaCL
28 #include "viennacl/scalar.hpp"
29 #include "viennacl/vector.hpp"
30 
31 #include "viennacl/vector.hpp"
32 #include "viennacl/matrix.hpp"
34 #include "viennacl/linalg/prod.hpp"
35 
36 namespace detail
37 {
38  template <typename ScalarType, typename MatrixTypeA, typename MatrixTypeB, typename MatrixTypeC>
40  MatrixTypeA const & A, ViennaCLTranspose transA,
41  MatrixTypeB const & B, ViennaCLTranspose transB,
42  ScalarType beta,
43  MatrixTypeC & C)
44  {
45 
46  if (transA == ViennaCLTrans && transB == ViennaCLTrans)
48  else if (transA == ViennaCLTrans && transB == ViennaCLNoTrans)
49  viennacl::linalg::prod_impl(viennacl::trans(A), B, C, alpha, beta);
50  else if (transA == ViennaCLNoTrans && transB == ViennaCLTrans)
51  viennacl::linalg::prod_impl(A, viennacl::trans(B), C, alpha, beta);
52  else if (transA == ViennaCLNoTrans && transB == ViennaCLNoTrans)
53  viennacl::linalg::prod_impl(A, B, C, alpha, beta);
54  //else
55  // return ViennaCLGenericFailure;
56  }
57 }
58 
59 
60 #endif
ViennaCLTranspose
Definition: viennacl.hpp:68
viennacl::enable_if< viennacl::is_any_sparse_matrix< M1 >::value, matrix_expression< const M1, const M1, op_trans > >::type trans(const M1 &mat)
Returns an expression template class representing a transposed matrix.
void gemm_dispatch(ScalarType alpha, MatrixTypeA const &A, ViennaCLTranspose transA, MatrixTypeB const &B, ViennaCLTranspose transB, ScalarType beta, MatrixTypeC &C)
Definition: blas3.hpp:39
Generic interface for matrix-vector and matrix-matrix products. See viennacl/linalg/vector_operations...
Implementation of the dense matrix class.
Definition: blas3.hpp:36
Implementations of dense direct solvers are found here.
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
float ScalarType
Definition: fft_1d.cpp:42
void prod_impl(const matrix_base< NumericT > &mat, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
Implementation of the ViennaCL scalar class.