47 #ifndef MUELU_AMGXOPERATOR_DEF_HPP
48 #define MUELU_AMGXOPERATOR_DEF_HPP
51 #if defined (HAVE_MUELU_AMGX)
79 vectorTimer1_->start();
84 if (comm->getSize() == 1) {
85 amgxXdata = mueluXdata;
86 amgxYdata = mueluYdata;
89 int n = mueluXdata.
size();
94 ArrayRCP<double> amgxXdata_nonConst = Teuchos::arcp_const_cast<double>(amgxXdata);
95 for (
int j = 0; j < n; j++) {
96 amgxXdata_nonConst[muelu2amgx_[j]] = mueluXdata[j];
97 amgxYdata [muelu2amgx_[j]] = mueluYdata[j];
101 AMGX_vector_upload(X_, N_, 1, &amgxXdata[0]);
102 AMGX_vector_upload(Y_, N_, 1, &amgxYdata[0]);
104 vectorTimer1_->stop();
105 vectorTimer1_->incrementNumCalls();
108 AMGX_solver_solve(Solver_, X_, Y_);
111 vectorTimer2_->start();
113 AMGX_vector_download(Y_, &amgxYdata[0]);
115 if (comm->getSize() > 1) {
116 int n = mueluYdata.
size();
118 for (
int j = 0; j < n; j++)
119 mueluYdata[j] = amgxYdata[muelu2amgx_[j]];
122 vectorTimer2_->stop();
123 vectorTimer2_->incrementNumCalls();
127 }
catch (std::exception& e) {
128 std::string errMsg = std::string(
"Caught an exception in MueLu::AMGXOperator::Apply():\n") + e.what() +
"\n";
139 #endif //if defined(HAVE_MUELU_AMGX)
141 #endif //ifdef MUELU_AMGXOPERATOR_DEF_HPP