43class GPUObliviousMPISender :
public GPUSender<field_type, OwnerOverlapCopyCommunicationType>
48 explicit GPUObliviousMPISender(
const OwnerOverlapCopyCommunicationType& cpuOwnerOverlapCopy)
49 : GPUSender<field_type, OwnerOverlapCopyCommunicationType>(cpuOwnerOverlapCopy)
57 auto sourceAsDuneVector = source.template asDuneBlockVector<block_size>();
58 auto destAsDuneVector = dest.template asDuneBlockVector<block_size>();
59 this->m_cpuOwnerOverlapCopy.copyOwnerToAll(sourceAsDuneVector, destAsDuneVector);
60 dest.copyFromHost(destAsDuneVector);
64 void initIndexSet()
const override
68 const auto& pis = this->m_cpuOwnerOverlapCopy.indexSet();
69 std::vector<int> indicesCopyOnCPU;
70 std::vector<int> indicesOwnerCPU;
71 for (
const auto& index : pis) {
72 if (index.local().attribute() == Dune::OwnerOverlapCopyAttributeSet::copy) {
73 for (
int component = 0; component < block_size; ++component) {
74 indicesCopyOnCPU.push_back(index.local().local() * block_size + component);
78 if (index.local().attribute() == Dune::OwnerOverlapCopyAttributeSet::owner) {
79 for (
int component = 0; component < block_size; ++component) {
80 indicesOwnerCPU.push_back(index.local().local() * block_size + component);
85 this->m_indicesCopy = std::make_unique<GpuVector<int>>(indicesCopyOnCPU);
86 this->m_indicesOwner = std::make_unique<GpuVector<int>>(indicesOwnerCPU);
void copyOwnerToAll(const X &source, X &dest) const override
copyOwnerToAll will copy the data in source to all processes.
Definition GpuObliviousMPISender.hpp:53