ViennaCL - The Vienna Computing Library: viennacl/scheduler/execute_matrix_prod.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
execute_matrix_prod.hpp
Go to the documentation of this file.
1 #ifndef VIENNACL_SCHEDULER_EXECUTE_MATRIX_PROD_HPP
2 #define VIENNACL_SCHEDULER_EXECUTE_MATRIX_PROD_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
21
26 #include "viennacl/forwards.h"
27 #include "viennacl/scheduler/forwards.h"
28 #include "viennacl/scheduler/execute_util.hpp"
29 #include "viennacl/scheduler/execute_generic_dispatcher.hpp"
30 #include "viennacl/linalg/vector_operations.hpp"
31 #include "viennacl/linalg/matrix_operations.hpp"
32 #include "viennacl/linalg/sparse_matrix_operations.hpp"
33 #include "viennacl/compressed_matrix.hpp"
34 #include "viennacl/coordinate_matrix.hpp"
35 #include "viennacl/ell_matrix.hpp"
36 #include "viennacl/hyb_matrix.hpp"
37
38 namespace viennacl
39 {
40 namespace scheduler
41 {
42 namespace detail
43 {
44 inline bool matrix_prod_temporary_required(statement const & s, lhs_rhs_element const & elem)
45 {
46 if (elem.type_family != COMPOSITE_OPERATION_FAMILY)
47 return false;
48
49 // check composite node for being a transposed matrix proxy:
50 statement_node const & leaf = s.array()[elem.node_index];
51 if ( leaf.op.type == OPERATION_UNARY_TRANS_TYPE && leaf.lhs.type_family == MATRIX_TYPE_FAMILY)
52 return false;
53
54 return true;
55 }
56
57 inline void matrix_matrix_prod(statement const & s,
58 lhs_rhs_element result,
59 lhs_rhs_element const & A,
60 lhs_rhs_element const & B,
61 double alpha,
62 double beta)
63 {
64 if (A.type_family == MATRIX_TYPE_FAMILY && B.type_family == MATRIX_TYPE_FAMILY) // C = A * B
65 {
66 assert( A.numeric_type == B.numeric_type && bool("Numeric type not the same!"));
67 assert( result.numeric_type == B.numeric_type && bool("Numeric type not the same!"));
68
69 if (A.subtype == DENSE_MATRIX_TYPE && B.subtype == DENSE_MATRIX_TYPE && result.subtype == DENSE_MATRIX_TYPE)
70 {
71 switch (result.numeric_type)
72 {
73 case FLOAT_TYPE:
74 viennacl::linalg::prod_impl(*A.matrix_float, *B.matrix_float, *result.matrix_float, static_cast<float>(alpha), static_cast<float>(beta)); break;
75 case DOUBLE_TYPE:
76 viennacl::linalg::prod_impl(*A.matrix_double, *B.matrix_double, *result.matrix_double, alpha, beta); break;
77 default:
78 throw statement_not_supported_exception("Invalid numeric type in matrix-matrix multiplication");
79 }
80 }
81
82 }
83 else if (A.type_family == MATRIX_TYPE_FAMILY && B.type_family == COMPOSITE_OPERATION_FAMILY) // C = A * B^T
84 {
85 statement_node const & leaf = s.array()[B.node_index];
86
87 assert(leaf.lhs.type_family == MATRIX_TYPE_FAMILY && leaf.op.type == OPERATION_UNARY_TRANS_TYPE && bool("Logic error: Argument not a matrix transpose!"));
88 assert(leaf.lhs.numeric_type == result.numeric_type && bool("Numeric type not the same!"));
89 assert(result.numeric_type == A.numeric_type && bool("Numeric type not the same!"));
90
91 if (A.subtype == DENSE_MATRIX_TYPE && leaf.lhs.subtype == DENSE_MATRIX_TYPE && result.subtype == DENSE_MATRIX_TYPE)
92 {
93 switch (result.numeric_type)
94 {
95 case FLOAT_TYPE:
96 viennacl::linalg::prod_impl(*A.matrix_float,
97 viennacl::matrix_expression< const matrix_base<float>,
98 const matrix_base<float>,
99 op_trans> (*(leaf.lhs.matrix_float), *(leaf.lhs.matrix_float)),
100 *result.matrix_float, static_cast<float>(alpha), static_cast<float>(beta)); break;
101 case DOUBLE_TYPE:
102 viennacl::linalg::prod_impl(*A.matrix_double,
103 viennacl::matrix_expression< const matrix_base<double>,
104 const matrix_base<double>,
105 op_trans>(*(leaf.lhs.matrix_double), *(leaf.lhs.matrix_double)),
106 *result.matrix_double, alpha, beta); break;
107 default:
108 throw statement_not_supported_exception("Invalid numeric type in matrix-matrix multiplication");
109 }
110 }
111 }
112 else if (A.type_family == COMPOSITE_OPERATION_FAMILY && B.type_family == MATRIX_TYPE_FAMILY) // C = A^T * B
113 {
114 statement_node const & leaf = s.array()[A.node_index];
115
116 assert(leaf.lhs.type_family == MATRIX_TYPE_FAMILY && leaf.op.type == OPERATION_UNARY_TRANS_TYPE && bool("Logic error: Argument not a matrix transpose!"));
117 assert(leaf.lhs.numeric_type == result.numeric_type && bool("Numeric type not the same!"));
118 assert(result.numeric_type == B.numeric_type && bool("Numeric type not the same!"));
119
120 if (leaf.lhs.subtype == DENSE_MATRIX_TYPE && B.subtype == DENSE_MATRIX_TYPE && result.subtype == DENSE_MATRIX_TYPE)
121 {
122 switch (result.numeric_type)
123 {
124 case FLOAT_TYPE:
125 viennacl::linalg::prod_impl(viennacl::matrix_expression< const matrix_base<float>,
126 const matrix_base<float>,
127 op_trans>(*leaf.lhs.matrix_float, *leaf.lhs.matrix_float),
128 *B.matrix_float,
129 *result.matrix_float, static_cast<float>(alpha), static_cast<float>(beta)); break;
130 case DOUBLE_TYPE:
131 viennacl::linalg::prod_impl(viennacl::matrix_expression< const matrix_base<double>,
132 const matrix_base<double>,
133 op_trans>(*leaf.lhs.matrix_double, *leaf.lhs.matrix_double),
134 *B.matrix_double,
135 *result.matrix_double, alpha, beta); break;
136 default:
137 throw statement_not_supported_exception("Invalid numeric type in matrix-matrix multiplication");
138 }
139 }
140 }
141 else if (A.type_family == COMPOSITE_OPERATION_FAMILY && B.type_family == COMPOSITE_OPERATION_FAMILY) // C = A^T * B^T
142 {
143 statement_node const & leafA = s.array()[A.node_index];
144 statement_node const & leafB = s.array()[B.node_index];
145
146 assert(leafA.lhs.type_family == MATRIX_TYPE_FAMILY && leafA.op.type == OPERATION_UNARY_TRANS_TYPE && bool("Logic error: Argument not a matrix transpose!"));
147 assert(leafB.lhs.type_family == MATRIX_TYPE_FAMILY && leafB.op.type == OPERATION_UNARY_TRANS_TYPE && bool("Logic error: Argument not a matrix transpose!"));
148 assert(leafA.lhs.numeric_type == result.numeric_type && bool("Numeric type not the same!"));
149 assert(leafB.lhs.numeric_type == result.numeric_type && bool("Numeric type not the same!"));
150
151 if (leafA.lhs.subtype == DENSE_MATRIX_TYPE && leafB.lhs.subtype == DENSE_MATRIX_TYPE && result.subtype == DENSE_MATRIX_TYPE)
152 {
153 switch (result.numeric_type)
154 {
155 case FLOAT_TYPE:
156 viennacl::linalg::prod_impl(viennacl::matrix_expression< const matrix_base<float>,
157 const matrix_base<float>,
158 op_trans>(*leafA.lhs.matrix_float, *leafA.lhs.matrix_float),
159 viennacl::matrix_expression< const matrix_base<float>,
160 const matrix_base<float>,
161 op_trans>(*leafB.lhs.matrix_float, *leafB.lhs.matrix_float),
162 *result.matrix_float, static_cast<float>(alpha), static_cast<float>(beta)); break;
163 case DOUBLE_TYPE:
164 viennacl::linalg::prod_impl(viennacl::matrix_expression< const matrix_base<double>,
165 const matrix_base<double>,
166 op_trans>(*leafA.lhs.matrix_double, *leafA.lhs.matrix_double),
167 viennacl::matrix_expression< const matrix_base<double>,
168 const matrix_base<double>,
169 op_trans>(*leafB.lhs.matrix_double, *leafB.lhs.matrix_double),
170 *result.matrix_double, alpha, beta); break;
171 default:
172 throw statement_not_supported_exception("Invalid numeric type in matrix-matrix multiplication");
173 }
174 }
175 }
176 else
177 throw statement_not_supported_exception("Matrix-matrix multiplication encountered operands being neither dense matrices nor transposed dense matrices");
178 }
179
180 inline void matrix_vector_prod(statement const & s,
181 lhs_rhs_element result,
182 lhs_rhs_element const & A,
183 lhs_rhs_element const & x)
184 {
185 assert( result.numeric_type == x.numeric_type && bool("Numeric type not the same!"));
186 assert( result.type_family == x.type_family && bool("Subtype not the same!"));
187 assert( result.subtype == DENSE_VECTOR_TYPE && bool("Result node for matrix-vector product not a vector type!"));
188
189 // deal with transposed product first:
190 // switch: trans for A
191 if (A.type_family == COMPOSITE_OPERATION_FAMILY) // prod(trans(A), x)
192 {
193 statement_node const & leaf = s.array()[A.node_index];
194
195 assert(leaf.lhs.type_family == MATRIX_TYPE_FAMILY && leaf.op.type == OPERATION_UNARY_TRANS_TYPE && bool("Logic error: Argument not a matrix transpose!"));
196 assert(leaf.lhs.numeric_type == x.numeric_type && bool("Numeric type not the same!"));
197
198 if (leaf.lhs.subtype == DENSE_MATRIX_TYPE)
199 {
200 switch (leaf.lhs.numeric_type)
201 {
202 case FLOAT_TYPE:
203 viennacl::linalg::prod_impl(viennacl::matrix_expression< const matrix_base<float>,
204 const matrix_base<float>,
205 op_trans>(*leaf.lhs.matrix_float, *leaf.lhs.matrix_float),
206 *x.vector_float,
207 *result.vector_float); break;
208 case DOUBLE_TYPE:
209 viennacl::linalg::prod_impl(viennacl::matrix_expression< const matrix_base<double>,
210 const matrix_base<double>,
211 op_trans>(*leaf.lhs.matrix_double, *leaf.lhs.matrix_double),
212 *x.vector_double,
213 *result.vector_double); break;
214 default:
215 throw statement_not_supported_exception("Invalid numeric type in matrix-{matrix,vector} multiplication");
216 }
217 }
218 else
219 throw statement_not_supported_exception("Invalid matrix type for transposed matrix-vector product");
220 }
221 else if (A.subtype == DENSE_MATRIX_TYPE)
222 {
223 switch (A.numeric_type)
224 {
225 case FLOAT_TYPE:
226 viennacl::linalg::prod_impl(*A.matrix_float, *x.vector_float, *result.vector_float);
227 break;
228 case DOUBLE_TYPE:
229 viennacl::linalg::prod_impl(*A.matrix_double, *x.vector_double, *result.vector_double);
230 break;
231 default:
232 throw statement_not_supported_exception("Invalid numeric type in matrix-{matrix,vector} multiplication");
233 }
234 }
235 else if (A.subtype == COMPRESSED_MATRIX_TYPE)
236 {
237 switch (A.numeric_type)
238 {
239 case FLOAT_TYPE:
240 viennacl::linalg::prod_impl(*A.compressed_matrix_float, *x.vector_float, float(1), *result.vector_float, float(0));
241 break;
242 case DOUBLE_TYPE:
243 viennacl::linalg::prod_impl(*A.compressed_matrix_double, *x.vector_double, double(1), *result.vector_double, double(0));
244 break;
245 default:
246 throw statement_not_supported_exception("Invalid numeric type in matrix-{matrix,vector} multiplication");
247 }
248 }
249 else if (A.subtype == COORDINATE_MATRIX_TYPE)
250 {
251 switch (A.numeric_type)
252 {
253 case FLOAT_TYPE:
254 viennacl::linalg::prod_impl(*A.coordinate_matrix_float, *x.vector_float, float(1), *result.vector_float, float(0));
255 break;
256 case DOUBLE_TYPE:
257 viennacl::linalg::prod_impl(*A.coordinate_matrix_double, *x.vector_double, double(1), *result.vector_double, double(0));
258 break;
259 default:
260 throw statement_not_supported_exception("Invalid numeric type in matrix-{matrix,vector} multiplication");
261 }
262 }
263 else if (A.subtype == ELL_MATRIX_TYPE)
264 {
265 switch (A.numeric_type)
266 {
267 case FLOAT_TYPE:
268 viennacl::linalg::prod_impl(*A.ell_matrix_float, *x.vector_float, float(1), *result.vector_float, float(0));
269 break;
270 case DOUBLE_TYPE:
271 viennacl::linalg::prod_impl(*A.ell_matrix_double, *x.vector_double, double(1), *result.vector_double, double(0));
272 break;
273 default:
274 throw statement_not_supported_exception("Invalid numeric type in matrix-{matrix,vector} multiplication");
275 }
276 }
277 else if (A.subtype == HYB_MATRIX_TYPE)
278 {
279 switch (A.numeric_type)
280 {
281 case FLOAT_TYPE:
282 viennacl::linalg::prod_impl(*A.hyb_matrix_float, *x.vector_float, float(1), *result.vector_float, float(0));
283 break;
284 case DOUBLE_TYPE:
285 viennacl::linalg::prod_impl(*A.hyb_matrix_double, *x.vector_double, double(1), *result.vector_double, double(0));
286 break;
287 default:
288 throw statement_not_supported_exception("Invalid numeric type in matrix-{matrix,vector} multiplication");
289 }
290 }
291 else
292 {
293 std::cout << "A.subtype: " << A.subtype << std::endl;
294 throw statement_not_supported_exception("Invalid matrix type for matrix-vector product");
295 }
296 }
297
298 } // namespace detail
299
300 inline void execute_matrix_prod(statement const & s, statement_node const & root_node)
301 {
302 statement_node const & leaf = s.array()[root_node.rhs.node_index];
303 viennacl::context ctx = detail::extract_context(root_node);
304
305 // Part 1: Check whether temporaries are required //
306
307 statement_node new_root_lhs;
308 statement_node new_root_rhs;
309
310 bool lhs_needs_temporary = detail::matrix_prod_temporary_required(s, leaf.lhs);
311 bool rhs_needs_temporary = detail::matrix_prod_temporary_required(s, leaf.rhs);
312
313 // check for temporary on lhs:
314 if (lhs_needs_temporary)
315 {
316 std::cout << "Temporary for LHS!" << std::endl;
317 detail::new_element(new_root_lhs.lhs, root_node.lhs, ctx);
318
319 new_root_lhs.op.type_family = OPERATION_BINARY_TYPE_FAMILY;
320 new_root_lhs.op.type = OPERATION_BINARY_ASSIGN_TYPE;
321
322 new_root_lhs.rhs.type_family = COMPOSITE_OPERATION_FAMILY;
323 new_root_lhs.rhs.subtype = INVALID_SUBTYPE;
324 new_root_lhs.rhs.numeric_type = INVALID_NUMERIC_TYPE;
325 new_root_lhs.rhs.node_index = leaf.lhs.node_index;
326
327 // work on subexpression:
328 // TODO: Catch exception, free temporary, then rethrow
329 detail::execute_composite(s, new_root_lhs);
330 }
331
332 // check for temporary on rhs:
333 if (rhs_needs_temporary)
334 {
335 detail::new_element(new_root_rhs.lhs, root_node.lhs, ctx);
336
337 new_root_rhs.op.type_family = OPERATION_BINARY_TYPE_FAMILY;
338 new_root_rhs.op.type = OPERATION_BINARY_ASSIGN_TYPE;
339
340 new_root_rhs.rhs.type_family = COMPOSITE_OPERATION_FAMILY;
341 new_root_rhs.rhs.subtype = INVALID_SUBTYPE;
342 new_root_rhs.rhs.numeric_type = INVALID_NUMERIC_TYPE;
343 new_root_rhs.rhs.node_index = leaf.rhs.node_index;
344
345 // work on subexpression:
346 // TODO: Catch exception, free temporary, then rethrow
347 detail::execute_composite(s, new_root_rhs);
348 }
349
350 // Part 2: Run the actual computations //
351
352 lhs_rhs_element x = lhs_needs_temporary ? new_root_lhs.lhs : leaf.lhs;
353 lhs_rhs_element y = rhs_needs_temporary ? new_root_rhs.lhs : leaf.rhs;
354
355 if (root_node.lhs.type_family == VECTOR_TYPE_FAMILY)
356 {
357 if (root_node.op.type != OPERATION_BINARY_ASSIGN_TYPE)
358 {
359 //split y += A*x
360 statement_node new_root_z;
361 detail::new_element(new_root_z.lhs, root_node.lhs, ctx);
362
363 // compute z = A * x
364 detail::matrix_vector_prod(s, new_root_z.lhs, x, y);
365
366 // assignment y = z
367 double alpha = 0;
368 if (root_node.op.type == OPERATION_BINARY_INPLACE_ADD_TYPE)
369 alpha = 1.0;
370 else if (root_node.op.type == OPERATION_BINARY_INPLACE_SUB_TYPE)
371 alpha = -1.0;
372 else
373 throw statement_not_supported_exception("Invalid assignment type for matrix-vector product");
374
375 lhs_rhs_element y2 = root_node.lhs;
376 detail::axbx(y2,
377 y2, 1.0, 1, false, false,
378 new_root_z.lhs, alpha, 1, false, false);
379
380 detail::delete_element(new_root_z.lhs);
381 }
382 else
383 detail::matrix_vector_prod(s, root_node.lhs, x, y);
384 }
385 else
386 {
387 double alpha = (root_node.op.type == OPERATION_BINARY_INPLACE_SUB_TYPE) ? -1.0 : 1.0;
388 double beta = (root_node.op.type != OPERATION_BINARY_ASSIGN_TYPE) ? 1.0 : 0.0;
389
390 detail::matrix_matrix_prod(s, root_node.lhs, x, y, alpha, beta);
391 }
392
393 // Part 3: Clean up //
394
395 if (lhs_needs_temporary)
396 detail::delete_element(new_root_lhs.lhs);
397
398 if (rhs_needs_temporary)
399 detail::delete_element(new_root_rhs.lhs);
400 }
401
402 } // namespace scheduler
403 } // namespace viennacl
404
405 #endif
406
viennacl::scheduler::HYB_MATRIX_TYPE
Definition: forwards.h:280
matrix_operations.hpp
Implementations of dense matrix related operations including matrix-vector products.
viennacl::scheduler::execute_matrix_prod
void execute_matrix_prod(statement const &s, statement_node const &root_node)
Definition: execute_matrix_prod.hpp:300
viennacl::scheduler::OPERATION_UNARY_TRANS_TYPE
Definition: forwards.h:106
vector_operations.hpp
Implementations of vector operations.
viennacl::scheduler::detail::extract_context
viennacl::context extract_context(statement_node const &root_node)
Helper routine for extracting the context in which a statement is executed.
Definition: execute_util.hpp:105
viennacl::scheduler::DENSE_VECTOR_TYPE
Definition: forwards.h:271
viennacl::scheduler::DOUBLE_TYPE
Definition: forwards.h:300
viennacl::scheduler::COORDINATE_MATRIX_TYPE
Definition: forwards.h:278
viennacl::scheduler::INVALID_SUBTYPE
Definition: forwards.h:266
viennacl::matrix_base< float >
viennacl::scheduler::lhs_rhs_element::subtype
statement_node_subtype subtype
Definition: forwards.h:340
viennacl::matrix_expression
Expression template class for representing a tree of expressions which ultimately result in a matrix...
Definition: forwards.h:341
viennacl::scheduler::MATRIX_TYPE_FAMILY
Definition: forwards.h:260
viennacl::scheduler::lhs_rhs_element::coordinate_matrix_double
viennacl::coordinate_matrix< double > * coordinate_matrix_double
Definition: forwards.h:443
viennacl::scheduler::statement_node::op
op_element op
Definition: forwards.h:481
forwards.h
This file provides the forward declarations for the main types used within ViennaCL.
viennacl::scheduler::detail::matrix_vector_prod
void matrix_vector_prod(statement const &s, lhs_rhs_element result, lhs_rhs_element const &A, lhs_rhs_element const &x)
Definition: execute_matrix_prod.hpp:180
viennacl::scheduler::lhs_rhs_element::type_family
statement_node_type_family type_family
Definition: forwards.h:339
viennacl::scheduler::OPERATION_BINARY_ASSIGN_TYPE
Definition: forwards.h:115
viennacl::scheduler::lhs_rhs_element
A class representing the 'data' for the LHS or RHS operand of the respective node.
Definition: forwards.h:337
viennacl::scheduler::statement::array
container_type const & array() const
Definition: forwards.h:528
execute_generic_dispatcher.hpp
Provides unified wrappers for the common routines {as(), asbs(), asbs_s()}, {av(), avbv(), avbv_v()}, and {am(), ambm(), ambm_m()} such that scheduler logic is not cluttered with numeric type decutions.
viennacl::scheduler::op_element::type_family
operation_node_type_family type_family
Definition: forwards.h:473
coordinate_matrix.hpp
Implementation of the coordinate_matrix class.
viennacl::scheduler::lhs_rhs_element::matrix_double
viennacl::matrix_base< double > * matrix_double
Definition: forwards.h:410
viennacl::scheduler::detail::delete_element
void delete_element(lhs_rhs_element &elem)
Definition: execute_util.hpp:266
viennacl::scheduler::lhs_rhs_element::hyb_matrix_double
viennacl::hyb_matrix< double > * hyb_matrix_double
Definition: forwards.h:465
viennacl::context
Represents a generic 'context' similar to an OpenCL context, but is backend-agnostic and thus also su...
Definition: context.hpp:39
viennacl::scheduler::COMPOSITE_OPERATION_FAMILY
Definition: forwards.h:251
hyb_matrix.hpp
Implementation of the hyb_matrix class.
viennacl::scheduler::DENSE_MATRIX_TYPE
Definition: forwards.h:274
viennacl::scheduler::lhs_rhs_element::compressed_matrix_float
viennacl::compressed_matrix< float > * compressed_matrix_float
Definition: forwards.h:431
viennacl::scheduler::detail::axbx
void axbx(lhs_rhs_element &x1, lhs_rhs_element const &x2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, lhs_rhs_element const &x3, ScalarType2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
Wrapper for viennacl::linalg::avbv(), taking care of the argument unwrapping.
Definition: execute_generic_dispatcher.hpp:67
viennacl::scheduler::INVALID_NUMERIC_TYPE
Definition: forwards.h:288
viennacl::scheduler::OPERATION_BINARY_INPLACE_ADD_TYPE
Definition: forwards.h:116
viennacl::scheduler::lhs_rhs_element::numeric_type
statement_node_numeric_type numeric_type
Definition: forwards.h:341
compressed_matrix.hpp
Implementation of the compressed_matrix class.
viennacl::scheduler::lhs_rhs_element::vector_float
viennacl::vector_base< float > * vector_float
Definition: forwards.h:385
sparse_matrix_operations.hpp
Implementations of operations using sparse matrices.
viennacl::scheduler::statement_node::rhs
lhs_rhs_element rhs
Definition: forwards.h:482
viennacl::scheduler::lhs_rhs_element::matrix_float
viennacl::matrix_base< float > * matrix_float
Definition: forwards.h:409
viennacl::scheduler::statement_node::lhs
lhs_rhs_element lhs
Definition: forwards.h:480
viennacl::scheduler::lhs_rhs_element::vector_double
viennacl::vector_base< double > * vector_double
Definition: forwards.h:386
ell_matrix.hpp
Implementation of the ell_matrix class.
viennacl::scheduler::OPERATION_BINARY_TYPE_FAMILY
Definition: forwards.h:59
viennacl::scheduler::lhs_rhs_element::compressed_matrix_double
viennacl::compressed_matrix< double > * compressed_matrix_double
Definition: forwards.h:432
viennacl::scheduler::lhs_rhs_element::ell_matrix_double
viennacl::ell_matrix< double > * ell_matrix_double
Definition: forwards.h:454
viennacl::scheduler::lhs_rhs_element::hyb_matrix_float
viennacl::hyb_matrix< float > * hyb_matrix_float
Definition: forwards.h:464
forwards.h
Provides the datastructures for dealing with a single statement such as 'x = y + z;'.
viennacl::scheduler::detail::execute_composite
void execute_composite(statement const &s, statement_node const &root_node)
Deals with x = RHS where RHS is an expression and x is either a scalar, a vector, or a matrix...
Definition: execute.hpp:42
viennacl::scheduler::OPERATION_BINARY_INPLACE_SUB_TYPE
Definition: forwards.h:117
viennacl::scheduler::detail::new_element
void new_element(lhs_rhs_element &new_elem, lhs_rhs_element const &old_element, viennacl::context const &ctx)
Definition: execute_util.hpp:204
viennacl::scheduler::lhs_rhs_element::ell_matrix_float
viennacl::ell_matrix< float > * ell_matrix_float
Definition: forwards.h:453
viennacl::scheduler::ELL_MATRIX_TYPE
Definition: forwards.h:279
viennacl::scheduler::op_element::type
operation_node_type type
Definition: forwards.h:474
viennacl::op_trans
A tag class representing transposed matrices.
Definition: forwards.h:220
viennacl::scheduler::FLOAT_TYPE
Definition: forwards.h:299
viennacl::scheduler::statement
The main class for representing a statement such as x = inner_prod(y,z); at runtime.
Definition: forwards.h:502
viennacl::scheduler::detail::matrix_matrix_prod
void matrix_matrix_prod(statement const &s, lhs_rhs_element result, lhs_rhs_element const &A, lhs_rhs_element const &B, double alpha, double beta)
Definition: execute_matrix_prod.hpp:57
viennacl::scheduler::lhs_rhs_element::node_index
vcl_size_t node_index
Definition: forwards.h:346
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
viennacl::scheduler::detail::matrix_prod_temporary_required
bool matrix_prod_temporary_required(statement const &s, lhs_rhs_element const &elem)
Definition: execute_matrix_prod.hpp:44
viennacl::scheduler::lhs_rhs_element::coordinate_matrix_float
viennacl::coordinate_matrix< float > * coordinate_matrix_float
Definition: forwards.h:442
viennacl::scheduler::VECTOR_TYPE_FAMILY
Definition: forwards.h:257
execute_util.hpp
Provides various utilities for implementing the execution of statements.
viennacl::scheduler::statement_node
Main datastructure for an node in the statement tree.
Definition: forwards.h:478
viennacl::scheduler::statement_not_supported_exception
Exception for the case the scheduler is unable to deal with the operation.
Definition: forwards.h:38
viennacl::scheduler::COMPRESSED_MATRIX_TYPE
Definition: forwards.h:277