Clang format
This commit is contained in:
committed by
Patrick Niklaus
parent
5f73ac1eda
commit
ef71cc0d12
@@ -1103,15 +1103,22 @@ class ContiguousInternalMemoryAlgorithmDataFacade<algorithm::MLD>
|
||||
BOOST_ASSERT(data_layout.GetBlockSize(storage::DataLayout::MLD_LEVEL_DATA) > 0);
|
||||
BOOST_ASSERT(data_layout.GetBlockSize(storage::DataLayout::MLD_CELL_TO_CHILDREN) > 0);
|
||||
|
||||
auto level_data = *data_layout.GetBlockPtr<util::MultiLevelPartitionView::LevelData>(memory_block, storage::DataLayout::MLD_PARTITION);
|
||||
auto level_data = *data_layout.GetBlockPtr<util::MultiLevelPartitionView::LevelData>(
|
||||
memory_block, storage::DataLayout::MLD_PARTITION);
|
||||
|
||||
auto mld_partition_ptr = data_layout.GetBlockPtr<util::PartitionID>(memory_block, storage::DataLayout::MLD_PARTITION);
|
||||
auto partition_entries_count = data_layout.GetBlockEntries(storage::DataLayout::MLD_PARTITION);
|
||||
util::ShM<util::PartitionID, true>::vector partition(mld_partition_ptr, partition_entries_count);
|
||||
auto mld_partition_ptr = data_layout.GetBlockPtr<util::PartitionID>(
|
||||
memory_block, storage::DataLayout::MLD_PARTITION);
|
||||
auto partition_entries_count =
|
||||
data_layout.GetBlockEntries(storage::DataLayout::MLD_PARTITION);
|
||||
util::ShM<util::PartitionID, true>::vector partition(mld_partition_ptr,
|
||||
partition_entries_count);
|
||||
|
||||
auto mld_chilren_ptr = data_layout.GetBlockPtr<util::CellID>(memory_block, storage::DataLayout::MLD_CELL_TO_CHILDREN);
|
||||
auto children_entries_count = data_layout.GetBlockEntries(storage::DataLayout::MLD_CELL_TO_CHILDREN);
|
||||
util::ShM<util::CellID, true>::vector cell_to_children(mld_chilren_ptr, children_entries_count);
|
||||
auto mld_chilren_ptr = data_layout.GetBlockPtr<util::CellID>(
|
||||
memory_block, storage::DataLayout::MLD_CELL_TO_CHILDREN);
|
||||
auto children_entries_count =
|
||||
data_layout.GetBlockEntries(storage::DataLayout::MLD_CELL_TO_CHILDREN);
|
||||
util::ShM<util::CellID, true>::vector cell_to_children(mld_chilren_ptr,
|
||||
children_entries_count);
|
||||
|
||||
mld_partition = util::MultiLevelPartitionView{level_data, partition, cell_to_children};
|
||||
}
|
||||
@@ -1138,10 +1145,7 @@ class ContiguousInternalMemoryAlgorithmDataFacade<algorithm::MLD>
|
||||
InitializeInternalPointers(allocator->GetLayout(), allocator->GetMemory());
|
||||
}
|
||||
|
||||
const util::MultiLevelPartitionView &GetMultiLevelPartition() const
|
||||
{
|
||||
return mld_partition;
|
||||
}
|
||||
const util::MultiLevelPartitionView &GetMultiLevelPartition() const { return mld_partition; }
|
||||
|
||||
const util::CellStorage<true> &GetCellStorage() const { return mld_cell_storage; }
|
||||
};
|
||||
|
||||
@@ -126,10 +126,7 @@ struct DataLayout
|
||||
entry_align[bid] = alignof(T);
|
||||
}
|
||||
|
||||
inline uint64_t GetBlockEntries(BlockID bid) const
|
||||
{
|
||||
return num_entries[bid];
|
||||
}
|
||||
inline uint64_t GetBlockEntries(BlockID bid) const { return num_entries[bid]; }
|
||||
|
||||
inline uint64_t GetBlockSize(BlockID bid) const
|
||||
{
|
||||
@@ -178,8 +175,7 @@ struct DataLayout
|
||||
return ptr;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T *GetBlockEnd(char *shared_memory, BlockID bid) const
|
||||
template <typename T> inline T *GetBlockEnd(char *shared_memory, BlockID bid) const
|
||||
{
|
||||
auto begin = GetBlockPtr<T>(shared_memory, bid);
|
||||
return begin + GetBlockEntries(bid);
|
||||
|
||||
@@ -178,11 +178,7 @@ template <bool UseShareMemory> class MultiLevelPartitionImpl final
|
||||
auto offsets = MakeLevelOffsets(lidx_to_num_cells);
|
||||
auto masks = MakeLevelMasks(offsets, num_level);
|
||||
auto bits = MakeBitToLevel(offsets, num_level);
|
||||
return LevelData{num_level,
|
||||
offsets,
|
||||
masks,
|
||||
bits,
|
||||
{0}};
|
||||
return LevelData{num_level, offsets, masks, bits, {0}};
|
||||
}
|
||||
|
||||
inline std::size_t LevelIDToIndex(LevelID l) const { return l - 1; }
|
||||
@@ -228,7 +224,8 @@ template <bool UseShareMemory> class MultiLevelPartitionImpl final
|
||||
return offsets;
|
||||
}
|
||||
|
||||
auto MakeLevelMasks(const std::array<std::uint8_t, MAX_NUM_LEVEL - 1> &level_offsets, std::uint32_t num_level) const
|
||||
auto MakeLevelMasks(const std::array<std::uint8_t, MAX_NUM_LEVEL - 1> &level_offsets,
|
||||
std::uint32_t num_level) const
|
||||
{
|
||||
std::array<PartitionID, MAX_NUM_LEVEL - 1> masks;
|
||||
|
||||
@@ -250,13 +247,14 @@ template <bool UseShareMemory> class MultiLevelPartitionImpl final
|
||||
return masks;
|
||||
}
|
||||
|
||||
auto MakeBitToLevel(const std::array<std::uint8_t, MAX_NUM_LEVEL - 1> &level_offsets, std::uint32_t num_level) const
|
||||
auto MakeBitToLevel(const std::array<std::uint8_t, MAX_NUM_LEVEL - 1> &level_offsets,
|
||||
std::uint32_t num_level) const
|
||||
{
|
||||
std::array<LevelID, NUM_PARTITION_BITS> bit_to_level;
|
||||
|
||||
for (auto l = 1u; l < num_level; ++l)
|
||||
{
|
||||
auto bits = level_offsets[l-1];
|
||||
auto bits = level_offsets[l - 1];
|
||||
// set all bits to point to the correct level.
|
||||
for (auto idx = bits; idx < NUM_PARTITION_BITS; ++idx)
|
||||
{
|
||||
@@ -329,7 +327,7 @@ template <bool UseShareMemory> class MultiLevelPartitionImpl final
|
||||
{
|
||||
const auto &parent_partition = partitions[level_idx + 1];
|
||||
|
||||
level_data.lidx_to_children_offsets[level_idx+1] = cell_to_children.size();
|
||||
level_data.lidx_to_children_offsets[level_idx + 1] = cell_to_children.size();
|
||||
|
||||
CellID last_parent_id = parent_partition[permutation.front()];
|
||||
cell_to_children.push_back(GetCell(level_idx + 1, permutation.front()));
|
||||
|
||||
Reference in New Issue
Block a user