diff --git a/ttmpy/README.md b/ttmpy/README.md index acd8056..f2e68ee 100644 --- a/ttmpy/README.md +++ b/ttmpy/README.md @@ -8,7 +8,7 @@ cd ttm Install OpenBLAS and MLK ```bash -sudo apt install libopenblas-dev libopenblas64-pthread-dev libomp-dev python3-pip python3-virtualenv +sudo apt install libmkl-dev intel-mkl libopenblas-dev libopenblas64-pthread-dev libomp-dev python3-pip python3-virtualenv ``` Navigate to the python wrapper folder diff --git a/ttmpy/setup.py b/ttmpy/setup.py index 192708c..a421d57 100644 --- a/ttmpy/setup.py +++ b/ttmpy/setup.py @@ -25,7 +25,7 @@ def build_extensions(self): #extra_link_args=['-fopenmp'] #IntelMKL -compile_args = ['-std=c++17','-O3','-fopenmp','-fPIC','-DUSE_MKLBLAS', '-DMKL_ILP64', '-m64'] +compile_args = ['-std=c++17','-O3','-fopenmp','-fPIC','-DUSE_MKL', '-DMKL_ILP64', '-m64'] include_dirs = ['../include','../../include','pybind11/include','/usr/include/mkl'] libraries=['m','dl','iomp5'] extra_link_args=['-Wl,--start-group','/usr/lib/x86_64-linux-gnu/libmkl_intel_ilp64.a','/usr/lib/x86_64-linux-gnu/libmkl_intel_thread.a','/usr/lib/x86_64-linux-gnu/libmkl_core.a','-Wl,--end-group','-fopenmp'] diff --git a/ttmpy/src/wrapped_ttm.cpp b/ttmpy/src/wrapped_ttm.cpp index 58a35bb..c11611d 100644 --- a/ttmpy/src/wrapped_ttm.cpp +++ b/ttmpy/src/wrapped_ttm.cpp @@ -13,6 +13,9 @@ // g++ -Wall -shared -std=c++17 wrapped_ttv.cpp -o ttvpy.so $(python3 -m pybind11 --includes) -I../include -fPIC -fopenmp -DUSE_OPENBLAS -lm -lopenblas +#if ! defined(USE_OPENBLAS) && ! defined(USE_MKL) && ! defined(USE_BLIS) +static_assert(0,"Static assert in ttmpy/ttm: missing specification of define USE_OPENBLAS or USE_MKL or USE_BLIS"); +#endif namespace py = pybind11; @@ -65,14 +68,14 @@ ttm(std::size_t const contraction_mode, // auto nnc = std::size_t(cinfo.size); -#if defined(USE_OPENBLAS) || defined(USE_MKLBLAS) +#if defined(USE_OPENBLAS) || defined(USE_MKL) tlib::ttm(tlib::parallel_policy::omp_forloop_t{}, tlib::slicing_policy::subtensor_t{}, tlib::fusion_policy::outer_t{}, q, p, aptr, na.data(), wa.data(), pia.data(), bptr, nb.data(), pib.data(), cptr, nc.data(), wc.data()); #else - static_assert(0,"Static assert in ttmpy/ttm: missing specification of define USE_OPENBLAS or USE_MKL"); + #endif return c;