Skip to content

Add hardware_info to csrc #3

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

Merged
merged 1 commit into from
May 14, 2025
Merged

Add hardware_info to csrc #3

merged 1 commit into from
May 14, 2025

Conversation

LoserCheems
Copy link
Collaborator

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:

  • Added the CHECK_CUDA macro to handle CUDA API error checking with descriptive error messages and program termination on failure.
  • Implemented get_current_device to retrieve the currently active CUDA device.
  • Added get_compute_capability to fetch the compute capability (major and minor version) of a specified CUDA device.
  • Created get_num_sm to obtain the number of streaming multiprocessors (SMs) on a given CUDA device.

@LoserCheems LoserCheems merged commit 781b938 into main May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant