Skip to content

Commit 437e909

Browse files
committed
Merge branch 'branch-25.08' into moar_shellcheck
2 parents c611822 + 32be51a commit 437e909

3 files changed

Lines changed: 54 additions & 5 deletions

File tree

cpp/include/cuvs/neighbors/tiered_index.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, NVIDIA CORPORATION.
2+
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,11 +32,11 @@ extern "C" {
3232
/**
3333
* @brief Enum to hold which ANN algorithm is being used in the tiered index
3434
*/
35-
enum cuvsTieredIndexANNAlgo {
35+
typedef enum {
3636
CUVS_TIERED_INDEX_ALGO_CAGRA,
3737
CUVS_TIERED_INDEX_ALGO_IVF_FLAT,
3838
CUVS_TIERED_INDEX_ALGO_IVF_PQ
39-
};
39+
} cuvsTieredIndexANNAlgo;
4040

4141
/**
4242
* @defgroup tiered_index_c_index Tiered Index

cpp/tests/neighbors/c_api.c

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, NVIDIA CORPORATION.
2+
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,16 +16,53 @@
1616

1717
#include <cuvs/core/c_api.h>
1818
#include <cuvs/neighbors/cagra.h>
19+
#include <cuvs/neighbors/tiered_index.h>
20+
21+
#include <dlpack/dlpack.h>
22+
23+
#include <assert.h>
1924
#include <stdio.h>
2025
#include <stdlib.h>
2126

22-
int main()
27+
void test_compile_cagra()
2328
{
2429
// simple smoke test to make sure that we can compile the cagra.h API
2530
// using a c compiler. This isn't aiming to be a full test, just checking
2631
// that the exposed C-API is valid C code and doesn't contain C++ features
32+
assert(!"test_compile_cagra is not meant to be run");
33+
2734
cuvsCagraIndex_t index;
2835
cuvsCagraIndexCreate(&index);
2936
cuvsCagraIndexDestroy(index);
37+
}
38+
39+
void test_compile_tiered_index()
40+
{
41+
// Smoke test to ensure that the tiered_index.h API compiles correctly
42+
// using a c compiler. Not a full test.
43+
assert(!"test_compile_tiered_index is not meant to be run");
44+
45+
cuvsTieredIndex_t tiered_index;
46+
cuvsTieredIndexCreate(&tiered_index);
47+
cuvsTieredIndexDestroy(tiered_index);
48+
49+
cuvsTieredIndexParams_t index_params;
50+
cuvsResources_t resources;
51+
cuvsFilter prefilter;
52+
DLManagedTensor dataset, neighbors, distances;
53+
cuvsTieredIndexParamsCreate(&index_params);
54+
cuvsTieredIndexParamsDestroy(index_params);
55+
cuvsTieredIndexBuild(resources, index_params, &dataset, tiered_index);
56+
cuvsTieredIndexSearch(resources, NULL, tiered_index, &dataset, &neighbors, &distances, prefilter);
57+
cuvsTieredIndexExtend(resources, &dataset, tiered_index);
58+
}
59+
60+
int main()
61+
{
62+
// These are smoke tests that check that the C-APIs compile with a C compiler.
63+
// These are not meant to be run.
64+
test_compile_cagra();
65+
test_compile_tiered_index();
66+
3067
return 0;
3168
}

java/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ do `./build.sh java` in the top level directory or just do `./build.sh` in this
2525

2626
Run `./build.sh --run-java-tests` from this directory.
2727

28+
To run a single test:
29+
```sh
30+
cd cuvs-java/
31+
mvn verify -Dintegration-test=com.nvidia.cuvs.CagraBuildAndSearchIT
32+
```
33+
Be sure to set (manually, if needed) your `LD_LIBRARY_PATH` to include the directory with the appropriate (matching)
34+
version of `libcuvs.so`.
35+
Also, ensure that your panama bindings are up-to-date. They can be re-generated by running:
36+
```sh
37+
./panama-bindings/generate-bindings.sh
38+
```
39+
2840

2941
## Examples
3042

0 commit comments

Comments
 (0)