Add hardware_info to csrc #3
Merged
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 pull request introduces a new header file,
csrc/src/hardware_info.h
, that provides utility functions for querying CUDA hardware information. The changes include the addition of macros and inline functions to streamline CUDA device queries.Key changes:
New utility functions for CUDA hardware queries:
CHECK_CUDA
macro to handle CUDA API error checking with descriptive error messages and program termination on failure.get_current_device
to retrieve the currently active CUDA device.get_compute_capability
to fetch the compute capability (major and minor version) of a specified CUDA device.get_num_sm
to obtain the number of streaming multiprocessors (SMs) on a given CUDA device.