QMCPACK
BlasThreadingEnv.cpp
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2019 QMCPACK developers.
6 //
7 // File developed by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
8 //
9 // File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
10 //
11 //////////////////////////////////////////////////////////////////////////////////////
12 
13 
14 #include "BlasThreadingEnv.h"
15 #include "config.h"
16 #ifdef HAVE_MKL
17 #include <mkl_service.h>
18 #endif
19 
20 namespace qmcplusplus
21 {
23 {
24 #ifdef HAVE_MKL
25  old_state_ = mkl_set_num_threads_local(num_threads);
26 #else
27  old_state_ = 0;
28 #endif
29 }
30 
32 {
33 #ifdef HAVE_MKL
34  mkl_set_num_threads_local(old_state_);
35 #endif
36 }
37 
39 {
40 #ifdef HAVE_MKL
41  return true;
42 #else
43  return false;
44 #endif
45 }
46 
47 } // namespace qmcplusplus
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
BlasThreadingEnv(int num_threads)
Constructor, obtains the number of threads at the next level.