__kernel void my_kernel(const int number) {
const int col = get_global_id(0);
const int row = get_global_id(1);
if (col == 0 && row == 0) {
// if i remove the printf(...) statement the compilation succeedss
printf("number = %i\n", number);
}
// do more stuff ...
};
Notes:
If I remove the printf(...) statement, the compilation succeeds
I am trying to offline compile an OpenCL program to SPIRV, but the compilation is crashing.
I can reproduce with llvm from two different systems:
Ubuntu clang version 18.1.3 (++20240322073153+ef6d1ec07c69-1~exp1~20240322193300.86)
Both of these can reproduce the issue, but the attached logs are from the binaries in void linux
LOGS logs.tar.gz
Here is a simple reproducer:
clang -c -target spirv64 -o sample.spv kernel.clcpp
kernel.clcpp
:Notes:
printf(...)
statement, the compilation succeedskernel.clcpp
->kernel.cl
and runningclang -c -target spirv64 -o sample.spv kernel.cl
succeedsprintf(...)
and they compile successfully