Reference documentation for deal.II version 9.0.0
|
#include <deal.II/matrix_free/cuda_matrix_free.h>
Classes | |
struct | Data |
Public Types | |
enum | ParallelizationScheme |
Public Member Functions | |
MatrixFree () | |
void | reinit (const Mapping< dim > &mapping, const DoFHandler< dim > &dof_handler, const ConstraintMatrix &constraints, const Quadrature< 1 > &quad, const AdditionalData additional_data=AdditionalData()) |
void | reinit (const DoFHandler< dim > &dof_handler, const ConstraintMatrix &constraints, const Quadrature< 1 > &quad, const AdditionalData AdditionalData=AdditionalData()) |
Data | get_data (unsigned int color) const |
template<typename functor > | |
void | cell_loop (const functor &func, const CUDAVector< Number > &src, CUDAVector< Number > &dst) const |
void | free () |
std::size_t | memory_consumption () const |
Public Member Functions inherited from Subscriptor | |
Subscriptor () | |
Subscriptor (const Subscriptor &) | |
Subscriptor (Subscriptor &&) noexcept | |
virtual | ~Subscriptor () |
Subscriptor & | operator= (const Subscriptor &) |
Subscriptor & | operator= (Subscriptor &&) noexcept |
void | subscribe (const char *identifier=nullptr) const |
void | unsubscribe (const char *identifier=nullptr) const |
unsigned int | n_subscriptions () const |
void | list_subscribers () const |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Private Attributes | |
ParallelizationScheme | parallelization_scheme |
unsigned int | fe_degree |
unsigned int | dofs_per_cell |
unsigned int | n_constrained_dofs |
unsigned int | q_points_per_cell |
unsigned int | n_colors |
std::vector< unsigned int > | n_cells |
std::vector< point_type * > | q_points |
std::vector< unsigned int * > | local_to_global |
std::vector< Number * > | inv_jacobian |
std::vector< Number * > | JxW |
std::vector< dim3 > | grid_dim |
std::vector< dim3 > | block_dim |
Additional Inherited Members | |
Static Public Member Functions inherited from Subscriptor | |
static ::ExceptionBase & | ExcInUse (int arg1, std::string arg2, std::string arg3) |
static ::ExceptionBase & | ExcNoSubscriber (std::string arg1, std::string arg2) |
This class collects all the data that is stored for the matrix free implementation. The storage scheme is tailored towards several loops performed with the same data, i.e., typically doing many matrix-vector products or residual computations on the same mesh.
This class does not implement any operations involving finite element basis functions, i.e., regarding the operation performed on the cells. For these operations, the class FEEvaluation is designed to use the data collected in this class.
This class implements a loop over all cells (cell_loop()). This loop is scheduled in such a way that cells that cells that share degrees of freedom are not worked on simultaneously, which implies that it is possible to write to vectors in parallel without having to explicitly synchronize access to these vectors and matrices. This class does not implement any shape values, all it does is to cache the respective data. To implement finite element operations, use the class CUDAWrappers::FEEvalutation.
This class traverse the cells in a different order than the usual Triangulation class in deal.II.
Definition at line 73 of file cuda_matrix_free.h.
enum CUDAWrappers::MatrixFree::ParallelizationScheme |
Parallelization scheme used: parallel_in_elem (parallelism at the level of degrees of freedom) or parallel_over_elem (parallelism at the level of cells)
Definition at line 89 of file cuda_matrix_free.h.
CUDAWrappers::MatrixFree< dim, Number >::MatrixFree | ( | ) |
Default constructor.
void CUDAWrappers::MatrixFree< dim, Number >::reinit | ( | const Mapping< dim > & | mapping, |
const DoFHandler< dim > & | dof_handler, | ||
const ConstraintMatrix & | constraints, | ||
const Quadrature< 1 > & | quad, | ||
const AdditionalData | additional_data = AdditionalData() |
||
) |
Extracts the information needed to perform loops over cells. The DoFHandler and ConstraintMatrix describe the layout of degrees of freedom, the DoFHandler and the mapping describe the transformation from unit to real cell, and the finite element underlying the DoFHandler together with the quadrature formula describe the local operations.
void CUDAWrappers::MatrixFree< dim, Number >::reinit | ( | const DoFHandler< dim > & | dof_handler, |
const ConstraintMatrix & | constraints, | ||
const Quadrature< 1 > & | quad, | ||
const AdditionalData | AdditionalData = AdditionalData() |
||
) |
Initializes the data structures. Same as above but using a Q1 mapping.
Data CUDAWrappers::MatrixFree< dim, Number >::get_data | ( | unsigned int | color | ) | const |
Return the Data structure associated with color
.
void CUDAWrappers::MatrixFree< dim, Number >::cell_loop | ( | const functor & | func, |
const CUDAVector< Number > & | src, | ||
CUDAVector< Number > & | dst | ||
) | const |
This method runs the loop over all cells and apply the local operation on each element in parallel. func
is a functor which is appplied on each color.
void CUDAWrappers::MatrixFree< dim, Number >::free | ( | ) |
Free all the memory allocated.
std::size_t CUDAWrappers::MatrixFree< dim, Number >::memory_consumption | ( | ) | const |
Return an approximation of the memory consumption of this class in bytes.
|
private |
Parallelization scheme used, parallelization over degrees of freedom or over cells.
Definition at line 200 of file cuda_matrix_free.h.
|
private |
Degree of the finite element used.
Definition at line 204 of file cuda_matrix_free.h.
|
private |
Number of degrees of freedom per cell.
Definition at line 208 of file cuda_matrix_free.h.
|
private |
Number of constrained degrees of freedom.
Definition at line 212 of file cuda_matrix_free.h.
|
private |
Number of quadrature points per cells.
Definition at line 216 of file cuda_matrix_free.h.
|
private |
Number of colors produced by the graph coloring algorithm.
Definition at line 220 of file cuda_matrix_free.h.
|
private |
Number of cells in each color.
Definition at line 224 of file cuda_matrix_free.h.
|
private |
Vector of pointers to the quadrature points associated to the cells of each color.
Definition at line 229 of file cuda_matrix_free.h.
|
private |
Map the position in the local vector to the position in the global vector.
Definition at line 234 of file cuda_matrix_free.h.
|
private |
Vector of pointer to the inverse Jacobian associated to the cells of each color.
Definition at line 239 of file cuda_matrix_free.h.
|
private |
Vector of pointer to the Jacobian time the weights associated to the cells of each color.
Definition at line 244 of file cuda_matrix_free.h.
|
private |
Grid dimensions associated to the different colors. The grid dimensions are used to launch the CUDA kernels.
Definition at line 253 of file cuda_matrix_free.h.
|
private |
Block dimensions associated to the different colors. The block dimensions are used to launch the CUDA kernels.
Definition at line 258 of file cuda_matrix_free.h.