Repository navigation
[FEA] expose python & C API for prefiltered brute force #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
63216bd
469a3ea
a6b93e5
5daba7a
3a50b90
59c4c28
31116fb
4623b8f
c422e2a
46454d9
9db7e47
c936f7e
3b65952
6c12dab
b3ff079
d0b7c8a
23f5909
4de501e
948b131
4d0a61d
21c44e7
f451ec6
3b2515d
a0d2097
3708175
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| /* | ||
| * Copyright (c) 2024, NVIDIA CORPORATION. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <cuvs/core/c_api.h> | ||
| #include <cuvs/distance/distance.h> | ||
| #include <dlpack/dlpack.h> | ||
| #include <stdint.h> | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| /** | ||
| * @defgroup prefilter | ||
| * @{ | ||
| */ | ||
|
|
||
| enum cuvsPrefilterType { | ||
| /* No filter */ | ||
| NO_FILTER, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will need a way to specify a custom filter function (maybe to accept a function pointer?) also. While bfknn currently only supports bitmap / bitset, we also need to expose the filtering APIs for the other ANN indexes (most ideally through the same API). I'm okay pushing this to a future change, since it's going to be needed ASAP so that we can expose the remaining filtering functions for the other algorithm. Can you create an issue for this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I will! |
||
| /* Filter an index with a bitset */ | ||
| BITSET, | ||
|
benfred marked this conversation as resolved.
Resolved
|
||
| /* Filter an index with a bitmap */ | ||
| BITMAP | ||
| }; | ||
|
|
||
| /** | ||
| * @brief Struct to hold address of cuvs::neighbor::prefilter and its type | ||
| * | ||
| */ | ||
| typedef struct { | ||
| uintptr_t addr; | ||
| enum cuvsPrefilterType type; | ||
| } cuvsPrefilter; | ||
|
|
||
| /** | ||
| * @} | ||
| */ | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you need to add the title after this, which is causing CI to fail with:
how about changing to something like
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I added some meaningful words here. It was fixed locally, and I'll push it after everything is correct.