![]() |
QMCPACK
|
class to compute matrix inversion and the log value of determinant of a batch of DiracMatrixes. More...
Public Types | |
using | FullPrecReal = RealAlias< VALUE_FP > |
using | LogValue = std::complex< FullPrecReal > |
template<typename T > | |
using | OffloadPinnedAllocator = OMPallocator< T, PinnedAlignedAllocator< T > > |
template<typename T > | |
using | OffloadPinnedMatrix = Matrix< T, OffloadPinnedAllocator< T > > |
template<typename T > | |
using | OffloadPinnedVector = Vector< T, OffloadPinnedAllocator< T > > |
using | HandleResource = compute::Queue< PlatformKind::OMPTARGET > |
Public Member Functions | |
DiracMatrixComputeOMPTarget () | |
std::unique_ptr< Resource > | makeClone () const override |
template<typename TMAT > | |
std::enable_if_t< std::is_same< VALUE_FP, TMAT >::value > | invert_transpose (HandleResource &resource, const OffloadPinnedMatrix< TMAT > &a_mat, OffloadPinnedMatrix< TMAT > &inv_a_mat, LogValue &log_value) |
compute the inverse of the transpose of matrix A and its determinant value in log when VALUE_FP and TMAT are the same More... | |
template<typename TMAT > | |
std::enable_if_t<!std::is_same< VALUE_FP, TMAT >::value > | invert_transpose (HandleResource &resource, const OffloadPinnedMatrix< TMAT > &a_mat, OffloadPinnedMatrix< TMAT > &inv_a_mat, LogValue &log_value) |
compute the inverse of the transpose of matrix A and its determinant value in log when VALUE_FP and TMAT are the different More... | |
template<typename TMAT , PlatformKind PL> | |
void | mw_invertTranspose (compute::Queue< PL > &resource_ignored, const RefVector< const OffloadPinnedMatrix< TMAT >> &a_mats, const RefVector< OffloadPinnedMatrix< TMAT >> &inv_a_mats, OffloadPinnedVector< LogValue > &log_values) |
This covers both mixed and Full precision case. More... | |
![]() | |
Resource (const std::string &name) | |
virtual | ~Resource ()=default |
const std::string & | getName () const |
Private Member Functions | |
void | reset (OffloadPinnedVector< VALUE_FP > &psi_Ms, const int n, const int lda, const int batch_size) |
reset internal work space. More... | |
void | reset (OffloadPinnedMatrix< VALUE_FP > &psi_M, const int n, const int lda) |
reset internal work space for single walker case My understanding might be off. More... | |
template<typename TMAT > | |
void | computeInvertAndLog (OffloadPinnedMatrix< TMAT > &a_mat, const int n, const int lda, LogValue &log_value) |
compute the inverse of invMat (in place) and the log value of determinant More... | |
template<typename TMAT > | |
void | computeInvertAndLog (OffloadPinnedVector< TMAT > &psi_Ms, const int n, const int lda, OffloadPinnedVector< LogValue > &log_values) |
Private Attributes | |
aligned_vector< VALUE_FP > | m_work_ |
int | lwork_ |
OffloadPinnedVector< VALUE_FP > | psiM_fp_ |
Matrices held in memory matrices n^2 * nw elements. More... | |
OffloadPinnedVector< VALUE_FP > | LU_diags_fp_ |
OffloadPinnedVector< int > | pivots_ |
OffloadPinnedVector< int > | infos_ |
DiracMatrix< VALUE_FP > | detEng_ |
matrix inversion engine More... | |
class to compute matrix inversion and the log value of determinant of a batch of DiracMatrixes.
VALUE_FP | the datatype used in the actual computation of the matrix |
There is one per crowd not one per MatrixUpdateEngine. this puts ownership of the scratch resources in a sensible place.
Currently this is CPU only but its external API is somewhat written to enforce the passing Dual data objects as arguments. Except for the single particle API log_value which is not Dual type but had better have an address in a OMPtarget mapped region if target is used with it. This makes this API incompatible to that used by MatrixDelayedUpdateCuda and DiracMatrixComputeCUDA.
Definition at line 45 of file DiracMatrixComputeOMPTarget.hpp.
using FullPrecReal = RealAlias<VALUE_FP> |
Definition at line 48 of file DiracMatrixComputeOMPTarget.hpp.
Definition at line 61 of file DiracMatrixComputeOMPTarget.hpp.
using LogValue = std::complex<FullPrecReal> |
Definition at line 49 of file DiracMatrixComputeOMPTarget.hpp.
using OffloadPinnedAllocator = OMPallocator<T, PinnedAlignedAllocator<T> > |
Definition at line 54 of file DiracMatrixComputeOMPTarget.hpp.
using OffloadPinnedMatrix = Matrix<T, OffloadPinnedAllocator<T> > |
Definition at line 56 of file DiracMatrixComputeOMPTarget.hpp.
using OffloadPinnedVector = Vector<T, OffloadPinnedAllocator<T> > |
Definition at line 58 of file DiracMatrixComputeOMPTarget.hpp.
|
inline |
Definition at line 163 of file DiracMatrixComputeOMPTarget.hpp.
|
inlineprivate |
compute the inverse of invMat (in place) and the log value of determinant
TMAT | value type of matrix |
[in,out] | a_mat | the matrix |
[in] | n | actual dimension of square matrix (no guarantee it really has full column rank) |
[in] | lda | leading dimension of Matrix container |
[out] | log_value | log a_mat before inversion |
Definition at line 121 of file DiracMatrixComputeOMPTarget.hpp.
References qmcplusplus::computeLogDet(), Matrix< T, Alloc >::data(), getNextLevelNumThreads(), qmcplusplus::lda, DiracMatrixComputeOMPTarget< VALUE_FP >::LU_diags_fp_, DiracMatrixComputeOMPTarget< VALUE_FP >::lwork_, DiracMatrixComputeOMPTarget< VALUE_FP >::m_work_, qmcplusplus::n, DiracMatrixComputeOMPTarget< VALUE_FP >::pivots_, DiracMatrixComputeOMPTarget< VALUE_FP >::reset(), qmcplusplus::Xgetrf(), and qmcplusplus::Xgetri().
Referenced by DiracMatrixComputeOMPTarget< VALUE_FP >::invert_transpose().
|
inlineprivate |
Definition at line 135 of file DiracMatrixComputeOMPTarget.hpp.
References qmcplusplus::computeLogDet(), Vector< T, Alloc >::data(), getNextLevelNumThreads(), qmcplusplus::lda, qmcplusplus::log_values(), DiracMatrixComputeOMPTarget< VALUE_FP >::LU_diags_fp_, DiracMatrixComputeOMPTarget< VALUE_FP >::lwork_, DiracMatrixComputeOMPTarget< VALUE_FP >::m_work_, qmcplusplus::n, DiracMatrixComputeOMPTarget< VALUE_FP >::pivots_, DiracMatrixComputeOMPTarget< VALUE_FP >::reset(), qmcplusplus::Xgetrf(), and qmcplusplus::Xgetri().
|
inline |
compute the inverse of the transpose of matrix A and its determinant value in log when VALUE_FP and TMAT are the same
TMAT | matrix value type |
TREAL | real type |
[in] | resource | compute resource |
[in] | a_mat | matrix to be inverted |
[out] | inv_a_mat | the inverted matrix |
[out] | log_value | breaks compatibility of MatrixUpdateOmpTarget with DiracMatrixComputeCUDA but is fine for OMPTarget |
Definition at line 178 of file DiracMatrixComputeOMPTarget.hpp.
References Matrix< T, Alloc >::cols(), DiracMatrixComputeOMPTarget< VALUE_FP >::computeInvertAndLog(), Matrix< T, Alloc >::data(), qmcplusplus::lda, qmcplusplus::n, Matrix< T, Alloc >::rows(), and qmcplusplus::simd::transpose().
Referenced by qmcplusplus::TEST_CASE().
|
inline |
compute the inverse of the transpose of matrix A and its determinant value in log when VALUE_FP and TMAT are the different
TMAT | matrix value type |
TREAL | real type |
Definition at line 198 of file DiracMatrixComputeOMPTarget.hpp.
References Matrix< T, Alloc >::cols(), DiracMatrixComputeOMPTarget< VALUE_FP >::computeInvertAndLog(), Matrix< T, Alloc >::data(), qmcplusplus::lda, qmcplusplus::n, DiracMatrixComputeOMPTarget< VALUE_FP >::psiM_fp_, qmcplusplus::simd::remapCopy(), Matrix< T, Alloc >::rows(), and qmcplusplus::simd::transpose().
|
inlineoverridevirtual |
Implements Resource.
Definition at line 165 of file DiracMatrixComputeOMPTarget.hpp.
|
inline |
This covers both mixed and Full precision case.
Definition at line 224 of file DiracMatrixComputeOMPTarget.hpp.
References DiracMatrixComputeOMPTarget< VALUE_FP >::detEng_, DiracMatrix< T_FP >::invert_transpose(), and qmcplusplus::log_values().
Referenced by qmcplusplus::TEST_CASE().
|
inlineprivate |
reset internal work space.
My understanding might be off.
it smells that this is so complex.
Definition at line 78 of file DiracMatrixComputeOMPTarget.hpp.
References qmcplusplus::batch_size, qmcplusplus::convert(), Vector< T, Alloc >::data(), qmcplusplus::lda, DiracMatrixComputeOMPTarget< VALUE_FP >::lwork_, DiracMatrixComputeOMPTarget< VALUE_FP >::m_work_, qmcplusplus::n, DiracMatrixComputeOMPTarget< VALUE_FP >::pivots_, and qmcplusplus::Xgetri().
Referenced by DiracMatrixComputeOMPTarget< VALUE_FP >::computeInvertAndLog().
|
inlineprivate |
reset internal work space for single walker case My understanding might be off.
it smells that this is so complex.
Definition at line 100 of file DiracMatrixComputeOMPTarget.hpp.
References Matrix< T, Alloc >::data(), qmcplusplus::lda, DiracMatrixComputeOMPTarget< VALUE_FP >::LU_diags_fp_, DiracMatrixComputeOMPTarget< VALUE_FP >::lwork_, DiracMatrixComputeOMPTarget< VALUE_FP >::m_work_, DiracMatrixComputeOMPTarget< VALUE_FP >::pivots_, and qmcplusplus::Xgetri().
|
private |
matrix inversion engine
Definition at line 160 of file DiracMatrixComputeOMPTarget.hpp.
Referenced by DiracMatrixComputeOMPTarget< VALUE_FP >::mw_invertTranspose().
|
private |
Definition at line 71 of file DiracMatrixComputeOMPTarget.hpp.
|
private |
Definition at line 69 of file DiracMatrixComputeOMPTarget.hpp.
Referenced by DiracMatrixComputeOMPTarget< VALUE_FP >::computeInvertAndLog(), and DiracMatrixComputeOMPTarget< VALUE_FP >::reset().
|
private |
Definition at line 65 of file DiracMatrixComputeOMPTarget.hpp.
Referenced by DiracMatrixComputeOMPTarget< VALUE_FP >::computeInvertAndLog(), and DiracMatrixComputeOMPTarget< VALUE_FP >::reset().
|
private |
Definition at line 64 of file DiracMatrixComputeOMPTarget.hpp.
Referenced by DiracMatrixComputeOMPTarget< VALUE_FP >::computeInvertAndLog(), and DiracMatrixComputeOMPTarget< VALUE_FP >::reset().
|
private |
Definition at line 70 of file DiracMatrixComputeOMPTarget.hpp.
Referenced by DiracMatrixComputeOMPTarget< VALUE_FP >::computeInvertAndLog(), and DiracMatrixComputeOMPTarget< VALUE_FP >::reset().
|
private |
Matrices held in memory matrices n^2 * nw elements.
Definition at line 68 of file DiracMatrixComputeOMPTarget.hpp.
Referenced by DiracMatrixComputeOMPTarget< VALUE_FP >::invert_transpose().