Skip to content

Commit 0cbdc06

Browse files
author
Vahid Tavanashad
committed
change to dynamic linking and add interface and threading layers
1 parent 77ef1a5 commit 0cbdc06

File tree

6 files changed

+17
-3
lines changed

6 files changed

+17
-3
lines changed

.github/workflows/build_pip.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242

4343
- name: Install Compiler and MKL
4444
run: |
45-
conda install mkl-devel mkl-service dpcpp_linux-64
45+
conda install mkl-devel - tbb-devel mkl-service dpcpp_linux-64
4646
python -c "import sys; print(sys.executable)"
4747
which python
4848
python -c "import mkl; print(mkl.__file__)"

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ cmake_print_variables(Python_NumPy_INCLUDE_DIRS)
2323
set(CYTHON_FLAGS "-t -w \"${CMAKE_SOURCE_DIR}\"")
2424
find_package(Cython REQUIRED)
2525

26-
set(MKL_LINK sdl)
26+
find_package(TBB REQUIRED)
27+
set(MKL_ARCH "intel64")
28+
set(MKL_INTERFACE ilp64)
29+
set(MKL_THREADING tbb_thread)
30+
set(MKL_LINK dynamic)
2731
find_package(MKL REQUIRED)
2832

2933
if(WIN32)

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ If these are installed as part of a `oneAPI` installation, the following package
4747

4848
If build dependencies are to be installed with Conda, the following packages must be installed from the Intel(R) channel
4949
- `mkl-devel`
50+
- `tbb-devel`
5051
- `dpcpp_linux-64` (or `dpcpp_win-64` for Windows)
5152
- `numpy-base`
5253

@@ -56,7 +57,7 @@ then the remaining dependencies
5657
- `cython`
5758
- `scikit-build`
5859

59-
and for `mkl-devel` and `dpcpp_linux-64` in a Conda environment, `MKLROOT` environment variable must be set
60+
and for `mkl-devel`, `tbb-devel` and `dpcpp_linux-64` in a Conda environment, `MKLROOT` environment variable must be set
6061
On Linux
6162
```sh
6263
export MKLROOT=$CONDA_PREFIX

conda-recipe-cf/meta.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ requirements:
2828
- scikit-build
2929
- python
3030
- mkl-devel
31+
- tbb-devel
3132
- numpy
3233
run:
3334
- python

conda-recipe/meta.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ requirements:
2828
- scikit-build
2929
- python
3030
- mkl-devel
31+
- tbb-devel
3132
- numpy-base
3233
run:
3334
- python

mkl_umath/tests/test_basic.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,10 @@ def test_umath(case):
8585
def test_cases_count():
8686
print("Test cases count:", len(test_cases))
8787
assert len(test_cases) > 0, "No test cases found"
88+
89+
def test_large():
90+
n = 2**31
91+
data = np.ones(n)
92+
mkl_res = mu.absolute(data)
93+
assert np.allclose(mkl_res, 1.0)
94+

0 commit comments

Comments
 (0)