From 71c85df4c1ce4efa41bb4adc8e9cb224c3ca9a2d Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Wed, 2 Dec 2020 11:04:04 -0800 Subject: Clean up the Tensor header and get rid of the EIGEN_SLEEP macro. --- unsupported/Eigen/CXX11/Tensor | 6 +++--- unsupported/Eigen/CXX11/src/Tensor/TensorDeviceGpu.h | 2 +- unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h | 9 --------- 3 files changed, 4 insertions(+), 13 deletions(-) (limited to 'unsupported/Eigen') diff --git a/unsupported/Eigen/CXX11/Tensor b/unsupported/Eigen/CXX11/Tensor index 2640f9565..beed2308a 100644 --- a/unsupported/Eigen/CXX11/Tensor +++ b/unsupported/Eigen/CXX11/Tensor @@ -33,10 +33,13 @@ * Much of the documentation can be found \ref eigen_tensors "here". */ +#include +#include #include #include #include #include +#include #ifdef _WIN32 typedef __int16 int16_t; @@ -48,7 +51,6 @@ typedef unsigned __int64 uint64_t; #include #else #include -#include #endif #ifdef _WIN32 @@ -70,8 +72,6 @@ typedef unsigned __int64 uint64_t; #else #include #endif - #include - #include #endif #include "src/Tensor/TensorMacros.h" diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceGpu.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceGpu.h index 7f3394438..9422dcd7a 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceGpu.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceGpu.h @@ -83,7 +83,7 @@ static void initializeDeviceProp() { // Wait for the other thread to inititialize the properties. while (!m_devicePropInitialized) { std::atomic_thread_fence(std::memory_order_acquire); - EIGEN_SLEEP(1000); + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); } } } diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h index 76d15f114..73ff3d2db 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h @@ -43,15 +43,6 @@ #define EIGEN_SFINAE_ENABLE_IF( __condition__ ) \ typename internal::enable_if< ( __condition__ ) , int >::type = 0 - -#if EIGEN_OS_WIN || EIGEN_OS_WIN64 -#define EIGEN_SLEEP(n) Sleep(n) -#elif EIGEN_OS_GNULINUX -#define EIGEN_SLEEP(n) usleep(n * 1000); -#else -#define EIGEN_SLEEP(n) sleep(std::max(1, n/1000)) -#endif - // Define a macro to use a reference on the host but a value on the device #if defined(SYCL_DEVICE_ONLY) #define EIGEN_DEVICE_REF -- cgit v1.2.3