From 8719b9c5bc1a97e62d675c02495ed72dda6fae73 Mon Sep 17 00:00:00 2001 From: Antonio Sánchez Date: Thu, 28 May 2020 17:40:15 +0000 Subject: Disable test for 32-bit systems (e.g. ARM, i386) Both i386 and 32-bit ARM do not define __uint128_t. On most systems, if __uint128_t is defined, then so is the macro __SIZEOF_INT128__. https://stackoverflow.com/questions/18531782/how-to-know-if-uint128-t-is-defined1 --- unsupported/test/cxx11_tensor_complex_cwise_ops_gpu.cu | 2 ++ unsupported/test/cxx11_tensor_fft.cpp | 8 ++++---- unsupported/test/cxx11_tensor_morphing.cpp | 4 ++-- unsupported/test/cxx11_tensor_of_float16_gpu.cu | 6 +++--- unsupported/test/cxx11_tensor_uint128.cpp | 2 +- 5 files changed, 12 insertions(+), 10 deletions(-) (limited to 'unsupported') diff --git a/unsupported/test/cxx11_tensor_complex_cwise_ops_gpu.cu b/unsupported/test/cxx11_tensor_complex_cwise_ops_gpu.cu index f2a2a6cfa..99447b21d 100644 --- a/unsupported/test/cxx11_tensor_complex_cwise_ops_gpu.cu +++ b/unsupported/test/cxx11_tensor_complex_cwise_ops_gpu.cu @@ -77,6 +77,8 @@ void test_cuda_complex_cwise_ops() { gpu_out.device(gpu_device) = -gpu_in1; expected = -a; break; + case NbOps: + break; } assert(cudaMemcpyAsync(actual.data(), d_out, complex_bytes, cudaMemcpyDeviceToHost, gpu_device.stream()) == cudaSuccess); diff --git a/unsupported/test/cxx11_tensor_fft.cpp b/unsupported/test/cxx11_tensor_fft.cpp index 641486a4a..2e1008eca 100644 --- a/unsupported/test/cxx11_tensor_fft.cpp +++ b/unsupported/test/cxx11_tensor_fft.cpp @@ -228,10 +228,10 @@ template static void test_fft_non_power_of_2_round_trip(int exponent) { int n = (1 << exponent) + 1; - Eigen::DSizes dimensions; + 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 +242,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) { diff --git a/unsupported/test/cxx11_tensor_morphing.cpp b/unsupported/test/cxx11_tensor_morphing.cpp index f01b95357..59f4c34b3 100644 --- a/unsupported/test/cxx11_tensor_morphing.cpp +++ b/unsupported/test/cxx11_tensor_morphing.cpp @@ -51,8 +51,8 @@ static void test_static_reshape() { // New dimensions: [2, 3, 7] Eigen::IndexList, type2index<3>, type2index<7>> dim; - Tensor reshaped = tensor.reshape(static_cast>(dim)); - + Tensor reshaped = tensor.reshape(static_cast>(dim)); + for (int i = 0; i < 2; ++i) { for (int j = 0; j < 3; ++j) { diff --git a/unsupported/test/cxx11_tensor_of_float16_gpu.cu b/unsupported/test/cxx11_tensor_of_float16_gpu.cu index 4d74e6138..c55676c76 100644 --- a/unsupported/test/cxx11_tensor_of_float16_gpu.cu +++ b/unsupported/test/cxx11_tensor_of_float16_gpu.cu @@ -64,7 +64,7 @@ void test_gpu_conversion() { Eigen::GpuStreamDevice stream; Eigen::GpuDevice gpu_device(&stream); int num_elem = 101; - + float* d_float = (float*)gpu_device.allocate(num_elem * sizeof(float)); Eigen::half* d_half = (Eigen::half*)gpu_device.allocate(num_elem * sizeof(Eigen::half)); float* d_conv = (float*)gpu_device.allocate(num_elem * sizeof(float)); @@ -322,7 +322,7 @@ template void test_gpu_reductions(int size1, int size2, int redux) { std::cout << "Reducing " << size1 << " by " << size2 - << " tensor along dim " << redux << std::endl; + << " tensor along dim " << redux << std::endl; Eigen::GpuStreamDevice stream; Eigen::GpuDevice gpu_device(&stream); @@ -346,7 +346,7 @@ void test_gpu_reductions(int size1, int size2, int redux) { gpu_float1.device(gpu_device) = gpu_float1.random() * 2.0f; gpu_float2.device(gpu_device) = gpu_float2.random() * 2.0f; - Eigen::array redux_dim = {{redux}}; + Eigen::array redux_dim = {redux}; gpu_res_float.device(gpu_device) = gpu_float1.sum(redux_dim).cast(); gpu_res_half.device(gpu_device) = gpu_float1.cast().sum(redux_dim); diff --git a/unsupported/test/cxx11_tensor_uint128.cpp b/unsupported/test/cxx11_tensor_uint128.cpp index 07691df98..46fceaa19 100644 --- a/unsupported/test/cxx11_tensor_uint128.cpp +++ b/unsupported/test/cxx11_tensor_uint128.cpp @@ -12,7 +12,7 @@ #include -#if EIGEN_COMP_MSVC +#if EIGEN_COMP_MSVC || !defined(__SIZEOF_INT128__) #define EIGEN_NO_INT128 #else typedef __uint128_t uint128_t; -- cgit v1.2.3