Skip to content

Commit

Permalink
fix(ttmpy): rename MKL FLAG
Browse files Browse the repository at this point in the history
  • Loading branch information
bassoy committed Oct 27, 2024
1 parent b48b8d1 commit 2a144f5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ttmpy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ttmpy/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
7 changes: 5 additions & 2 deletions ttmpy/src/wrapped_ttm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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<T>(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;
Expand Down

0 comments on commit 2a144f5

Please sign in to comment.