Mimic cuda assert output in span check. (#4762)

This commit is contained in:
Jiaming Yuan 2019-08-13 01:44:54 -04:00 committed by GitHub
parent c5b229632d
commit c0ffe65f5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,9 +74,12 @@ namespace common {
do { \ do { \
if (!(cond)) { \ if (!(cond)) { \
printf("\nKernel error:\n" \ printf("\nKernel error:\n" \
"In: %s, \tline: %d\n" \ "In: %s: %d\n" \
"\t%s\n\tExpecting: %s\n", \ "\t%s\n\tExpecting: %s\n" \
__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond); \ "\tBlock: [%d, %d, %d], Thread: [%d, %d, %d]\n\n", \
__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, \
blockIdx.x, blockIdx.y, blockIdx.z, \
threadIdx.x, threadIdx.y, threadIdx.z); \
asm("trap;"); \ asm("trap;"); \
} \ } \
} while (0); } while (0);