Skip to content

Commit

Permalink
Rename numberOfCUDADevices() to cms::cuda::numberOfDevices
Browse files Browse the repository at this point in the history
  • Loading branch information
makortel committed Feb 28, 2020
1 parent 5d6b994 commit 25f8a68
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.

This file was deleted.

14 changes: 14 additions & 0 deletions HeterogeneousCore/CUDAServices/interface/numberOfDevices.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef HeterogeneousCore_CUDAServices_numberOfDevices_h
#define HeterogeneousCore_CUDAServices_numberOfDevices_h

namespace cms {
namespace cuda {
// Returns the number of CUDA devices
// The difference wrt. the standard CUDA function or
// cms::cuda::deviceCount() is that if CUDAService is disabled,
// this function returns 0.
int numberOfDevices();
} // namespace cuda
} // namespace cms

#endif
8 changes: 0 additions & 8 deletions HeterogeneousCore/CUDAServices/src/numberOfCUDADevices.cc

This file was deleted.

10 changes: 10 additions & 0 deletions HeterogeneousCore/CUDAServices/src/numberOfDevices.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "HeterogeneousCore/CUDAServices/interface/numberOfDevices.h"
#include "HeterogeneousCore/CUDAServices/interface/CUDAService.h"
#include "FWCore/ServiceRegistry/interface/Service.h"

namespace cms::cuda {
int numberOfDevices() {
edm::Service<CUDAService> cs;
return cs->enabled() ? cs->numberOfDevices() : 0;
}
} // namespace cms::cuda

0 comments on commit 25f8a68

Please sign in to comment.