1 #ifndef VIENNACL_LINALG_OPENCL_BISECT_KERNEL_CALLS_HPP_
2 #define VIENNACL_LINALG_OPENCL_BISECT_KERNEL_CALLS_HPP_
45 template<
typename NumericT>
48 const unsigned int mat_size,
49 const NumericT lg,
const NumericT ug,
50 const NumericT precision)
60 viennacl::traits::opencl_handle(input.
g_b),
61 static_cast<cl_uint>(mat_size),
62 viennacl::traits::opencl_handle(result.
vcl_g_left),
63 viennacl::traits::opencl_handle(result.
vcl_g_right),
66 static_cast<NumericT>(lg),
67 static_cast<NumericT>(ug),
68 static_cast<cl_uint>(0),
69 static_cast<cl_uint>(mat_size),
70 static_cast<NumericT>(precision)
75 template<
typename NumericT>
78 const unsigned int mat_size,
79 const NumericT lg,
const NumericT ug,
80 const NumericT precision)
90 viennacl::traits::opencl_handle(input.
g_b),
91 static_cast<cl_uint>(mat_size),
92 static_cast<NumericT>(lg),
93 static_cast<NumericT>(ug),
94 static_cast<cl_uint>(0),
95 static_cast<cl_uint>(mat_size),
96 static_cast<NumericT>(precision),
97 viennacl::traits::opencl_handle(result.
g_num_one),
99 viennacl::traits::opencl_handle(result.
g_left_one),
100 viennacl::traits::opencl_handle(result.
g_right_one),
101 viennacl::traits::opencl_handle(result.
g_pos_one),
102 viennacl::traits::opencl_handle(result.
g_left_mult),
112 template<
typename NumericT>
115 const unsigned int mat_size,
116 const NumericT precision)
118 unsigned int num_one_intervals = result.
g_num_one;
129 viennacl::traits::opencl_handle(input.
g_b),
130 static_cast<cl_uint>(mat_size),
131 static_cast<cl_uint>(num_one_intervals),
132 viennacl::traits::opencl_handle(result.
g_left_one),
133 viennacl::traits::opencl_handle(result.
g_right_one),
134 viennacl::traits::opencl_handle(result.
g_pos_one),
135 static_cast<NumericT>(precision)
140 template<
typename NumericT>
143 const unsigned int mat_size,
144 const NumericT precision)
156 viennacl::traits::opencl_handle(input.
g_b),
157 static_cast<cl_uint>(mat_size),
160 viennacl::traits::opencl_handle(result.
g_left_mult),
165 viennacl::traits::opencl_handle(result.
g_pos_mult),
166 static_cast<NumericT>(precision)
static void init(viennacl::ocl::context &ctx)
void bisectLargeMultIntervals(const viennacl::linalg::detail::InputData< NumericT > &input, viennacl::linalg::detail::ResultDataLarge< NumericT > &result, const unsigned int mat_size, const NumericT precision)
viennacl::vector< NumericT > g_left_mult
void bisectSmall(const viennacl::linalg::detail::InputData< NumericT > &input, viennacl::linalg::detail::ResultDataSmall< NumericT > &result, const unsigned int mat_size, const NumericT lg, const NumericT ug, const NumericT precision)
#define VIENNACL_BISECT_MAX_THREADS_BLOCK
viennacl::vector< NumericT > g_left_one
Represents an OpenCL kernel within ViennaCL.
size_type local_work_size(int index=0) const
Returns the local work size at the respective dimension.
viennacl::scalar< unsigned int > g_num_blocks_mult
Manages an OpenCL context and provides the respective convenience functions for creating buffers...
viennacl::vector< unsigned int > g_blocks_mult
viennacl::vector< unsigned int > g_left_count_mult
const std::string BISECT_KERNEL_SMALL
const std::string BISECT_KERNEL_LARGE_ONE_INTERVALS
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
viennacl::vector< unsigned int > g_right_count_mult
const std::string BISECT_KERNEL_LARGE
void bisectLargeOneIntervals(const viennacl::linalg::detail::InputData< NumericT > &input, viennacl::linalg::detail::ResultDataLarge< NumericT > &result, const unsigned int mat_size, const NumericT precision)
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.
unsigned int getNumBlocksLinear(const unsigned int num_threads, const unsigned int num_threads_block)
viennacl::vector< NumericT > vcl_g_right
right interval limits at the end of the computation
viennacl::vector< NumericT > g_lambda_mult
viennacl::vector< NumericT > vcl_g_left
left interval limits at the end of the computation
viennacl::vector< unsigned int > vcl_g_left_count
number of eigenvalues smaller than the left interval limit
viennacl::vector< unsigned int > g_pos_one
OpenCL kernels for the bisection algorithm for eigenvalues.
#define VIENNACL_BISECT_MAX_THREADS_BLOCK_SMALL_MATRIX
const std::string BISECT_KERNEL_LARGE_MULT_INTERVALS
viennacl::vector< NumericT > g_right_one
void enqueue(KernelType &k, viennacl::ocl::command_queue const &queue)
Enqueues a kernel in the provided queue.
viennacl::vector< unsigned int > g_pos_mult
viennacl::vector< unsigned int > vcl_g_right_count
number of eigenvalues bigger than the right interval limit
In this class the data of the result for large matrices is stored.
size_type global_work_size(int index=0) const
Returns the global work size at the respective dimension.
viennacl::vector< unsigned int > g_blocks_mult_sum
viennacl::scalar< unsigned int > g_num_one
number of intervals containing one eigenvalue after the first step
In this class the data of the result for small matrices is stored.
Main kernel class for the generation of the bisection kernels and utilities.
void bisectLarge(const viennacl::linalg::detail::InputData< NumericT > &input, viennacl::linalg::detail::ResultDataLarge< NumericT > &result, const unsigned int mat_size, const NumericT lg, const NumericT ug, const NumericT precision)
viennacl::vector< NumericT > g_right_mult