message: Fix an issue in HypreLOBPCG when HYPRE is built with CUDA
diff: @@ -5697,16 +5697,18 @@ HypreLOBPCG::OperatorMatvec( void *matvec_data,
  Operator *Aop = (Operator*)A;
  - int width = Aop->Width();
  -
  hypre_ParVector * xPar = (hypre_ParVector *)x;
  hypre_ParVector * yPar = (hypre_ParVector *)y;
  - Vector xVec(xPar->local_vector->data, width);
  - Vector yVec(yPar->local_vector->data, width);
  + HypreParVector xVec(xPar);
  + HypreParVector yVec(yPar);
  Aop->Mult( xVec, yVec );
  + // Move data back to hypre's device memory location in case the above Mult
  + // operation moved it to host.
  + yVec.HypreReadWrite();
  +
  return 0;
  }
  @@ -5723,18 +5725,19 @@ HypreLOBPCG::PrecondSolve(void *solver,
  void *x)
  {
  Solver *PC = (Solver*)solver;
  - Operator *OP = (Operator*)A;
  -
  - int width = OP->Width();
  hypre_ParVector * bPar = (hypre_ParVector *)b;
  hypre_ParVector * xPar = (hypre_ParVector *)x;
  - Vector bVec(bPar->local_vector->data, width);
  - Vector xVec(xPar->local_vector->data, width);
  + HypreParVector bVec(bPar);
  + HypreParVector xVec(xPar);
  PC->Mult( bVec, xVec );
  + // Move data back to hypre's device memory location in case the above Mult
  + // operation moved it to host.
  + xVec.HypreReadWrite();
  +
  return 0;
  }
  