ViennaCL - The Vienna Computing Library  1.5.1
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-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 
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"
33 
34 
35 namespace viennacl
36 {
37  namespace linalg
38  {
39  namespace opencl
40  {
41 
42  namespace detail
43  {
44 
45  template <typename ScalarType>
47  viennacl::backend::mem_handle const & row_index_array,
48  viennacl::backend::mem_handle const & row_buffer,
49  viennacl::backend::mem_handle const & col_buffer,
50  viennacl::backend::mem_handle const & element_buffer,
51  vcl_size_t num_rows
52  )
53  {
54  viennacl::ocl::context & ctx = const_cast<viennacl::ocl::context &>(viennacl::traits::opencl_handle(vec).context());
55 
58 
59  viennacl::ocl::enqueue(k(row_index_array.opencl_handle(), row_buffer.opencl_handle(), col_buffer.opencl_handle(), element_buffer.opencl_handle(),
60  vec,
61  static_cast<cl_uint>(num_rows)));
62  }
63 
64  } //namespace detail
65 
66 
67  } // namespace opencl
68  } //namespace linalg
69 } //namespace viennacl
70 
71 
72 #endif
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:470
void level_scheduling_substitute(vector< ScalarType > &vec, 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:46
std::size_t vcl_size_t
Definition: forwards.h:58
Represents an OpenCL device within ViennaCL.
Represents an OpenCL kernel within ViennaCL.
Definition: kernel.hpp:59
Various little tools used here and there in ViennaCL.
Manages an OpenCL context and provides the respective convenience functions for creating buffers...
Definition: context.hpp:51
This file provides the forward declarations for the main types used within ViennaCL.
void enqueue(KernelType &k, viennacl::ocl::command_queue const &queue)
Enqueues a kernel in the provided queue.
Definition: enqueue.hpp:48
Main kernel class for generating OpenCL kernels for incomplete LU factorization preconditioners.
Definition: ilu.hpp:49
OpenCL kernel file for nonnegative matrix factorization.
Implementation of a smart-pointer-like class for handling OpenCL handles.
static void init(viennacl::ocl::context &ctx)
Definition: ilu.hpp:56
Representation of an OpenCL kernel in ViennaCL.
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
Main abstraction class for multiple memory domains. Represents a buffer in either main RAM...
Definition: mem_handle.hpp:62
Implementation of the ViennaCL scalar class.