Use Specific CCCL Includes#1806
Merged
rapids-bot[bot] merged 7 commits intorapidsai:mainfrom Feb 18, 2026
Merged
Conversation
dantegd
requested changes
Feb 17, 2026
| } | ||
|
|
||
| // Only keep the kernel if it's not EmptyKernel | ||
| if (!is_empty_kernel) { valid_kernels.push_back(kernels.release()[i]); } |
Member
There was a problem hiding this comment.
Suggested change
| if (!is_empty_kernel) { valid_kernels.push_back(kernels.release()[i]); } | |
| if (!is_empty_kernel) { valid_kernels.push_back(kernels[i]); } |
In the first iteration (e.g. i == 0) this transfers ownership and sets kernels to nullptr. On the next iteration, kernels.release() returns nullptr, and nullptr[i] is undefined behavior. The unique_ptr can keep owning the array until the function returns; you only need to copy the cudaKernel_t handles into valid_kernels, no?
Member
Author
There was a problem hiding this comment.
Good point, probably why the tests are failing.
| AlgorithmLauncher::AlgorithmLauncher(cudaKernel_t k) : kernel{k} {} | ||
| AlgorithmLauncher::AlgorithmLauncher(cudaKernel_t k, cudaLibrary_t lib) : kernel{k}, library{lib} {} | ||
|
|
||
| AlgorithmLauncher::~AlgorithmLauncher() { RAFT_CUDA_TRY(cudaLibraryUnload(library)); } |
Member
There was a problem hiding this comment.
Suggested change
| AlgorithmLauncher::~AlgorithmLauncher() { RAFT_CUDA_TRY(cudaLibraryUnload(library)); } | |
| AlgorithmLauncher::~AlgorithmLauncher() { | |
| if (library != nullptr) { | |
| (void)cudaLibraryUnload(library); // ignore errors in destructor | |
| } | |
| } |
This might be one of those places where I'm rusty about C++ destructors, isn't throwing from destructors during stack unwinding undefined behavior?
Member
Author
There was a problem hiding this comment.
Ugh yeah. I'm surprised the compiler did not complain.
dantegd
approved these changes
Feb 18, 2026
Member
Author
|
/merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is needed downstream because cub injects an EmptyKernel symbol into every TU that includes either cub/cub.cuh or cub/device/* includes, and this causes an issue for cubins created using JIT-LTO.
This PR also fixes 2 bugs in JIT kernels:
cub::EmptyKernelfrom JIT TUs specifically because they only expect 1 kernel but are finding 2 insteadcudaLibrary_tthat loads the JIT kernel and unloading it at destruction