Skip to content

Commit 8acff55

Browse files
committed
Map unknown exit codes to PlatformStatus.PlatformNotAvailable
For example, if the system does not have libdrm.so.2 installed, then rocmIsEnabled exits with code 127 because of "error while loading shared libraries: libdrm.so.2: cannot open shared object file: No such file or directory" which leads to a Python error "ValueError: 127 is not a valid PlatformStatus"
1 parent 54a31a8 commit 8acff55

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

HeterogeneousCore/Common/python/PlatformStatus.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ class PlatformStatus(enum.IntEnum):
77
PlatformNotAvailable = 1 # the platform is not available for this architecture, OS or compiler
88
RuntimeNotAvailable = 2 # the runtime could not be initialised
99
DevicesNotAvailable = 3 # there are no visible, usable devices
10+
11+
@classmethod
12+
def _missing_(cls, value):
13+
return cls.PlatformNotAvailable

0 commit comments

Comments
 (0)