Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/VecSim/index_factories/components/components_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ CreateIndexComponents(std::shared_ptr<VecSimAllocator> allocator, VecSimMetric m
// Currently we have only one distance calculator implementation
auto indexCalculator = new (allocator) DistanceCalculatorCommon<DistType>(allocator, distFunc);

// TODO: take into account quantization
auto preprocessors =
CreatePreprocessorsContainer<DataType>(allocator, metric, dim, is_normalized, alignment);

Expand Down
26 changes: 14 additions & 12 deletions src/VecSim/vec_sim_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ typedef struct {
// all the ready swap jobs in a batch.
} TieredHNSWParams;

// A struct that contains HNSW Disk tiered index specific params.
// Consider removing and use TieredHNSWParams instead if they both share swapJobThreshold
typedef struct {
char _placeholder; // Reserved for future fields and avoid compiler errors
} TieredHNSWDiskParams;

// A struct that contains SVS tiered index specific params.
typedef struct {
size_t trainingTriggerThreshold; // The flat index size threshold to trigger the initialization
Expand All @@ -223,6 +229,7 @@ typedef struct {
union {
TieredHNSWParams tieredHnswParams;
TieredSVSParams tieredSVSParams;
TieredHNSWDiskParams tieredHnswDiskParams;
} specificParams;
} TieredIndexParams;

Expand All @@ -239,21 +246,16 @@ struct VecSimParams {
void *logCtx; // External context that stores the index log.
};

// Parameters for creating a disk-based vector index. Currently only HNSW Disk is supported.
typedef struct VecSimHNSWDiskParams {
size_t dim;
VecSimType type;
VecSimMetric metric;
size_t M;
size_t efConstruction;
size_t efRuntime;
size_t blockSize;
bool multi;
typedef struct {
void *storage; // Opaque pointer to disk storage
const char *indexName;
size_t indexNameLen;
void *logCtx;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

void *logCtx is in VecSimParams

} VecSimHNSWDiskParams;
} VecSimDiskContext;

typedef struct {
VecSimParams *indexParams;
VecSimDiskContext *diskContext;
} VecSimParamsDisk;

/**
* The specific job types in use (to be extended in the future by demand)
Expand Down
Loading