Skip to content

Commit 6e64d84

Browse files
authored
Avoid callgraph recursion due to exception branch in get_global_id (#579)
1 parent ff726d0 commit 6e64d84

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/pocl/device/runtime.jl

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# reset the runtime cache from global scope, so that any change triggers recompilation
2+
GPUCompiler.reset_runtime()
3+
14
signal_exception() = return
25

36
malloc(sz) = C_NULL
@@ -7,23 +10,23 @@ report_oom(sz) = return
710
import SPIRVIntrinsics: get_global_id
811

912
function report_exception(ex)
10-
SPIRVIntrinsics.@printf(
11-
"ERROR: a %s was thrown during kernel execution on thread (%d, %d, %d).\n",
12-
ex, get_global_id(0), get_global_id(1), get_global_id(2)
13-
)
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+
# )
1417
return
1518
end
1619

1720
function report_exception_name(ex)
18-
SPIRVIntrinsics.@printf(
19-
"ERROR: a %s was thrown during kernel execution on thread (%d, %d, %d).\n",
20-
ex, get_global_id(0), get_global_id(1), get_global_id(2)
21-
)
22-
SPIRVIntrinsics.@printf("Stacktrace:\n")
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")
2326
return
2427
end
2528

2629
function report_exception_frame(idx, func, file, line)
27-
SPIRVIntrinsics.@printf(" [%d] %s at %s:%d\n", idx, func, file, line)
30+
# SPIRVIntrinsics.@printf(" [%d] %s at %s:%d\n", idx, func, file, line)
2831
return
2932
end

0 commit comments

Comments
 (0)