ViennaCL - The Vienna Computing Library  1.5.2
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-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 
26 #include "viennacl/forwards.h"
27 
28 namespace viennacl
29 {
30  namespace linalg
31  {
32  namespace detail
33  {
34  template <typename T, typename B>
35  bool op_aliasing(vector_base<T> const & /*lhs*/, B const & /*b*/)
36  {
37  return false;
38  }
39 
40  template <typename T>
41  bool op_aliasing(vector_base<T> const & lhs, vector_base<T> const & b)
42  {
43  return lhs.handle() == b.handle();
44  }
45 
46  template <typename T, typename LHS, typename RHS, typename OP>
48  {
49  return op_aliasing(lhs, rhs.lhs()) || op_aliasing(lhs, rhs.rhs());
50  }
51 
52 
53  template <typename T, typename F, typename B>
54  bool op_aliasing(matrix_base<T, F> const & /*lhs*/, B const & /*b*/)
55  {
56  return false;
57  }
58 
59  template <typename T, typename F>
60  bool op_aliasing(matrix_base<T, F> const & lhs, matrix_base<T, F> const & b)
61  {
62  return lhs.handle() == b.handle();
63  }
64 
65  template <typename T, typename F, typename LHS, typename RHS, typename OP>
67  {
68  return op_aliasing(lhs, rhs.lhs()) || op_aliasing(lhs, rhs.rhs());
69  }
70 
71 
78  template <typename A, typename OP, typename T>
79  struct op_executor {};
80 
81  }
82  }
83 }
84 
85 #endif // VIENNACL_LINALG_DETAIL_OP_EXECUTOR_HPP
Worker class for decomposing expression templates.
Definition: op_executor.hpp:79
lhs_reference_type lhs() const
Get left hand side operand.
Definition: vector.hpp:181
Common base class for dense vectors, vector ranges, and vector slices.
Definition: forwards.h:205
This file provides the forward declarations for the main types used within ViennaCL.
RHS & rhs() const
Get right hand side operand.
Definition: matrix.hpp:177
LHS & lhs() const
Get left hand side operand.
Definition: matrix.hpp:174
A dense matrix class.
Definition: forwards.h:290
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
Definition: cpu_ram.hpp:29
An expression template class that represents a binary operation that yields a vector.
Definition: forwards.h:181
Expression template class for representing a tree of expressions which ultimately result in a matrix...
Definition: forwards.h:283
handle_type & handle()
Returns the OpenCL handle, non-const-version.
Definition: matrix.hpp:654
const handle_type & handle() const
Returns the memory handle.
Definition: vector.hpp:856
rhs_reference_type rhs() const
Get right hand side operand.
Definition: vector.hpp:184
bool op_aliasing(vector_base< T > const &, B const &)
Definition: op_executor.hpp:35