Skip to content

Commit

Permalink
Cmake bits are mostly correct
Browse files Browse the repository at this point in the history
  • Loading branch information
cjnolet committed Nov 21, 2023
1 parent 8151e55 commit a6d92e1
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 49 deletions.
29 changes: 7 additions & 22 deletions cpp/bench/ann/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,47 +209,32 @@ endif()
if(CUVS_BENCH_USE_RAFT_IVF_PQ)
ConfigureAnnBench(
NAME RAFT_IVF_PQ PATH bench/ann/src/raft/raft_benchmark.cu
$<$<BOOL:${CUVS_BENCH_USE_RAFT_IVF_PQ}>:bench/ann/src/raft/raft_ivf_pq.cu> LINKS raft::compiled
$<$<BOOL:${CUVS_BENCH_USE_RAFT_IVF_PQ}>:bench/ann/src/raft/raft_ivf_pq.cu> LINKS cuvs
)
endif()

if(CUVS_BENCH_USE_RAFT_IVF_FLAT)
ConfigureAnnBench(
NAME
RAFT_IVF_FLAT
PATH
bench/ann/src/raft/raft_benchmark.cu
$<$<BOOL:${CUVS_BENCH_USE_RAFT_IVF_FLAT}>:bench/ann/src/raft/raft_ivf_flat.cu>
LINKS
raft::compiled
NAME RAFT_IVF_FLAT PATH bench/ann/src/raft/raft_benchmark.cu
$<$<BOOL:${CUVS_BENCH_USE_RAFT_IVF_FLAT}>:bench/ann/src/raft/raft_ivf_flat.cu> LINKS cuvs
)
endif()

if(CUVS_BENCH_USE_RAFT_BRUTE_FORCE)
ConfigureAnnBench(
NAME RAFT_BRUTE_FORCE PATH bench/ann/src/raft/raft_benchmark.cu LINKS raft::compiled
)
ConfigureAnnBench(NAME RAFT_BRUTE_FORCE PATH bench/ann/src/raft/raft_benchmark.cu LINKS cuvs)
endif()

if(CUVS_BENCH_USE_RAFT_CAGRA)
ConfigureAnnBench(
NAME RAFT_CAGRA PATH bench/ann/src/raft/raft_benchmark.cu
$<$<BOOL:${CUVS_BENCH_USE_RAFT_CAGRA}>:bench/ann/src/raft/raft_cagra.cu> LINKS raft::compiled
$<$<BOOL:${CUVS_BENCH_USE_RAFT_CAGRA}>:bench/ann/src/raft/raft_cagra.cu> LINKS cuvs
)
endif()

if(CUVS_BENCH_USE_RAFT_CAGRA_HNSWLIB)
ConfigureAnnBench(
NAME
RAFT_CAGRA_HNSWLIB
PATH
bench/ann/src/raft/raft_cagra_hnswlib.cu
INCLUDES
${CMAKE_CURRENT_BINARY_DIR}/_deps/hnswlib-src/hnswlib
LINKS
raft::compiled
CXXFLAGS
"${HNSW_CXX_FLAGS}"
NAME RAFT_CAGRA_HNSWLIB PATH bench/ann/src/raft/raft_cagra_hnswlib.cu INCLUDES
${CMAKE_CURRENT_BINARY_DIR}/_deps/hnswlib-src/hnswlib LINKS cuvs CXXFLAGS "${HNSW_CXX_FLAGS}"
)
endif()

Expand Down
4 changes: 2 additions & 2 deletions cpp/bench/micro/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function(ConfigureBench)

target_link_libraries(
${BENCH_NAME}
PRIVATE raft::raft ${CUVS_CTK_MATH_DEPENDENCIES} benchmark::benchmark Threads::Threads
PRIVATE raft::raft cuvs_internal benchmark::benchmark Threads::Threads
$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_CXX> $<TARGET_NAME_IF_EXISTS:conda_env>
)

Expand Down Expand Up @@ -67,7 +67,7 @@ function(ConfigureBench)

endfunction()

if(BUILD_PRIMS_BENCH)
if(BUILD_MICRO_BENCH)
ConfigureBench(
NAME CLUSTER_BENCH PATH bench/micro/cluster/kmeans_balanced.cu bench/micro/cluster/kmeans.cu
bench/micro/main.cpp OPTIONAL LIB EXPLICIT_INSTANTIATE_ONLY
Expand Down
2 changes: 1 addition & 1 deletion cpp/bench/micro/matrix/select_k.cu
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include <raft_internal/matrix/select_k.cuh>
#include <cuvs_internal/matrix/select_k.cuh>

#include <common/benchmark.hpp>

Expand Down
2 changes: 1 addition & 1 deletion cpp/bench/micro/neighbors/refine.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#pragma once

#include <raft_internal/neighbors/refine_helper.cuh>
#include <cuvs_internal/neighbors/refine_helper.cuh>

#include <common/benchmark.hpp>

Expand Down
8 changes: 4 additions & 4 deletions cpp/internal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# the License.
# =============================================================================

if(BUILD_TESTS OR BUILD_PRIMS_BENCH)
add_library(raft_internal INTERFACE)
if(BUILD_TESTS OR BUILD_MICRO_BENCH)
add_library(cuvs_internal INTERFACE)
target_include_directories(
raft_internal INTERFACE "$<BUILD_INTERFACE:${RAFT_SOURCE_DIR}/internal>"
cuvs_internal INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/internal>"
)
target_compile_features(raft_internal INTERFACE cxx_std_17 $<BUILD_INTERFACE:cuda_std_17>)
target_compile_features(cuvs_internal INTERFACE cxx_std_17 $<BUILD_INTERFACE:cuda_std_17>)
endif()
4 changes: 2 additions & 2 deletions cpp/internal/cuvs_internal/neighbors/naive_knn.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

#pragma once

#include <raft/distance/distance_types.hpp>
#include <cuvs/distance/distance_types.hpp>
#include <cuvs/spatial/knn/detail/ann_utils.cuh>
#include <raft/matrix/detail/select_k.cuh>
#include <raft/spatial/knn/detail/ann_utils.cuh>
#include <raft/util/cuda_utils.cuh>

#include <raft/core/resource/cuda_stream.hpp>
Expand Down
2 changes: 1 addition & 1 deletion cpp/internal/cuvs_internal/neighbors/refine_helper.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
#pragma once

#include <cuvs_internal/neighbors/naive_knn.cuh>
#include <raft/core/resource/cuda_stream.hpp>
#include <raft_internal/neighbors/naive_knn.cuh>

#include <raft/core/device_mdarray.hpp>
#include <raft/core/device_mdspan.hpp>
Expand Down
13 changes: 4 additions & 9 deletions cpp/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,12 @@ function(ConfigureTest)
add_executable(${TEST_NAME} ${_CUVS_TEST_PATH})
target_link_libraries(
${TEST_NAME}
PRIVATE raft::raft
GTest::gtest
GTest::gtest_main
Threads::Threads
${CUVS_CTK_MATH_DEPENDENCIES}
$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_CXX>
$<TARGET_NAME_IF_EXISTS:conda_env>
PRIVATE cuvs raft::raft cuvs_internal GTest::gtest GTest::gtest_main Threads::Threads
$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_CXX> $<TARGET_NAME_IF_EXISTS:conda_env>
)
set_target_properties(
${TEST_NAME}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUVS_BINARY_DIR}/gtests>"
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/gtests>"
INSTALL_RPATH "\$ORIGIN/../../../lib"
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
Expand Down Expand Up @@ -242,4 +237,4 @@ endif()
# ##################################################################################################
# Install tests ####################################################################################
# ##################################################################################################
rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing DESTINATION bin/gtests/libraft)
rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing DESTINATION bin/gtests/libcuvs)
2 changes: 1 addition & 1 deletion cpp/test/neighbors/ann_cagra.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "ann_utils.cuh"
#include <raft/core/resource/cuda_stream.hpp>

#include <raft_internal/neighbors/naive_knn.cuh>
#include <cuvs_internal/neighbors/naive_knn.cuh>

#include <raft/core/device_mdspan.hpp>
#include <raft/core/device_resources.hpp>
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/neighbors/ann_ivf_flat.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <raft/util/fast_int_div.cuh>
#include <thrust/functional.h>

#include <raft_internal/neighbors/naive_knn.cuh>
#include <cuvs_internal/neighbors/naive_knn.cuh>

#include <raft/core/device_mdspan.hpp>
#include <raft/core/logger.hpp>
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/neighbors/ann_ivf_pq.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "ann_utils.cuh"
#include <raft/core/resource/cuda_stream.hpp>

#include <raft_internal/neighbors/naive_knn.cuh>
#include <cuvs_internal/neighbors/naive_knn.cuh>

#include <raft/core/logger.hpp>
#include <raft/distance/distance_types.hpp>
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/neighbors/ann_nn_descent.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "../test_utils.cuh"
#include "ann_utils.cuh"

#include <raft_internal/neighbors/naive_knn.cuh>
#include <cuvs_internal/neighbors/naive_knn.cuh>

#include <raft/core/resource/cuda_stream.hpp>
#include <raft/neighbors/nn_descent.cuh>
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/neighbors/ann_utils.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <rmm/device_uvector.hpp>
#include <rmm/mr/device/device_memory_resource.hpp>

#include <raft_internal/neighbors/naive_knn.cuh>
#include <cuvs_internal/neighbors/naive_knn.cuh>

#include "../test_utils.cuh"
#include <gtest/gtest.h>
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/neighbors/refine.cu
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "ann_utils.cuh"
#include <raft/core/resource/cuda_stream.hpp>

#include <raft_internal/neighbors/refine_helper.cuh>
#include <cuvs_internal/neighbors/refine_helper.cuh>

#include <raft/core/logger.hpp>
#include <raft/core/resources.hpp>
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/stats/neighborhood_recall.cu
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <raft/core/resource/cuda_stream.hpp>
#include <raft/core/resources.hpp>

#include <raft_internal/neighbors/naive_knn.cuh>
#include <cuvs_internal/neighbors/naive_knn.cuh>

#include <raft/stats/neighborhood_recall.cuh>
#include <raft/util/itertools.hpp>
Expand Down

0 comments on commit a6d92e1

Please sign in to comment.