ATLAS Offline Software
Loading...
Searching...
No Matches
device_context.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGINDETCUDA_DEVCONTEXTS_H
6#define TRIGINDETCUDA_DEVCONTEXTS_H
7
9
11
12#include <cuda_runtime.h>
13#include <tbb/tick_count.h>
14
15#include "CommonStructures.h"
16
17
19public:
21 size_t hostSize() { return h_size;}
22 size_t deviceSize() { return d_size;}
23
25 cudaStream_t m_stream{};
26 unsigned char *h_settings{};
27 unsigned char *d_settings{};
28 unsigned char *h_spacepoints{};
29 unsigned char *d_spacepoints{};
30
31 unsigned char *d_detmodel{};
32
33 unsigned char *h_outputseeds{};
34 unsigned char *d_outputseeds{};
35
36 unsigned char *d_doubletstorage{};
37 unsigned char *d_doubletinfo{};
38
39 size_t d_size{}, h_size{};
41
42private:
44};
45
47public:
49 size_t hostSize() { return h_size;}
50 size_t deviceSize() { return d_size;}
51 size_t managedSize() { return m_size;}
52
54 cudaStream_t m_stream{};
55
56
57 unsigned char *m_settings{};
58
59
60 unsigned char *m_spacepoints{};
61
62 unsigned char *d_detmodel{};
63
64
65
66
67 unsigned char *m_outputseeds{};
68 unsigned char *m_confirmedseeds{};
69
70 unsigned char *d_doubletstorage{};
71 unsigned char *d_doubletinfo{};
72
73 size_t d_size{}, h_size{}, m_size{};
75
76private:
78};
79
81public:
82 GbtsDeviceContext() = default;
83 size_t hostSize() { return h_size;}
84 size_t deviceSize() { return d_size;}
85
86 int m_deviceId{-1};
87 cudaStream_t m_stream;
88 size_t d_size{}, h_size{};
89
90 int m_nLayers{};
93 int m_nNodes{};
94 unsigned int m_nMaxEdges{};
95
97
99
100 //1. Input data structures on GPU
101
102 float* d_sp_params{};//spacepoint parameters x, y, z, w
104 float* d_layer_geo{};
105
106 //2. GBTS algorithm parameters
107
109
110 //3. Graph nodes on GPU
111
112 float* d_node_params{};//tau1, tau2, r, phi, z
113 int* d_node_index{};//original spacepoint index
114 int* d_eta_bin_views{};//views of the nodes
115 float* d_bin_rads{};//minimum and maximum r of nodes inside an eta-bin
116
117 int* d_node_eta_index{};//for data binning
118 int* d_node_phi_index{};//for data binning
119
120 unsigned int* d_eta_phi_histo{};//for data binning
121 unsigned int* d_phi_cusums{};//for data binning
122 unsigned int* d_eta_node_counter{};//for data binning
123
124 int* h_eta_bin_views{};//eta-bin views of the node_params array
125 float* h_bin_rads{};
126
127 unsigned int* h_bin_pair_views{};
128 unsigned int* d_bin_pair_views{};
129
132
135
136 unsigned int* d_num_incoming_edges{};
138
139 unsigned char* d_num_neighbours{};
142 unsigned int* d_counters{};
143
144 // message-passing CCA
145
146 int* d_active_edges{}; //holds indices of the edges that need more CCA iterations
147 char* d_levels{}; //d_levels[edge_idx] = the maxium length of seeds starting with this edge
148 int* d_level_views{}; //edge indices by level
149 int* d_level_boundaries{}; //number of edges for each level in the above
150
151 // seed-extraction walkthrough
152
153 int* d_mini_states{}; // edge_idx and prev mini_state forms a seeds uniuqe path through the graph
154 int* d_seed_proposals{}; // int quality and final mini_state_idx
155 float* d_state_store{}; // global overflow of live edgeStates
156 unsigned long long int* d_edge_bids{}; //first 32 bits are seed quality second 32 bits are seed_proposals index [int_m_J, prop_idx]
157 char* d_seed_ambiguity{}; //0 as default/is real seed, 1 as maybe seed, -1 as maybe not seed, -2 as fake
158
159 //output stats
160
161 unsigned int m_nEdges{};
162 unsigned int m_nLinks{};
163 unsigned int m_nUniqueEdges{};
164 unsigned int m_nSeeds{};
165
166 //output array
167
169
171 //stores each edges node-pair, number of connections and the self-refrencing indexes of those connections
172
173private:
175};
176
177
178#endif
struct gpuParameters GPU_PARAMETERS
static Double_t sc
unsigned int * d_eta_node_counter
GbtsDeviceContext()=default
unsigned int m_nSeeds
TrigAccel::ITk::Tracklet * d_seeds
cudaStream_t m_stream
unsigned int * d_phi_cusums
unsigned int * d_num_incoming_edges
unsigned int * h_bin_pair_views
unsigned long long int * d_edge_bids
unsigned char * d_num_neighbours
GbtsDeviceContext(const GbtsDeviceContext &sc)
unsigned int m_nLinks
unsigned int * d_eta_phi_histo
unsigned int m_nUniqueEdges
unsigned int m_nMaxEdges
unsigned int * d_counters
unsigned int * d_bin_pair_views
unsigned int m_nEdges
unsigned char * d_spacepoints
GPU_PARAMETERS m_gpuParams
unsigned char * d_detmodel
unsigned char * h_outputseeds
unsigned char * d_outputseeds
unsigned char * h_spacepoints
unsigned char * h_settings
unsigned char * d_doubletstorage
unsigned char * d_doubletinfo
SeedMakingDeviceContext(const SeedMakingDeviceContext &sc)
unsigned char * d_settings
SeedMakingManagedDeviceContext(const SeedMakingManagedDeviceContext &sc)