Repository navigation
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: NVIDIA/raft
Length of output: 18277
🏁 Script executed:
Repository: NVIDIA/raft
Length of output: 5447
🌐 Web query:
NVIDIA cuRAND curandSetStream documentation return status generator default stream behavior💡 Result:
The function curandSetStream is used to associate a specific CUDA stream with a cuRAND generator for subsequent kernel launches [1][2]. Return Status The curandSetStream function returns a curandStatus_t value [1][3]. The possible return values are: - CURAND_STATUS_SUCCESS: Indicates the stream was set successfully [1][4]. - CURAND_STATUS_NOT_INITIALIZED: Indicates that the generator was not properly created before calling this function [1][2]. Default Stream Behavior When a cuRAND generator is first created, it does not have a user-specified stream assigned to it. If curandSetStream is not called, or if no stream has been explicitly configured for the generator, all cuRAND kernel launches will execute on the default CUDA stream (also referred to as the null stream) [2]. Additionally, users can explicitly specify the null stream by passing NULL as the stream argument to curandSetStream [1][2]. The behavior of the default stream itself (e.g., whether it operates in legacy mode or per-thread mode) is determined by global CUDA configuration settings, such as compiler flags or preprocessor definitions (e.g., --default-stream or CUDA_API_PER_THREAD_DEFAULT_STREAM) [5]. Once a stream is set using curandSetStream, all library functions will utilize that stream for kernel launches until it is changed again [1][2].
Citations:
Check the
curandSetStreamstatus.Line 228 ignores the
curandStatus_treturned bycurandSetStream. If it fails,curand_generate_uniformXcan use the generator’s default stream instead ofstream, so its writes may not be ordered withalteration_kernel.Check the status with the repository’s RAFT error-handling convention before seeding and generating values.
🤖 Prompt for AI Agents
Sources: Coding guidelines, Path instructions, MCP tools