Kokkos Node API and Local Linear Algebra Kernels Version of the Day
Kokkos_TBBNode.cpp
00001 #include "Kokkos_TBBNode.hpp"
00002 #include <Teuchos_ParameterList.hpp>
00003 
00004 // tbb::task_scheduler_init Kokkos::TBBNode::tsi_(tbb::task_scheduler_init::deferred);
00005 
00006 namespace Kokkos {
00007 
00008   TBBNode::TBBNode(Teuchos::ParameterList &pl) : alreadyInit_(false), tsi_(tbb::task_scheduler_init::deferred) {
00009     int numThreads = pl.get<int>("Num Threads",-1);
00010     if (numThreads >= 0) {
00011       init(numThreads);
00012     }
00013   }
00014 
00015   void TBBNode::init(int numThreads) {
00016     if (alreadyInit_) {
00017       tsi_.terminate();
00018     }
00019     // 
00020     if (numThreads >= 1) {
00021       tsi_.initialize(numThreads);
00022     }
00023     else {
00024       tsi_.initialize(tbb::task_scheduler_init::automatic);
00025     }
00026   }
00027 
00028   TBBNode::~TBBNode() {}
00029 
00030 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends