Introduce a portable EIGEN_SLEEP macro.

This commit is contained in:
Benoit Steiner
2016-12-09 14:52:15 -08:00
parent aafa97f4d2
commit 4deafd35b7
5 changed files with 15 additions and 20 deletions

View File

@@ -88,11 +88,7 @@ static void initializeDeviceProp() {
#if __cplusplus >= 201103L
std::atomic_thread_fence(std::memory_order_acquire);
#endif
#if EIGEN_OS_WIN || EIGEN_OS_WIN64
Sleep(1000);
#else
sleep(1);
#endif
EIGEN_SLEEP(1000);
}
}
}

View File

@@ -51,4 +51,10 @@
#endif
#if EIGEN_OS_WIN || EIGEN_OS_WIN64
#define EIGEN_SLEEP(n) Sleep(n)
#else
#define EIGEN_SLEEP(n) sleep(n*1000)
#endif
#endif