From b0c5bfdf7844328f726c2c472a5fc85724292244 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Fri, 28 Oct 2016 03:43:41 +0000 Subject: Added missing template parameters --- unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h b/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h index 428d32d41..ffcf8b00f 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h @@ -80,8 +80,8 @@ struct traits > }; -template class MakePointer_> -struct traits > +template class MakePointer_> +struct traits > : public traits { typedef traits BaseTraits; @@ -142,16 +142,16 @@ struct eval, Eig typedef const TensorFixedSize& type; }; -template -struct eval, Eigen::Dense> +template class MakePointer> +struct eval, Eigen::Dense> { - typedef const TensorMap& type; + typedef const TensorMap& type; }; -template -struct eval, Eigen::Dense> +template class MakePointer> +struct eval, Eigen::Dense> { - typedef const TensorMap& type; + typedef const TensorMap& type; }; template @@ -197,16 +197,16 @@ struct nested > }; -template -struct nested > +template class MakePointer> +struct nested > { - typedef const TensorMap& type; + typedef const TensorMap& type; }; -template -struct nested > +template class MakePointer> +struct nested > { - typedef const TensorMap& type; + typedef const TensorMap& type; }; template -- cgit v1.2.3 From 8471cf199695804f5e58c63c58b5ec3350d49560 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Fri, 28 Oct 2016 03:46:08 +0000 Subject: Fixed compilation warning --- unsupported/test/cxx11_tensor_scan_cuda.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsupported/test/cxx11_tensor_scan_cuda.cu b/unsupported/test/cxx11_tensor_scan_cuda.cu index 761d11fd1..5f146f3c9 100644 --- a/unsupported/test/cxx11_tensor_scan_cuda.cu +++ b/unsupported/test/cxx11_tensor_scan_cuda.cu @@ -55,7 +55,7 @@ void test_cuda_cumsum(int m_size, int k_size, int n_size) t_result = t_input.cumsum(1); cudaMemcpy(t_result_gpu.data(), d_t_result, t_result_bytes, cudaMemcpyDeviceToHost); - for (size_t i = 0; i < t_result.size(); i++) { + for (DenseIndex i = 0; i < t_result.size(); i++) { if (fabs(t_result(i) - t_result_gpu(i)) < 1e-4f) { continue; } -- cgit v1.2.3 From 306daa24a3fb4031cf20a58f2f9f26625698e8a4 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Fri, 28 Oct 2016 03:50:31 +0000 Subject: Fixed a compilation warning --- unsupported/test/cxx11_tensor_contract_cuda.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsupported/test/cxx11_tensor_contract_cuda.cu b/unsupported/test/cxx11_tensor_contract_cuda.cu index 767e9c678..dd68430ce 100644 --- a/unsupported/test/cxx11_tensor_contract_cuda.cu +++ b/unsupported/test/cxx11_tensor_contract_cuda.cu @@ -69,7 +69,7 @@ void test_cuda_contraction(int m_size, int k_size, int n_size) t_result = t_left.contract(t_right, dims); cudaMemcpy(t_result_gpu.data(), d_t_result, t_result_bytes, cudaMemcpyDeviceToHost); - for (size_t i = 0; i < t_result.size(); i++) { + for (DenseIndex i = 0; i < t_result.size(); i++) { if (fabs(t_result(i) - t_result_gpu(i)) < 1e-4f) { continue; } -- cgit v1.2.3 From 0b4b0f11e889674effe698d792caea7d00ba067b Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Fri, 28 Oct 2016 04:01:01 +0000 Subject: Fixed a few more compilation warnings --- unsupported/test/cxx11_tensor_cuda.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unsupported/test/cxx11_tensor_cuda.cu b/unsupported/test/cxx11_tensor_cuda.cu index bf216587a..0ba9d52e9 100644 --- a/unsupported/test/cxx11_tensor_cuda.cu +++ b/unsupported/test/cxx11_tensor_cuda.cu @@ -303,8 +303,8 @@ void test_cuda_contraction() cudaMemcpy(t_result.data(), d_t_result, t_result_bytes, cudaMemcpyDeviceToHost); - for (size_t i = 0; i < t_result.dimensions().TotalSize(); i++) { - if (fabs(t_result.data()[i] - m_result.data()[i]) >= 1e-4) { + for (DenseIndex i = 0; i < t_result.size(); i++) { + if (fabs(t_result.data()[i] - m_result.data()[i]) >= 1e-4f) { std::cout << "mismatch detected at index " << i << ": " << t_result.data()[i] << " vs " << m_result.data()[i] << std::endl; assert(false); } -- cgit v1.2.3 From d5f88e2357699193f82f0f44f14c8cfaface60a0 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Thu, 27 Oct 2016 21:48:21 -0700 Subject: Sharded the tensor_image_patch test to help it run on low power devices --- unsupported/test/cxx11_tensor_image_patch.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/unsupported/test/cxx11_tensor_image_patch.cpp b/unsupported/test/cxx11_tensor_image_patch.cpp index 988b01481..475c59651 100644 --- a/unsupported/test/cxx11_tensor_image_patch.cpp +++ b/unsupported/test/cxx11_tensor_image_patch.cpp @@ -13,7 +13,7 @@ using Eigen::Tensor; -static void test_simple_patch() +void test_simple_patch() { Tensor tensor(2,3,5,7); tensor.setRandom(); @@ -180,7 +180,7 @@ static void test_simple_patch() } // Verifies VALID padding (no padding) with incrementing values. -static void test_patch_padding_valid() +void test_patch_padding_valid() { int input_depth = 3; int input_rows = 3; @@ -256,7 +256,7 @@ static void test_patch_padding_valid() } // Verifies VALID padding (no padding) with the same value. -static void test_patch_padding_valid_same_value() +void test_patch_padding_valid_same_value() { int input_depth = 1; int input_rows = 5; @@ -329,7 +329,7 @@ static void test_patch_padding_valid_same_value() } // Verifies SAME padding. -static void test_patch_padding_same() +void test_patch_padding_same() { int input_depth = 3; int input_rows = 4; @@ -405,7 +405,7 @@ static void test_patch_padding_same() } } -static void test_patch_no_extra_dim() +void test_patch_no_extra_dim() { Tensor tensor(2,3,5); tensor.setRandom(); @@ -553,7 +553,7 @@ static void test_patch_no_extra_dim() } } -static void test_imagenet_patches() +void test_imagenet_patches() { // Test the code on typical configurations used by the 'imagenet' benchmarks at // https://github.com/soumith/convnet-benchmarks @@ -748,10 +748,10 @@ static void test_imagenet_patches() void test_cxx11_tensor_image_patch() { - CALL_SUBTEST(test_simple_patch()); - CALL_SUBTEST(test_patch_no_extra_dim()); - CALL_SUBTEST(test_patch_padding_valid()); - CALL_SUBTEST(test_patch_padding_valid_same_value()); - CALL_SUBTEST(test_patch_padding_same()); - CALL_SUBTEST(test_imagenet_patches()); + CALL_SUBTEST_1(test_simple_patch()); + CALL_SUBTEST_2(test_patch_no_extra_dim()); + CALL_SUBTEST_3(test_patch_padding_valid()); + CALL_SUBTEST_4(test_patch_padding_valid_same_value()); + CALL_SUBTEST_5(test_patch_padding_same()); + CALL_SUBTEST_6(test_imagenet_patches()); } -- cgit v1.2.3 From 0a9ad6fc72f83ac0d3e4fa8d0fa6b339969f341a Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Fri, 28 Oct 2016 07:54:27 -0700 Subject: Worked around Visual Studio compilation errors --- unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h | 4 +++- unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h b/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h index 9d5cf1a8c..68d14a7e5 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h @@ -38,7 +38,9 @@ struct traits > }; template struct MakePointer { - typedef typename MakePointer_::Type Type; + // Intermediate typedef to workaround MSVC issue. + typedef MakePointer_ MakePointerT; + typedef typename MakePointerT::Type Type; }; }; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h b/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h index 9cf4a07e5..bbd5eb374 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h @@ -42,9 +42,10 @@ struct traits > enum { Flags = 0 }; - template - struct MakePointer { - typedef typename MakePointer_::Type Type; + template struct MakePointer { + // Intermediate typedef to workaround MSVC issue. + typedef MakePointer_ MakePointerT; + typedef typename MakePointerT::Type Type; }; }; -- cgit v1.2.3 From 7a0e96b80dc622e3802ec158a12c63b728d7fce9 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Tue, 1 Nov 2016 12:08:09 -0700 Subject: Gate the code that refers to cuda fp16 primitives more thoroughly --- Eigen/src/Core/arch/CUDA/PacketMathHalf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Eigen/src/Core/arch/CUDA/PacketMathHalf.h b/Eigen/src/Core/arch/CUDA/PacketMathHalf.h index 9dd89e07f..de905bbf4 100644 --- a/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +++ b/Eigen/src/Core/arch/CUDA/PacketMathHalf.h @@ -15,7 +15,7 @@ namespace Eigen { namespace internal { // Most of the following operations require arch >= 3.0 -#if defined(EIGEN_HAS_CUDA_FP16) && defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 300 +#if defined(EIGEN_HAS_CUDA_FP16) && defined(__CUDACC__) && defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 300 template<> struct is_arithmetic { enum { value = true }; }; -- cgit v1.2.3