Fix test errors
Check the HIP API calls status, and abort if != success. Change-Id: Ifc38d8f28092ffdce1674a05a7886f7c0c97a885
This commit is contained in:
committed by
Laurent Morichetti
parent
1680d2c70e
commit
4c6f249cc1
+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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user