![]() |
QMCPACK
|
implements matrix inversion via cuSolverDN More...
Public Member Functions | |
cuSolverInverter () | |
default constructor More... | |
~cuSolverInverter () | |
template<typename TMAT , typename TREAL , typename = std::enable_if_t<std::is_same<TMAT, T_FP>::value>> | |
std::enable_if_t< std::is_same< TMAT, T_FP >::value > | invert_transpose (const Matrix< TMAT > &logdetT, Matrix< TMAT > &Ainv, Matrix< TMAT, CUDAAllocator< TMAT >> &Ainv_gpu, std::complex< TREAL > &log_value) |
compute the inverse of the transpose of matrix A and its determinant value in log when T_FP and TMAT are the same More... | |
template<typename TMAT , typename TREAL , typename = std::enable_if_t<!std::is_same<TMAT, T_FP>::value>> | |
std::enable_if_t<!std::is_same< TMAT, T_FP >::value > | invert_transpose (const Matrix< TMAT > &logdetT, Matrix< TMAT > &Ainv, Matrix< TMAT, CUDAAllocator< TMAT >> &Ainv_gpu, std::complex< TREAL > &log_value) |
compute the inverse of the transpose of matrix A and its determinant value in log when T_FP and TMAT are not the same More... | |
Private Member Functions | |
void | resize (int norb) |
resize the internal storage More... | |
Private Attributes | |
Matrix< T_FP, CUDAAllocator< T_FP > > | Mat1_gpu |
scratch memory for cusolverDN More... | |
Matrix< T_FP, CUDAAllocator< T_FP > > | Mat2_gpu |
scratch memory for cusolverDN More... | |
Vector< int, CUDAHostAllocator< int > > | ipiv |
pivot array + info More... | |
Vector< int, CUDAAllocator< int > > | ipiv_gpu |
Vector< T_FP, CUDAHostAllocator< T_FP > > | LU_diag |
diagonal terms of LU matrix More... | |
Vector< T_FP, CUDAAllocator< T_FP > > | LU_diag_gpu |
Vector< T_FP, CUDAAllocator< T_FP > > | work_gpu |
workspace More... | |
cusolverDnHandle_t | h_cusolver_ |
cudaStream_t | hstream_ |
implements matrix inversion via cuSolverDN
T_FP | high precision for matrix inversion, T_FP >= T |
Definition at line 29 of file cuSolverInverter.hpp.
|
inline |
default constructor
Definition at line 71 of file cuSolverInverter.hpp.
References qmcplusplus::cudaErrorCheck(), cudaStreamCreate, cusolverErrorCheck, cuSolverInverter< T_FP >::h_cusolver_, and cuSolverInverter< T_FP >::hstream_.
|
inline |
Definition at line 78 of file cuSolverInverter.hpp.
References qmcplusplus::cudaErrorCheck(), cudaStreamDestroy, cusolverErrorCheck, cuSolverInverter< T_FP >::h_cusolver_, and cuSolverInverter< T_FP >::hstream_.
|
inline |
compute the inverse of the transpose of matrix A and its determinant value in log when T_FP and TMAT are the same
TREAL | real type |
Definition at line 89 of file cuSolverInverter.hpp.
References qmcplusplus::computeLogDet(), CUBLAS_OP_T, qmcplusplus::cudaErrorCheck(), cudaMemcpyAsync, cudaMemcpyDeviceToHost, cudaMemcpyHostToDevice, cudaStreamSynchronize, cusolverErrorCheck, Matrix< T, Alloc >::data(), extract_matrix_diagonal_cuda(), qmcplusplus::cusolver::getrf(), qmcplusplus::cusolver::getrs(), cuSolverInverter< T_FP >::h_cusolver_, cuSolverInverter< T_FP >::hstream_, cuSolverInverter< T_FP >::ipiv, cuSolverInverter< T_FP >::ipiv_gpu, cuSolverInverter< T_FP >::LU_diag, cuSolverInverter< T_FP >::LU_diag_gpu, make_identity_matrix_cuda(), cuSolverInverter< T_FP >::Mat1_gpu, cuSolverInverter< T_FP >::resize(), Matrix< T, Alloc >::rows(), Matrix< T, Alloc >::size(), and cuSolverInverter< T_FP >::work_gpu.
Referenced by qmcplusplus::TEMPLATE_TEST_CASE(), and qmcplusplus::TEST_CASE().
|
inline |
compute the inverse of the transpose of matrix A and its determinant value in log when T_FP and TMAT are not the same
TREAL | real type |
Definition at line 144 of file cuSolverInverter.hpp.
References qmcplusplus::computeLogDet(), copy_matrix_cuda(), CUBLAS_OP_T, qmcplusplus::cudaErrorCheck(), cudaMemcpyAsync, cudaMemcpyDeviceToHost, cudaMemcpyHostToDevice, cudaStreamSynchronize, cusolverErrorCheck, Matrix< T, Alloc >::data(), extract_matrix_diagonal_cuda(), qmcplusplus::cusolver::getrf(), qmcplusplus::cusolver::getrs(), cuSolverInverter< T_FP >::h_cusolver_, cuSolverInverter< T_FP >::hstream_, cuSolverInverter< T_FP >::ipiv, cuSolverInverter< T_FP >::ipiv_gpu, qmcplusplus::isnan(), cuSolverInverter< T_FP >::LU_diag, cuSolverInverter< T_FP >::LU_diag_gpu, make_identity_matrix_cuda(), cuSolverInverter< T_FP >::Mat1_gpu, cuSolverInverter< T_FP >::Mat2_gpu, norm(), cuSolverInverter< T_FP >::resize(), Matrix< T, Alloc >::rows(), Matrix< T, Alloc >::size(), and cuSolverInverter< T_FP >::work_gpu.
|
inlineprivate |
resize the internal storage
norb | number of electrons/orbitals |
delay,maximum | delay 0<delay<=norb |
Definition at line 52 of file cuSolverInverter.hpp.
References cusolverErrorCheck, qmcplusplus::cusolver::getrf_bufferSize(), cuSolverInverter< T_FP >::h_cusolver_, cuSolverInverter< T_FP >::ipiv, cuSolverInverter< T_FP >::ipiv_gpu, cuSolverInverter< T_FP >::LU_diag, cuSolverInverter< T_FP >::LU_diag_gpu, cuSolverInverter< T_FP >::Mat1_gpu, and cuSolverInverter< T_FP >::work_gpu.
Referenced by cuSolverInverter< T_FP >::invert_transpose().
|
private |
Definition at line 45 of file cuSolverInverter.hpp.
Referenced by cuSolverInverter< T_FP >::cuSolverInverter(), cuSolverInverter< T_FP >::invert_transpose(), cuSolverInverter< T_FP >::resize(), and cuSolverInverter< T_FP >::~cuSolverInverter().
|
private |
Definition at line 46 of file cuSolverInverter.hpp.
Referenced by cuSolverInverter< T_FP >::cuSolverInverter(), cuSolverInverter< T_FP >::invert_transpose(), and cuSolverInverter< T_FP >::~cuSolverInverter().
|
private |
pivot array + info
Definition at line 36 of file cuSolverInverter.hpp.
Referenced by cuSolverInverter< T_FP >::invert_transpose(), and cuSolverInverter< T_FP >::resize().
|
private |
Definition at line 37 of file cuSolverInverter.hpp.
Referenced by cuSolverInverter< T_FP >::invert_transpose(), and cuSolverInverter< T_FP >::resize().
|
private |
diagonal terms of LU matrix
Definition at line 39 of file cuSolverInverter.hpp.
Referenced by cuSolverInverter< T_FP >::invert_transpose(), and cuSolverInverter< T_FP >::resize().
|
private |
Definition at line 40 of file cuSolverInverter.hpp.
Referenced by cuSolverInverter< T_FP >::invert_transpose(), and cuSolverInverter< T_FP >::resize().
|
private |
scratch memory for cusolverDN
Definition at line 32 of file cuSolverInverter.hpp.
Referenced by cuSolverInverter< T_FP >::invert_transpose(), and cuSolverInverter< T_FP >::resize().
|
private |
scratch memory for cusolverDN
Definition at line 34 of file cuSolverInverter.hpp.
Referenced by cuSolverInverter< T_FP >::invert_transpose().
|
private |
workspace
Definition at line 42 of file cuSolverInverter.hpp.
Referenced by cuSolverInverter< T_FP >::invert_transpose(), and cuSolverInverter< T_FP >::resize().