-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29061 from makortel/fixCUDAESProduct
Fix cms::cuda::ESProduct for zero devices
- Loading branch information
Showing
5 changed files
with
26 additions
and
19 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
9 changes: 0 additions & 9 deletions
9
HeterogeneousCore/CUDAServices/interface/numberOfCUDADevices.h
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
HeterogeneousCore/CUDAServices/interface/numberOfDevices.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,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 |
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
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 |