Skip to content
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

We need to enable the c_api by default #416

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Another round of c_api test improvements
  • Loading branch information
robertmaynard committed Oct 17, 2024
commit bbe74b82f0b6ac3525da5ba555c6ac37c72d0329
36 changes: 28 additions & 8 deletions cpp/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ if(BUILD_TESTS)
endif()

if(TARGET cuvs::c_api)
enable_language(C)

ConfigureTest(NAME INTEROP_TEST PATH core/interop.cu C_LIB)
ConfigureTest(
NAME DISTANCE_C_TEST PATH distance/run_pairwise_distance_c.c distance/pairwise_distance_c.cu
Expand All @@ -239,19 +241,37 @@ if(TARGET cuvs::c_api)
target_link_libraries(NEIGHBORS_HNSW_TEST PRIVATE hnswlib::hnswlib)
target_compile_definitions(NEIGHBORS_HNSW_TEST PUBLIC CUVS_BUILD_CAGRA_HNSWLIB)
endif()
endif()

# ##################################################################################################
# Install tests ####################################################################################
# ##################################################################################################
rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing DESTINATION bin/gtests/libcuvs)

if(TARGET cuvs::c_api)
enable_language(C)

add_executable(cuvs_c_test core/c_api.c)
target_link_libraries(cuvs_c_test PUBLIC cuvs::c_api)

add_executable(cuvs_c_neighbors_test neighbors/c_api.c)
target_link_libraries(cuvs_c_neighbors_test PUBLIC cuvs::c_api)

set_target_properties(
cuvs_c_test cuvs_c_neighbors_test
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUVS_BINARY_DIR}/gtests>"
INSTALL_RPATH "\$ORIGIN/../../../lib"
)

rapids_test_add(
NAME cuvs_c_test
COMMAND cuvs_c_test
GPUS 1
PERCENT 100
INSTALL_COMPONENT_SET testing
)
rapids_test_add(
NAME cuvs_c_neighbors_test
COMMAND cuvs_c_neighbors_test
GPUS 1
PERCENT 100
INSTALL_COMPONENT_SET testing
)
endif()

# ##################################################################################################
# Install tests ####################################################################################
# ##################################################################################################
rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing DESTINATION bin/gtests/libcuvs)
Loading