Skip to content

Commit

Permalink
build with MKL_SEQUENTIAL
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jan 26, 2024
1 parent 48b7e85 commit 51a34c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
sudo apt install ninja-build
- name: Configure tests
run: cmake ${{ github.workspace }}/dlib/test -B build -GNinja -DDLIB_USE_CUDA=OFF
run: cmake ${{ github.workspace }}/dlib/test -B build -GNinja -DDLIB_USE_CUDA=OFF -DDLIB_USE_MKL_SEQUENTIAL=ON

- name: Build tests
run: cmake --build build --config Release --target dtest
Expand All @@ -53,7 +53,7 @@ jobs:
run: build/dtest --runall -q

- name: Configure examples
run: cmake ${{ github.workspace }}/examples -B buildExamples -GNinja -DDLIB_USE_CUDA=OFF
run: cmake ${{ github.workspace }}/examples -B buildExamples -GNinja -DDLIB_USE_CUDA=OFF -DDLIB_USE_MKL_SEQUENTIAL=ON

- name: Build examples
run: cmake --build buildExamples --config Release
Expand Down
16 changes: 8 additions & 8 deletions dlib/fft/mkl_fft.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

namespace dlib
{
inline bool init_mkl_threads()
{
static const bool done = [] {mkl_set_num_threads(1); return true;}();
return done;
}
// inline bool init_mkl_threads()
// {
// static const bool done = [] {mkl_set_num_threads(1); return true;}();
// return done;
// }

template<typename T>
void mkl_fft(const fft_size& dims, const std::complex<T>* in, std::complex<T>* out, bool is_inverse)
Expand Down Expand Up @@ -70,7 +70,7 @@ namespace dlib
DLIB_DFTI_CHECK_STATUS(status);

// Unless we use sequential mode, the fft results are not correct.
(void)init_mkl_threads();
// (void)init_mkl_threads();
status = DftiSetValue(h, DFTI_THREAD_LIMIT, 1);
DLIB_DFTI_CHECK_STATUS(status);

Expand Down Expand Up @@ -154,7 +154,7 @@ namespace dlib
DLIB_DFTI_CHECK_STATUS(status);

// Unless we use sequential mode, the fft results are not correct.
(void)init_mkl_threads();
// (void)init_mkl_threads();
status = DftiSetValue(h, DFTI_THREAD_LIMIT, 1);
DLIB_DFTI_CHECK_STATUS(status);

Expand Down Expand Up @@ -235,7 +235,7 @@ namespace dlib
DLIB_DFTI_CHECK_STATUS(status);

// Unless we use sequential mode, the fft results are not correct.
(void)init_mkl_threads();
// (void)init_mkl_threads();
status = DftiSetValue(h, DFTI_THREAD_LIMIT, 1);
DLIB_DFTI_CHECK_STATUS(status);

Expand Down

0 comments on commit 51a34c3

Please sign in to comment.