MCPcopy Create free account
hub / github.com/NVIDIA/SOL-ExecBench / _gpu_sm_version

Function _gpu_sm_version

tests/conftest.py:22–32  ·  view source on GitHub ↗

Return the SM version of the current GPU (e.g. 90, 100), or 0 if unavailable.

()

Source from the content-addressed store, hash-verified

20
21
22def _gpu_sm_version() -> int:
23 """Return the SM version of the current GPU (e.g. 90, 100), or 0 if unavailable."""
24 try:
25 import torch
26
27 if not torch.cuda.is_available():
28 return 0
29 major, minor = torch.cuda.get_device_capability()
30 return major * 10 + minor
31 except ImportError:
32 return 0
33
34
35requires_sm100 = pytest.mark.skipif(

Callers 2

conftest.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected