Commit Graph

63 Commits

Author SHA1 Message Date
Oleksandr Pavlyk
4f15840832 Use state.add_summary to supplement integral TypeID with meaningful type name 2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
9dba866426 Add State.add_summary method
state.add_summary(column_name: str, value: Union[int, float, str])

This is used in examples/axes.py to map integral value from Int64Axis
to string description.
2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
df426a0bad Add examples/axes.py 2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
576c473481 Add implementation of and signature for State.getDevice
make batch/sync arguments of State.exec keyword-only

Provide default column_name value for State.addElementCount method,
so that it can be called state.addElementCount(count), or as
state.addElementCount(count, column_name="Descriptive Name")
2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
2507bc2263 Add Python example based on C++ example/auto_throughput.cpp 2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
4950a50961 Add empty py.typed to signal mypy that package has type annotations 2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
c9f0785aed Replace uses of deprecated typing.Tuple, typing.Callable, etc.
Also use typing.Self to encode that `Benchmark.addInt64Axis` returns
self.
2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
6f8bcdc774 Fixed correctness of nvbench.State.getStream() method
Fix run-time exception:

```
Fail: Unexpected error: RuntimeError: return_value_policy = copy, but type is non-copyable! (#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)
```

caused by attempt to returning move-only `nvbench::cuda_stream` class
instance using default `pybind11::return_value_policy::copy`.
2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
e768ce28b6 Add Python stub file for cuda.nvbench API 2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
c49d718f65 Corrected nvbench.State.getBlockingKernel -> getBlockingKernelTimeout
Similar change for setBlockingKernelTimeout.

Corrected statement in a comment.
2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
c184549cda Import and reexport symbols from _nvbench one-by-one 2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
b88cc78aeb Add license header to py_nvbench.cpp
Also updated comment as to why calling
`nvbench::benchmark_manager::get().initialize()` is necessary
for running all tests.
2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
6552ef503c Draft of Python API for NVBench
The prototype is based on pybind11 to minimize boiler-plate
code needed to deal with move-only semantics of many nvbench
classes.
2025-07-28 15:37:04 -05:00