Add examples/cpu_only.py based on code from PR feedback

https://github.com/NVIDIA/nvbench/pull/237#issuecomment-3058594793
This commit is contained in:
Oleksandr Pavlyk
2025-07-21 10:59:37 -05:00
parent 6b4da8c5cb
commit c960ef75cc

View File

@@ -0,0 +1,18 @@
import sys
import time
import cuda.nvbench as nvbench
def throughput_bench(state: nvbench.State) -> None:
def launcher(launch: nvbench.Launch):
time.sleep(1)
state.exec(launcher)
if __name__ == "__main__":
b = nvbench.register(throughput_bench)
b.setIsCPUOnly(True)
nvbench.run_all_benchmarks(sys.argv)