Device side assert support

Este commit está contenido en:
Rahul Garg
2017-09-07 20:45:27 +05:30
padre cc08b36647
commit 40ff42e555
Se han modificado 2 ficheros con 3 adiciones y 1 borrados
+1 -1
Ver fichero
@@ -99,7 +99,7 @@ extern int HIP_TRACE_API;
// TODO-HCC add a dummy implementation of assert, need to replace with a proper kernel exit call.
#if __HIP_DEVICE_COMPILE__ == 1
#undef assert
#define assert(COND) { if (COND) {} }
#define assert(COND) { if (!COND) {abort();} }
#endif
+2
Ver fichero
@@ -111,6 +111,8 @@ kernelName<<<numblocks,numthreads,memperblock,streamId>>>(__VA_ARGS__);\
#ifdef __HIP_DEVICE_COMPILE__
#define abort() {asm("trap;");}
#undef assert
#define assert(COND) { if (!COND) {abort();} }
#endif
#endif