Moving once_flag as requested by reviewer
Signed-off-by: Vishakha Agrawal <vishakha.agrawal@intel.com>
This commit is contained in:
parent
508fddb3af
commit
f63da8dfc0
@ -42,7 +42,6 @@ limitations under the License.
|
||||
#endif
|
||||
|
||||
namespace tensorflow {
|
||||
absl::once_flag omp_setting_flag;
|
||||
|
||||
ThreadPoolDevice::ThreadPoolDevice(const SessionOptions& options,
|
||||
const string& name, Bytes memory_limit,
|
||||
@ -57,6 +56,7 @@ ThreadPoolDevice::ThreadPoolDevice(const SessionOptions& options,
|
||||
if (DisableMKL()) return;
|
||||
#ifdef _OPENMP
|
||||
const char* user_omp_threads = getenv("OMP_NUM_THREADS");
|
||||
static absl::once_flag omp_setting_flag;
|
||||
if (user_omp_threads == nullptr) {
|
||||
// OMP_NUM_THREADS controls MKL's intra-op parallelization
|
||||
// Default to available physical cores
|
||||
|
Loading…
x
Reference in New Issue
Block a user