Back to home page

Project CMSSW displayed by LXR

 
 

    


Warning, /CUDADataFormats/Track/README.md is written in an unsupported language. File is not indexed.

0001 # Track CUDA Data Formats
0002 
0003 `CUDADataFormat`s meant to be used on Host (CPU) or Device (CUDA GPU) for
0004 storing information about `Track`s created during the Pixel-local Reconstruction
0005 chain. It stores data in an SoA manner. It combines the data contained in the
0006 deprecated `TrackSoAHeterogeneousT` and `TrajectoryStateSoAT` classes. 
0007 
0008 The host format is inheriting from `CUDADataFormats/Common/interface/PortableHostCollection.h`,
0009 while the device format is inheriting from `CUDADataFormats/Common/interface/PortableDeviceCollection.h`
0010 
0011 Both formats use the same SoA Layout (`TrackSoAHeterogeneousLayout`) which is generated
0012 via the `GENERATE_SOA_LAYOUT` macro in the `PixelTrackUtilities.h` file.
0013 
0014 ## Notes
0015 
0016 -`hitIndices` and `detIndices`, instances of `HitContainer`, have been added into the
0017 layout as `SOA_SCALAR`s, meaning that they manage their own data independently from the SoA
0018 `Layout`. This could be improved in the future, if `HitContainer` (aka a `OneToManyAssoc` of fixed size)
0019 is replaced, but there don't seem to be any conflicts in including it in the `Layout` like this.
0020 - Host and Device classes should **not** be created via inheritance, as they're done here,
0021 but via composition. See [this discussion](https://github.com/cms-sw/cmssw/pull/40465#discussion_r1066039309).
0022 
0023 ## TrackSoAHeterogeneousHost
0024 
0025 The version of the data format to be used for storing `Track` data on the CPU. 
0026 Instances of this class are to be used for:
0027 
0028 - Having a place to copy data to host from device, via `cudaMemcpy`, or
0029 - Running host-side algorithms using data stored in an SoA manner.
0030 
0031 ## TrackSoAHeterogeneousDevice
0032 
0033 The version of the data format to be used for storing `Track` data on the GPU.
0034 
0035 Instances of `TrackSoAHeterogeneousDevice` are to be created on host and be
0036 used on device only. To do so, the instance's `view()` method is to be called
0037 to pass a `View` to any kernel launched. Accessing data from the `view()` is not
0038 possible on the host side.
0039 
0040 ## Utilities
0041 
0042 `PixelTrackUtilities.h` contains a collection of methods which were originally
0043 defined as class methods inside either `TrackSoAHeterogeneousT` and `TrajectoryStateSoAT`
0044 which have been adapted to operate on `View` instances, so that they are callable
0045 from within `__global__` kernels, on both CPU and CPU. 
0046 
0047 ## Use case
0048 
0049 See `test/TrackSoAHeterogeneous_test.cpp` for a simple example of instantiation,
0050 processing and copying from device to host.