Skip to content

Commit d811139

Browse files
chore: update README for patch method
1 parent a99ded1 commit d811139

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,31 @@ Where `<numpy_version>` should be the latest version from https://software.repos
3434

3535
---
3636

37+
# Patching Mechanisms
38+
39+
`mkl_umath` provides a convenient programmatic patch method to enable MKL-accelerated umath operations in NumPy.
40+
41+
## Programmatic Quickstart
42+
43+
```python
44+
import mkl_umath
45+
import numpy
46+
47+
mkl_umath.patch_numpy_umath()
48+
print(mkl_umath.is_patched())
49+
# run your accelerated numpy workloads here!
50+
mkl_umath.restore_numpy_umath()
51+
```
52+
53+
```python
54+
import mkl_umath
55+
import numpy
56+
with mkl_umath.mkl_umath():
57+
# run your accelerated workloads here!
58+
pass
59+
```
60+
---
61+
3762
## Building
3863

3964
Intel(R) C compiler and Intel(R) OneAPI Math Kernel Library (OneMKL) are required to build `mkl_umath` from source.

0 commit comments

Comments
 (0)