diff options
Diffstat (limited to 'unsupported/test')
-rw-r--r-- | unsupported/test/cxx11_tensor_contract_cuda.cu | 2 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_cuda.cu | 4 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_image_patch.cpp | 24 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_scan_cuda.cu | 2 |
4 files changed, 16 insertions, 16 deletions
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; } 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); } 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<float, 4> 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<float, 3> 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()); } 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; } |