Skip to content

Commit 265ccbb

Browse files
committed
Rename Trs to LowerTrs.
1 parent 234d2b1 commit 265ccbb

File tree

17 files changed

+207
-190
lines changed

17 files changed

+207
-190
lines changed

core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ target_sources(ginkgo
2828
solver/fcg.cpp
2929
solver/gmres.cpp
3030
solver/ir.cpp
31-
solver/trs.cpp
31+
solver/lower_trs.cpp
3232
stop/combined.cpp
3333
stop/criterion.cpp
3434
stop/iteration.cpp

core/solver/trs.cpp renamed to core/solver/lower_trs.cpp

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3030
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3131
******************************<GINKGO LICENSE>*******************************/
3232

33-
#include <ginkgo/core/solver/trs.hpp>
33+
#include <ginkgo/core/solver/lower_trs.hpp>
3434

3535

3636
#include <ginkgo/core/base/array.hpp>
@@ -43,26 +43,26 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4343
#include <ginkgo/core/matrix/dense.hpp>
4444

4545

46-
#include "core/solver/trs_kernels.hpp"
46+
#include "core/solver/lower_trs_kernels.hpp"
4747

4848

4949
namespace gko {
5050
namespace solver {
5151

5252

53-
namespace trs {
53+
namespace lower_trs {
5454

5555

56-
GKO_REGISTER_OPERATION(generate, trs::generate);
57-
GKO_REGISTER_OPERATION(solve, trs::solve);
56+
GKO_REGISTER_OPERATION(generate, lower_trs::generate);
57+
GKO_REGISTER_OPERATION(solve, lower_trs::solve);
5858

5959

60-
} // namespace trs
60+
} // namespace lower_trs
6161

6262

6363
template <typename ValueType, typename IndexType>
64-
void Trs<ValueType, IndexType>::generate(const LinOp *system_matrix,
65-
const LinOp *b)
64+
void LowerTrs<ValueType, IndexType>::generate(const LinOp *system_matrix,
65+
const LinOp *b)
6666
{
6767
using CsrMatrix = matrix::Csr<ValueType, IndexType>;
6868
using Vector = matrix::Dense<ValueType>;
@@ -77,26 +77,29 @@ void Trs<ValueType, IndexType>::generate(const LinOp *system_matrix,
7777
copy_and_convert_to<CsrMatrix>(exec, system_matrix);
7878
}
7979
auto dense_b = as<const Vector>(b);
80-
exec->run(trs::make_generate(gko::lend(csr_system_matrix_), dense_b));
80+
exec->run(lower_trs::make_generate(gko::lend(csr_system_matrix_), dense_b));
8181
}
8282

8383

8484
template <typename ValueType, typename IndexType>
85-
void Trs<ValueType, IndexType>::apply_impl(const LinOp *b, LinOp *x) const
85+
void LowerTrs<ValueType, IndexType>::apply_impl(const LinOp *b, LinOp *x) const
8686
{
8787
using Vector = matrix::Dense<ValueType>;
8888
const auto exec = this->get_executor();
8989

9090
auto dense_b = as<const Vector>(b);
9191
auto dense_x = as<Vector>(x);
9292

93-
exec->run(trs::make_solve(gko::lend(csr_system_matrix_), dense_b, dense_x));
93+
exec->run(
94+
lower_trs::make_solve(gko::lend(csr_system_matrix_), dense_b, dense_x));
9495
}
9596

9697

9798
template <typename ValueType, typename IndexType>
98-
void Trs<ValueType, IndexType>::apply_impl(const LinOp *alpha, const LinOp *b,
99-
const LinOp *beta, LinOp *x) const
99+
void LowerTrs<ValueType, IndexType>::apply_impl(const LinOp *alpha,
100+
const LinOp *b,
101+
const LinOp *beta,
102+
LinOp *x) const
100103
{
101104
auto dense_x = as<matrix::Dense<ValueType>>(x);
102105

@@ -107,8 +110,8 @@ void Trs<ValueType, IndexType>::apply_impl(const LinOp *alpha, const LinOp *b,
107110
}
108111

109112

110-
#define GKO_DECLARE_TRS(_vtype, _itype) class Trs<_vtype, _itype>
111-
GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(GKO_DECLARE_TRS);
113+
#define GKO_DECLARE_LOWER_TRS(_vtype, _itype) class LowerTrs<_vtype, _itype>
114+
GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(GKO_DECLARE_LOWER_TRS);
112115

113116

114117
} // namespace solver

core/solver/trs_kernels.hpp renamed to core/solver/lower_trs_kernels.hpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3030
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3131
******************************<GINKGO LICENSE>*******************************/
3232

33-
#ifndef GKO_CORE_SOLVER_TRS_KERNELS_HPP_
34-
#define GKO_CORE_SOLVER_TRS_KERNELS_HPP_
33+
#ifndef GKO_CORE_SOLVER_LOWER_TRS_KERNELS_HPP_
34+
#define GKO_CORE_SOLVER_LOWER_TRS_KERNELS_HPP_
3535

3636

3737
#include <memory>
@@ -44,55 +44,55 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4444

4545
namespace gko {
4646
namespace kernels {
47-
namespace trs {
47+
namespace lower_trs {
4848

4949

50-
#define GKO_DECLARE_TRS_GENERATE_KERNEL(_vtype, _itype) \
50+
#define GKO_DECLARE_LOWER_TRS_GENERATE_KERNEL(_vtype, _itype) \
5151
void generate(std::shared_ptr<const DefaultExecutor> exec, \
5252
const matrix::Csr<_vtype, _itype> *matrix, \
5353
const matrix::Dense<_vtype> *b)
5454

5555

56-
#define GKO_DECLARE_TRS_SOLVE_KERNEL(_vtype, _itype) \
56+
#define GKO_DECLARE_LOWER_TRS_SOLVE_KERNEL(_vtype, _itype) \
5757
void solve(std::shared_ptr<const DefaultExecutor> exec, \
5858
const matrix::Csr<_vtype, _itype> *matrix, \
5959
const matrix::Dense<_vtype> *b, matrix::Dense<_vtype> *x)
6060

6161

62-
#define GKO_DECLARE_ALL_AS_TEMPLATES \
63-
template <typename ValueType, typename IndexType> \
64-
GKO_DECLARE_TRS_SOLVE_KERNEL(ValueType, IndexType); \
65-
template <typename ValueType, typename IndexType> \
66-
GKO_DECLARE_TRS_GENERATE_KERNEL(ValueType, IndexType)
62+
#define GKO_DECLARE_ALL_AS_TEMPLATES \
63+
template <typename ValueType, typename IndexType> \
64+
GKO_DECLARE_LOWER_TRS_SOLVE_KERNEL(ValueType, IndexType); \
65+
template <typename ValueType, typename IndexType> \
66+
GKO_DECLARE_LOWER_TRS_GENERATE_KERNEL(ValueType, IndexType)
6767

6868

69-
} // namespace trs
69+
} // namespace lower_trs
7070

7171

7272
namespace omp {
73-
namespace trs {
73+
namespace lower_trs {
7474

7575
GKO_DECLARE_ALL_AS_TEMPLATES;
7676

77-
} // namespace trs
77+
} // namespace lower_trs
7878
} // namespace omp
7979

8080

8181
namespace cuda {
82-
namespace trs {
82+
namespace lower_trs {
8383

8484
GKO_DECLARE_ALL_AS_TEMPLATES;
8585

86-
} // namespace trs
86+
} // namespace lower_trs
8787
} // namespace cuda
8888

8989

9090
namespace reference {
91-
namespace trs {
91+
namespace lower_trs {
9292

9393
GKO_DECLARE_ALL_AS_TEMPLATES;
9494

95-
} // namespace trs
95+
} // namespace lower_trs
9696
} // namespace reference
9797

9898

@@ -103,4 +103,4 @@ GKO_DECLARE_ALL_AS_TEMPLATES;
103103
} // namespace gko
104104

105105

106-
#endif // GKO_CORE_SOLVER_TRS_KERNELS_HPP
106+
#endif // GKO_CORE_SOLVER_LOWER_TRS_KERNELS_HPP

core/test/solver/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ ginkgo_create_test(cgs)
44
ginkgo_create_test(fcg)
55
ginkgo_create_test(gmres)
66
ginkgo_create_test(ir)
7-
ginkgo_create_test(trs)
7+
ginkgo_create_test(lower_trs)

core/test/solver/trs.cpp renamed to core/test/solver/lower_trs.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3030
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3131
******************************<GINKGO LICENSE>*******************************/
3232

33-
#include <ginkgo/core/solver/trs.hpp>
33+
#include <ginkgo/core/solver/lower_trs.hpp>
3434

3535

3636
#include <memory>
@@ -46,33 +46,34 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4646
namespace {
4747

4848

49-
class Trs : public ::testing::Test {
49+
class LowerTrs : public ::testing::Test {
5050
protected:
51-
using Solver = gko::solver::Trs<>;
51+
using Solver = gko::solver::LowerTrs<>;
5252
using CGSolver = gko::solver::Cg<>;
5353

54-
Trs()
54+
LowerTrs()
5555
: exec(gko::ReferenceExecutor::create()),
5656
prec_fac(CGSolver::build().on(exec)),
57-
trs_factory(Solver::build().with_preconditioner(prec_fac).on(exec))
57+
lower_trs_factory(
58+
Solver::build().with_preconditioner(prec_fac).on(exec))
5859
{}
5960

6061
std::shared_ptr<const gko::Executor> exec;
6162
std::shared_ptr<CGSolver::Factory> prec_fac;
62-
std::unique_ptr<Solver::Factory> trs_factory;
63+
std::unique_ptr<Solver::Factory> lower_trs_factory;
6364
};
6465

6566

66-
TEST_F(Trs, TrsFactoryKnowsItsExecutor)
67+
TEST_F(LowerTrs, LowerTrsFactoryKnowsItsExecutor)
6768
{
68-
ASSERT_EQ(trs_factory->get_executor(), exec);
69+
ASSERT_EQ(lower_trs_factory->get_executor(), exec);
6970
}
7071

7172

72-
TEST_F(Trs, TrsFactoryKnowsItsPrecond)
73+
TEST_F(LowerTrs, LowerTrsFactoryKnowsItsPrecond)
7374
{
7475
ASSERT_EQ(static_cast<const CGSolver::Factory *>(
75-
trs_factory->get_parameters().preconditioner.get()),
76+
lower_trs_factory->get_parameters().preconditioner.get()),
7677
prec_fac.get());
7778
}
7879

cuda/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ target_sources(ginkgo_cuda
4747
solver/fcg_kernels.cu
4848
solver/gmres_kernels.cu
4949
solver/ir_kernels.cu
50-
solver/trs_kernels.cu
50+
solver/lower_trs_kernels.cu
5151
stop/criterion_kernels.cu
5252
stop/residual_norm_reduction_kernels.cu)
5353

cuda/solver/trs_kernels.cu renamed to cuda/solver/lower_trs_kernels.cu

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3030
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3131
******************************<GINKGO LICENSE>*******************************/
3232

33-
#include "core/solver/trs_kernels.hpp"
33+
#include "core/solver/lower_trs_kernels.hpp"
3434

3535

3636
#include <ginkgo/core/base/exception_helpers.hpp>
@@ -46,19 +46,20 @@ namespace gko {
4646
namespace kernels {
4747
namespace cuda {
4848
/**
49-
* @brief The TRS solver namespace.
49+
* @brief The LOWER_TRS solver namespace.
5050
*
51-
* @ingroup trs
51+
* @ingroup lower_trs
5252
*/
53-
namespace trs {
53+
namespace lower_trs {
5454

5555

5656
template <typename ValueType, typename IndexType>
5757
void generate(std::shared_ptr<const CudaExecutor> exec,
5858
const matrix::Csr<ValueType, IndexType> *matrix,
5959
const matrix::Dense<ValueType> *b) GKO_NOT_IMPLEMENTED;
6060

61-
GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(GKO_DECLARE_TRS_GENERATE_KERNEL);
61+
GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(
62+
GKO_DECLARE_LOWER_TRS_GENERATE_KERNEL);
6263

6364

6465
template <typename ValueType, typename IndexType>
@@ -67,10 +68,11 @@ void solve(std::shared_ptr<const CudaExecutor> exec,
6768
const matrix::Dense<ValueType> *b,
6869
matrix::Dense<ValueType> *x) GKO_NOT_IMPLEMENTED;
6970

70-
GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(GKO_DECLARE_TRS_SOLVE_KERNEL);
71+
GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(
72+
GKO_DECLARE_LOWER_TRS_SOLVE_KERNEL);
7173

7274

73-
} // namespace trs
75+
} // namespace lower_trs
7476
} // namespace cuda
7577
} // namespace kernels
7678
} // namespace gko

0 commit comments

Comments
 (0)