Skip to content

Commit

Permalink
rename CoarseFine to RestrictProlong
Browse files Browse the repository at this point in the history
  • Loading branch information
yhmtsai committed May 18, 2020
1 parent 7bc7aed commit ef08bb8
Show file tree
Hide file tree
Showing 10 changed files with 155 additions and 134 deletions.
12 changes: 6 additions & 6 deletions core/multigrid/amgx_pgm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace amgx_pgm {


GKO_REGISTER_OPERATION(restrict_apply, amgx_pgm::restrict_apply);
GKO_REGISTER_OPERATION(prolongate_applyadd, amgx_pgm::prolongate_applyadd);
GKO_REGISTER_OPERATION(prolong_applyadd, amgx_pgm::prolong_applyadd);
GKO_REGISTER_OPERATION(initial, amgx_pgm::initial);
GKO_REGISTER_OPERATION(match_edge, amgx_pgm::match_edge);
GKO_REGISTER_OPERATION(count_unagg, amgx_pgm::count_unagg);
Expand Down Expand Up @@ -154,13 +154,13 @@ void AmgxPgm<ValueType, IndexType>::restrict_apply_impl(const LinOp *b,


template <typename ValueType, typename IndexType>
void AmgxPgm<ValueType, IndexType>::prolongate_applyadd_impl(const LinOp *b,
LinOp *x) const
void AmgxPgm<ValueType, IndexType>::prolong_applyadd_impl(const LinOp *b,
LinOp *x) const
{
auto exec = this->get_executor();
exec->run(amgx_pgm::make_prolongate_applyadd(
agg_, as<matrix::Dense<ValueType>>(b),
as<matrix::Dense<ValueType>>(x)));
exec->run(amgx_pgm::make_prolong_applyadd(agg_,
as<matrix::Dense<ValueType>>(b),
as<matrix::Dense<ValueType>>(x)));
}


Expand Down
8 changes: 4 additions & 4 deletions core/multigrid/amgx_pgm_kernels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************<GINKGO LICENSE>*******************************/

#ifndef GKO_CORE_SOLVER_AMGX_PGM_KERNELS_HPP_
#define GKO_CORE_SOLVER_AMGX_PGM_KERNELS_HPP_
#ifndef GKO_CORE_MULTIGRID_AMGX_PGM_KERNELS_HPP_
#define GKO_CORE_MULTIGRID_AMGX_PGM_KERNELS_HPP_


#include <ginkgo/core/multigrid/amgx_pgm.hpp>
Expand All @@ -57,7 +57,7 @@ namespace amgx_pgm {


#define GKO_DECLARE_AMGX_PGM_PROLONGATE_APPLY_KERNEL(_vtype, _itype) \
void prolongate_applyadd( \
void prolong_applyadd( \
std::shared_ptr<const DefaultExecutor> exec, const Array<_itype> &agg, \
const matrix::Dense<_vtype> *b, matrix::Dense<_vtype> *x)

Expand Down Expand Up @@ -177,4 +177,4 @@ GKO_DECLARE_ALL_AS_TEMPLATES;
} // namespace gko


#endif // GKO_CORE_SOLVER_AMGX_PGM_KERNELS_HPP_
#endif // GKO_CORE_MULTIGRID_AMGX_PGM_KERNELS_HPP_
8 changes: 4 additions & 4 deletions cuda/multigrid/amgx_pgm_kernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(


template <typename ValueType, typename IndexType>
void prolongate_applyadd(std::shared_ptr<const CudaExecutor> exec,
const Array<IndexType> &agg,
const matrix::Dense<ValueType> *b,
matrix::Dense<ValueType> *x) GKO_NOT_IMPLEMENTED;
void prolong_applyadd(std::shared_ptr<const CudaExecutor> exec,
const Array<IndexType> &agg,
const matrix::Dense<ValueType> *b,
matrix::Dense<ValueType> *x) GKO_NOT_IMPLEMENTED;

GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(
GKO_DECLARE_AMGX_PGM_PROLONGATE_APPLY_KERNEL);
Expand Down
8 changes: 4 additions & 4 deletions hip/multigrid/amgx_pgm_kernels.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(


template <typename ValueType, typename IndexType>
void prolongate_applyadd(std::shared_ptr<const HipExecutor> exec,
const Array<IndexType> &agg,
const matrix::Dense<ValueType> *b,
matrix::Dense<ValueType> *x) GKO_NOT_IMPLEMENTED;
void prolong_applyadd(std::shared_ptr<const HipExecutor> exec,
const Array<IndexType> &agg,
const matrix::Dense<ValueType> *b,
matrix::Dense<ValueType> *x) GKO_NOT_IMPLEMENTED;

GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(
GKO_DECLARE_AMGX_PGM_PROLONGATE_APPLY_KERNEL);
Expand Down
1 change: 0 additions & 1 deletion include/ginkgo/core/matrix/csr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include <ginkgo/core/base/array.hpp>
#include <ginkgo/core/base/coarse_fine.hpp>
#include <ginkgo/core/base/lin_op.hpp>


Expand Down
18 changes: 9 additions & 9 deletions include/ginkgo/core/multigrid/amgx_pgm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <vector>


#include <ginkgo/core/base/coarse_fine.hpp>
#include <ginkgo/core/base/exception_helpers.hpp>
#include <ginkgo/core/base/lin_op.hpp>
#include <ginkgo/core/base/types.hpp>
#include <ginkgo/core/matrix/csr.hpp>
#include <ginkgo/core/multigrid/restrict_prolong.hpp>


namespace gko {
Expand All @@ -59,13 +59,13 @@ namespace multigrid {
* @tparam ValueType precision of matrix elements
* @tparam IndexType precision of matrix indexes
*
* @ingroup CoarseFine
* @ingroup RestrictProlong
* @ingroup LinOp
*/
template <typename ValueType = default_precision, typename IndexType = int32>
class AmgxPgm : public EnableCFOp<AmgxPgm<ValueType, IndexType>> {
friend class EnableCFOp<AmgxPgm>;
friend class EnablePolymorphicObject<AmgxPgm, CoarseFine>;
class AmgxPgm : public EnableRestrictProlong<AmgxPgm<ValueType, IndexType>> {
friend class EnableRestrictProlong<AmgxPgm>;
friend class EnablePolymorphicObject<AmgxPgm, RestrictProlong>;

public:
using value_type = ValueType;
Expand Down Expand Up @@ -117,19 +117,19 @@ class AmgxPgm : public EnableCFOp<AmgxPgm<ValueType, IndexType>> {
*/
bool GKO_FACTORY_PARAMETER(deterministic, false);
};
GKO_ENABLE_CFOP_FACTORY(AmgxPgm, parameters, Factory);
GKO_ENABLE_RESTRICT_PROLONG_FACTORY(AmgxPgm, parameters, Factory);
GKO_ENABLE_BUILD_METHOD(Factory);

protected:
void restrict_apply_impl(const LinOp *b, LinOp *x) const override;

void prolongate_applyadd_impl(const LinOp *b, LinOp *x) const override;
void prolong_applyadd_impl(const LinOp *b, LinOp *x) const override;
explicit AmgxPgm(std::shared_ptr<const Executor> exec)
: EnableCFOp<AmgxPgm>(std::move(exec))
: EnableRestrictProlong<AmgxPgm>(std::move(exec))
{}
explicit AmgxPgm(const Factory *factory,
std::shared_ptr<const LinOp> system_matrix)
: EnableCFOp<AmgxPgm>(factory->get_executor()),
: EnableRestrictProlong<AmgxPgm>(factory->get_executor()),
parameters_{factory->get_parameters()},
system_matrix_{std::move(system_matrix)},
agg_(factory->get_executor(), system_matrix_->get_size()[0])
Expand Down
Loading

0 comments on commit ef08bb8

Please sign in to comment.