@@ -10,23 +10,29 @@ report_oom(sz) = return
1010import SPIRVIntrinsics: get_global_id
1111
1212function report_exception (ex)
13- SPIRVIntrinsics. @printf (
14- " ERROR: a %s was thrown during kernel execution on thread (%d, %d, %d).\n " ,
15- ex, get_global_id (UInt32 (0 )), get_global_id (UInt32 (1 )), get_global_id (UInt32 (2 ))
16- )
13+ @static if VERSION < v " 1.12"
14+ SPIRVIntrinsics. @printf (
15+ " ERROR: a %s was thrown during kernel execution on thread (%d, %d, %d).\n " ,
16+ ex, get_global_id (UInt32 (1 )), get_global_id (UInt32 (2 )), get_global_id (UInt32 (3 ))
17+ )
18+ end
1719 return
1820end
1921
2022function report_exception_name (ex)
21- SPIRVIntrinsics. @printf (
22- " ERROR: a %s was thrown during kernel execution on thread (%d, %d, %d).\n " ,
23- ex, get_global_id (UInt32 (0 )), get_global_id (UInt32 (1 )), get_global_id (UInt32 (2 ))
24- )
25- SPIRVIntrinsics. @printf (" Stacktrace:\n " )
23+ @static if VERSION < v " 1.12"
24+ SPIRVIntrinsics. @printf (
25+ " ERROR: a %s was thrown during kernel execution on thread (%d, %d, %d).\n " ,
26+ ex, get_global_id (UInt32 (1 )), get_global_id (UInt32 (2 )), get_global_id (UInt32 (3 ))
27+ )
28+ SPIRVIntrinsics. @printf (" Stacktrace:\n " )
29+ end
2630 return
2731end
2832
2933function report_exception_frame (idx, func, file, line)
30- SPIRVIntrinsics. @printf (" [%d] %s at %s:%d\n " , idx, func, file, line)
34+ @static if VERSION < v " 1.12"
35+ SPIRVIntrinsics. @printf (" [%d] %s at %s:%d\n " , idx, func, file, line)
36+ end
3137 return
3238end
0 commit comments