Skip to content

Commit d7602a1

Browse files
committed
main svs_extentions
1 parent 97f2030 commit d7602a1

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

src/VecSim/algorithms/svs/svs_extensions.h

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@
2929

3030
static constexpr VecSimSvsQuantBits get_compression_mode() { return VecSimSvsQuant_Scalar; }
3131

32-
template <svs::data::ImmutableMemoryDataset Dataset, svs::threads::ThreadPool Pool>
33-
static index_storage_type create_storage(const Dataset &data, size_t block_size, Pool &pool,
34-
std::shared_ptr<VecSimAllocator> allocator,
35-
size_t /*leanvec_dim*/) {
36-
const auto dim = data.dimensions();
37-
auto svs_bs = svs_details::SVSBlockSize(block_size, element_size(dim));
32+
template <svs::data::ImmutableMemoryDataset Dataset, svs::threads::ThreadPool Pool>
33+
static index_storage_type create_storage(const Dataset &data, size_t block_size, Pool &pool,
34+
std::shared_ptr<VecSimAllocator> allocator,
35+
size_t /*leanvec_dim*/) {
36+
const auto dim = data.dimensions();
37+
auto svs_bs = svs_details::SVSBlockSize(block_size, element_size(dim));
3838

3939
allocator_type data_allocator{std::move(allocator)};
4040
auto blocked_alloc = svs::make_blocked_allocator_handle({svs_bs}, data_allocator);
4141

4242
return index_storage_type::compress(data, pool, blocked_alloc);
4343
}
4444

45-
static constexpr size_t element_size(size_t dims, size_t alignment = 0,
46-
size_t /*leanvec_dim*/ = 0) {
47-
return dims * sizeof(element_type);
48-
}
45+
static constexpr size_t element_size(size_t dims, size_t alignment = 0,
46+
size_t /*leanvec_dim*/ = 0) {
47+
return dims * sizeof(element_type);
48+
}
4949

5050
static size_t storage_capacity(const index_storage_type &storage) {
5151
// SQDataset does not provide a capacity method
@@ -107,11 +107,12 @@
107107
}
108108
}
109109

110-
template <svs::data::ImmutableMemoryDataset Dataset, svs::threads::ThreadPool Pool>
111-
static index_storage_type create_storage(const Dataset &data, size_t block_size, Pool &pool,
112-
std::shared_ptr<VecSimAllocator> allocator) {
113-
const auto dim = data.dimensions();
114-
auto svs_bs = svs_details::SVSBlockSize(block_size, element_size(dim));
110+
template <svs::data::ImmutableMemoryDataset Dataset, svs::threads::ThreadPool Pool>
111+
static index_storage_type create_storage(const Dataset &data, size_t block_size, Pool &pool,
112+
std::shared_ptr<VecSimAllocator> allocator,
113+
size_t /*leanvec_dim*/) {
114+
const auto dim = data.dimensions();
115+
auto svs_bs = svs_details::SVSBlockSize(block_size, element_size(dim));
115116

116117
allocator_type data_allocator{std::move(allocator)};
117118
auto blocked_alloc = svs::make_blocked_allocator_handle({svs_bs}, data_allocator);

0 commit comments

Comments
 (0)