Merge pull request #175 from gargrahul/assert_support

Device side assert support

[ROCm/clr commit: 096caca840]
This commit is contained in:
Maneesh Gupta
2017-09-14 16:08:00 +05:30
کامیت شده توسط GitHub
کامیت bb818d9c74
2فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
@@ -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
@@ -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