Warning, /CUDADataFormats/Vertex/README.md is written in an unsupported language. File is not indexed.
0001 # Vertex CUDA Data Formats
0002
0003 `CUDADataFormat`s meant to be used on Host (CPU) or Device (CUDA GPU) for
0004 storing information about vertices created during the Pixel-local Reconstruction
0005 chain. It stores data in an SoA manner. It contains the data that was previously
0006 contained in the deprecated `ZVertexSoA` class.
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 (`ZVertexSoAHeterogeneousLayout`) which is generated
0012 via the `GENERATE_SOA_LAYOUT` macro in the `ZVertexUtilities.h` file.
0013
0014 ## Notes
0015
0016 - Initially, `ZVertexSoA` had distinct array sizes for each attribute (e.g. `zv` was `MAXVTX` elements
0017 long, `ndof` was `MAXTRACKS` elements long). All columns are now of uniform `MAXTRACKS` size,
0018 meaning that there will be some wasted space (appx. 190kB).
0019 - Host and Device classes should **not** be created via inheritance, as they're done here,
0020 but via composition. See [this discussion](https://github.com/cms-sw/cmssw/pull/40465#discussion_r1066039309).
0021
0022 ## ZVertexHeterogeneousHost
0023
0024 The version of the data format to be used for storing vertex data on the CPU.
0025 Instances of this class are to be used for:
0026
0027 - Having a place to copy data to host from device, via `cudaMemcpy`, or
0028 - Running host-side algorithms using data stored in an SoA manner.
0029
0030 ## ZVertexHeterogeneousDevice
0031
0032 The version of the data format to be used for storing vertex data on the GPU.
0033
0034 Instances of `ZVertexHeterogeneousDevice` are to be created on host and be
0035 used on device only. To do so, the instance's `view()` method is to be called
0036 to pass a `View` to any kernel launched. Accessing data from the `view()` is not
0037 possible on the host side.
0038
0039 ## Utilities
0040
0041 Apart from `ZVertexSoAHeterogeneousLayout`, `ZVertexUtilities.h` also contains
0042 a collection of methods which were originally
0043 defined as class methods inside the `ZVertexSoA` class
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.