Skip to content

Commit

Permalink
Address code style and quality issues (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard authored Nov 28, 2018
1 parent 0a61607 commit fb73c7a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions HeterogeneousCore/CUDAServices/src/CachingHostAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,18 @@ struct CachingHostAllocator
bytes(0),
bin(INVALID_BIN),
device(INVALID_DEVICE_ORDINAL),
associated_stream(0),
ready_event(0)
associated_stream(nullptr),
ready_event(nullptr)
{}

// Constructor (suitable for searching maps for a range of suitable blocks)
BlockDescriptor() :
d_ptr(NULL),
d_ptr(nullptr),
bytes(0),
bin(INVALID_BIN),
device(INVALID_DEVICE_ORDINAL),
associated_stream(0),
ready_event(0)
associated_stream(nullptr),
ready_event(nullptr)
{}

// Comparison functor for comparing host pointers
Expand Down Expand Up @@ -348,9 +348,9 @@ struct CachingHostAllocator
cudaError_t HostAllocate(
void **d_ptr, ///< [out] Reference to pointer to the allocation
size_t bytes, ///< [in] Minimum number of bytes for the allocation
cudaStream_t active_stream = 0) ///< [in] The stream to be associated with this allocation
cudaStream_t active_stream = nullptr) ///< [in] The stream to be associated with this allocation
{
*d_ptr = NULL;
*d_ptr = nullptr;
int device = INVALID_DEVICE_ORDINAL;
cudaError_t error = cudaSuccess;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class HeterogeneousEDProducer: public Devices, public edm::stream::EDProducer<ed
explicit HeterogeneousEDProducer(const edm::ParameterSet& iConfig):
Devices(iConfig.getUntrackedParameter<edm::ParameterSet>("heterogeneousEnabled_"))
{}
~HeterogeneousEDProducer() = default;
~HeterogeneousEDProducer() override = default;

protected:
edm::EDGetTokenT<HeterogeneousProduct> consumesHeterogeneous(const edm::InputTag& tag) {
Expand All @@ -187,11 +187,11 @@ class HeterogeneousEDProducer: public Devices, public edm::stream::EDProducer<ed
}

private:
void beginStream(edm::StreamID id) {
void beginStream(edm::StreamID id) override {
Devices::call_beginStream(id);
}

void acquire(const edm::Event& iEvent, const edm::EventSetup& iSetup, edm::WaitingTaskWithArenaHolder waitingTaskHolder) override final {
void acquire(const edm::Event& iEvent, const edm::EventSetup& iSetup, edm::WaitingTaskWithArenaHolder waitingTaskHolder) final {
const HeterogeneousProductBase *input = nullptr;

std::vector<const HeterogeneousProduct *> products;
Expand All @@ -213,7 +213,7 @@ class HeterogeneousEDProducer: public Devices, public edm::stream::EDProducer<ed
Devices::call_acquire(input, eventWrapper, iSetup, std::move(waitingTaskHolder));
}

void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override final {
void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) final {
if(algoExecutionLocation_.deviceType() == HeterogeneousDeviceId::kInvalidDevice) {
// TODO: eventually fall back to CPU
throw cms::Exception("LogicError") << "Trying to produce(), but algorithm was not executed successfully anywhere?";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void SiPixelFedCablingMapGPUWrapper::ModulesToUnpack::fillAsync(SiPixelFedCablin
path = {fed, link, roc};
const sipixelobjects::PixelROC* pixelRoc = cabling->findItem(path);
if (pixelRoc != nullptr) {
modToUnpHost[index] = (modules.size() != 0) && (modules.find(pixelRoc->rawId()) == modules.end());
modToUnpHost[index] = (not modules.empty()) and (modules.find(pixelRoc->rawId()) == modules.end());
} else { // store some dummy number
modToUnpHost[index] = true;
}
Expand Down

0 comments on commit fb73c7a

Please sign in to comment.