cusvna 1.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
cusvna/__init__.py ADDED
@@ -0,0 +1,20 @@
1
+ """
2
+ cusvna, CUDA Self-Validated Numerical Analysis: header-only C++17 library for rigorous affine and
3
+ interval arithmetic in CUDA kernels. The Python package only ships the headers, add get_include()
4
+ to the include paths of nvcc or NVRTC and include <cusvna/aa.cuh>, <cusvna/af1.cuh> or <cusvna/interval.cuh>.
5
+ """
6
+
7
+ import os
8
+
9
+ __version__ = "1.0.1"
10
+
11
+ _package_dir = os.path.dirname(os.path.abspath(__file__))
12
+
13
+
14
+ def get_include():
15
+ """Include directory containing the cusvna/ headers, to pass as -I to nvcc or NVRTC."""
16
+ include_dir = os.path.join(_package_dir, "include")
17
+ if os.path.isdir(os.path.join(include_dir, "cusvna")):
18
+ return include_dir
19
+ # source checkout or editable install: the headers are in the cusvna/ directory of the repository
20
+ return os.path.dirname(os.path.dirname(_package_dir))
cusvna/__main__.py ADDED
@@ -0,0 +1,12 @@
1
+ import argparse
2
+
3
+ import cusvna
4
+
5
+ parser = argparse.ArgumentParser(prog="python -m cusvna", description=cusvna.__doc__.strip().split("\n")[0])
6
+ parser.add_argument("--include", action="store_true", help="print the include directory (for -I)")
7
+ parser.add_argument("--version", action="version", version=cusvna.__version__)
8
+ args = parser.parse_args()
9
+ if args.include:
10
+ print(cusvna.get_include())
11
+ else:
12
+ parser.print_help()