From 15ca081b39d0107ee86636dd5496b2031f233dee Mon Sep 17 00:00:00 2001
From: Stuart Archibald <redacted>
Date: Fri, 22 Feb 2019 10:47:03 +0000
Subject: [PATCH 11/15] intel mkl_random

---
 numpy/random_intel/__init__.py |  7 +++++++
 numpy/random_intel/setup.py    | 10 ++++++++++
 numpy/setup.py                 |  1 +
 numpy/tests/test_warnings.py   |  2 ++
 4 files changed, 20 insertions(+)
 create mode 100644 numpy/random_intel/__init__.py
 create mode 100644 numpy/random_intel/setup.py

diff --git a/numpy/random_intel/__init__.py b/numpy/random_intel/__init__.py
new file mode 100644
index 0000000..9c105de
--- /dev/null
+++ b/numpy/random_intel/__init__.py
@@ -0,0 +1,7 @@
+import warnings
+try:
+    with warnings.catch_warnings():
+        warnings.filterwarnings("ignore", message="numpy.ndarray size changed")
+        from mkl_random import *
+except ImportError as e:
+    warnings.warn("mkl_random not found. Install it with 'conda instal -c intel mkl_random', or get it from 'http://github.com/IntelPython/mkl_random'", stacklevel=2)
diff --git a/numpy/random_intel/setup.py b/numpy/random_intel/setup.py
new file mode 100644
index 0000000..6d4fecf
--- /dev/null
+++ b/numpy/random_intel/setup.py
@@ -0,0 +1,10 @@
+from __future__ import division, print_function
+
+def configuration(parent_package='',top_path=None):
+    from numpy.distutils.misc_util import Configuration
+    config = Configuration('random_intel', parent_package, top_path)
+    return config
+
+if __name__ == '__main__':
+    from numpy.distutils.core import setup
+    setup(configuration=configuration)
diff --git a/numpy/setup.py b/numpy/setup.py
index 3d06cf6..0098b56 100644
--- a/numpy/setup.py
+++ b/numpy/setup.py
@@ -29,6 +29,7 @@ def configuration(parent_package='',top_path=None):
     config.add_subpackage('matrixlib')
     config.add_subpackage('polynomial')
     config.add_subpackage('random')
+    config.add_subpackage('random_intel')
     config.add_subpackage('testing')
     config.add_data_dir('doc')
     config.add_data_dir('tests')
diff --git a/numpy/tests/test_warnings.py b/numpy/tests/test_warnings.py
index aa6f69f..8b062ad 100644
--- a/numpy/tests/test_warnings.py
+++ b/numpy/tests/test_warnings.py
@@ -71,6 +71,8 @@ if sys.version_info >= (3, 4):
                 continue
             if path == base / "random" / "__init__.py":
                 continue
+            if path == base / "random_intel" / "__init__.py":
+                continue
             # use tokenize to auto-detect encoding on systems where no
             # default encoding is defined (e.g. LANG='C')
             with tokenize.open(str(path)) as file:
-- 
2.20.1

