-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from SegmentLinking/use_common_library
Move some things out into a common library
- Loading branch information
Showing
43 changed files
with
1,098 additions
and
1,080 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "RecoTracker/LSTCore/interface/LSTESData.h" | ||
#include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
#include "FWCore/Utilities/interface/typelookup.h" | ||
|
||
TYPELOOKUP_DATA_REG(SDL::LSTESData<alpaka_common::DevHost>); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
#include "RecoTracker/LSTCore/interface/alpaka/LST.h" | ||
#include "RecoTracker/LSTCore/interface/LSTESData.h" | ||
#include "HeterogeneousCore/AlpakaCore/interface/alpaka/typelookup.h" | ||
|
||
// Temporary hack: The DevHost instantiation is needed in both CPU and GPU plugins, | ||
// whereas the (non-host-)Device instantiation only in the GPU plugin | ||
TYPELOOKUP_DATA_REG(SDL::LSTESData<SDL::DevHost>); | ||
TYPELOOKUP_ALPAKA_TEMPLATED_DATA_REG(SDL::LSTESData); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#ifndef RecoTracker_LSTCore_interface_Constants_h | ||
#define RecoTracker_LSTCore_interface_Constants_h | ||
|
||
#include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
|
||
#ifdef CACHE_ALLOC | ||
#include "HeterogeneousCore/AlpakaInterface/interface/CachedBufAlloc.h" | ||
#endif | ||
|
||
namespace SDL { | ||
|
||
// Buffer type for allocations where auto type can't be used. | ||
template <typename TDev, typename TData> | ||
using Buf = alpaka::Buf<TDev, TData, alpaka_common::Dim1D, alpaka_common::Idx>; | ||
|
||
// Allocation wrapper function to make integration of the caching allocator easier and reduce code boilerplate. | ||
template <typename T, typename TAcc, typename TSize, typename TQueue> | ||
ALPAKA_FN_HOST ALPAKA_FN_INLINE Buf<alpaka::Dev<TAcc>, T> allocBufWrapper(TAcc const& devAccIn, | ||
TSize nElements, | ||
TQueue queue) { | ||
#ifdef CACHE_ALLOC | ||
return cms::alpakatools::allocCachedBuf<T, alpaka_common::Idx>( | ||
devAccIn, queue, alpaka_common::Vec1D(static_cast<alpaka_common::Idx>(nElements))); | ||
#else | ||
return alpaka::allocBuf<T, alpaka_common::Idx>(devAccIn, | ||
alpaka_common::Vec1D(static_cast<alpaka_common::Idx>(nElements))); | ||
#endif | ||
} | ||
|
||
// Second allocation wrapper function when queue is not given. Reduces code boilerplate. | ||
template <typename T, typename TAcc, typename TSize> | ||
ALPAKA_FN_HOST ALPAKA_FN_INLINE Buf<alpaka::Dev<TAcc>, T> allocBufWrapper(TAcc const& devAccIn, TSize nElements) { | ||
return alpaka::allocBuf<T, alpaka_common::Idx>(devAccIn, | ||
alpaka_common::Vec1D(static_cast<alpaka_common::Idx>(nElements))); | ||
} | ||
|
||
// If a compile time flag does not define PT_CUT, default to 0.8 (GeV) | ||
#ifndef PT_CUT | ||
constexpr float PT_CUT = 0.8f; | ||
#endif | ||
|
||
constexpr unsigned int MAX_BLOCKS = 80; | ||
constexpr unsigned int MAX_CONNECTED_MODULES = 40; | ||
|
||
constexpr unsigned int N_MAX_PIXEL_SEGMENTS_PER_MODULE = 50000; | ||
|
||
constexpr unsigned int N_MAX_PIXEL_MD_PER_MODULES = 2 * N_MAX_PIXEL_SEGMENTS_PER_MODULE; | ||
|
||
constexpr unsigned int N_MAX_PIXEL_TRIPLETS = 5000; | ||
constexpr unsigned int N_MAX_PIXEL_QUINTUPLETS = 15000; | ||
|
||
constexpr unsigned int N_MAX_PIXEL_TRACK_CANDIDATES = 30000; | ||
constexpr unsigned int N_MAX_NONPIXEL_TRACK_CANDIDATES = 1000; | ||
|
||
constexpr unsigned int size_superbins = 45000; | ||
|
||
//defining the constant host device variables right up here | ||
// Currently pixel tracks treated as LSs with 2 double layers (IT layers 1+2 and 3+4) and 4 hits. To be potentially handled better in the future. | ||
struct Params_pLS { | ||
static constexpr int kLayers = 2, kHits = 4; | ||
}; | ||
struct Params_LS { | ||
static constexpr int kLayers = 2, kHits = 4; | ||
}; | ||
struct Params_T3 { | ||
static constexpr int kLayers = 3, kHits = 6; | ||
}; | ||
struct Params_pT3 { | ||
static constexpr int kLayers = 5, kHits = 10; | ||
}; | ||
struct Params_T5 { | ||
static constexpr int kLayers = 5, kHits = 10; | ||
}; | ||
struct Params_pT5 { | ||
static constexpr int kLayers = 7, kHits = 14; | ||
}; | ||
|
||
} //namespace SDL | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
...Tracker/LSTCore/interface/alpaka/Module.h → RecoTracker/LSTCore/interface/Module.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
RecoTracker/LSTCore/src/alpaka/PixelMap.h → RecoTracker/LSTCore/interface/PixelMap.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.