FairRoot/PandaRoot
PndCudaExampleTask.cxx
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndCudaExampleTask source file -----
3 // -------------------------------------------------------------------------
4 // libc includes
5 #include <iostream>
6 
7 // Root includes
8 #include "TROOT.h"
9 #include "TClonesArray.h"
10 
11 // framework includes
12 #include "FairRootManager.h"
13 #include "FairRun.h"
14 #include "FairRuntimeDb.h"
15 #include "FairHit.h"
16 #include "FairMultiLinkedData.h"
17 #include "FairEventHeader.h"
18 #include "PndCudaExampleTask.h"
19 
20 #include "PndDetectorList.h"
21 #include <iomanip>
22 
23 // ----- Default constructor -------------------------------------------
25 : FairTask("Calls a CUDA function")
26 {
27 }
28 // -------------------------------------------------------------------------
29 
30 // ----- Destructor ----------------------------------------------------
32 {
33 }
34 
35 // ----- Public method Init --------------------------------------------
37 {
38  FairRootManager* ioman = FairRootManager::Instance();
39  if (!ioman) {
40  std::cout << "-E- PndCudaExampleTask::Init: "
41  << "RootManager not instantiated!" << std::endl;
42  return kFATAL;
43  }
44 
45  std::cout << "-I- PndCudaExampleTask::Init: Initialization successfull" << std::endl;
46 
47  return kSUCCESS;
48 }
49 
50 // -------------------------------------------------------------------------
52 {
53 
54 }
55 
56 
57 // ----- Public method Exec --------------------------------------------
58 void PndCudaExampleTask::Exec(Option_t*)
59 {
60  std::cout << "============= PndCudaExampleTask:: START DEVICE INFO: " << std::endl;
61  DeviceInfo_();
62  std::cout << "============= PndCudaExampleTask:: END DEVICE INFO" << std::endl;
63  std::cout << "============= PndCudaExampleTask:: START CUDA KERNEL CALL: " << std::endl;
64  callGpuStuff();
65  std::cout << "============= PndCudaExampleTask:: END CUDA KERNEL CALL" << std::endl;
66  std::cout << "============= End PndCudaExampleTask::Exec" << std::endl;
67  std::cout << std::endl;
68 }
69 
71 {
72 
73 }
74 
ClassImp(PndCudaExampleTask)
virtual void SetParContainers()
virtual void Exec(Option_t *opt)
virtual InitStatus Init()