-
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.
Use different exit codes for different conditions
- Loading branch information
Showing
6 changed files
with
56 additions
and
14 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: 7 additions & 2 deletions
9
HeterogeneousCore/CUDAUtilities/bin/cudaIsEnabled_fallback.cpp
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,5 +1,10 @@ | ||
// C/C++ headers | ||
#include <cstdlib> | ||
|
||
// always returns EXIT_FAILURE | ||
int main() { return EXIT_FAILURE; } | ||
// CMSSW headers | ||
#include "HeterogeneousCore/Common/interface/PlatformStatus.h" | ||
|
||
int main() { | ||
// CUDA is not available on this architecture, OS and compiler combination | ||
return PlatformStatus::PlatformNotAvailable; | ||
} |
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,13 @@ | ||
#ifndef HeterogeneousCore_Common_interface_PlatformStatus_h | ||
#define HeterogeneousCore_Common_interface_PlatformStatus_h | ||
|
||
// Please note: these values must be kept in sync with HeterogeneousCore/Common/python/PlatformStatus.py | ||
|
||
enum PlatformStatus : int { | ||
Success = 0, | ||
PlatformNotAvailable = 1, // the platform is not available for this architecture, OS or compiler | ||
RuntimeNotAvailable = 2, // the runtime could not be initialised | ||
DevicesNotAvailable = 3, // there are no visible, usable devices | ||
}; | ||
|
||
#endif // HeterogeneousCore_Common_interface_PlatformStatus_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,9 @@ | ||
import enum | ||
|
||
# Please note: these values must be kept in sync with HeterogeneousCore/Common/interface/PlatformStatus.h | ||
|
||
class PlatformStatus(enum.IntEnum): | ||
Success = 0 | ||
PlatformNotAvailable = 1 # the platform is not available for this architecture, OS or compiler | ||
RuntimeNotAvailable = 2 # the runtime could not be initialised | ||
DevicesNotAvailable = 3 # there are no visible, usable devices |
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: 7 additions & 2 deletions
9
HeterogeneousCore/ROCmUtilities/bin/rocmIsEnabled_fallback.cpp
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,5 +1,10 @@ | ||
// C/C++ headers | ||
#include <cstdlib> | ||
|
||
// always returns EXIT_FAILURE | ||
int main() { return EXIT_FAILURE; } | ||
// CMSSW headers | ||
#include "HeterogeneousCore/Common/interface/PlatformStatus.h" | ||
|
||
int main() { | ||
// ROCm is not available on this architecture, OS and compiler combination | ||
return PlatformStatus::PlatformNotAvailable; | ||
} |