]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix location AssertCuda 7398/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 30 Oct 2018 20:18:41 +0000 (21:18 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 30 Oct 2018 20:18:41 +0000 (21:18 +0100)
tests/tests.h

index 6f564b535137a15af9a8eebe4d5b759c7c0c071c..2c27ab7d32f538ee1a5664a019d9e5423424f0b9 100644 (file)
@@ -600,9 +600,10 @@ struct MPILogInitAll
 // Also initialize a dummy handle that makes sure that unused memory is released
 // before the device shuts down.
 void
-init_cuda(bool use_mpi = false)
+init_cuda(const bool use_mpi = false)
 {
   static Utilities::CUDA::Handle cuda_handle;
+
 #  ifndef DEAL_II_WITH_MPI
   Assert(use_mpi == false, ExcInternalError());
 #  endif
@@ -611,10 +612,10 @@ init_cuda(bool use_mpi = false)
   int         device_id       = 0;
   int         n_devices       = 0;
   cudaError_t cuda_error_code = cudaGetDeviceCount(&n_devices);
+  AssertCuda(cuda_error_code);
   if (my_id == 0)
     {
       Testing::srand(std::time(nullptr));
-      AssertCuda(cuda_error_code);
       device_id = Testing::rand() % n_devices;
     }
 #  ifdef DEAL_II_WITH_MPI

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.