forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
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 cms-sw#16 from SegmentLinking/from-CMSSW_13_3_0_pr…
…e3_LST_X/modules-dev SDL::modulesBuffer as an ES product
- Loading branch information
Showing
8 changed files
with
94 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
<use name="DataFormats/Common"/> | ||
<use name="alpaka"/> | ||
<use name="lst_headers"/> | ||
<use name="DataFormats/TrackerRecHit2D"/> | ||
<use name="HeterogeneousCore/AlpakaInterface"/> | ||
<flags ALPAKA_BACKENDS="cuda serial"/> | ||
<export> | ||
<lib name="RecoTrackerLST"/> | ||
<lib name="1"/> | ||
</export> |
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,57 @@ | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
|
||
#include "HeterogeneousCore/AlpakaCore/interface/alpaka/ESProducer.h" | ||
#include "HeterogeneousCore/AlpakaCore/interface/alpaka/ModuleFactory.h" | ||
#include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
#include "HeterogeneousCore/AlpakaInterface/interface/memory.h" | ||
|
||
#include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h" | ||
|
||
// LST includes | ||
#include <SDL/Module.h> | ||
#include <SDL/ModuleMethods.h> | ||
#include <SDL/LST.h> | ||
|
||
namespace cms::alpakatools { | ||
template <> | ||
struct CopyToDevice<SDL::modulesBuffer<alpaka_common::DevHost>> { | ||
template <typename TQueue> | ||
static auto copyAsync(TQueue& queue, SDL::modulesBuffer<alpaka_common::DevHost> const& srcData) { | ||
return SDL::modulesBuffer<alpaka::Dev<TQueue>>(queue, srcData); | ||
} | ||
}; | ||
} //namespace cms::alpakatools | ||
namespace ALPAKA_ACCELERATOR_NAMESPACE { | ||
|
||
class LSTModulesDevESProducer : public ESProducer { | ||
public: | ||
LSTModulesDevESProducer(const edm::ParameterSet &iConfig); | ||
|
||
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); | ||
|
||
std::optional<SDL::modulesBuffer<alpaka_common::DevHost>> produce(const TrackerRecoGeometryRecord &iRecord); | ||
|
||
}; | ||
|
||
LSTModulesDevESProducer::LSTModulesDevESProducer(const edm::ParameterSet &iConfig) | ||
: ESProducer(iConfig) | ||
{ | ||
setWhatProduced(this, iConfig.getParameter<std::string>("ComponentName")); | ||
} | ||
|
||
void LSTModulesDevESProducer::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { | ||
edm::ParameterSetDescription desc; | ||
desc.add<std::string>("ComponentName", "")->setComment("Product label"); | ||
descriptions.addWithDefaultLabel(desc); | ||
} | ||
|
||
std::optional<SDL::modulesBuffer<alpaka_common::DevHost>> LSTModulesDevESProducer::produce(const TrackerRecoGeometryRecord &iRecord) { | ||
SDL::modulesBuffer<alpaka_common::DevHost> modules(cms::alpakatools::host()); | ||
alpaka::QueueCpuBlocking queue(cms::alpakatools::host()); | ||
SDL::LST::loadAndFillES(queue, &modules); | ||
return modules; | ||
} | ||
|
||
} // namespace ALPAKA_ACCELERATOR_NAMESPACE | ||
|
||
DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(LSTModulesDevESProducer); |
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,9 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
from RecoTracker.LST.lstProducer_cfi import lstProducer | ||
|
||
from Configuration.ProcessModifiers.gpu_cff import gpu | ||
(~gpu).toModify(lstProducer.alpaka, backend = 'serial_sync') | ||
|
||
from RecoTracker.LST.lstModulesDevESProducer_cfi import lstModulesDevESProducer | ||
(~gpu).toModify(lstModulesDevESProducer.alpaka, backend = 'serial_sync') |
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,7 @@ | ||
#include <SDL/Module.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::modulesBuffer<alpaka_common::DevHost>); | ||
TYPELOOKUP_ALPAKA_TEMPLATED_DATA_REG(SDL::modulesBuffer); |
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