Skip to content

Commit

Permalink
remove unused scalars
Browse files Browse the repository at this point in the history
  • Loading branch information
upsj committed Jul 4, 2024
1 parent 5e847f7 commit 88bbd77
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 37 deletions.
9 changes: 4 additions & 5 deletions core/solver/bicg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ void Bicg<ValueType>::apply_dense_impl(const matrix::Dense<ValueType>* dense_b,
GKO_SOLVER_VECTOR(p2, dense_b);
GKO_SOLVER_VECTOR(q2, dense_b);

GKO_SOLVER_SCALAR(alpha, dense_b);
GKO_SOLVER_SCALAR(beta, dense_b);
GKO_SOLVER_SCALAR(prev_rho, dense_b);
GKO_SOLVER_SCALAR(rho, dense_b);
Expand Down Expand Up @@ -255,7 +254,7 @@ int workspace_traits<Bicg<ValueType>>::num_arrays(const Solver&)
template <typename ValueType>
int workspace_traits<Bicg<ValueType>>::num_vectors(const Solver&)
{
return 14;
return 13;
}


Expand All @@ -264,8 +263,8 @@ std::vector<std::string> workspace_traits<Bicg<ValueType>>::op_names(
const Solver&)
{
return {
"r", "z", "p", "q", "r2", "z2", "p2",
"q2", "alpha", "beta", "prev_rho", "rho", "one", "minus_one",
"r", "z", "p", "q", "r2", "z2", "p2",
"q2", "beta", "prev_rho", "rho", "one", "minus_one",
};
}

Expand All @@ -281,7 +280,7 @@ std::vector<std::string> workspace_traits<Bicg<ValueType>>::array_names(
template <typename ValueType>
std::vector<int> workspace_traits<Bicg<ValueType>>::scalars(const Solver&)
{
return {alpha, beta, prev_rho, rho};
return {beta, prev_rho, rho};
}


Expand Down
8 changes: 3 additions & 5 deletions core/solver/cg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ void Cg<ValueType>::apply_dense_impl(const VectorType* dense_b,
GKO_SOLVER_VECTOR(p, dense_b);
GKO_SOLVER_VECTOR(q, dense_b);

GKO_SOLVER_SCALAR(alpha, dense_b);
GKO_SOLVER_SCALAR(beta, dense_b);
GKO_SOLVER_SCALAR(prev_rho, dense_b);
GKO_SOLVER_SCALAR(rho, dense_b);
Expand Down Expand Up @@ -206,7 +205,7 @@ int workspace_traits<Cg<ValueType>>::num_arrays(const Solver&)
template <typename ValueType>
int workspace_traits<Cg<ValueType>>::num_vectors(const Solver&)
{
return 10;
return 9;
}


Expand All @@ -215,8 +214,7 @@ std::vector<std::string> workspace_traits<Cg<ValueType>>::op_names(
const Solver&)
{
return {
"r", "z", "p", "q", "alpha",
"beta", "prev_rho", "rho", "one", "minus_one",
"r", "z", "p", "q", "beta", "prev_rho", "rho", "one", "minus_one",
};
}

Expand All @@ -232,7 +230,7 @@ std::vector<std::string> workspace_traits<Cg<ValueType>>::array_names(
template <typename ValueType>
std::vector<int> workspace_traits<Cg<ValueType>>::scalars(const Solver&)
{
return {alpha, beta, prev_rho, rho};
return {beta, prev_rho, rho};
}


Expand Down
9 changes: 4 additions & 5 deletions core/solver/fcg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ void Fcg<ValueType>::apply_dense_impl(const VectorType* dense_b,
GKO_SOLVER_VECTOR(q, dense_b);
GKO_SOLVER_VECTOR(t, dense_b);

GKO_SOLVER_SCALAR(alpha, dense_b);
GKO_SOLVER_SCALAR(beta, dense_b);
GKO_SOLVER_SCALAR(prev_rho, dense_b);
GKO_SOLVER_SCALAR(rho, dense_b);
Expand Down Expand Up @@ -209,7 +208,7 @@ int workspace_traits<Fcg<ValueType>>::num_arrays(const Solver&)
template <typename ValueType>
int workspace_traits<Fcg<ValueType>>::num_vectors(const Solver&)
{
return 12;
return 11;
}


Expand All @@ -218,8 +217,8 @@ std::vector<std::string> workspace_traits<Fcg<ValueType>>::op_names(
const Solver&)
{
return {
"r", "z", "p", "q", "t", "alpha",
"beta", "prev_rho", "rho", "rho_t", "one", "minus_one",
"r", "z", "p", "q", "t", "beta",
"prev_rho", "rho", "rho_t", "one", "minus_one",
};
}

Expand All @@ -235,7 +234,7 @@ std::vector<std::string> workspace_traits<Fcg<ValueType>>::array_names(
template <typename ValueType>
std::vector<int> workspace_traits<Fcg<ValueType>>::scalars(const Solver&)
{
return {alpha, beta, prev_rho, rho, rho_t};
return {beta, prev_rho, rho, rho_t};
}


Expand Down
12 changes: 5 additions & 7 deletions include/ginkgo/core/solver/bicg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,16 @@ struct workspace_traits<Bicg<ValueType>> {
constexpr static int p2 = 6;
// "transposed" q vector
constexpr static int q2 = 7;
// alpha scalar
constexpr static int alpha = 8;
// beta scalar
constexpr static int beta = 9;
constexpr static int beta = 8;
// previous rho scalar
constexpr static int prev_rho = 10;
constexpr static int prev_rho = 9;
// current rho scalar
constexpr static int rho = 11;
constexpr static int rho = 10;
// constant 1.0 scalar
constexpr static int one = 12;
constexpr static int one = 11;
// constant -1.0 scalar
constexpr static int minus_one = 13;
constexpr static int minus_one = 12;

// stopping status array
constexpr static int stop = 0;
Expand Down
12 changes: 5 additions & 7 deletions include/ginkgo/core/solver/cg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,16 @@ struct workspace_traits<Cg<ValueType>> {
constexpr static int p = 2;
// q vector
constexpr static int q = 3;
// alpha scalar
constexpr static int alpha = 4;
// beta scalar
constexpr static int beta = 5;
constexpr static int beta = 4;
// previous rho scalar
constexpr static int prev_rho = 6;
constexpr static int prev_rho = 5;
// current rho scalar
constexpr static int rho = 7;
constexpr static int rho = 6;
// constant 1.0 scalar
constexpr static int one = 8;
constexpr static int one = 7;
// constant -1.0 scalar
constexpr static int minus_one = 9;
constexpr static int minus_one = 8;

// stopping status array
constexpr static int stop = 0;
Expand Down
14 changes: 6 additions & 8 deletions include/ginkgo/core/solver/fcg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,18 @@ struct workspace_traits<Fcg<ValueType>> {
constexpr static int q = 3;
// t vector
constexpr static int t = 4;
// alpha scalar
constexpr static int alpha = 5;
// beta scalar
constexpr static int beta = 6;
constexpr static int beta = 5;
// previous rho scalar
constexpr static int prev_rho = 7;
constexpr static int prev_rho = 6;
// current rho scalar
constexpr static int rho = 8;
constexpr static int rho = 7;
// current rho_t scalar
constexpr static int rho_t = 9;
constexpr static int rho_t = 8;
// constant 1.0 scalar
constexpr static int one = 10;
constexpr static int one = 9;
// constant -1.0 scalar
constexpr static int minus_one = 11;
constexpr static int minus_one = 10;

// stopping status array
constexpr static int stop = 0;
Expand Down

0 comments on commit 88bbd77

Please sign in to comment.