13#ifndef ARCANE_IMPL_IBUFFERCOPIER_H
14#define ARCANE_IMPL_IBUFFERCOPIER_H
18#include "arcane/utils/MemoryView.h"
21#include "arcane/core/GroupIndexTable.h"
22#include "arcane/accelerator/core/RunQueue.h"
62 virtual void setRunQueue(
const RunQueue& queue) = 0;
80 RunQueue* q = (m_queue.isNull()) ? nullptr : &m_queue;
88 RunQueue* q = (m_queue.isNull()) ? nullptr : &m_queue;
93 void setRunQueue(
const RunQueue& queue)
override { m_queue = queue; }
103class TableBufferCopier
117 _buildFinalIndexes(final_indexes, indexes);
118 m_base_copier.copyFromBufferAsync(final_indexes, buffer, var_value);
126 _buildFinalIndexes(final_indexes, indexes);
127 m_base_copier.copyToBufferAsync(final_indexes, buffer, var_value);
129 void barrier()
override { m_base_copier.barrier(); }
131 void setRunQueue(
const RunQueue& queue)
override { m_base_copier.setRunQueue(queue); }
135 GroupIndexTable* m_table =
nullptr;
136 DirectBufferCopier m_base_copier;
140 void _buildFinalIndexes(Array<Int32>& final_indexes, ConstArrayView<Int32> orig_indexes)
145 GroupIndexTable& table = *m_table;
146 Int32 n = orig_indexes.size();
147 final_indexes.resize(n);
148 for (Int32 i = 0; i < n; ++i)
149 final_indexes[i] = table[orig_indexes[i]];
Memory and allocator management functions.
Execution queue for an accelerator.
Constant view of an array of type T.
Constant view on a contiguous memory region containing fixed-size elements.
void barrier() override
Blocks until the copies are finished.
Base class of a hash table between group items and their positions in the table.
Interface for copying elements between two regions with indexing.
virtual void barrier()=0
Blocks until the copies are finished.
Mutable view on a contiguous memory region containing fixed-size elements.
void barrier() override
Blocks until the copies are finished.
1D data vector with value semantics (STL style).
void copyWithIndexedDestination(MutableMemoryView destination, ConstMemoryView source, SmallSpan< const Int32 > indexes, RunQueue *run_queue=nullptr)
Memory copy with indirection.
IMemoryAllocator * getDefaultDataAllocator()
Default allocator for data.
void copyWithIndexedSource(MutableMemoryView destination, ConstMemoryView source, SmallSpan< const Int32 > indexes, RunQueue *run_queue=nullptr)
Copies data on the host with indirection.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --