ViennaCL - The Vienna Computing Library: libviennacl/src/blas3.hpp Source File

ViennaCL - The Vienna Computing Library 1.7.1 Free open-source GPU-accelerated linear algebra and solver library. |

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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"
33 #include "viennacl/linalg/direct_solve.hpp"
34 #include "viennacl/linalg/prod.hpp"
35
36 namespace detail
37 {
38 template <typename ScalarType, typename MatrixTypeA, typename MatrixTypeB, typename MatrixTypeC>
39 void gemm_dispatch(ScalarType alpha,
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)
47 viennacl::linalg::prod_impl(viennacl::trans(A), viennacl::trans(B), C, alpha, beta);
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
ViennaCLTranspose
Definition: viennacl.hpp:68
viennacl::trans
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.
Definition: sparse_matrix_operations.hpp:376
detail::gemm_dispatch
void gemm_dispatch(ScalarType alpha, MatrixTypeA const &A, ViennaCLTranspose transA, MatrixTypeB const &B, ViennaCLTranspose transB, ScalarType beta, MatrixTypeC &C)
Definition: blas3.hpp:39
prod.hpp
Generic interface for matrix-vector and matrix-matrix products. See viennacl/linalg/vector_operations...
matrix.hpp
Implementation of the dense matrix class.
viennacl_private.hpp
direct_solve.hpp
Implementations of dense direct solvers are found here.
vector.hpp
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
ScalarType
float ScalarType
Definition: fft_1d.cpp:42
ViennaCLNoTrans
Definition: viennacl.hpp:71
viennacl::linalg::prod_impl
void prod_impl(const matrix_base< NumericT > &mat, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
Definition: matrix_operations.hpp:438
ViennaCLTrans
Definition: viennacl.hpp:72
scalar.hpp
Implementation of the ViennaCL scalar class.
viennacl.hpp