Check the HIP API calls status, and abort if != success.

Change-Id: Ifc38d8f28092ffdce1674a05a7886f7c0c97a885
Цей коміт міститься в:
Laurent Morichetti authored and Laurent Morichetti committed 2022-06-03 01:39:58 -04:00
1 джерело 1680d2c70e
коміт 4c6f249cc1
2 files changed
+27 -9

No files matched your search

+11 -2
Переглянути файл
@@ -22,10 +22,19 @@
#include "roctx.h"
#define HIP_CALL(call) \
do { \
hipError_t err = call; \
if (err != hipSuccess) { \
fprintf(stderr, "%s\n", hipGetErrorString(err)); \
abort(); \
} \
} while (0)
__global__ void kernel() {}
int main(int argc, char* argv[]) {
hipSetDevice(0);
HIP_CALL(hipSetDevice(0));
// Not in a roctx range.
kernel<<<1, 1>>>();
@@ -59,6 +68,6 @@ int main(int argc, char* argv[]) {
if (roctxRangePop() != 0) return -1;
hipDeviceSynchronize();
HIP_CALL(hipDeviceSynchronize());
return 0;
}