From 1bb6fa99a31d2dcf5431087d3f238e2dcca03084 Mon Sep 17 00:00:00 2001 From: Deven Desai Date: Wed, 20 Jun 2018 16:44:58 -0400 Subject: merging the CUDA and HIP implementation for the Tensor directory and the unit tests --- unsupported/test/cxx11_tensor_of_float16_gpu.cu | 80 ++++++++++++------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'unsupported/test/cxx11_tensor_of_float16_gpu.cu') diff --git a/unsupported/test/cxx11_tensor_of_float16_gpu.cu b/unsupported/test/cxx11_tensor_of_float16_gpu.cu index 7a751ff02..150fde8bf 100644 --- a/unsupported/test/cxx11_tensor_of_float16_gpu.cu +++ b/unsupported/test/cxx11_tensor_of_float16_gpu.cu @@ -9,7 +9,7 @@ #define EIGEN_TEST_NO_LONGDOUBLE #define EIGEN_TEST_NO_COMPLEX -#define EIGEN_TEST_FUNC cxx11_tensor_of_float16_cuda +#define EIGEN_TEST_FUNC cxx11_tensor_of_float16_gpu #define EIGEN_DEFAULT_DENSE_INDEX_TYPE int #define EIGEN_USE_GPU @@ -20,8 +20,8 @@ using Eigen::Tensor; template -void test_cuda_numext() { - Eigen::CudaStreamDevice stream; +void test_gpu_numext() { + Eigen::GpuStreamDevice stream; Eigen::GpuDevice gpu_device(&stream); int num_elem = 101; @@ -57,11 +57,11 @@ void test_cuda_numext() { } -#ifdef EIGEN_HAS_CUDA_FP16 +#ifdef EIGEN_HAS_GPU_FP16 template -void test_cuda_conversion() { - Eigen::CudaStreamDevice stream; +void test_gpu_conversion() { + Eigen::GpuStreamDevice stream; Eigen::GpuDevice gpu_device(&stream); int num_elem = 101; @@ -95,8 +95,8 @@ void test_cuda_conversion() { } template -void test_cuda_unary() { - Eigen::CudaStreamDevice stream; +void test_gpu_unary() { + Eigen::GpuStreamDevice stream; Eigen::GpuDevice gpu_device(&stream); int num_elem = 101; @@ -132,8 +132,8 @@ void test_cuda_unary() { } template -void test_cuda_elementwise() { - Eigen::CudaStreamDevice stream; +void test_gpu_elementwise() { + Eigen::GpuStreamDevice stream; Eigen::GpuDevice gpu_device(&stream); int num_elem = 101; @@ -174,8 +174,8 @@ void test_cuda_elementwise() { } template -void test_cuda_trancendental() { - Eigen::CudaStreamDevice stream; +void test_gpu_trancendental() { + Eigen::GpuStreamDevice stream; Eigen::GpuDevice gpu_device(&stream); int num_elem = 101; @@ -268,8 +268,8 @@ void test_cuda_trancendental() { } template -void test_cuda_contractions() { - Eigen::CudaStreamDevice stream; +void test_gpu_contractions() { + Eigen::GpuStreamDevice stream; Eigen::GpuDevice gpu_device(&stream); int rows = 23; int cols = 23; @@ -319,12 +319,12 @@ void test_cuda_contractions() { } template -void test_cuda_reductions(int size1, int size2, int redux) { +void test_gpu_reductions(int size1, int size2, int redux) { std::cout << "Reducing " << size1 << " by " << size2 << " tensor along dim " << redux << std::endl; - Eigen::CudaStreamDevice stream; + Eigen::GpuStreamDevice stream; Eigen::GpuDevice gpu_device(&stream); int num_elem = size1*size2; int result_size = (redux == 1 ? size1 : size2); @@ -368,20 +368,20 @@ void test_cuda_reductions(int size1, int size2, int redux) { } template -void test_cuda_reductions() { - test_cuda_reductions(13, 13, 0); - test_cuda_reductions(13, 13, 1); +void test_gpu_reductions() { + test_gpu_reductions(13, 13, 0); + test_gpu_reductions(13, 13, 1); - test_cuda_reductions(35, 36, 0); - test_cuda_reductions(35, 36, 1); + test_gpu_reductions(35, 36, 0); + test_gpu_reductions(35, 36, 1); - test_cuda_reductions(36, 35, 0); - test_cuda_reductions(36, 35, 1); + test_gpu_reductions(36, 35, 0); + test_gpu_reductions(36, 35, 1); } template -void test_cuda_full_reductions() { - Eigen::CudaStreamDevice stream; +void test_gpu_full_reductions() { + Eigen::GpuStreamDevice stream; Eigen::GpuDevice gpu_device(&stream); int size = 13; int num_elem = size*size; @@ -429,9 +429,9 @@ void test_cuda_full_reductions() { } template -void test_cuda_forced_evals() { +void test_gpu_forced_evals() { - Eigen::CudaStreamDevice stream; + Eigen::GpuStreamDevice stream; Eigen::GpuDevice gpu_device(&stream); int num_elem = 101; @@ -479,20 +479,20 @@ void test_cuda_forced_evals() { #endif -void test_cxx11_tensor_of_float16_cuda() +void test_cxx11_tensor_of_float16_gpu() { - CALL_SUBTEST_1(test_cuda_numext()); - -#ifdef EIGEN_HAS_CUDA_FP16 - CALL_SUBTEST_1(test_cuda_conversion()); - CALL_SUBTEST_1(test_cuda_unary()); - CALL_SUBTEST_1(test_cuda_elementwise()); - CALL_SUBTEST_1(test_cuda_trancendental()); - CALL_SUBTEST_2(test_cuda_contractions()); - CALL_SUBTEST_3(test_cuda_reductions()); - CALL_SUBTEST_4(test_cuda_full_reductions()); - CALL_SUBTEST_5(test_cuda_forced_evals()); + CALL_SUBTEST_1(test_gpu_numext()); + +#ifdef EIGEN_HAS_GPU_FP16 + CALL_SUBTEST_1(test_gpu_conversion()); + CALL_SUBTEST_1(test_gpu_unary()); + CALL_SUBTEST_1(test_gpu_elementwise()); + CALL_SUBTEST_1(test_gpu_trancendental()); + CALL_SUBTEST_2(test_gpu_contractions()); + CALL_SUBTEST_3(test_gpu_reductions()); + CALL_SUBTEST_4(test_gpu_full_reductions()); + CALL_SUBTEST_5(test_gpu_forced_evals()); #else - std::cout << "Half floats are not supported by this version of cuda: skipping the test" << std::endl; + std::cout << "Half floats are not supported by this version of gpu: skipping the test" << std::endl; #endif } -- cgit v1.2.3