ViennaCL - The Vienna Computing Library: viennacl/linalg/detail/op_executor.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
op_executor.hpp
Go to the documentation of this file.
1 #ifndef VIENNACL_LINALG_DETAIL_OP_EXECUTOR_HPP
2 #define VIENNACL_LINALG_DETAIL_OP_EXECUTOR_HPP
3
4 /* =========================================================================
5 Copyright (c) 2010-2016, 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 manual)
17
18 License: MIT (X11), see file LICENSE in the base directory
19 ============================================================================= */
20
26 #include "viennacl/forwards.h"
27
28 namespace viennacl
29 {
30 namespace linalg
31 {
32 namespace detail
33 {
34
35 template<typename NumericT, typename B>
36 bool op_aliasing(vector_base<NumericT> const & /*lhs*/, B const & /*b*/)
37 {
38 return false;
39 }
40
41 template<typename NumericT>
42 bool op_aliasing(vector_base<NumericT> const & lhs, vector_base<NumericT> const & b)
43 {
44 return lhs.handle() == b.handle();
45 }
46
47 template<typename NumericT, typename LhsT, typename RhsT, typename OpT>
48 bool op_aliasing(vector_base<NumericT> const & lhs, vector_expression<const LhsT, const RhsT, OpT> const & rhs)
49 {
50 return op_aliasing(lhs, rhs.lhs()) || op_aliasing(lhs, rhs.rhs());
51 }
52
53
54 template<typename NumericT, typename B>
55 bool op_aliasing(matrix_base<NumericT> const & /*lhs*/, B const & /*b*/)
56 {
57 return false;
58 }
59
60 template<typename NumericT>
61 bool op_aliasing(matrix_base<NumericT> const & lhs, matrix_base<NumericT> const & b)
62 {
63 return lhs.handle() == b.handle();
64 }
65
66 template<typename NumericT, typename LhsT, typename RhsT, typename OpT>
67 bool op_aliasing(matrix_base<NumericT> const & lhs, matrix_expression<const LhsT, const RhsT, OpT> const & rhs)
68 {
69 return op_aliasing(lhs, rhs.lhs()) || op_aliasing(lhs, rhs.rhs());
70 }
71
72
79 template<typename A, typename OP, typename T>
80 struct op_executor {};
81
82 }
83 }
84 }
85
86 #endif // VIENNACL_LINALG_DETAIL_OP_EXECUTOR_HPP
viennacl::linalg::detail::op_executor
Worker class for decomposing expression templates.
Definition: op_executor.hpp:80
viennacl::matrix_base< NumericT >
viennacl::matrix_expression
Expression template class for representing a tree of expressions which ultimately result in a matrix...
Definition: forwards.h:341
forwards.h
This file provides the forward declarations for the main types used within ViennaCL.
viennacl::vector_expression::lhs
lhs_reference_type lhs() const
Get left hand side operand.
Definition: vector.hpp:74
viennacl::vector_expression
An expression template class that represents a binary operation that yields a vector.
Definition: forwards.h:239
viennacl::linalg::detail::op_aliasing
bool op_aliasing(vector_base< NumericT > const &, B const &)
Definition: op_executor.hpp:36
viennacl::vector_expression::rhs
rhs_reference_type rhs() const
Get right hand side operand.
Definition: vector.hpp:77
viennacl::vector_base< NumericT >
viennacl::matrix_base::handle
handle_type & handle()
Returns the OpenCL handle, non-const-version.
Definition: matrix_def.hpp:244
viennacl::matrix_expression::rhs
RHS & rhs() const
Get right hand side operand.
Definition: matrix.hpp:69
viennacl::matrix_expression::lhs
LHS & lhs() const
Get left hand side operand.
Definition: matrix.hpp:66
viennacl::vector_base::handle
const handle_type & handle() const
Returns the memory handle.
Definition: vector_def.hpp:128