]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix CUDA test 6578/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 11 May 2018 12:10:47 +0000 (14:10 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sat, 12 May 2018 13:48:35 +0000 (15:48 +0200)
cmake/macros/macro_deal_ii_pickup_tests.cmake
tests/cuda/solver_02.cu
tests/cuda/solver_02.output

index 93ad5bc0b1d4653afb1c85f2fe961ceefb0c3c3f..8efe48707c19b916f58e50c36d70bb753c956389 100644 (file)
@@ -86,7 +86,7 @@ MACRO(DEAL_II_PICKUP_TESTS)
 
   IF(DEAL_II_WITH_CUDA)
     FIND_PACKAGE(CUDA)
-    SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -std=c++11 -arch=sm_35)
+    SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -std=c++11 -arch=sm_35 -Xcompiler ${OpenMP_CXX_FLAGS})
   ENDIF()
 
   FIND_PACKAGE(Perl REQUIRED)
index 296afe35491737b8fe602a996596cc7348c48266..225bbd40883b89a053ae255a8f157118decc4423 100644 (file)
@@ -55,10 +55,8 @@ void test(Utilities::CUDA::Handle &cuda_handle)
 
   // Generate a random solution and then compute the rhs
   dealii::Vector<double> sol_ref(size);
-  std::default_random_engine generator;
-  std::normal_distribution<> distribution(10., 2.);
   for (auto &val : sol_ref)
-    val = distribution(generator);
+    val = random_value(5.,15.);
 
   dealii::Vector<double> rhs(size);
   matrix.vmult(rhs, sol_ref);
@@ -72,8 +70,9 @@ void test(Utilities::CUDA::Handle &cuda_handle)
   rhs_dev.import(rhs_host, VectorOperation::insert);
 
   LinearAlgebra::CUDAWrappers::Vector<double> solution_dev(size);
+  const std::array<std::string,3> solver_names {"Cholesky", "LU_dense", "LU_host"};
 
-  for (auto solver_type: {"Cholesky", "LU_dense", "LU_host"})
+  for (auto solver_type: solver_names)
     {
       // Solve on the device
       CUDAWrappers::SolverDirect<double>::AdditionalData data(solver_type);
@@ -91,7 +90,7 @@ void test(Utilities::CUDA::Handle &cuda_handle)
       for (unsigned int i = 0; i < size; ++i)
         AssertThrow(std::abs(solution_host[i] - sol_ref[i]) < 1e-12,
                     ExcInternalError());
-      std::cout<<solver_type<<std::endl;
+      deallog << solver_type << std::endl;
     }
 }
 
index d0ba62aa9b8f8cc5a5ae0c0e3ef5c683c3bcd964..3db636dcc5c6bd97312430510bb516931f4dca95 100644 (file)
@@ -1,8 +1,11 @@
 
 DEAL::Starting value 0.00000
 DEAL::Convergence step 0 value 0.00000
+DEAL::Cholesky
 DEAL::Starting value 0.00000
 DEAL::Convergence step 0 value 0.00000
-DEAL:cg::Starting value 0.000
+DEAL::LU_dense
+DEAL::Starting value 0.00000
 DEAL::Convergence step 0 value 0.00000
-DEAL:cg::Starting value 0.000
+DEAL::LU_host
+DEAL::OK

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.