Add State.get_axis_values and State.get_axis_values_as_string

Add nvbench.State methods to get Python dictionary representing
axis values of benchmark configuration state represents.

get_axis_values_as_string gives a string of space-separated
name=values pairs.
This commit is contained in:
Oleksandr Pavlyk
2025-07-25 16:39:01 -05:00
parent 5613281c2e
commit eb614ac52f
2 changed files with 28 additions and 0 deletions

View File

@@ -238,6 +238,12 @@ class State:
def add_summary(self, column_name: str, value: Union[int, float, str]) -> None:
"Add summary column with a value"
...
def get_axis_values(self) -> dict[str, int | float | str]:
"Get dictionary with axis values for this configuration"
...
def get_axis_values_as_string(self) -> str:
"Get string of space-separated name=value pairs for this configuration"
...
def register(fn: Callable[[State], None]) -> Benchmark:
"""