Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions include/svs/core/data/simple.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "svs/lib/uuid.h"

// stdlib
#include <memory>
#include <span>
#include <type_traits>

Expand Down Expand Up @@ -672,10 +673,10 @@ class SimpleData<T, Extent, Blocked<Alloc>> {
/// Add a new data block to the end of the current collection of blocks.
///
void add_block() {
blocks_.emplace_back(
blocks_.emplace_back(std::make_unique<array_type>(
make_dims(blocksize().value(), lib::forward_extent<Extent>(dimensions())),
allocator_.get_allocator()
);
));
}

///
Expand Down Expand Up @@ -727,12 +728,12 @@ class SimpleData<T, Extent, Blocked<Alloc>> {

const_value_type get_datum(size_t i) const {
auto [block_id, data_id] = resolve(i);
return getindex(blocks_, block_id).slice(data_id);
return getindex(blocks_, block_id)->slice(data_id);
}

value_type get_datum(size_t i) {
auto [block_id, data_id] = resolve(i);
return getindex(blocks_, block_id).slice(data_id);
return getindex(blocks_, block_id)->slice(data_id);
}

void prefetch(size_t i) const { lib::prefetch(get_datum(i)); }
Expand Down Expand Up @@ -827,7 +828,7 @@ class SimpleData<T, Extent, Blocked<Alloc>> {
private:
// The blocksize in terms of number of vectors.
lib::PowerOfTwo blocksize_;
std::vector<array_type> blocks_;
std::vector<std::unique_ptr<array_type>> blocks_;
size_t dimensions_;
size_t size_;
Blocked<Alloc> allocator_;
Expand Down
Loading