diff --git a/src/device/runtime.jl b/src/device/runtime.jl index b2a78a29..76309f31 100644 --- a/src/device/runtime.jl +++ b/src/device/runtime.jl @@ -7,8 +7,23 @@ malloc(sz) = C_NULL report_oom(sz) = return -report_exception(ex) = return +function report_exception(ex) + @printf( + "ERROR: a %s was thrown during kernel execution on thread (%d, %d, %d).\n", + ex, get_global_id(UInt32(0)), get_global_id(UInt32(1)), get_global_id(UInt32(2)) + ) + return +end -report_exception_name(ex) = return +function report_exception_name(ex) + @printf( + "ERROR: a %s was thrown during kernel execution on thread (%d, %d, %d).\nStacktrace:\n", + ex, get_global_id(UInt32(0)), get_global_id(UInt32(1)), get_global_id(UInt32(2)) + ) + return +end -report_exception_frame(idx, func, file, line) = return +function report_exception_frame(idx, func, file, line) + @printf(" [%d] %s at %s:%d\n", idx, func, file, line) + return +end