16#include "arcane/accelerator/core/Memory.h"
17#include "arcane/accelerator/GenericFilterer.h"
36 IndexSelecter(
const RunQueue& runqueue)
40 m_memory_host =
eMemoryRessource(m_is_accelerator_policy ? eMemoryRessource::HostPinned : eMemoryRessource::Host);
41 m_memory_device =
eMemoryRessource(m_is_accelerator_policy ? eMemoryRessource::Device : eMemoryRessource::Host);
65 template <
typename PredicateType>
76 to_instantiate =
true;
88 [=] ARCCORE_HOST_DEVICE(
Int32 input_index,
Int32 output_index) ->
void {
89 out_lid_select[output_index] = input_index;
93 if (nb_idx_selected && host_view) {
96 m_localid_select_device.subView(0, nb_idx_selected).data(),
97 nb_idx_selected *
sizeof(
Int32))
102 ConstArrayView<Int32> lid_select_view = (host_view ? m_localid_select_host.subConstView(0, nb_idx_selected) : m_localid_select_device.subConstView(0, nb_idx_selected));
104 return lid_select_view;
109 bool m_is_accelerator_policy =
false;
Memory and allocator management functions.
Generic filtering algorithm on accelerator.
void resize(Int32 nb_idx)
Defines the interval [0,nb_idx[ on which the selection will be performed.
GenericFilterer * m_generic_filterer_instance
GenericFilterer instance.
Int32 m_index_number
Interval [0, m_index_number[ on which the selection will be performed.
RunQueue m_asynchronous_queue_pointer
Pointer to the GenericFilterer queue.
ConstArrayView< Int32 > syncSelectIf(const RunQueue &rqueue_async, PredicateType pred, bool host_view=false)
Selects the indices according to the predicate pred and synchronizes rqueue_async.
Execution queue for an accelerator.
void copyMemory(const MemoryCopyArgs &args) const
Copies information between two memory regions.
void barrier() const
Blocks until all commands associated with the queue are finished.
eExecutionPolicy executionPolicy() const
Execution policy of the queue.
Constant view of an array of type T.
View of an array of elements of type T.
1D data vector with value semantics (STL style).
Namespace for accelerator usage.
bool isAcceleratorPolicy(eExecutionPolicy exec_policy)
Indicates if exec_policy corresponds to an accelerator.
IMemoryAllocator * getAllocator(eMemoryResource mem_resource)
Default allocator for the resource mem_resource.
Arcane::eMemoryResource eMemoryRessource
Typedef for the historical Arcane version (with 2's').
std::int32_t Int32
Signed integer type of 32 bits.