Skip to content

Commit ec84e25

Browse files
Use cuda-pathfinder instead of cuda-bindings for Pathfinder
Removed use of __all__ per PR feedback. Emit warnings.warn if version information could not be retrieved from the package metadata, e.g., package has been renamed by source code was not updated.
1 parent b19cde3 commit ec84e25

File tree

2 files changed

+28
-19
lines changed

2 files changed

+28
-19
lines changed

python/cuda/nvbench/__init__.py

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,40 @@
11
import importlib.metadata
2+
import warnings
23

3-
from cuda.bindings.path_finder import ( # type: ignore[import-not-found]
4-
_load_nvidia_dynamic_library,
4+
from cuda.pathfinder import ( # type: ignore[import-not-found]
5+
load_nvidia_dynamic_lib,
56
)
67

78
try:
89
__version__ = importlib.metadata.version("pynvbench")
9-
except Exception:
10+
except Exception as e:
1011
__version__ = "0.0.0dev"
12+
warnings.warn(
13+
"Could not retrieve version of pynvbench package dynamically from its metadata. "
14+
f"Exception {e} was raised. "
15+
f"Version is set to fall-back value '{__version__}' instead."
16+
)
1117

1218
for libname in ("cupti", "nvperf_target", "nvperf_host"):
13-
_load_nvidia_dynamic_library(libname)
19+
load_nvidia_dynamic_lib(libname)
1420

1521
from ._nvbench import ( # noqa: E402
16-
Benchmark,
17-
CudaStream,
18-
Launch,
19-
State,
20-
register,
21-
run_all_benchmarks,
22+
Benchmark as Benchmark,
23+
)
24+
from ._nvbench import ( # noqa: E402
25+
CudaStream as CudaStream,
26+
)
27+
from ._nvbench import ( # noqa: E402
28+
Launch as Launch,
29+
)
30+
from ._nvbench import ( # noqa: E402
31+
State as State,
32+
)
33+
from ._nvbench import ( # noqa: E402
34+
register as register,
35+
)
36+
from ._nvbench import ( # noqa: E402
37+
run_all_benchmarks as run_all_benchmarks,
2238
)
2339

24-
__all__ = [
25-
"register",
26-
"run_all_benchmarks",
27-
"CudaStream",
28-
"Launch",
29-
"State",
30-
"Benchmark",
31-
]
40+
del load_nvidia_dynamic_lib

python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ classifiers = [
1414
requires-python = ">=3.9"
1515
dependencies = [
1616
# pathfinder
17-
"cuda-bindings",
17+
"cuda-pathfinder",
1818

1919
# Library expects to find shared libraries
2020
# libcupti, libnvperf_target, libnvperf_host

0 commit comments

Comments
 (0)