ATLAS Offline Software
GeoLoadGpu.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ISF_FASTCALOGPU_GeoLoadGpu_H
6 #define ISF_FASTCALOGPU_GeoLoadGpu_H
7 
8 // This header can be use both gcc and nvcc host part
9 
10 #include <map>
11 #include <vector>
12 
13 #include "GeoGpu_structs.h"
14 
15 typedef std::map<Identifier_Gpu, const CaloDetDescrElement_Gpu*> t_cellmap_Gpu;
16 
17 class GeoLoadGpu {
18 public:
19  GeoLoadGpu() = default;
20 
22  delete m_cellid_array;
23  }
24 
25  void set_ncells( unsigned long nc ) { m_ncells = nc; };
26  void set_nregions( unsigned int nr ) { m_nregions = nr; };
28  t_cellmap_Gpu* set_cellmap( ) { return m_cells ; };
29  void set_regions( GeoRegion* r ) { m_regions = r; };
32  void set_max_sample( int s ) { m_max_sample = s; };
34  const CaloDetDescrElement_Gpu* index2cell( unsigned long index ) { return ( *m_cells )[m_cellid_array[index]]; };
35 
37  bool LoadGpu() {
38  return LoadGpu_cu();
39  }
40  bool LoadGpu_kk();
41  bool LoadGpu_cu();
42 
43  void set_geoPtr( GeoGpu* ptr ) { m_geo_d = ptr; }
44  GeoGpu* get_geoPtr() const { return m_geo_d; }
45 
46  unsigned long get_ncells() const { return m_ncells; }
47 
48  // bool LoadGpu_Region(GeoRegion * ) ;
49 
50 private:
51  bool TestGeo();
52  bool SanityCheck();
53 
54 protected:
55  unsigned long m_ncells{0}; // number of cells
56  unsigned int m_nregions{0}; // number of regions
57  t_cellmap_Gpu* m_cells{0}; // from Geometry class
58  GeoRegion* m_regions{0}; // array of regions on host
59  GeoRegion* m_regions_d{0}; // array of region on GPU
60  CaloDetDescrElement_Gpu* m_cells_d{0}; // Cells in GPU
61  Identifier_Gpu* m_cellid_array{0}; // cell id to Indentifier lookup table
62  int m_max_sample{0}; // Max number of samples
63  Rg_Sample_Index* m_sample_index_h{0}; // index for flatout of GeoLookup over sample
64 
66 
67 };
68 #endif
GeoLoadGpu::get_geoPtr
GeoGpu * get_geoPtr() const
Definition: GeoLoadGpu.h:44
beamspotman.r
def r
Definition: beamspotman.py:676
GeoLoadGpu::set_cells_g
void set_cells_g(CaloDetDescrElement_Gpu *gc)
Definition: GeoLoadGpu.h:31
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
GeoLoadGpu::set_g_regions
void set_g_regions(GeoRegion *gr)
Definition: GeoLoadGpu.h:30
GeoLoadGpu::set_ncells
void set_ncells(unsigned long nc)
Definition: GeoLoadGpu.h:25
CaloDetDescrElement_Gpu
Definition: CaloDetDescrElement_g.h:10
GeoLoadGpu::m_geo_d
GeoGpu * m_geo_d
Definition: GeoLoadGpu.h:65
GeoLoadGpu::set_max_sample
void set_max_sample(int s)
Definition: GeoLoadGpu.h:32
index
Definition: index.py:1
GeoLoadGpu::LoadGpu
bool LoadGpu()
Definition: GeoLoadGpu.h:37
GeoLoadGpu::LoadGpu_kk
bool LoadGpu_kk()
GeoLoadGpu::set_nregions
void set_nregions(unsigned int nr)
Definition: GeoLoadGpu.h:26
t_cellmap_Gpu
std::map< Identifier_Gpu, const CaloDetDescrElement_Gpu * > t_cellmap_Gpu
Definition: GeoLoadGpu.h:15
gr
#define gr
GeoLoadGpu::set_sample_index_h
void set_sample_index_h(Rg_Sample_Index *s)
Definition: GeoLoadGpu.h:33
GeoLoadGpu::m_cells
t_cellmap_Gpu * m_cells
Definition: GeoLoadGpu.h:57
GeoLoadGpu::set_regions
void set_regions(GeoRegion *r)
Definition: GeoLoadGpu.h:29
GeoLoadGpu::GeoLoadGpu
GeoLoadGpu()=default
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
GeoLoadGpu::m_regions
GeoRegion * m_regions
Definition: GeoLoadGpu.h:58
GeoLoadGpu::~GeoLoadGpu
~GeoLoadGpu()
Definition: GeoLoadGpu.h:21
GeoLoadGpu::m_cells_d
CaloDetDescrElement_Gpu * m_cells_d
Definition: GeoLoadGpu.h:60
GeoGpu
Definition: GeoGpu_structs.h:15
GeoLoadGpu::get_ncells
unsigned long get_ncells() const
Definition: GeoLoadGpu.h:46
Identifier_Gpu
Definition: Identifier_g.h:15
GeoLoadGpu::index2cell
const CaloDetDescrElement_Gpu * index2cell(unsigned long index)
Definition: GeoLoadGpu.h:34
GeoLoadGpu::SanityCheck
bool SanityCheck()
GeoLoadGpu::TestGeo
bool TestGeo()
GeoLoadGpu::m_nregions
unsigned int m_nregions
Definition: GeoLoadGpu.h:56
GeoLoadGpu::set_cellmap
void set_cellmap(t_cellmap_Gpu *cm)
Definition: GeoLoadGpu.h:27
GeoLoadGpu::m_max_sample
int m_max_sample
Definition: GeoLoadGpu.h:62
GeoLoadGpu::m_ncells
unsigned long m_ncells
Definition: GeoLoadGpu.h:55
Rg_Sample_Index
Definition: GeoGpu_structs.h:10
GeoLoadGpu
Definition: GeoLoadGpu.h:17
GeoRegion
Definition: GeoRegion.h:18
DeMoScan.index
string index
Definition: DeMoScan.py:362
GeoLoadGpu::m_sample_index_h
Rg_Sample_Index * m_sample_index_h
Definition: GeoLoadGpu.h:63
GeoLoadGpu::LoadGpu_cu
bool LoadGpu_cu()
GeoLoadGpu::set_geoPtr
void set_geoPtr(GeoGpu *ptr)
Definition: GeoLoadGpu.h:43
GeoGpu_structs.h
plotBeamSpotMon.nc
int nc
Definition: plotBeamSpotMon.py:83
GeoLoadGpu::get_cellmap
t_cellmap_Gpu * get_cellmap()
Definition: GeoLoadGpu.h:36
GeoLoadGpu::m_regions_d
GeoRegion * m_regions_d
Definition: GeoLoadGpu.h:59
GeoLoadGpu::set_cellmap
t_cellmap_Gpu * set_cellmap()
Definition: GeoLoadGpu.h:28
GeoLoadGpu::m_cellid_array
Identifier_Gpu * m_cellid_array
Definition: GeoLoadGpu.h:61