12#ifndef ARCANE_CORE_BLOCKINDEXLIST_H
13#define ARCANE_CORE_BLOCKINDEXLIST_H
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/utils/UniqueArray.h"
36class ARCANE_CORE_EXPORT BlockIndex
38 friend class BlockIndexList;
42 static constexpr Int16 MAX_BLOCK_SIZE = 512;
48 , m_value_offset(value_offset)
57 ARCANE_CHECK_AT(i, m_size);
58 return m_block_start[i] + m_value_offset;
69 const Int32* m_block_start =
nullptr;
70 Int32 m_value_offset = 0;
84 friend class BlockIndexListBuilder;
90 Int32 nbBlock()
const {
return m_nb_block; }
91 Real memoryRatio()
const;
95 Int32 index = m_blocks_index_and_offset[i * 2];
96 Int32 offset = m_blocks_index_and_offset[(i * 2) + 1];
97 Int16 size = ((i + 1) != m_nb_block) ? m_block_size : m_last_block_size;
98 return BlockIndex(m_indexes.span().ptrAt(index), offset, size);
109 Int32 m_original_size = 0;
111 Int32 m_nb_block = 0;
113 Int16 m_block_size = 0;
115 Int16 m_last_block_size = 0;
120 void _setNbBlock(
Int32 nb_block);
121 Int32 _currentIndexPosition()
const;
122 void _addBlockInfo(
const Int32* data,
Int16 size);
123 Int32 _computeNbContigusBlock()
const;
134class ARCANE_CORE_EXPORT BlockIndexListBuilder
143 void setVerbose(
bool v) { m_is_verbose = v; }
160 bool m_is_verbose =
false;
161 Int16 m_block_size = 32;
165 void _throwInvalidBlockSize [[noreturn]] (
Int32 block_size);
Declarations of Arcane's general types.
Base class for 1D data vectors.
void setBlockSizeAsPowerOfTwo(Int32 v)
Sets the block size as a power of 2.
Int32 valueOffset() const
Offset of the block values.
Int16 size() const
Size of the block.
Int32 operator[](Int32 i) const
i-th value of the block
View of an array of elements of type T.
Unicode character string.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
1D data vector with value semantics (STL style).
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int16_t Int16
Signed integer type of 16 bits.
double Real
Type representing a real number.
std::int32_t Int32
Signed integer type of 32 bits.