Skip to content

Commit

Permalink
Restore cms::cuda::ESProduct construction without GPU
Browse files Browse the repository at this point in the history
  • Loading branch information
makortel authored and fwyzard committed Aug 22, 2021
1 parent 097fe4a commit c9c01df
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions HeterogeneousCore/CUDACore/interface/ESProduct.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ namespace cms {
class ESProduct {
public:
ESProduct() : gpuDataPerDevice_(numberOfDevices()) {
cms::cuda::ScopedSetDevice scopedDevice;
for (size_t i = 0; i < gpuDataPerDevice_.size(); ++i) {
scopedDevice.set(i);
gpuDataPerDevice_[i].m_event = getEventCache().get();
if (not gpuDataPerDevice_.empty()) {
cms::cuda::ScopedSetDevice scopedDevice;
for (size_t i = 0; i < gpuDataPerDevice_.size(); ++i) {
scopedDevice.set(i);
gpuDataPerDevice_[i].m_event = getEventCache().get();
}
}
}

Expand Down

0 comments on commit c9c01df

Please sign in to comment.