Repository navigation
Commit b7c157b
committed
GPU: let the constant-address-space constants be built on Metal
A constructor's implicit `this` is generic in MSL 4.1, and a generic pointer does
not reach the constant address space, so a class-type constant at program scope
could not be constructed at all: gpustd::bitset for the DetID and GlobalTrackID
masks, CfChargePos for INVALID_CHARGE_POS.
MSL lets a member function be qualified with the address space of its `this`, so
each of the two constructors gains a constant-qualified overload next to the
existing one; for bitset that sits next to the __constant copy constructor
OpenCL already needs for the same reason.
Reading those constants back needs nothing further, with one exception:
sTrackSources is derived with operator| from the constant sMasks and then
indexed by isTrackSource. Rather than give bitset constant-qualified accessors
as well, that pair is left out of device code on Metal exactly as it already is
on OpenCL; its only caller is on the host.1 parent 45693c5 commit b7c157b
3 files changed
Lines changed: 8 additions & 2 deletions
File tree
- DataFormats/Reconstruction/include/ReconstructionDataFormats
- GPU
- GPUTracking/TPCClusterFinder
- Utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
0 commit comments