use camelCase, remove commented code

This commit is contained in:
Tobias Meyer Andersen 2024-06-26 15:34:47 +02:00
parent d6f8678617
commit 605e32c54b
2 changed files with 7 additions and 8 deletions

View File

@ -128,7 +128,7 @@ CuDILU<M, X, Y, l>::CuDILU(const M& A, bool split_matrix)
, m_gpuNaturalToReorder(m_naturalToReordered) , m_gpuNaturalToReorder(m_naturalToReordered)
, m_gpuReorderToNatural(m_reorderedToNatural) , m_gpuReorderToNatural(m_reorderedToNatural)
, m_gpuDInv(m_gpuMatrix.N() * m_gpuMatrix.blockSize() * m_gpuMatrix.blockSize()) , m_gpuDInv(m_gpuMatrix.N() * m_gpuMatrix.blockSize() * m_gpuMatrix.blockSize())
, m_split_matrix(split_matrix) , m_splitMatrix(split_matrix)
{ {
// TODO: Should in some way verify that this matrix is symmetric, only do it debug mode? // TODO: Should in some way verify that this matrix is symmetric, only do it debug mode?
@ -147,7 +147,7 @@ CuDILU<M, X, Y, l>::CuDILU(const M& A, bool split_matrix)
fmt::format("CuSparse matrix not same number of non zeroes as DUNE matrix. {} vs {}. ", fmt::format("CuSparse matrix not same number of non zeroes as DUNE matrix. {} vs {}. ",
m_gpuMatrix.nonzeroes(), m_gpuMatrix.nonzeroes(),
A.nonzeroes())); A.nonzeroes()));
if (m_split_matrix) { if (m_splitMatrix) {
m_gpuMatrixReorderedDiag.reset(new auto(CuVector<field_type>(blocksize_ * blocksize_ * m_cpuMatrix.N()))); m_gpuMatrixReorderedDiag.reset(new auto(CuVector<field_type>(blocksize_ * blocksize_ * m_cpuMatrix.N())));
extractLowerAndUpperMatrices<M, field_type, CuSparseMatrix<field_type>>( extractLowerAndUpperMatrices<M, field_type, CuSparseMatrix<field_type>>(
m_cpuMatrix, m_reorderedToNatural, m_gpuMatrixReorderedLower, m_gpuMatrixReorderedUpper); m_cpuMatrix, m_reorderedToNatural, m_gpuMatrixReorderedLower, m_gpuMatrixReorderedUpper);
@ -170,11 +170,10 @@ CuDILU<M, X, Y, l>::apply(X& v, const Y& d)
{ {
OPM_TIMEBLOCK(prec_apply); OPM_TIMEBLOCK(prec_apply);
{ {
// ScopedTimer timer("apply", apply_time);
int levelStartIdx = 0; int levelStartIdx = 0;
for (int level = 0; level < m_levelSets.size(); ++level) { for (int level = 0; level < m_levelSets.size(); ++level) {
const int numOfRowsInLevel = m_levelSets[level].size(); const int numOfRowsInLevel = m_levelSets[level].size();
if (m_split_matrix) { if (m_splitMatrix) {
detail::computeLowerSolveLevelSetSplit<field_type, blocksize_>( detail::computeLowerSolveLevelSetSplit<field_type, blocksize_>(
m_gpuMatrixReorderedLower->getNonZeroValues().data(), m_gpuMatrixReorderedLower->getNonZeroValues().data(),
m_gpuMatrixReorderedLower->getRowIndices().data(), m_gpuMatrixReorderedLower->getRowIndices().data(),
@ -205,7 +204,7 @@ CuDILU<M, X, Y, l>::apply(X& v, const Y& d)
for (int level = m_levelSets.size() - 1; level >= 0; --level) { for (int level = m_levelSets.size() - 1; level >= 0; --level) {
const int numOfRowsInLevel = m_levelSets[level].size(); const int numOfRowsInLevel = m_levelSets[level].size();
levelStartIdx -= numOfRowsInLevel; levelStartIdx -= numOfRowsInLevel;
if (m_split_matrix) { if (m_splitMatrix) {
detail::computeUpperSolveLevelSetSplit<field_type, blocksize_>( detail::computeUpperSolveLevelSetSplit<field_type, blocksize_>(
m_gpuMatrixReorderedUpper->getNonZeroValues().data(), m_gpuMatrixReorderedUpper->getNonZeroValues().data(),
m_gpuMatrixReorderedUpper->getRowIndices().data(), m_gpuMatrixReorderedUpper->getRowIndices().data(),
@ -260,7 +259,7 @@ CuDILU<M, X, Y, l>::computeDiagAndMoveReorderedData()
{ {
OPM_TIMEBLOCK(prec_update); OPM_TIMEBLOCK(prec_update);
{ {
if (m_split_matrix) { if (m_splitMatrix) {
detail::copyMatDataToReorderedSplit<field_type, blocksize_>( detail::copyMatDataToReorderedSplit<field_type, blocksize_>(
m_gpuMatrix.getNonZeroValues().data(), m_gpuMatrix.getNonZeroValues().data(),
m_gpuMatrix.getRowIndices().data(), m_gpuMatrix.getRowIndices().data(),
@ -284,7 +283,7 @@ CuDILU<M, X, Y, l>::computeDiagAndMoveReorderedData()
int levelStartIdx = 0; int levelStartIdx = 0;
for (int level = 0; level < m_levelSets.size(); ++level) { for (int level = 0; level < m_levelSets.size(); ++level) {
const int numOfRowsInLevel = m_levelSets[level].size(); const int numOfRowsInLevel = m_levelSets[level].size();
if (m_split_matrix) { if (m_splitMatrix) {
detail::computeDiluDiagonalSplit<field_type, blocksize_>( detail::computeDiluDiagonalSplit<field_type, blocksize_>(
m_gpuMatrixReorderedLower->getNonZeroValues().data(), m_gpuMatrixReorderedLower->getNonZeroValues().data(),
m_gpuMatrixReorderedLower->getRowIndices().data(), m_gpuMatrixReorderedLower->getRowIndices().data(),

View File

@ -129,7 +129,7 @@ private:
//! \brief Stores the inverted diagonal that we use in DILU //! \brief Stores the inverted diagonal that we use in DILU
CuVector<field_type> m_gpuDInv; CuVector<field_type> m_gpuDInv;
//! \brief Bool storing whether or not we should store matrices in a split format //! \brief Bool storing whether or not we should store matrices in a split format
bool m_split_matrix; bool m_splitMatrix;
}; };
} // end namespace Opm::cuistl } // end namespace Opm::cuistl