ViennaCL - The Vienna Computing Library: viennacl/linalg/detail/spai/block_matrix.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
block_matrix.hpp
Go to the documentation of this file.
1 #ifndef VIENNACL_LINALG_DETAIL_SPAI_BLOCK_MATRIX_HPP
2 #define VIENNACL_LINALG_DETAIL_SPAI_BLOCK_MATRIX_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 #include <utility>
22 #include <iostream>
23 #include <fstream>
24 #include <string>
25 #include <algorithm>
26 #include <vector>
27 #include "viennacl/ocl/backend.hpp"
28 #include "viennacl/tools/tools.hpp"
29
36 namespace viennacl
37 {
38 namespace linalg
39 {
40 namespace detail
41 {
42 namespace spai
43 {
44
49 class block_matrix
50 {
51 public:
52
54
56 viennacl::ocl::handle<cl_mem>& handle(){ return elements_; }
57
59 viennacl::ocl::handle<cl_mem>& handle1() { return matrix_dimensions_; }
60
62 viennacl::ocl::handle<cl_mem>& handle2() { return start_block_inds_; }
63
65
67 const viennacl::ocl::handle<cl_mem>& handle() const { return elements_; }
68
70 const viennacl::ocl::handle<cl_mem>& handle1() const { return matrix_dimensions_; }
71
73 const viennacl::ocl::handle<cl_mem>& handle2() const { return start_block_inds_; }
74
75 private:
76 viennacl::ocl::handle<cl_mem> elements_;
77 viennacl::ocl::handle<cl_mem> matrix_dimensions_;
78 viennacl::ocl::handle<cl_mem> start_block_inds_;
79 };
80
81
82 }
83 }
84 }
85 }
86 #endif
viennacl::linalg::detail::spai::block_matrix
Represents contigious matrices on GPU.
Definition: block_matrix.hpp:49
viennacl::linalg::detail::spai::block_matrix::handle
viennacl::ocl::handle< cl_mem > & handle()
Returns a handle to the elements.
Definition: block_matrix.hpp:56
tools.hpp
Various little tools used here and there in ViennaCL.
viennacl::linalg::detail::spai::block_matrix::handle
const viennacl::ocl::handle< cl_mem > & handle() const
Returns a handle to the const elements.
Definition: block_matrix.hpp:67
viennacl::linalg::detail::spai::block_matrix::handle1
viennacl::ocl::handle< cl_mem > & handle1()
Returns a handle to the matrix dimensions.
Definition: block_matrix.hpp:59
backend.hpp
Implementations of the OpenCL backend, where all contexts are stored in.
viennacl::linalg::detail::spai::block_matrix::handle2
viennacl::ocl::handle< cl_mem > & handle2()
Returns a handle to the start indices of matrix.
Definition: block_matrix.hpp:62
viennacl::linalg::detail::spai::block_matrix::handle2
const viennacl::ocl::handle< cl_mem > & handle2() const
Returns a handle to the const start indices of matrix.
Definition: block_matrix.hpp:73
viennacl::linalg::detail::spai::block_matrix::handle1
const viennacl::ocl::handle< cl_mem > & handle1() const
Returns a handle to the const matrix dimensions.
Definition: block_matrix.hpp:70
viennacl::ocl::handle< cl_mem >