]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Work around a problem when using very old TBB versions. 3889/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 31 Jan 2017 22:50:08 +0000 (15:50 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 31 Jan 2017 22:50:08 +0000 (15:50 -0700)
include/deal.II/base/thread_management.h

index 28d94bd288705f45e572e8d1b7a59caa9df543d4..c1d81dda72656aa152aa7e812d75c61cc7e51f64 100644 (file)
@@ -42,6 +42,7 @@
 #    include <pthread.h>
 #  endif
 #  include <tbb/task.h>
+#  include <tbb/tbb_stddef.h>
 #endif
 
 
@@ -2918,7 +2919,17 @@ namespace Threads
       task->set_ref_count (2);
 
       tbb::task *worker = new (task->allocate_child()) TaskEntryPoint<RT>(*this);
+
+      // in earlier versions of the TBB, task::spawn was a regular
+      // member function; however, in later versions, it was converted
+      // into a static function. we could always call it as a regular member
+      // function of *task, but that appears to confuse the NVidia nvcc
+      // compiler. consequently, the following work-around:
+#if TBB_VERSION_MAJOR >= 4
       tbb::task::spawn (*worker);
+#else
+      task->spawn (*worker);
+#endif
     }
 
 

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.