|
29 | 29 |
|
30 | 30 | static constexpr VecSimSvsQuantBits get_compression_mode() { return VecSimSvsQuant_Scalar; }
|
31 | 31 |
|
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)); |
38 | 38 |
|
39 | 39 | allocator_type data_allocator{std::move(allocator)};
|
40 | 40 | auto blocked_alloc = svs::make_blocked_allocator_handle({svs_bs}, data_allocator);
|
41 | 41 |
|
42 | 42 | return index_storage_type::compress(data, pool, blocked_alloc);
|
43 | 43 | }
|
44 | 44 |
|
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 | + } |
49 | 49 |
|
50 | 50 | static size_t storage_capacity(const index_storage_type &storage) {
|
51 | 51 | // SQDataset does not provide a capacity method
|
|
107 | 107 | }
|
108 | 108 | }
|
109 | 109 |
|
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)); |
115 | 116 |
|
116 | 117 | allocator_type data_allocator{std::move(allocator)};
|
117 | 118 | auto blocked_alloc = svs::make_blocked_allocator_handle({svs_bs}, data_allocator);
|
|
0 commit comments