You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cuda_bindings/README.md
+33-37Lines changed: 33 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -31,57 +31,41 @@ Source builds work for multiple Python versions, however pre-build PyPI and Cond
31
31
32
32
* Python 3.9 to 3.12
33
33
34
-
## Testing (Cython)
35
-
36
-
Cython tests are located under `tests/cython`.
34
+
## Testing
37
35
38
36
Latest dependencies can be found in [requirements.txt](https://github.com/NVIDIA/cuda-python/blob/main/cuda_bindings/requirements.txt).
39
37
40
-
## Testing (Python)
38
+
Multiple testing options are available:
41
39
42
-
Latest dependencies can be found in [requirements.txt](https://github.com/NVIDIA/cuda-python/blob/main/cuda_bindings/requirements.txt).
40
+
* Cython Unit Tests
41
+
* Python Unit Tests
42
+
* Samples
43
+
* Benchmark
43
44
44
-
### Unit-tests
45
+
### Python Unit Tests
45
46
46
-
To run unit-tests against local builds:
47
-
```
48
-
python -m pytest tests/
49
-
```
50
-
To run unit-tests against installed builds:
51
-
```
52
-
pytest tests/
53
-
```
47
+
Responsible for validating different binding usage patterns. Unit test `test_kernelParams.py` is particularly special since it demonstrates various approaches in setting up kernel launch parameters.
54
48
55
-
### Unit-tests
49
+
To run these tests:
50
+
*`python -m pytest tests/` against local builds
51
+
*`pytest tests/` against installed package
56
52
53
+
### Cython Unit Tests
57
54
58
-
### Benchmark
55
+
Cython tests are located under `tests/cython` and need to be built. Furthermore they need CUDA Toolkit headers matching the major-minor of CUDA Python. To build them:
59
56
60
-
To run unit-tests against local builds:
61
-
```
62
-
python -m pytest --benchmark-only benchmark/
63
-
```
64
-
To run unit-tests against installed builds:
65
-
```
66
-
pytest --benchmark-only benchmark/
67
-
```
57
+
1. Setup environment variable `CUDA_HOME` with the path to the CUDA Toolkit installation.
58
+
2. Run `build_tests` script located in `test/cython` appropriate to your platform. This will both Cythonize the tests and build them.
68
59
69
-
### Samples
60
+
To run these tests:
61
+
*`python -m pytest tests/cython/` against local builds
62
+
*`pytest tests/cython/` against installed package
70
63
71
-
To run unit-tests against local builds:
72
-
```
73
-
python -m pytest benchmark/
74
-
```
75
-
To run unit-tests against installed builds:
76
-
```
77
-
pytest benchmark/
78
-
```
79
-
80
-
## Examples
64
+
### Samples
81
65
82
-
[CUDA Samples](https://github.com/NVIDIA/cuda-samples/tree/master)rewriten using CUDA Python are found in `examples`.
66
+
Various [CUDA Samples](https://github.com/NVIDIA/cuda-samples/tree/master)that were rewritten using CUDA Python can be found in `examples`.
83
67
84
-
Custom extra included examples:
68
+
In addition, extra examples are included:
85
69
86
70
*`examples/extra/jit_program_test.py`: Demonstrates the use of the API to compile and
87
71
launch a kernel on the device. Includes device memory allocation /
@@ -90,3 +74,15 @@ Custom extra included examples:
90
74
*`examples/extra/numba_emm_plugin.py`: Implements a Numba External Memory Management
91
75
plugin, showing that this CUDA Python Driver API can coexist with other
92
76
wrappers of the driver API.
77
+
78
+
To run these samples:
79
+
*`python -m pytest tests/cython/` against local builds
80
+
*`pytest tests/cython/` against installed package
81
+
82
+
### Benchmark (WIP)
83
+
84
+
Benchmarks were used for performance analysis during initial release of CUDA Python. Today they need to be updated the 12.x toolkit and are work in progress.
85
+
86
+
The intended way to run these benchmarks was:
87
+
*`python -m pytest --benchmark-only benchmark/` against local builds
88
+
*`pytest --benchmark-only benchmark/` against installed package
0 commit comments