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

Complete the deprecation of duplicated hpp headers #793

Merged
merged 2 commits into from
Sep 2, 2022

Conversation

ahendriksen
Copy link
Contributor

Replace all .hpp headers that have a .cuh header in the same directory with the
same name by a simple include of the cuh header and a pragma warning of
deprecation.

This change hopefully prevents future head scratching when changes in a
file are seemingly not picked up by the compiler..

Care has been taken to copy the right start year for the copyright line.
Copyright lines have been updated to 2022 when necessary.

The following template has been used for the .hpp header replacement
text:

/*
 * %%COPYRIGHT_LINE%%
 *
 * [... snip license .. ]
 */
/**
 * This file is deprecated and will be removed in release 22.06.
 * Please use the cuh version instead.
 */

/**
 * DISCLAIMER: this file is deprecated: use %%CUH_FILE%% instead
 */
#pragma once

#pragma message(__FILE__                                                               \
                " is deprecated and will be removed in a future release." \
                " Please use the cuh version instead.")

@ahendriksen ahendriksen requested a review from a team as a code owner August 25, 2022 12:29
@github-actions github-actions bot added the cpp label Aug 25, 2022
@ahendriksen
Copy link
Contributor Author

This is a follow up to #524

I am note sure that I understood the rationale for duplicating some files and not duplicating others. In any case, I think it would be wise to make sure that there is only one header that contains the actual code. The risk of the .cuh and .hpp headers diverging is quite real. I for one did not know we had full code duplication in some (i.e. 83) headers.

@cjnolet
Copy link
Member

cjnolet commented Aug 25, 2022

@ahendriksen this is definitely a welcome change. Thank you for doing this!

When the original headers were duplicated, we weren't expecting for them to stick around as long as they have. @lowener has graciously started reconciling the raft includes in cuml and related libs so that we can remove the additional headers as a next step.

@achirkin
Copy link
Contributor

NB: cpp/include/raft/spatial/knn/detail/processing.hpp is one exception where we currently need both .hpp and .cuh files. There may be more, but I'm not aware of others.

@ahendriksen
Copy link
Contributor Author

@achirkin : I will roll back the removal of processing.hpp. It looks like this file is only included from ann_common.h (which is deprecated), and processing.cuh. Is it part of the external interface of RAFT? In that case, should it be moved out of the detail directory?

Replace #include <path.hpp> with #include <path.cuh> if possible. This
should reduce the number of deprecation warnings.
Replace all .hpp headers that have a .cuh header in the same directory with the
same name by a simple include of the cuh header and a pragma warning of
deprecation.

This change hopefully prevents future head scratching when changes in a
file are seemingly not picked up by the compiler..

Care has been taken to copy the right start year for the copyright line.
Copyright lines have been updated to 2022 when necessary.

The following template has been used for the .hpp header replacement
text:

------------------------------------------------------------
 * %%COPYRIGHT_LINE%%
 *
 * [... snip license .. ]
 */
/**
 * This file is deprecated and will be removed in release 22.06.
 * Please use the cuh version instead.
 */

/**
 * DISCLAIMER: this file is deprecated: use %%CUH_FILE%% instead
 */

                " is deprecated and will be removed in a future release." \
                " Please use the cuh version instead.")

------------------------------------------------------------
@achirkin
Copy link
Contributor

No, it's not really a part of the external interface, but it's a member of a struct which is currently public but should be deprecated and removed at some point (https://github.com/rapidsai/raft/blob/branch-22.10/cpp/include/raft/spatial/knn/ann_common.h#L40)

@ahendriksen
Copy link
Contributor Author

I found the following files to have non-trivial diffs:

include/raft/linalg/transpose.hpp   (mdspan based transpose only in .cuh header)
raft_linalg_add.hpp                 (more doxygen comments in .cuh header)
spatial/knn/detail/processing.hpp   (as mentioned in discussion above)

Repushing.

@ahendriksen ahendriksen added 3 - Ready for Review improvement Improvement / enhancement to an existing function labels Aug 30, 2022
@ahendriksen
Copy link
Contributor Author

@cjnolet Tamas and Artem have taken a look and I have taken their feedback into account. There are three files where this PR is non-trivial:

include/raft/linalg/transpose.hpp   (mdspan based transpose only in .cuh header)
raft_linalg_add.hpp                 (more doxygen comments in .cuh header)
spatial/knn/detail/processing.hpp   (as mentioned in discussion above)

Could you have a look? (no rush, just an update)

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 great. Thanks Allard!

@cjnolet
Copy link
Member

cjnolet commented Sep 2, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit ff133d4 into rapidsai:branch-22.10 Sep 2, 2022
@ahendriksen ahendriksen deleted the deprecate-hpp branch March 17, 2023 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review cpp improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants