MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/core/common_runtime/mkl_threadpool_device_test.cc:29–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28#if defined(_OPENMP) && !defined(ENABLE_DNNL_THREADPOOL)
29TEST(MKLThreadPoolDeviceTest, TestOmpDefaults) {
30 SessionOptions options;
31 unsetenv("OMP_NUM_THREADS");
32
33 ThreadPoolDevice* tp = new ThreadPoolDevice(
34 options, "/device:CPU:0", Bytes(256), DeviceLocality(), cpu_allocator());
35
36 const int ht = port::NumHyperthreadsPerCore();
37 EXPECT_EQ(omp_get_max_threads(), (port::NumSchedulableCPUs() + ht - 1) / ht);
38}
39
40TEST(MKLThreadPoolDeviceTest, TestOmpPreSets) {
41 SessionOptions options;

Callers

nothing calls this directly

Calls 5

cpu_allocatorFunction · 0.85
unsetenvFunction · 0.50
NumHyperthreadsPerCoreFunction · 0.50
NumSchedulableCPUsFunction · 0.50
setenvFunction · 0.50

Tested by

no test coverage detected