PandaRoot
PndCudaExampleTask.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /*
14 
15  Test Task to try out some cuda in FairRoot
16  Andreas Herten, June 2013
17 
18  */
19 #ifndef PNDCUDAEXAMPLETASK_H_
20 #define PNDCUDAEXAMPLETASK_H_
21 
22 // framework includes
23 #include "FairTask.h"
24 #include "PndDetectorList.h"
25 
26 #include <vector>
27 #include <map>
28 
29 // Actual GPU device-using function have to be declared as extern
30 extern "C" void DeviceInfo();
31 extern "C" void someOperation();
32 
33 class TClonesArray;
34 
35 class PndCudaExampleTask : public FairTask {
36  public:
39 
41  virtual ~PndCudaExampleTask();
42 
44  virtual void SetParContainers();
45  virtual InitStatus Init();
46 
48  virtual void Exec(Option_t *opt);
49 
50  virtual void Finish();
51 
52  protected:
53  // For both external functions local representatives have to exist
54  void callGpuStuff() { someOperation(); };
55  void DeviceInfo_() { return DeviceInfo(); }
56 
57  private:
58  void Register();
59 
60  void Reset();
61 
62  void ProduceHits();
63 
64  ClassDef(PndCudaExampleTask, 1);
65 };
66 
67 #endif
virtual InitStatus Init()
void someOperation()
virtual void Finish()
void DeviceInfo()
virtual void Exec(Option_t *opt)
virtual ~PndCudaExampleTask()
virtual void SetParContainers()