19#ifndef OPM_GPUISTL_GPUSENDER_HPP
20#define OPM_GPUISTL_GPUSENDER_HPP
22#include <dune/istl/owneroverlapcopy.hh>
24#include <opm/simulators/linalg/FlowLinearSolverParameters.hpp>
25#include <opm/simulators/linalg/gpuistl/GpuVector.hpp>
42template <
class field_type,
class OwnerOverlapCopyCommunicationType>
65 virtual void initIndexSet()
const = 0;
76 std::call_once(m_initializedIndices, [&]() { initIndexSet(); });
77 x.setZeroAtIndexSet(*m_indicesCopy);
91 std::call_once(m_initializedIndices, [&]() { initIndexSet(); });
93 const auto dotAtRank = x.dot(
y, *m_indicesOwner);
105 auto xDotX = field_type(0);
109 return std::sqrt(
xDotX);
119 return m_cpuOwnerOverlapCopy.communicator();
126 mutable std::once_flag m_initializedIndices;
127 mutable std::unique_ptr<GpuVector<int>> m_indicesOwner;
128 mutable std::unique_ptr<GpuVector<int>> m_indicesCopy;
GPUSender is a wrapper class for classes which will implement copOwnerToAll This is implemented with ...
Definition GpuSender.hpp:44
void project(X &x) const
project will project x to the owned subspace
Definition GpuSender.hpp:74
virtual void copyOwnerToAll(const X &source, X &dest) const =0
copyOwnerToAll will copy the data in source to all processes.
void dot(const X &x, const X &y, field_type &output) const
dot will carry out the dot product between x and y on the owned indices, then sum up the result acros...
Definition GpuSender.hpp:89
field_type norm(const X &x) const
norm computes the l^2-norm of x across processes.
Definition GpuSender.hpp:103
const ::Dune::Communication< MPI_Comm > & communicator() const
communicator returns the MPI communicator used by this GPUSender
Definition GpuSender.hpp:117
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240