mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-04-19 22:38:52 +00:00
Build multi architecture cuda wheels (#302)
* Add cuda architectures to build wheel for * Package scripts in wheel * Separate cuda major version extraction to fix architecutre selection logic * Add back statement printing cuda version * [pre-commit.ci] auto code formatting --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
3
python/scripts/nvbench_json/__init__.py
Normal file
3
python/scripts/nvbench_json/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from . import reader, version
|
||||
|
||||
__all__ = ["reader", "version"]
|
||||
10
python/scripts/nvbench_json/reader.py
Normal file
10
python/scripts/nvbench_json/reader.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import json
|
||||
|
||||
from . import version
|
||||
|
||||
|
||||
def read_file(filename):
|
||||
with open(filename, "r") as f:
|
||||
file_root = json.load(f)
|
||||
version.check_file_version(filename, file_root)
|
||||
return file_root
|
||||
32
python/scripts/nvbench_json/version.py
Normal file
32
python/scripts/nvbench_json/version.py
Normal file
@@ -0,0 +1,32 @@
|
||||
file_version = (1, 0, 0)
|
||||
|
||||
file_version_string = "{}.{}.{}".format(
|
||||
file_version[0], file_version[1], file_version[2]
|
||||
)
|
||||
|
||||
|
||||
def check_file_version(filename, root_node):
|
||||
try:
|
||||
version_node = root_node["meta"]["version"]["json"]
|
||||
except KeyError:
|
||||
print("WARNING:")
|
||||
print(" {} is written in an older, unversioned format. ".format(filename))
|
||||
print(" It may not read correctly.")
|
||||
print(" Reader expects JSON file version {}.".format(file_version_string))
|
||||
return
|
||||
|
||||
# TODO We could do something fancy here using semantic versioning, but
|
||||
# for now just warn on mismatch.
|
||||
if version_node["string"] != file_version_string:
|
||||
print("WARNING:")
|
||||
print(
|
||||
" {} was written using a different NVBench JSON file version.".format(
|
||||
filename
|
||||
)
|
||||
)
|
||||
print(" It may not read correctly.")
|
||||
print(
|
||||
" (file version: {} reader version: {})".format(
|
||||
version_node["string"], file_version_string
|
||||
)
|
||||
)
|
||||
Reference in New Issue
Block a user