Skip to content

feat: expose CUDA device attributes - #255

Open
honeyspoon wants to merge 2 commits into
NVlabs:mainfrom
honeyspoon:feat/device-attributes
Open

feat: expose CUDA device attributes#255
honeyspoon wants to merge 2 commits into
NVlabs:mainfrom
honeyspoon:feat/device-attributes

Conversation

@honeyspoon

Copy link
Copy Markdown

Why

Device exposes its L2 size, but querying related occupancy, bandwidth, and persisting-cache limits requires direct calls through cuda_core::sys.

What changed

  • Add a non-exhaustive DeviceAttribute enum.
  • Add safe Device::attribute access to integer-valued CUDA device properties.
  • Cover compute capability, clocks, memory bus and cache limits, and per-SM occupancy resources.
  • Route l2_cache_size_bytes through the shared query path.
  • Add a GPU-gated test that queries every exposed attribute and checks the existing L2 helper against the generic result.

This extends the existing Device API only; it does not add context, stream, module, or launch abstractions.

Validation

  • cargo fmt --all -- --check
  • cargo check -p cuda-core --all-targets
  • cargo test -p cuda-core --test device_attributes --no-run
  • cargo test -p cuda-core --doc
  • full workspace Clippy, compile-only, and CPU suites passed before splitting the independent changes

Signed-off-by: abder <bobmatt911@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

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.

2 participants