12#ifndef ARCCORE_COMMON_ACCELERATOR_INTERNAL_REDUCEMEMORYIMPL_H
13#define ARCCORE_COMMON_ACCELERATOR_INTERNAL_REDUCEMEMORYIMPL_H
17#include "arccore/common/accelerator/IReduceMemoryImpl.h"
19#include "arccore/common/Array.h"
24namespace Arcane::Accelerator::Impl
43 _allocateGridDataMemory();
49 return m_grid_memory_info;
85 void _allocateGridDataMemory();
86 void _allocateMemoryForGridDeviceCount();
87 void _setReducePolicy();
88 void _allocateMemoryForReduceData(
Int32 new_size);
Interface for memory management for reductions.
UniqueArray< std::byte > m_host_memory_bytes
Allocation for the reduced data in host memory.
void release() override
Releases the instance.
UniqueArray< Byte > m_grid_buffer
Array containing the reduction value for each block of a grid.
UniqueArray< unsigned int > m_grid_device_count
Array of 1 unsigned integer containing the number of grids that have already performed the reduction.
UniqueArray< std::byte > m_identity_buffer
Buffer to store the identity value.
void setGridSizeAndAllocate(Int32 grid_size) override
Sets the GPU grid size (the number of blocks) and allocates memory.
void allocateReduceDataMemory(Int32 data_type_size) override
Allocates memory for a data item that needs to be reduced.
Int32 gridSize() const override
GPU grid size (number of blocks).
GridMemoryInfo gridMemoryInfo() override
Information about the memory used by the reduction.
Int64 m_size
Size allocated for m_device_memory.
Int32 m_grid_size
Current grid size (number of blocks).
Int64 m_data_type_size
Current data size.
Implementation of a command for accelerator.
1D data vector with value semantics (STL style).
std::int64_t Int64
Signed integer type of 64 bits.
std::int32_t Int32
Signed integer type of 32 bits.
Memory information for reduction on accelerators.