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

[IMP] move core CUDA RT macros to cuda_rt_essentials.hpp #1584

Merged
merged 2 commits into from
Jun 10, 2023

Conversation

MatthiasKohl
Copy link
Contributor

The reasoning behind this PR is as follows:
for now, anyone wanting to use RAFT_CUDA_TRY_NO_THROW still needs to include cudart_utils.hpp which can be costly (compilation) due to the include of memory_pool.hpp.
By moving the macros to the essentials, we should not break anything for anyone, but allow anyone to improve compilation times by including the essentials only. At the same time, it should add minimal overhead to the compilation time of the essentials file since the pre-processor is (usually) fast compared to the rest of the compilation pipeline.

@MatthiasKohl MatthiasKohl requested a review from a team as a code owner June 9, 2023 08:57
@github-actions github-actions bot added the cpp label Jun 9, 2023
@MatthiasKohl MatthiasKohl added 3 - Ready for Review improvement Improvement / enhancement to an existing function non-breaking Non-breaking change and removed cpp labels Jun 9, 2023
Copy link
Contributor

@ahendriksen ahendriksen 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 to me 👍.

do { \
cudaError_t const status = call; \
if (cudaSuccess != status) { \
printf("CUDA call='%s' at file=%s line=%d failed with %s\n", \
Copy link
Contributor

Choose a reason for hiding this comment

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

One change request related to the header being self-standing. Can you add an include of cstdio to the top of cuda_rt_essentials.hpp?

This should have been done before, but probably escaped review.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually, nothing was directly using cstdio in this file and cstdio was only included transitively through core/error.hpp for things like SET_ERROR_MSG.

So all was actually good before (IMO), and I fixed the include here now since we now use cstdio directly in this file.

Thanks for pointing it out !

@github-actions github-actions bot added the cpp label Jun 9, 2023
@MatthiasKohl
Copy link
Contributor Author

This should be good to be merged

@cjnolet
Copy link
Member

cjnolet commented Jun 10, 2023

/merge

@rapids-bot rapids-bot bot merged commit 5dd7017 into rapidsai:branch-23.08 Jun 10, 2023
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