Skip to content

Commit

Permalink
update ivf_flat go api
Browse files Browse the repository at this point in the history
  • Loading branch information
benfred committed Feb 6, 2025
1 parent 56ba002 commit 9996ed9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion go/ivf_flat/ivf_flat.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ func SearchIndex[T any](Resources cuvs.Resource, params *SearchParams, index *Iv
if !index.trained {
return errors.New("index needs to be built before calling search")
}
prefilter := C.cuvsFilter{
addr: 0,
_type: C.NO_FILTER,
}

return cuvs.CheckCuvs(cuvs.CuvsError(C.cuvsIvfFlatSearch(C.cuvsResources_t(Resources.Resource), params.params, index.index, (*C.DLManagedTensor)(unsafe.Pointer(queries.C_tensor)), (*C.DLManagedTensor)(unsafe.Pointer(neighbors.C_tensor)), (*C.DLManagedTensor)(unsafe.Pointer(distances.C_tensor)))))
return cuvs.CheckCuvs(cuvs.CuvsError(C.cuvsIvfFlatSearch(C.cuvsResources_t(Resources.Resource), params.params, index.index, (*C.DLManagedTensor)(unsafe.Pointer(queries.C_tensor)), (*C.DLManagedTensor)(unsafe.Pointer(neighbors.C_tensor)), (*C.DLManagedTensor)(unsafe.Pointer(distances.C_tensor)), prefilter)))
}

0 comments on commit 9996ed9

Please sign in to comment.