Skip to content

Commit

Permalink
Protect cms::cuda::ESProduct construction from zero devices
Browse files Browse the repository at this point in the history
  • Loading branch information
makortel committed Feb 28, 2020
1 parent 25f8a68 commit e752b87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions HeterogeneousCore/CUDACore/interface/ESProduct.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#include <vector>

#include "FWCore/Utilities/interface/thread_safety_macros.h"
#include "HeterogeneousCore/CUDAServices/interface/numberOfDevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/EventCache.h"
#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
#include "HeterogeneousCore/CUDAUtilities/interface/deviceCount.h"
#include "HeterogeneousCore/CUDAUtilities/interface/currentDevice.h"
#include "HeterogeneousCore/CUDAUtilities/interface/eventWorkHasCompleted.h"

Expand All @@ -18,7 +18,7 @@ namespace cms {
template <typename T>
class ESProduct {
public:
ESProduct() : gpuDataPerDevice_(deviceCount()) {
ESProduct() : gpuDataPerDevice_(numberOfDevices()) {
for (size_t i = 0; i < gpuDataPerDevice_.size(); ++i) {
gpuDataPerDevice_[i].m_event = getEventCache().get();
}
Expand Down

0 comments on commit e752b87

Please sign in to comment.