From 82b5f3884c190490062d96713061ed6b29cd88cb Mon Sep 17 00:00:00 2001 From: Jordan Harlow <109105754+jharlow-intel@users.noreply.github.com> Date: Wed, 27 May 2026 08:20:39 -0600 Subject: [PATCH] chore: update README for patch method --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 82acffc..c192a96 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,32 @@ The list of supported by `mkl_random.RandomState` constructor `brng` keywords is --- +# Patching Mechanisms + +`mkl_random` provides a convenient programmatic patch method to enable MKL-accelerated random operations in NumPy. + +## Programmatic Quickstart + +```python +import mkl_random +import numpy + +mkl_random.patch_numpy_random() +print(mkl_random.is_patched()) +# run your accelerated numpy workloads here! +mkl_random.restore_numpy_random() +``` + +```python +import mkl_random +import numpy +with mkl_random.mkl_random(): + # run your accelerated workloads here! + pass +``` + +--- + To build `mkl_random` from sources on Linux: - install a recent version of MKL, if necessary; - execute `source /path_to_oneapi/mkl/latest/env/vars.sh`;