diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-12-09 14:52:15 -0800 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-12-09 14:52:15 -0800 |
commit | 4deafd35b75cde9c9d40360a37c364594fd8161a (patch) | |
tree | 331800e21f91f2493625ce78154a7f404d77cde2 /unsupported/Eigen/CXX11 | |
parent | aafa97f4d292bfe8f20756191ca34cf147e7778d (diff) |
Introduce a portable EIGEN_SLEEP macro.
Diffstat (limited to 'unsupported/Eigen/CXX11')
-rw-r--r-- | unsupported/Eigen/CXX11/Tensor | 2 | ||||
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorDeviceCuda.h | 6 | ||||
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h | 6 |
3 files changed, 9 insertions, 5 deletions
diff --git a/unsupported/Eigen/CXX11/Tensor b/unsupported/Eigen/CXX11/Tensor index 8b36093f0..f98eb03bd 100644 --- a/unsupported/Eigen/CXX11/Tensor +++ b/unsupported/Eigen/CXX11/Tensor @@ -53,8 +53,10 @@ typedef __int32 int32_t; typedef unsigned __int32 uint32_t; typedef __int64 int64_t; typedef unsigned __int64 uint64_t; +#include <windows.h> #else #include <stdint.h> +#include <unistd.h> #endif #if __cplusplus > 199711 || EIGEN_COMP_MSVC >= 1900 diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceCuda.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceCuda.h index ec732f17d..e6cee11ef 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceCuda.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceCuda.h @@ -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); } } } diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h index ee0078bbc..090e7a835 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h @@ -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 |