Skip to content

feat(nvidia): add DeviceGetAttribute to runtime - #45

Merged
voltjia merged 1 commit into
InfiniTensor:masterfrom
fuyou4546:feat/add-device-get-attribute
Aug 11, 2026
Merged

feat(nvidia): add DeviceGetAttribute to runtime#45
voltjia merged 1 commit into
InfiniTensor:masterfrom
fuyou4546:feat/add-device-get-attribute

Conversation

@fuyou4546

Copy link
Copy Markdown
Contributor

Summary

  • Add DeviceGetAttribute to the NVIDIA Runtime specialization in src/native/cuda/nvidia/runtime_.h
  • Add device property constants: kDevAttrWarpSize, kDevAttrComputeCapabilityMajor, kDevAttrComputeCapabilityMinor, kDevAttrMaxSharedMemoryPerBlockOptin

Motivation

Enables callers to query device attributes (warp size, compute capability, max shared memory) through Runtime<Device::Type::kNvidia>::DeviceGetAttribute.

Type of Change

  • feat - new feature / new backend capability / new public API
  • fix - bug fix
  • perf - performance improvement without behavior change
  • refactor - code restructuring without behavior change
  • test - adding or fixing tests only
  • docs - documentation only
  • build / ci - build system or CI configuration
  • chore - tooling, formatting, or other non-code changes
  • Breaking change (requires a ! in the Conventional Commits prefix or a BREAKING CHANGE: footer)

Platforms Affected

  • CPU (WITH_CPU)
  • NVIDIA (WITH_NVIDIA)
  • Iluvatar (WITH_ILUVATAR)
  • Hygon (WITH_HYGON)
  • MetaX (WITH_METAX)
  • Moore (WITH_MOORE)
  • Cambricon (WITH_CAMBRICON)
  • Ascend (WITH_ASCEND)
  • Build system / CMake / generated headers
  • Public headers / installed consumer API
  • Documentation only

Smoke Build and Test Result

cmake -S . -B build -DWITH_NVIDIA=ON -DINFINI_RT_BUILD_TESTING=ON
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zhangshuo/projects/InfiniTensor/InfiniRT/build

cmake --build build -j
Consolidate compiler generated dependencies of target infinirt
···
[100%] Built target test_tensor_view_allocations

ctest --test-dir build --output-on-failure
···
100% tests passed, 0 tests failed out of 12
Total Test time (real) =  12.96 sec

Test Results on Supported Platforms

Platform Affected Build / Smoke Result Full Result / Notes
CPU
NVIDIA
Iluvatar
Hygon
MetaX
Moore
Cambricon
Ascend
Full `ctest` output (optional)
Test project /home/zhangshuo/projects/InfiniTensor/InfiniRT/build
      Start  1: test_smoke
 1/12 Test  #1: test_smoke .......................   Passed    0.00 sec
      Start  2: test_core
 2/12 Test  #2: test_core ........................   Passed    0.00 sec
      Start  3: test_small_vector
 3/12 Test  #3: test_small_vector ................   Passed    0.00 sec
      Start  4: test_metadata_view
 4/12 Test  #4: test_metadata_view ...............   Passed    0.00 sec
      Start  5: test_shape_strides_storage
 5/12 Test  #5: test_shape_strides_storage .......   Passed    0.00 sec
      Start  6: test_tensor_view_allocations
 6/12 Test  #6: test_tensor_view_allocations .....   Passed    0.00 sec
      Start  7: test_cpu_runtime
 7/12 Test  #7: test_cpu_runtime .................   Passed    0.00 sec
      Start  8: test_nvidia_runtime
 8/12 Test  #8: test_nvidia_runtime ..............   Passed    3.05 sec
      Start  9: test_nvidia_graph
 9/12 Test  #9: test_nvidia_graph ................   Passed    2.82 sec
      Start 10: test_runtime_dispatch
10/12 Test #10: test_runtime_dispatch ............   Passed    2.89 sec
      Start 11: test_install
11/12 Test #11: test_install .....................   Passed    0.02 sec
      Start 12: test_install_consumer
12/12 Test #12: test_install_consumer ............   Passed    4.25 sec

100% tests passed, 0 tests failed out of 12

Total Test time (real) =  13.06 sec

Benchmark / Performance Impact

N/A

Notes for Reviewers

@voltjia voltjia changed the title feat(nvidia): add DeviceGetAttribute to runtime feat(nvidia): add DeviceGetAttribute to runtime Aug 11, 2026
@voltjia
voltjia merged commit 0cdbb16 into InfiniTensor:master Aug 11, 2026
4 checks passed
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