From 693fb1d41e1b267ae149b8f368fc3008bd59aab9 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Tue, 7 Aug 2018 17:18:51 -0700 Subject: [PATCH 1/5] Fix init order. --- unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h b/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h index e3e650fa5..a07e32db0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h @@ -786,7 +786,7 @@ struct TensorEvaluator(TensorEvaluator::Layout) == static_cast(TensorEvaluator::Layout)), YOU_MADE_A_PROGRAMMING_MISTAKE); From 908b906d79a30b357f82e9c8a1e0d238e2f3469a Mon Sep 17 00:00:00 2001 From: Mehdi Goli Date: Wed, 8 Aug 2018 10:01:10 +0100 Subject: [PATCH 2/5] Disabling assert inside SYCL kernel. --- test/main.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/main.h b/test/main.h index 5d64bc736..de8a4865f 100644 --- a/test/main.h +++ b/test/main.h @@ -193,7 +193,7 @@ namespace Eigen #define EIGEN_DEFAULT_IO_FORMAT IOFormat(4, 0, " ", "\n", "", "", "", "") -#if (defined(_CPPUNWIND) || defined(__EXCEPTIONS)) && !defined(__CUDA_ARCH__) && !defined(__HIP_DEVICE_COMPILE__) +#if (defined(_CPPUNWIND) || defined(__EXCEPTIONS)) && !defined(__CUDA_ARCH__) && !defined(__HIP_DEVICE_COMPILE__) && !defined(__SYCL_DEVICE_ONLY__) #define EIGEN_EXCEPTIONS #endif @@ -272,7 +272,7 @@ namespace Eigen } #endif //EIGEN_EXCEPTIONS - #elif !defined(__CUDACC__) && !defined(__HIPCC__)// EIGEN_DEBUG_ASSERTS + #elif !defined(__CUDACC__) && !defined(__HIPCC__) && !defined(__SYCL_DEVICE_ONLY__) // EIGEN_DEBUG_ASSERTS // see bug 89. The copy_bool here is working around a bug in gcc <= 4.3 #define eigen_assert(a) \ if( (!Eigen::internal::copy_bool(a)) && (!no_more_assert) )\ @@ -329,7 +329,7 @@ namespace Eigen std::cout << "Can't VERIFY_RAISES_STATIC_ASSERT( " #a " ) with exceptions disabled\n"; #endif - #if !defined(__CUDACC__) && !defined(__HIPCC__) + #if !defined(__CUDACC__) && !defined(__HIPCC__) && !defined(__SYCL_DEVICE_ONLY__) #define EIGEN_USE_CUSTOM_ASSERT #endif @@ -845,4 +845,4 @@ int main(int argc, char *argv[]) #ifdef _MSC_VER // 4503 - decorated name length exceeded, name was truncated #pragma warning( disable : 4503) -#endif +#endif \ No newline at end of file From 22031ab59a5b9c7b2612feaa12abe7bcef56a8e2 Mon Sep 17 00:00:00 2001 From: Mehdi Goli Date: Wed, 8 Aug 2018 11:07:27 +0100 Subject: [PATCH 3/5] Adding EIGEN_UNROLL_LOOP macro. --- Eigen/src/Core/util/Macros.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 9a2f5ab05..81ca6b8fe 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -1092,5 +1092,15 @@ bool all(T t, Ts ... ts){ return t && all(ts...); } } #endif +// Wrapping #pragma unroll in a macro since it is required for SYCL +#if defined(__SYCL_DEVICE_ONLY__) + #if defined(_MSC_VER) + #define EIGEN_UNROLL_LOOP __Pragma(unroll) + #else + #define EIGEN_UNROLL_LOOP _Pragma("unroll") + #endif +#else + #define EIGEN_UNROLL_LOOP +#endif #endif // EIGEN_MACROS_H From 67711eaa310b1f1db67fc866cc64f703faa4f788 Mon Sep 17 00:00:00 2001 From: Mehdi Goli Date: Wed, 8 Aug 2018 11:38:10 +0100 Subject: [PATCH 4/5] Fixing typo. --- Eigen/src/Core/util/Macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 81ca6b8fe..bcdede61e 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -1095,7 +1095,7 @@ bool all(T t, Ts ... ts){ return t && all(ts...); } // Wrapping #pragma unroll in a macro since it is required for SYCL #if defined(__SYCL_DEVICE_ONLY__) #if defined(_MSC_VER) - #define EIGEN_UNROLL_LOOP __Pragma(unroll) + #define EIGEN_UNROLL_LOOP __pragma(unroll) #else #define EIGEN_UNROLL_LOOP _Pragma("unroll") #endif From 532a0be05c0bc0f9a199f97122c88967494dd4ba Mon Sep 17 00:00:00 2001 From: Mehdi Goli Date: Wed, 8 Aug 2018 12:12:26 +0100 Subject: [PATCH 5/5] Fixing compiler warning in TensorBlock.h as it was creating a lot of noise at compilation. --- unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h index dc8b5ae6d..45ddfdb39 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h @@ -89,7 +89,7 @@ EIGEN_STRONG_INLINE void MergeResourceRequirements( // policy if block shapes/sizes conflict). *block_shape = resources[0].block_shape; *block_total_size = resources[0].block_total_size; - for (int i = 1; i < resources.size(); ++i) { + for (std::vector::size_type i = 1; i < resources.size(); ++i) { if (resources[i].block_shape == TensorBlockShapeType::kSkewedInnerDims && *block_shape != TensorBlockShapeType::kSkewedInnerDims) { *block_shape = TensorBlockShapeType::kSkewedInnerDims;