Skip to content

Commit

Permalink
MB-61930: Use the go-faiss OpenMP API for setting the default number …
Browse files Browse the repository at this point in the history
…of OMP Threads to be 1
  • Loading branch information
CascadingRadium committed Jun 7, 2024
1 parent 8d27d20 commit 61451a1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions section_faiss_vector_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ import (
seg "github.com/blevesearch/scorch_segment_api/v2"
)

const defaultFaissOMPThreads = 1

func init() {
rand.Seed(time.Now().UTC().UnixNano())
registerSegmentSection(SectionFaissVectorIndex, &faissVectorIndexSection{})
isFieldNotApplicableToInvertedTextSection = func(field index.Field) bool {
_, ok := field.(index.VectorField)
return ok
}
faiss.SetOMPThreads(defaultFaissOMPThreads)
}

type faissVectorIndexSection struct {
Expand Down

0 comments on commit 61451a1

Please sign in to comment.