Skip to content

Commit 4d406d6

Browse files
feat(examples): add query_props example to print runtime device props (sm_52)
Provides a simple way to assert Tesla M40 (sm_52) selection at runtime via CudaContext::current_device_props(). Refs: #16 Co-authored-by: openhands <openhands@all-hands.dev>
1 parent 7256dc4 commit 4d406d6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

examples/query_props.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
fn main() {
2+
let ctx = m40_llm::cuda::CudaContext::new(-1).unwrap();
3+
let p = ctx.current_device_props().unwrap();
4+
println!(
5+
"name={} major={} minor={} device_id={}",
6+
p.name, p.major, p.minor, p.device_id
7+
);
8+
}

0 commit comments

Comments
 (0)