47 #ifndef MUELU_AMGXOPERATOR_DEF_HPP
48 #define MUELU_AMGXOPERATOR_DEF_HPP
50 #if defined(HAVE_MUELU_AMGX)
78 vectorTimer1_->start();
83 if (comm->getSize() == 1) {
84 amgxXdata = mueluXdata;
85 amgxYdata = mueluYdata;
88 int n = mueluXdata.
size();
93 ArrayRCP<double> amgxXdata_nonConst = Teuchos::arcp_const_cast<
double>(amgxXdata);
94 for (
int j = 0; j < n; j++) {
95 amgxXdata_nonConst[muelu2amgx_[j]] = mueluXdata[j];
96 amgxYdata[muelu2amgx_[j]] = mueluYdata[j];
100 AMGX_vector_upload(X_, N_, 1, &amgxXdata[0]);
101 AMGX_vector_upload(Y_, N_, 1, &amgxYdata[0]);
103 vectorTimer1_->stop();
104 vectorTimer1_->incrementNumCalls();
108 solverTimer_->start();
109 AMGX_solver_solve(Solver_, X_, Y_);
110 solverTimer_->stop();
111 solverTimer_->incrementNumCalls();
114 vectorTimer2_->start();
116 AMGX_vector_download(Y_, &amgxYdata[0]);
118 if (comm->getSize() > 1) {
119 int n = mueluYdata.
size();
121 for (
int j = 0; j < n; j++)
122 mueluYdata[j] = amgxYdata[muelu2amgx_[j]];
125 vectorTimer2_->stop();
126 vectorTimer2_->incrementNumCalls();
130 }
catch (std::exception& e) {
131 std::string errMsg = std::string(
"Caught an exception in MueLu::AMGXOperator::Apply():\n") + e.what() +
"\n";
136 template <
class Node>
142 #endif // if defined(HAVE_MUELU_AMGX)
144 #endif // ifdef MUELU_AMGXOPERATOR_DEF_HPP
size_t getNumVectors() const
Teuchos::RCP< const Map > getRangeMap() const
Returns the Tpetra::Map object associated with the range of this operator.
Teuchos::ArrayRCP< const Scalar > getData(size_t j) const
void resize(const size_type n, const T &val=T())
void apply(const MultiVector &X, MultiVector &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const
Returns a solution for the linear system AX=Y in the Tpetra::MultiVector X.
Teuchos::ArrayRCP< Scalar > getDataNonConst(size_t j)
Teuchos::RCP< const Map > getDomainMap() const
Returns the Tpetra::Map object associated with the domain of this operator.
virtual Teuchos::RCP< const map_type > getMap() const
Exception throws to report errors in the internal logical of the program.
bool hasTransposeApply() const
Indicates whether this operator supports applying the adjoint operator.