Commit 97d9ef5
authored
[hipDNN] Fix test failures in non-GPU environments by handling hipErrorNoDevice (#4426)
Tests were failing with error code 100 ("no ROCm-capable device is
detected") when run in environments without GPUs. This affected all
tests, not just GPU-specific ones, making it impossible to run the test
suite in non-GPU environments.
In non-GPU environments:
1. Any HIP API call triggers HIP runtime initialization
2. HIP detects no GPU and sets `hipErrorNoDevice` (error 100)
3. This error persists and cannot be cleared, even after calling
`hipGetLastError()`
4. The `HipErrorHandler` test listener checks for HIP errors after each
test
5. It detected this persistent error and failed all tests
Modified `HipErrorHandler::OnTestEnd()` to silently accept
`hipErrorNoDevice`:
- Check if the error is `hipErrorNoDevice` after calling
`hipGetLastError()`
- If true, return early without failing the test
- This allows tests to run in non-GPU environments1 parent d2fca53 commit 97d9ef5
File tree
1 file changed
+8
-0
lines changed- projects/hipdnn/test_sdk/include/hipdnn_test_sdk/utilities
1 file changed
+8
-0
lines changedLines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
| |||
0 commit comments