From 9a6a43319f31c03cda67c4ff772de339d0f19b8f Mon Sep 17 00:00:00 2001 From: Thales Sabino Date: Thu, 12 Jul 2018 11:20:59 +0100 Subject: Fix cxx11_tensor_fft not building on Windows. The type used in Eigen::DSizes needs to be at least 8 bytes long. Internally Tensor tries to convert this to an __int64 on Windows and this fails to build. On Linux, long and long long are both 8 byte integer types. * * * Changing from "long long" to "std::int64_t". --- unsupported/test/cxx11_tensor_fft.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'unsupported/test/cxx11_tensor_fft.cpp') diff --git a/unsupported/test/cxx11_tensor_fft.cpp b/unsupported/test/cxx11_tensor_fft.cpp index a55369477..ef5f1a312 100644 --- a/unsupported/test/cxx11_tensor_fft.cpp +++ b/unsupported/test/cxx11_tensor_fft.cpp @@ -228,10 +228,13 @@ template static void test_fft_non_power_of_2_round_trip(int exponent) { int n = (1 << exponent) + 1; - Eigen::DSizes dimensions; + // The dimension type needs to be at least 8 bytes long for the + // Tensor constructor to work. On Windows, long is only 4 bytes long, + // so use long long here to force the usage of a 8 bytes integer type. + Eigen::DSizes dimensions; dimensions[0] = n; - const DSizes arr = dimensions; - Tensor input; + const DSizes arr = dimensions; + Tensor input; input.resize(arr); input.setRandom(); @@ -242,7 +245,7 @@ static void test_fft_non_power_of_2_round_trip(int exponent) { Tensor, 1, ColMajor> forward = input.template fft(fft); - Tensor output = + Tensor output = forward.template fft(fft); for (int i = 0; i < n; ++i) { -- cgit v1.2.3