1 #ifndef VIENNACL_LINALG_AMG_OPERATIONS_HPP_
2 #define VIENNACL_LINALG_AMG_OPERATIONS_HPP_
33 #ifdef VIENNACL_WITH_OPENCL
37 #ifdef VIENNACL_WITH_CUDA
50 template<
typename NumericT,
typename AMGContextT>
58 #ifdef VIENNACL_WITH_OPENCL
63 #ifdef VIENNACL_WITH_CUDA
76 template<
typename NumericT,
typename AMGContextT>
84 #ifdef VIENNACL_WITH_OPENCL
89 #ifdef VIENNACL_WITH_CUDA
102 template<
typename NumericT,
typename AMGContextT>
105 AMGContextT & amg_context,
113 #ifdef VIENNACL_WITH_OPENCL
118 #ifdef VIENNACL_WITH_CUDA
131 template<
typename NumericT>
145 #ifdef VIENNACL_WITH_OPENCL
154 #ifdef VIENNACL_WITH_CUDA
172 template<
typename SparseMatrixType,
typename NumericT>
177 assert( (A.size1() == B.
size1()) &&
bool(
"Size check failed for assignment to dense matrix: size1(A) != size1(B)"));
178 assert( (A.size2() == B.
size1()) &&
bool(
"Size check failed for assignment to dense matrix: size2(A) != size2(B)"));
185 #ifdef VIENNACL_WITH_OPENCL
190 #ifdef VIENNACL_WITH_CUDA
202 template<
typename NumericT>
215 #ifdef VIENNACL_WITH_OPENCL
220 #ifdef VIENNACL_WITH_CUDA
Simple enable-if variant that uses the SFINAE pattern.
void amg_influence(compressed_matrix< NumericT > const &A, viennacl::linalg::detail::amg::amg_level_context &amg_context, viennacl::linalg::amg_tag &tag)
Dispatcher for influence processing.
Exception class in case of memory errors.
void amg_interpol(compressed_matrix< NumericT > const &A, compressed_matrix< NumericT > &P, AMGContextT &amg_context, amg_tag &tag)
Implementations of routines for AMG in OpenCL.
Implementation of the dense matrix class.
void switch_memory_context(viennacl::context new_ctx)
Switches the memory context of the matrix.
void amg_influence(compressed_matrix< NumericT > const &A, AMGContextT &amg_context, amg_tag &tag)
This file provides the forward declarations for the main types used within ViennaCL.
Implementations of routines for AMG using the CPU on the host (with OpenMP if enabled).
void amg_coarse(InternalT1 &A, viennacl::linalg::detail::amg::amg_level_context &amg_context, viennacl::linalg::amg_tag &tag)
Calls the right coarsening procedure.
void amg_coarse(compressed_matrix< NumericT > const &A, AMGContextT &amg_context, amg_tag &tag)
Represents a generic 'context' similar to an OpenCL context, but is backend-agnostic and thus also su...
void amg_interpol(MatrixT const &A, MatrixT &P, viennacl::linalg::detail::amg::amg_level_context &amg_context, viennacl::linalg::amg_tag &tag)
Dispatcher for building the interpolation matrix.
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
void assign_to_dense(viennacl::compressed_matrix< NumericT, AlignmentV > const &A, viennacl::matrix_base< NumericT > &B)
viennacl::enable_if< viennacl::is_any_sparse_matrix< SparseMatrixType >::value >::type assign_to_dense(SparseMatrixType const &A, viennacl::matrix_base< NumericT > &B)
void amg_transpose(compressed_matrix< NumericT > const &A, compressed_matrix< NumericT > &B)
Computes B = trans(A).
void smooth_jacobi(unsigned int iterations, compressed_matrix< NumericT > const &A, vector< NumericT > &x, vector< NumericT > &x_backup, vector< NumericT > const &rhs_smooth, NumericT weight)
void amg_interpol(MatrixT const &A, MatrixT &P, viennacl::linalg::detail::amg::amg_level_context &amg_context, viennacl::linalg::amg_tag &tag)
Dispatcher for building the interpolation matrix.
void assign_to_dense(viennacl::compressed_matrix< NumericT, AlignmentV > const &A, viennacl::matrix_base< NumericT > &B)
void assign_to_dense(viennacl::compressed_matrix< NumericT, AlignmentV > const &A, viennacl::matrix_base< NumericT > &B)
Implementations of routines for AMG in OpenCL.
void smooth_jacobi(unsigned int iterations, compressed_matrix< NumericT > const &A, vector< NumericT > &x, vector< NumericT > &x_backup, vector< NumericT > const &rhs_smooth, NumericT weight)
Damped Jacobi Smoother (CUDA version)
void amg_transpose(compressed_matrix< NumericT > &A, compressed_matrix< NumericT > &B)
size_type size1() const
Returns the number of rows.
void smooth_jacobi(unsigned int iterations, compressed_matrix< NumericT > const &A, vector< NumericT > &x, vector< NumericT > &x_backup, vector< NumericT > const &rhs_smooth, NumericT weight)
Damped Jacobi Smoother (CUDA version)
A tag for algebraic multigrid (AMG). Used to transport information from the user to the implementatio...
void amg_influence(compressed_matrix< NumericT > const &A, viennacl::linalg::detail::amg::amg_level_context &amg_context, viennacl::linalg::amg_tag &tag)
Dispatcher for influence processing.
void smooth_jacobi(unsigned int iterations, compressed_matrix< NumericT > const &A, vector< NumericT > &x, vector< NumericT > &x_backup, vector< NumericT > const &rhs_smooth, NumericT weight)
Jacobi Smoother (OpenCL version)
viennacl::context context(T const &t)
Returns an ID for the currently active memory domain of an object.
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
void amg_coarse(MatrixT &A, viennacl::linalg::detail::amg::amg_level_context &amg_context, viennacl::linalg::amg_tag &tag)
Entry point and dispatcher for coarsening procedures.
void amg_coarse(InternalT1 &A, viennacl::linalg::detail::amg::amg_level_context &amg_context, viennacl::linalg::amg_tag &tag)
Calls the right coarsening procedure.
Helper classes and functions for the AMG preconditioner. Experimental.
void amg_interpol(MatrixT const &A, MatrixT &P, viennacl::linalg::detail::amg::amg_level_context &amg_context, viennacl::linalg::amg_tag &tag)
Dispatcher for building the interpolation matrix.
viennacl::backend::mem_handle & handle(T &obj)
Returns the generic memory handle of an object. Non-const version.
Implementation of the ViennaCL scalar class.
memory_types get_active_handle_id() const
Returns an ID for the currently active memory buffer. Other memory buffers might contain old or no da...
void amg_influence(compressed_matrix< NumericT > const &A, viennacl::linalg::detail::amg::amg_level_context &amg_context, viennacl::linalg::amg_tag &tag)
Dispatcher for influence processing.