File indexing completed on 2023-01-19 02:53:23
0001 #ifndef RecoPixelVertexing_PixelVertexFinding_plugins_gpuVertexFinder_h
0002 #define RecoPixelVertexing_PixelVertexFinding_plugins_gpuVertexFinder_h
0003
0004 #include <cstddef>
0005 #include <cstdint>
0006
0007 #include "CUDADataFormats/Track/interface/PixelTrackUtilities.h"
0008 #include "CUDADataFormats/Vertex/interface/ZVertexSoAHeterogeneousHost.h"
0009 #include "CUDADataFormats/Vertex/interface/ZVertexSoAHeterogeneousDevice.h"
0010 #include "CUDADataFormats/Vertex/interface/ZVertexUtilities.h"
0011 #include "PixelVertexWorkSpaceUtilities.h"
0012 #include "PixelVertexWorkSpaceSoAHost.h"
0013 #include "PixelVertexWorkSpaceSoADevice.h"
0014
0015 namespace gpuVertexFinder {
0016
0017 using VtxSoAView = zVertex::ZVertexSoAView;
0018 using WsSoAView = gpuVertexFinder::workSpace::PixelVertexWorkSpaceSoAView;
0019
0020 __global__ void init(VtxSoAView pdata, WsSoAView pws) {
0021 zVertex::utilities::init(pdata);
0022 gpuVertexFinder::workSpace::utilities::init(pws);
0023 }
0024
0025 template <typename TrackerTraits>
0026 class Producer {
0027 using TkSoAConstView = TrackSoAConstView<TrackerTraits>;
0028
0029 public:
0030 Producer(bool oneKernel,
0031 bool useDensity,
0032 bool useDBSCAN,
0033 bool useIterative,
0034 int iminT,
0035 float ieps,
0036 float ierrmax,
0037 float ichi2max
0038 )
0039 : oneKernel_(oneKernel && !(useDBSCAN || useIterative)),
0040 useDensity_(useDensity),
0041 useDBSCAN_(useDBSCAN),
0042 useIterative_(useIterative),
0043 minT(iminT),
0044 eps(ieps),
0045 errmax(ierrmax),
0046 chi2max(ichi2max) {}
0047
0048 ~Producer() = default;
0049
0050 ZVertexSoADevice makeAsync(cudaStream_t stream, const TkSoAConstView &tracks_view, float ptMin, float ptMax) const;
0051 ZVertexSoAHost make(const TkSoAConstView &tracks_view, float ptMin, float ptMax) const;
0052
0053 private:
0054 const bool oneKernel_;
0055 const bool useDensity_;
0056 const bool useDBSCAN_;
0057 const bool useIterative_;
0058
0059 int minT;
0060 float eps;
0061 float errmax;
0062 float chi2max;
0063 };
0064
0065 }
0066
0067 #endif