Skip to content

Commit

Permalink
Apply pre-commmit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandanehy authored and actions-user committed Nov 28, 2023
1 parent 74a5e29 commit 8d23442
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 49 deletions.
6 changes: 3 additions & 3 deletions resolve/GramSchmidt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ namespace ReSolve
s += h_L_[idxmap(j, k, num_vecs_ + 1)] * H[idxmap(i, k, num_vecs_ + 1)];
} // for k
H[idxmap(i, j, num_vecs_ + 1)] -= s;
} // for j
} // for j
vec_Hcolumn_->setCurrentSize(i + 1);
vec_Hcolumn_->update(&H[idxmap(i, 0, num_vecs_ + 1)], memory::HOST, memory::DEVICE);
vector_handler_->massAxpy(n, vec_Hcolumn_, i, V, vec_w_, memspace);
Expand Down Expand Up @@ -248,7 +248,7 @@ namespace ReSolve
s += h_L_[idxmap(j, k, num_vecs_ + 1)] * H[idxmap(i, k, num_vecs_ + 1)];
} // for k
H[idxmap(i, j, num_vecs_ + 1)] -= s;
} // for j
} // for j

// now compute h_rv = L^T h_H
double h;
Expand All @@ -269,7 +269,7 @@ namespace ReSolve
s += h_L_[idxmap(j, k, num_vecs_ + 1)] * h_aux_[k];
} // for k
h_aux_[j] -= s;
} // for j
} // for j

// and now subtract that from h_H
for (int j = 0; j <= i; ++j) {
Expand Down
2 changes: 1 addition & 1 deletion resolve/GramSchmidt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace ReSolve
GSVariant variant_;
bool setup_complete_; // to avoid double allocations and stuff

index_type num_vecs_; // the same as restart
index_type num_vecs_; // the same as restart
vector_type* vec_rv_{nullptr};
vector_type* vec_Hcolumn_{nullptr};

Expand Down
2 changes: 1 addition & 1 deletion resolve/LinSolverDirectCuSolverRf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace ReSolve
// default

const cusolverRfFactorization_t fact_alg =
CUSOLVERRF_FACTORIZATION_ALG0; // 0 - default, 1 or 2
CUSOLVERRF_FACTORIZATION_ALG0; // 0 - default, 1 or 2
const cusolverRfTriangularSolve_t solve_alg =
CUSOLVERRF_TRIANGULAR_SOLVE_ALG1; // 1- default, 2 or 3 // 1 causes error
this->setAlgorithms(fact_alg, solve_alg);
Expand Down
8 changes: 4 additions & 4 deletions resolve/LinSolverDirectRocSolverRf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ namespace ReSolve
int solve(vector_type* rhs, vector_type* x);
int solve(vector_type* rhs); // the solutuon is returned IN RHS (rhs is overwritten)

int setSolveMode(int mode); // should probably be enum
int getSolveMode(); // should be enum too
int setSolveMode(int mode); // should probably be enum
int getSolveMode(); // should be enum too

private:
rocblas_status status_rocblas_;
Expand All @@ -59,8 +59,8 @@ namespace ReSolve
void addFactors(matrix::Sparse* L,
matrix::Sparse* U); // create L+U from sepeate L, U factors
rocsolver_rfinfo infoM_;
matrix::Sparse* M_{nullptr}; // the matrix that contains added factors
int solve_mode_; // 0 is default and 1 is fast
matrix::Sparse* M_{nullptr}; // the matrix that contains added factors
int solve_mode_; // 0 is default and 1 is fast

// not used by default - for fast solve
rocsparse_mat_descr descr_L_{nullptr};
Expand Down
4 changes: 2 additions & 2 deletions resolve/LinSolverIterativeFGMRES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace ReSolve
tol_ = 1e-14; // default
maxit_ = 100; // default
restart_ = 10;
conv_cond_ = 0; // default
conv_cond_ = 0; // default

d_V_ = nullptr;
d_Z_ = nullptr;
Expand All @@ -37,7 +37,7 @@ namespace ReSolve
tol_ = 1e-14; // default
maxit_ = 100; // default
restart_ = 10;
conv_cond_ = 0; // default
conv_cond_ = 0; // default

d_V_ = nullptr;
d_Z_ = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion resolve/LinSolverIterativeFGMRES.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace ReSolve
GramSchmidt* GS_;
void precV(vector_type* rhs, vector_type* x); // multiply the vector by preconditioner
LinSolverDirect* LU_solver_;
index_type n_; // for simplicity
index_type n_; // for simplicity
real_type final_residual_norm_;
real_type initial_residual_norm_;
index_type fgmres_iters_;
Expand Down
4 changes: 2 additions & 2 deletions resolve/SystemSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace
~SystemSolver();

public:
analyze(); // symbolic part
factorize(); // numeric part
analyze(); // symbolic part
factorize(); // numeric part
refactorize();
solve(double* x, double* rhs); // for triangular solve
refine(double, double* rhs); // for iterative refinement
Expand Down
2 changes: 1 addition & 1 deletion resolve/cuda/cudaVectorKernels.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ namespace ReSolve
// real_type* scale);
} // namespace kernels

} // namespace vector
} // namespace vector
} // namespace ReSolve
2 changes: 1 addition & 1 deletion resolve/hip/hipVectorKernels.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ namespace ReSolve
// real_type* scale);
} // namespace kernels

} // namespace vector
} // namespace vector
} // namespace ReSolve
8 changes: 4 additions & 4 deletions resolve/matrix/MatrixHandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ namespace ReSolve
void setValuesChanged(bool toWhat, std::string memspace);

private:
bool new_matrix_{true}; ///< if the structure changed, you need a new handler.
bool new_matrix_{true}; ///< if the structure changed, you need a new handler.

MemoryHandler mem_; ///< Device memory manager object
MatrixHandlerImpl* cpuImpl_{nullptr}; ///< Pointer to CPU implementation
MatrixHandlerImpl* cudaImpl_{nullptr}; ///< Pointer to CUDA implementation
MatrixHandlerImpl* hipImpl_{nullptr}; ///< Pointer to HIP implementation

bool isCpuEnabled_{false}; ///< true if CPU implementation is instantiated
bool isCudaEnabled_{false}; ///< true if CUDA implementation is instantiated
bool isHipEnabled_{false}; ///< true if HIP implementation is instantiated
bool isCpuEnabled_{false}; ///< true if CPU implementation is instantiated
bool isCudaEnabled_{false}; ///< true if CUDA implementation is instantiated
bool isHipEnabled_{false}; ///< true if HIP implementation is instantiated
};

} // namespace ReSolve
2 changes: 1 addition & 1 deletion resolve/matrix/MatrixHandlerCuda.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace ReSolve
LinAlgWorkspaceCUDA* workspace_{nullptr};
bool values_changed_{true}; ///< needed for matvec

MemoryHandler mem_; ///< Device memory manager object
MemoryHandler mem_; ///< Device memory manager object
};

} // namespace ReSolve
2 changes: 1 addition & 1 deletion resolve/matrix/MatrixHandlerHip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace ReSolve
LinAlgWorkspaceHIP* workspace_{nullptr};
bool values_changed_{true}; ///< needed for matvec

MemoryHandler mem_; ///< Device memory manager object
MemoryHandler mem_; ///< Device memory manager object
};

} // namespace ReSolve
4 changes: 2 additions & 2 deletions resolve/matrix/Sparse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ namespace ReSolve
bool owns_gpu_data_{false}; ///< for row/col data
bool owns_gpu_vals_{false}; ///< for values

MemoryHandler mem_; ///< Device memory manager object
MemoryHandler mem_; ///< Device memory manager object
};
} // namespace matrix
} // namespace matrix
} // namespace ReSolve
2 changes: 1 addition & 1 deletion resolve/vector/Vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ namespace ReSolve

MemoryHandler mem_; ///< Device memory manager object
};
} // namespace vector
} // namespace vector
} // namespace ReSolve
20 changes: 10 additions & 10 deletions resolve/vector/VectorHandlerCuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ namespace ReSolve
alpha->getData(memory::DEVICE), // B
k + 1, // ldb
&ONE,
y->getData(memory::DEVICE), // c
size); // ldc
y->getData(memory::DEVICE), // c
size); // ldc
}
}

Expand Down Expand Up @@ -244,14 +244,14 @@ namespace ReSolve
cublasDgemm(handle_cublas,
CUBLAS_OP_T,
CUBLAS_OP_N,
k + 1, // m
2, // n
size, // k
&ONE, // alpha
V->getData(memory::DEVICE), // A
size, // lda
x->getData(memory::DEVICE), // B
size, // ldb
k + 1, // m
2, // n
size, // k
&ONE, // alpha
V->getData(memory::DEVICE), // A
size, // lda
x->getData(memory::DEVICE), // B
size, // ldb
&ZERO,
res->getData(memory::DEVICE), // c
k + 1); // ldc
Expand Down
20 changes: 10 additions & 10 deletions resolve/vector/VectorHandlerHip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ namespace ReSolve
alpha->getData(memory::DEVICE), // B
k, // ldb
&ONE,
y->getData(memory::DEVICE), // c
size); // ldc
y->getData(memory::DEVICE), // c
size); // ldc
}
}

Expand Down Expand Up @@ -244,14 +244,14 @@ namespace ReSolve
rocblas_dgemm(handle_rocblas,
rocblas_operation_transpose,
rocblas_operation_none,
k + 1, // m
2, // n
size, // k
&ONE, // alpha
V->getData(memory::DEVICE), // A
size, // lda
x->getData(memory::DEVICE), // B
size, // ldb
k + 1, // m
2, // n
size, // k
&ONE, // alpha
V->getData(memory::DEVICE), // A
size, // lda
x->getData(memory::DEVICE), // B
size, // ldb
&ZERO,
res->getData(memory::DEVICE), // c
k + 1); // ldc
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/matrix/MatrixHandlerTests.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,5 @@ namespace ReSolve
}
}; // class MatrixHandlerTests

} // namespace tests
} // namespace tests
} // namespace ReSolve
2 changes: 1 addition & 1 deletion tests/unit/matrix/MatrixIoTests.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,5 +292,5 @@ namespace ReSolve
std::string datafiles_folder_;
}; // class MatrixIoTests

} // namespace tests
} // namespace tests
} // namespace ReSolve
2 changes: 1 addition & 1 deletion tests/unit/memory/MemoryUtilsTests.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,5 @@ namespace ReSolve

}; // class MemoryUtilsTests

} // namespace tests
} // namespace tests
} // namespace ReSolve
2 changes: 1 addition & 1 deletion tests/unit/utilities/logger/LoggerTests.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,5 @@ namespace ReSolve
const std::string message_ = "[MESSAGE] ";
}; // class LoggerTests

} // namespace tests
} // namespace tests
} // namespace ReSolve

0 comments on commit 8d23442

Please sign in to comment.