ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
hsolver::LinearAlgebra< T, Device > Class Template Reference

Collective block algebra; only small coefficients cross the device boundary. More...

#include <linear_algebra.h>

Collaboration diagram for hsolver::LinearAlgebra< T, Device >:

Public Member Functions

 LinearAlgebra (const diag_comm_info &comm)
std::size_t storage_bytes (ct::DeviceType device) const
std::vector< Wide > projection_cross (int ld, int dim, int nx, int ny, const T *x, const T *y)
 Projection products and reductions in wavefunction precision; return double coefficients.
std::vector< Wide > arnoldi_dots (int ld, int dim, int bands, int count, int stride, const T *basis, const T *x)
 Arnoldi products in wavefunction precision; use dots() for reliable norms.
std::vector< Wide > dots (int ld, int dim, int bands, int count, int stride, const T *basis, const T *x)
 Products between corresponding bands and several Arnoldi blocks.
ct::Tensor dots_tensor (int ld, int dim, int bands, int count, int stride, const T *basis, const T *x)
std::vector< Wide > cross (int ld, int dim, int nx, int ny, const T *x, const T *y)
 Global X-adjoint times Y, with double accumulation for both precisions.
ct::Tensor cross_tensor (int ld, int dim, int nx, int ny, const T *x, const T *y)
ct::Tensor cross_root_tensor (int ld, int dim, int nx, int ny, const T *x, const T *y)
std::vector< Wide > gram (int ld, int dim, int bands, const T *input)
 Global X-adjoint times X, reusing one FP64 conversion of the valid rows.
ct::Tensor gram_tensor (int ld, int dim, int bands, const T *input)
ct::Tensor gram_root_tensor (int ld, int dim, int bands, const T *input)
void expand (int ld, int dim, int nx, int ny, const T *x, const std::vector< Wide > &c, T *y, T beta)
 Y = X*C + beta*Y, using a small host coefficient matrix.
const T * prepare_coefficients (const Wide *coefficients, const int64_t count)
 Convert/upload host coefficients once for several block rotations. The borrowed Device pointer is invalidated by the next prepare_coefficients() or nonempty expand() on this object. expand_prepared() does not invalidate it.
void expand_prepared (int ld, int dim, int nx, int ny, const T *x, const T *c, T *y, T beta)
 Y = X*C + beta*Y with already prepared Device coefficients (ld C = nx). X and Y must not overlap; C must contain at least nx*ny elements.

Private Types

using Wide = std::complex<double>

Private Member Functions

void reduce (std::vector< Wide > *values) const
void reduce (Wide *values, const int64_t count) const
void cross_local_into (int ld, int dim, int nx, int ny, const T *x, const T *y, Wide *result)
void gram_local_into (int ld, int dim, int bands, const T *input, Wide *result)

Private Attributes

const diag_comm_info comm_
ct::Tensor products_
ct::Tensor coefficients_
ct::Tensor left_
ct::Tensor right_
ct::Tensor native_products_

Detailed Description

template<typename T, typename Device>
class hsolver::LinearAlgebra< T, Device >

Collective block algebra; only small coefficients cross the device boundary.

Member Typedef Documentation

◆ Wide

template<typename T, typename Device>
using hsolver::LinearAlgebra< T, Device >::Wide = std::complex<double>
private

Constructor & Destructor Documentation

◆ LinearAlgebra()

template<typename T, typename Device>
hsolver::LinearAlgebra< T, Device >::LinearAlgebra ( const diag_comm_info & comm)
inlineexplicit

Member Function Documentation

◆ arnoldi_dots()

template<typename T, typename Device>
std::vector< std::complex< double > > hsolver::LinearAlgebra< T, Device >::arnoldi_dots ( int ld,
int dim,
int bands,
int count,
int stride,
const T * basis,
const T * x )

Arnoldi products in wavefunction precision; use dots() for reliable norms.

Here is the call graph for this function:

◆ cross()

template<typename T, typename Device>
std::vector< std::complex< double > > hsolver::LinearAlgebra< T, Device >::cross ( int ld,
int dim,
int nx,
int ny,
const T * x,
const T * y )

Global X-adjoint times Y, with double accumulation for both precisions.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cross_local_into()

template<typename T, typename Device>
void hsolver::LinearAlgebra< T, Device >::cross_local_into ( int ld,
int dim,
int nx,
int ny,
const T * x,
const T * y,
Wide * result )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cross_root_tensor()

template<typename T, typename Device>
ct::Tensor hsolver::LinearAlgebra< T, Device >::cross_root_tensor ( int ld,
int dim,
int nx,
int ny,
const T * x,
const T * y )
Here is the call graph for this function:

◆ cross_tensor()

template<typename T, typename Device>
ct::Tensor hsolver::LinearAlgebra< T, Device >::cross_tensor ( int ld,
int dim,
int nx,
int ny,
const T * x,
const T * y )

Host Tensor result; uses direct output storage for block projections.

Here is the call graph for this function:

◆ dots()

template<typename T, typename Device>
std::vector< std::complex< double > > hsolver::LinearAlgebra< T, Device >::dots ( int ld,
int dim,
int bands,
int count,
int stride,
const T * basis,
const T * x )

Products between corresponding bands and several Arnoldi blocks.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dots_tensor()

template<typename T, typename Device>
ct::Tensor hsolver::LinearAlgebra< T, Device >::dots_tensor ( int ld,
int dim,
int bands,
int count,
int stride,
const T * basis,
const T * x )
Here is the call graph for this function:

◆ expand()

template<typename T, typename Device>
void hsolver::LinearAlgebra< T, Device >::expand ( int ld,
int dim,
int nx,
int ny,
const T * x,
const std::vector< Wide > & c,
T * y,
T beta )

Y = X*C + beta*Y, using a small host coefficient matrix.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ expand_prepared()

template<typename T, typename Device>
void hsolver::LinearAlgebra< T, Device >::expand_prepared ( int ld,
int dim,
int nx,
int ny,
const T * x,
const T * c,
T * y,
T beta )

Y = X*C + beta*Y with already prepared Device coefficients (ld C = nx). X and Y must not overlap; C must contain at least nx*ny elements.

◆ gram()

template<typename T, typename Device>
std::vector< std::complex< double > > hsolver::LinearAlgebra< T, Device >::gram ( int ld,
int dim,
int bands,
const T * input )

Global X-adjoint times X, reusing one FP64 conversion of the valid rows.

Here is the call graph for this function:

◆ gram_local_into()

template<typename T, typename Device>
void hsolver::LinearAlgebra< T, Device >::gram_local_into ( int ld,
int dim,
int bands,
const T * input,
Wide * result )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gram_root_tensor()

template<typename T, typename Device>
ct::Tensor hsolver::LinearAlgebra< T, Device >::gram_root_tensor ( int ld,
int dim,
int bands,
const T * input )
Here is the call graph for this function:

◆ gram_tensor()

template<typename T, typename Device>
ct::Tensor hsolver::LinearAlgebra< T, Device >::gram_tensor ( int ld,
int dim,
int bands,
const T * input )
Here is the call graph for this function:

◆ prepare_coefficients()

template<typename T, typename Device>
const T * hsolver::LinearAlgebra< T, Device >::prepare_coefficients ( const Wide * coefficients,
const int64_t count )

Convert/upload host coefficients once for several block rotations. The borrowed Device pointer is invalidated by the next prepare_coefficients() or nonempty expand() on this object. expand_prepared() does not invalidate it.

Here is the call graph for this function:

◆ projection_cross()

template<typename T, typename Device>
std::vector< std::complex< double > > hsolver::LinearAlgebra< T, Device >::projection_cross ( int ld,
int dim,
int nx,
int ny,
const T * x,
const T * y )

Projection products and reductions in wavefunction precision; return double coefficients.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reduce() [1/2]

template<typename T, typename Device>
void hsolver::LinearAlgebra< T, Device >::reduce ( std::vector< Wide > * values) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reduce() [2/2]

template<typename T, typename Device>
void hsolver::LinearAlgebra< T, Device >::reduce ( Wide * values,
const int64_t count ) const
private
Here is the call graph for this function:

◆ storage_bytes()

template<typename T, typename Device>
std::size_t hsolver::LinearAlgebra< T, Device >::storage_bytes ( ct::DeviceType device) const

Owned reusable storage only; excludes returned vectors and borrowed views.

Member Data Documentation

◆ coefficients_

template<typename T, typename Device>
ct::Tensor hsolver::LinearAlgebra< T, Device >::coefficients_
private

◆ comm_

template<typename T, typename Device>
const diag_comm_info hsolver::LinearAlgebra< T, Device >::comm_
private

◆ left_

template<typename T, typename Device>
ct::Tensor hsolver::LinearAlgebra< T, Device >::left_
private

◆ native_products_

template<typename T, typename Device>
ct::Tensor hsolver::LinearAlgebra< T, Device >::native_products_
private

◆ products_

template<typename T, typename Device>
ct::Tensor hsolver::LinearAlgebra< T, Device >::products_
private

◆ right_

template<typename T, typename Device>
ct::Tensor hsolver::LinearAlgebra< T, Device >::right_
private

The documentation for this class was generated from the following files: