ViennaCL - The Vienna Computing Library: viennacl/linalg/opencl/misc_operations.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
misc_operations.hpp
Go to the documentation of this file.
1 #ifndef VIENNACL_LINALG_OPENCL_MISC_OPERATIONS_HPP_
2 #define VIENNACL_LINALG_OPENCL_MISC_OPERATIONS_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
25 #include "viennacl/forwards.h"
26 #include "viennacl/ocl/device.hpp"
27 #include "viennacl/ocl/handle.hpp"
28 #include "viennacl/ocl/kernel.hpp"
29 #include "viennacl/scalar.hpp"
30 #include "viennacl/vector.hpp"
31 #include "viennacl/tools/tools.hpp"
32 #include "viennacl/linalg/opencl/kernels/ilu.hpp"
33
34
35 namespace viennacl
36 {
37 namespace linalg
38 {
39 namespace opencl
40 {
41 namespace detail
42 {
43
44 template<typename NumericT>
45 void level_scheduling_substitute(vector<NumericT> & x,
46 viennacl::backend::mem_handle const & row_index_array,
47 viennacl::backend::mem_handle const & row_buffer,
48 viennacl::backend::mem_handle const & col_buffer,
49 viennacl::backend::mem_handle const & element_buffer,
50 vcl_size_t num_rows
51 )
52 {
53 viennacl::ocl::context & ctx = const_cast<viennacl::ocl::context &>(viennacl::traits::opencl_handle(x).context());
54
55 viennacl::linalg::opencl::kernels::ilu<NumericT>::init(ctx);
56 viennacl::ocl::kernel & k = ctx.get_kernel(viennacl::linalg::opencl::kernels::ilu<NumericT>::program_name(), "level_scheduling_substitute");
57
58 viennacl::ocl::enqueue(k(row_index_array.opencl_handle(), row_buffer.opencl_handle(), col_buffer.opencl_handle(), element_buffer.opencl_handle(),
59 x,
60 static_cast<cl_uint>(num_rows)));
61 }
62
63 } //namespace detail
64 } // namespace opencl
65 } //namespace linalg
66 } //namespace viennacl
67
68
69 #endif
device.hpp
Represents an OpenCL device within ViennaCL.
viennacl::ocl::kernel
Represents an OpenCL kernel within ViennaCL.
Definition: kernel.hpp:58
tools.hpp
Various little tools used here and there in ViennaCL.
viennacl::ocl::context
Manages an OpenCL context and provides the respective convenience functions for creating buffers...
Definition: context.hpp:55
forwards.h
This file provides the forward declarations for the main types used within ViennaCL.
viennacl::linalg::opencl::kernels::ilu
Main kernel class for generating OpenCL kernels for incomplete LU factorization preconditioners.
Definition: ilu.hpp:453
viennacl::ocl::context::get_kernel
viennacl::ocl::kernel & get_kernel(std::string const &program_name, std::string const &kernel_name)
Convenience function for retrieving the kernel of a program directly from the context.
Definition: context.hpp:605
ilu.hpp
OpenCL kernel file for nonnegative matrix factorization.
handle.hpp
Implementation of a smart-pointer-like class for handling OpenCL handles.
viennacl::linalg::opencl::kernels::ilu::init
static void init(viennacl::ocl::context &ctx)
Definition: ilu.hpp:460
viennacl::vcl_size_t
std::size_t vcl_size_t
Definition: forwards.h:75
viennacl::linalg::opencl::detail::level_scheduling_substitute
void level_scheduling_substitute(vector< NumericT > &x, viennacl::backend::mem_handle const &row_index_array, viennacl::backend::mem_handle const &row_buffer, viennacl::backend::mem_handle const &col_buffer, viennacl::backend::mem_handle const &element_buffer, vcl_size_t num_rows)
Definition: misc_operations.hpp:45
viennacl::vector< NumericT >
viennacl::ocl::enqueue
void enqueue(KernelType &k, viennacl::ocl::command_queue const &queue)
Enqueues a kernel in the provided queue.
Definition: enqueue.hpp:50
kernel.hpp
Representation of an OpenCL kernel in ViennaCL.
vector.hpp
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
viennacl::backend::mem_handle
Main abstraction class for multiple memory domains. Represents a buffer in either main RAM...
Definition: mem_handle.hpp:89
scalar.hpp
Implementation of the ViennaCL scalar class.