Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions aten/src/TH/THGeneral.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
#include <malloc/malloc.h>
#endif

#ifdef TH_BLAS_MKL
extern void mkl_set_num_threads(int);
extern int mkl_get_max_threads(void);
#endif

/* Torch Error Handling */
static void defaultErrorHandlerFunction(const char *msg, void *data)
{
Expand Down Expand Up @@ -302,6 +307,10 @@ void THSetNumThreads(int num_threads)
#ifdef _OPENMP
omp_set_num_threads(num_threads);
#endif
#ifdef TH_BLAS_MKL
mkl_set_num_threads(num_threads);
#endif

}

int THGetNumThreads(void)
Expand All @@ -322,10 +331,6 @@ int THGetNumCores(void)
#endif
}

#ifdef TH_BLAS_MKL
extern int mkl_get_max_threads(void);
#endif

TH_API void THInferNumThreads(void)
{
#if defined(_OPENMP) && defined(TH_BLAS_MKL)
Expand Down