-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'cms-sw:master' into fixTrkValPlot
- Loading branch information
Showing
676 changed files
with
27,187 additions
and
17,525 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<use name="DataFormats/Common"/> | ||
<use name="CUDADataFormats/Common"/> | ||
<use name="HeterogeneousCore/CUDAUtilities"/> | ||
<use name="cuda"/> | ||
<use name="rootcore"/> | ||
|
||
<export> | ||
<lib name="1"/> | ||
</export> | ||
|
59 changes: 59 additions & 0 deletions
59
CUDADataFormats/SiStripCluster/interface/SiStripClustersCUDA.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#ifndef CUDADataFormats_SiStripCluster_interface_SiStripClustersCUDA_h | ||
#define CUDADataFormats_SiStripCluster_interface_SiStripClustersCUDA_h | ||
|
||
#include "DataFormats/SiStripCluster/interface/SiStripClustersSOABase.h" | ||
#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h" | ||
#include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h" | ||
#include "HeterogeneousCore/CUDAUtilities/interface/cudaCompat.h" | ||
|
||
#include <cuda_runtime.h> | ||
|
||
class SiStripClustersCUDADevice : public SiStripClustersSOABase<cms::cuda::device::unique_ptr> { | ||
public: | ||
SiStripClustersCUDADevice() = default; | ||
explicit SiStripClustersCUDADevice(uint32_t maxClusters, uint32_t maxStripsPerCluster, cudaStream_t stream); | ||
~SiStripClustersCUDADevice() override = default; | ||
|
||
SiStripClustersCUDADevice(const SiStripClustersCUDADevice &) = delete; | ||
SiStripClustersCUDADevice &operator=(const SiStripClustersCUDADevice &) = delete; | ||
SiStripClustersCUDADevice(SiStripClustersCUDADevice &&) = default; | ||
SiStripClustersCUDADevice &operator=(SiStripClustersCUDADevice &&) = default; | ||
|
||
struct DeviceView { | ||
uint32_t *clusterIndex_; | ||
uint32_t *clusterSize_; | ||
uint8_t *clusterADCs_; | ||
stripgpu::detId_t *clusterDetId_; | ||
stripgpu::stripId_t *firstStrip_; | ||
bool *trueCluster_; | ||
float *barycenter_; | ||
float *charge_; | ||
uint32_t nClusters_; | ||
uint32_t maxClusterSize_; | ||
}; | ||
|
||
DeviceView *view() const { return view_d.get(); } | ||
uint32_t nClusters() const { return nClusters_; } | ||
uint32_t *nClustersPtr() { return &nClusters_; } | ||
uint32_t maxClusterSize() const { return maxClusterSize_; } | ||
uint32_t *maxClusterSizePtr() { return &maxClusterSize_; } | ||
|
||
private: | ||
cms::cuda::device::unique_ptr<DeviceView> view_d; // "me" pointer | ||
uint32_t nClusters_; | ||
uint32_t maxClusterSize_; | ||
}; | ||
|
||
class SiStripClustersCUDAHost : public SiStripClustersSOABase<cms::cuda::host::unique_ptr> { | ||
public: | ||
SiStripClustersCUDAHost() = default; | ||
explicit SiStripClustersCUDAHost(const SiStripClustersCUDADevice &clusters_d, cudaStream_t stream); | ||
~SiStripClustersCUDAHost() override = default; | ||
|
||
SiStripClustersCUDAHost(const SiStripClustersCUDAHost &) = delete; | ||
SiStripClustersCUDAHost &operator=(const SiStripClustersCUDAHost &) = delete; | ||
SiStripClustersCUDAHost(SiStripClustersCUDAHost &&) = default; | ||
SiStripClustersCUDAHost &operator=(SiStripClustersCUDAHost &&) = default; | ||
}; | ||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#include "CUDADataFormats/SiStripCluster/interface/SiStripClustersCUDA.h" | ||
#include "HeterogeneousCore/CUDAUtilities/interface/copyAsync.h" | ||
|
||
SiStripClustersCUDADevice::SiStripClustersCUDADevice(uint32_t maxClusters, | ||
uint32_t maxStripsPerCluster, | ||
cudaStream_t stream) { | ||
maxClusterSize_ = maxStripsPerCluster; | ||
|
||
clusterIndex_ = cms::cuda::make_device_unique<uint32_t[]>(maxClusters, stream); | ||
clusterSize_ = cms::cuda::make_device_unique<uint32_t[]>(maxClusters, stream); | ||
clusterADCs_ = cms::cuda::make_device_unique<uint8_t[]>(maxClusters * maxStripsPerCluster, stream); | ||
clusterDetId_ = cms::cuda::make_device_unique<stripgpu::detId_t[]>(maxClusters, stream); | ||
firstStrip_ = cms::cuda::make_device_unique<stripgpu::stripId_t[]>(maxClusters, stream); | ||
trueCluster_ = cms::cuda::make_device_unique<bool[]>(maxClusters, stream); | ||
barycenter_ = cms::cuda::make_device_unique<float[]>(maxClusters, stream); | ||
charge_ = cms::cuda::make_device_unique<float[]>(maxClusters, stream); | ||
|
||
auto view = cms::cuda::make_host_unique<DeviceView>(stream); | ||
view->clusterIndex_ = clusterIndex_.get(); | ||
view->clusterSize_ = clusterSize_.get(); | ||
view->clusterADCs_ = clusterADCs_.get(); | ||
view->clusterDetId_ = clusterDetId_.get(); | ||
view->firstStrip_ = firstStrip_.get(); | ||
view->trueCluster_ = trueCluster_.get(); | ||
view->barycenter_ = barycenter_.get(); | ||
view->charge_ = charge_.get(); | ||
view->maxClusterSize_ = maxStripsPerCluster; | ||
|
||
view_d = cms::cuda::make_device_unique<DeviceView>(stream); | ||
cms::cuda::copyAsync(view_d, view, stream); | ||
#ifdef GPU_CHECK | ||
cudaCheck(cudaStreamSynchronize(stream)); | ||
#endif | ||
} | ||
|
||
SiStripClustersCUDAHost::SiStripClustersCUDAHost(const SiStripClustersCUDADevice& clusters_d, cudaStream_t stream) { | ||
nClusters_ = clusters_d.nClusters(); | ||
maxClusterSize_ = clusters_d.maxClusterSize(); | ||
clusterIndex_ = cms::cuda::make_host_unique<uint32_t[]>(nClusters_, stream); | ||
clusterSize_ = cms::cuda::make_host_unique<uint32_t[]>(nClusters_, stream); | ||
clusterADCs_ = cms::cuda::make_host_unique<uint8_t[]>(nClusters_ * maxClusterSize_, stream); | ||
clusterDetId_ = cms::cuda::make_host_unique<stripgpu::detId_t[]>(nClusters_, stream); | ||
firstStrip_ = cms::cuda::make_host_unique<stripgpu::stripId_t[]>(nClusters_, stream); | ||
trueCluster_ = cms::cuda::make_host_unique<bool[]>(nClusters_, stream); | ||
barycenter_ = cms::cuda::make_host_unique<float[]>(nClusters_, stream); | ||
charge_ = cms::cuda::make_host_unique<float[]>(nClusters_, stream); | ||
|
||
cms::cuda::copyAsync(clusterIndex_, clusters_d.clusterIndex(), nClusters_, stream); | ||
cms::cuda::copyAsync(clusterSize_, clusters_d.clusterSize(), nClusters_, stream); | ||
cms::cuda::copyAsync(clusterADCs_, clusters_d.clusterADCs(), nClusters_ * maxClusterSize_, stream); | ||
cms::cuda::copyAsync(clusterDetId_, clusters_d.clusterDetId(), nClusters_, stream); | ||
cms::cuda::copyAsync(firstStrip_, clusters_d.firstStrip(), nClusters_, stream); | ||
cms::cuda::copyAsync(trueCluster_, clusters_d.trueCluster(), nClusters_, stream); | ||
cms::cuda::copyAsync(barycenter_, clusters_d.barycenter(), nClusters_, stream); | ||
cms::cuda::copyAsync(charge_, clusters_d.charge(), nClusters_, stream); | ||
#ifdef GPU_CHECK | ||
cudaCheck(cudaStreamSynchronize(stream)); | ||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef CUDADataFormats_SiStripCluster_classes_h | ||
#define CUDADataFormats_SiStripCluster_classes_h | ||
|
||
#include "CUDADataFormats/Common/interface/Product.h" | ||
#include "CUDADataFormats/SiStripCluster/interface/SiStripClustersCUDA.h" | ||
#include "DataFormats/Common/interface/Wrapper.h" | ||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<lcgdict> | ||
<class name="cms::cuda::Product<SiStripClustersCUDADevice>" persistent="false"/> | ||
<class name="edm::Wrapper<cms::cuda::Product<SiStripClustersCUDADevice>>" persistent="false"/> | ||
<class name="SiStripClustersCUDAHost" persistent="false"/> | ||
<class name="edm::Wrapper<SiStripClustersCUDAHost>" persistent="false"/> | ||
</lcgdict> |
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
51 changes: 51 additions & 0 deletions
51
CalibCalorimetry/EcalLaserSorting/test/streamOutPadding_cfg.py
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,51 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
import FWCore.ParameterSet.VarParsing as VarParsing | ||
|
||
options = VarParsing.VarParsing('analysis') | ||
|
||
options.register ('compAlgo', | ||
'ZLIB', # default value | ||
VarParsing.VarParsing.multiplicity.singleton, | ||
VarParsing.VarParsing.varType.string, | ||
"Compression Algorithm") | ||
|
||
options.parseArguments() | ||
|
||
|
||
process = cms.Process("HLT") | ||
|
||
import FWCore.Framework.test.cmsExceptionsFatal_cff | ||
process.options = FWCore.Framework.test.cmsExceptionsFatal_cff.options | ||
|
||
process.load("FWCore.MessageLogger.MessageLogger_cfi") | ||
|
||
process.maxEvents = cms.untracked.PSet( | ||
input = cms.untracked.int32(50) | ||
) | ||
|
||
process.source = cms.Source("EmptySource", | ||
firstEvent = cms.untracked.uint64(10123456789) | ||
) | ||
|
||
process.m1 = cms.EDProducer("StreamThingProducer", | ||
instance_count = cms.int32(5), | ||
array_size = cms.int32(2) | ||
) | ||
|
||
process.m2 = cms.EDProducer("NonProducer") | ||
|
||
process.a1 = cms.EDAnalyzer("StreamThingAnalyzer", | ||
product_to_get = cms.string('m1') | ||
) | ||
|
||
process.out = cms.OutputModule("EventStreamFileWriter", | ||
fileName = cms.untracked.string('teststreamfile.dat'), | ||
padding = cms.untracked.uint32(4096), | ||
compression_level = cms.untracked.int32(1), | ||
use_compression = cms.untracked.bool(True), | ||
compression_algorithm = cms.untracked.string(options.compAlgo), | ||
max_event_size = cms.untracked.int32(7000000) | ||
) | ||
|
||
process.p1 = cms.Path(process.m1*process.a1*process.m2) | ||
process.end = cms.EndPath(process.out) |
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 was deleted.
Oops, something went wrong.
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.