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

[FEA] Use CAGRA in C++ template #1730

Merged
merged 5 commits into from
Aug 15, 2023

Conversation

lowener
Copy link
Contributor

@lowener lowener commented Aug 9, 2023

Proposal to change the C++ template from a distance computation to a vector search application using CAGRA.

@cjnolet cjnolet added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Aug 10, 2023
Copy link
Member

@cjnolet cjnolet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good- just one question about dependencies.

@@ -28,11 +28,13 @@ rapids_cuda_init_architectures(test_raft)

project(test_raft LANGUAGES CXX CUDA)

find_package(OpenMP)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we adding openmp to the dependencies here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CAGRA is using openmp and the link from raft::compiled to openmp is not automatic.
I've found that openmp needs to be found in the dependencies of the consumer`s project for the link to happend:

raft/cpp/CMakeLists.txt

Lines 445 to 451 in b7d2a9a

target_link_libraries(
raft_lib
PUBLIC raft::raft
${RAFT_CTK_MATH_DEPENDENCIES} # TODO: Once `raft::resources` is used everywhere, this
# will just be cublas
$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_CXX>
)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robertmaynard do you have any ideas of why this might be happening? Are we missing something in the raft_lib side?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no exporting of the need for OpenMP to consuming projects. https://github.com/rapidsai/raft/blob/branch-23.10/cpp/CMakeLists.txt#L130 would need to change to rapids_find_package with the proper export sets to remove the need for consumers to explicitly find OpenMP

Copy link
Member

@cjnolet cjnolet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cjnolet
Copy link
Member

cjnolet commented Aug 14, 2023

/merge

@rapids-bot rapids-bot bot merged commit 2c85c0b into rapidsai:branch-23.10 Aug 15, 2023
@lowener lowener deleted the 23.10-cmake-cagra branch August 21, 2023 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake cpp improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
Development

Successfully merging this pull request may close these issues.

3 participants