-
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.
Add abstract interfaces for the CUDA and ROCm services
Split the CUDA and ROCm services into an interface and a concrete implementation. Split the CUDAService into CUDAInterface and CUDAService. The former implements the CUDAService interface, while the latter implement the conrete functionality, and is used only if: - CUDA is available on the current platforms, OS and compiler; - the current system has at least one available CUDA GPU; - gpu-nvidia is among the process.options.accelerators. Split the ROCmService into ROCmInterface and ROCmService. The former implements the ROCmService interface, while the latter implement the conrete functionality, and is used only if: - ROCm is available on the current platforms, OS and compiler; - the current system has at least one available ROCm GPU; - gpu-amd is among the process.options.accelerators. Update all uses of the edm::Service<CUDAService> and edm::Service<ROCmService> to the interface classes, and check explicitly that a concrete implementation of the service is available.
- Loading branch information
Showing
59 changed files
with
557 additions
and
405 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
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
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
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
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
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
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 |
---|---|---|
@@ -1,12 +1,4 @@ | ||
<iftool name="cuda"> | ||
<use name="FWCore/ServiceRegistry"/> | ||
<use name="FWCore/ParameterSet"/> | ||
<use name="FWCore/MessageLogger"/> | ||
<use name="FWCore/Utilities"/> | ||
<use name="HeterogeneousCore/CUDAUtilities"/> | ||
<use name="cuda"/> | ||
<use name="cuda-nvml"/> | ||
<export> | ||
<lib name="1"/> | ||
</export> | ||
</iftool> | ||
<use name="FWCore/ServiceRegistry"/> | ||
<export> | ||
<lib name="1"/> | ||
</export> |
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,19 @@ | ||
#ifndef HeterogeneousCore_CUDAServices_interface_CUDAInterface | ||
#define HeterogeneousCore_CUDAServices_interface_CUDAInterface | ||
|
||
#include <utility> | ||
|
||
class CUDAInterface { | ||
public: | ||
CUDAInterface() = default; | ||
virtual ~CUDAInterface() = default; | ||
|
||
virtual bool enabled() const = 0; | ||
|
||
virtual int numberOfDevices() const = 0; | ||
|
||
// Returns the (major, minor) CUDA compute capability of the given device. | ||
virtual std::pair<int, int> computeCapability(int device) const = 0; | ||
}; | ||
|
||
#endif // HeterogeneousCore_CUDAServices_interface_CUDAInterface |
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
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
Oops, something went wrong.