You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clang is generating spirv with function calls which should be treated as builtins.
This is only occurring when using the C++ for OpenCL mode
kernel.cl:
// this sample doesn't use any C++ for OpenCL features__kernelvoidsample(write_onlyimage2d_timg) {
constintcol=get_global_id(0);
constintrow=get_global_id(1);
int2coord;
coord.x=col;
coord.y=row;
float4px= {0, 0, 0, 1};
write_imagef(img, coord, px);
}
clang is generating spirv with function calls which should be treated as builtins.
This is only occurring when using the C++ for OpenCL mode
kernel.cl:
When compiling with
-cl-std=clc++
When I examine
sample_cpp.spv
withspirv-dis
I see:OpFunctionCall %ulong %_Z13get_global_idj %uint_0
OpFunctionCall %void %_Z12write_imagef14ocl_image2d_woDv2_iDv4_f %19 %29 %32
This appears to be incorrect.
When i repeat the same process but without the
-cl-std=clc++
flag:I get no errors.
Examining the spirv output, I see the expected output in the spirv:
%21 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId Aligned 32
OpImageWrite %19 %28 %18
I have tried this with multiple versions of clang, and it happens with clang>=19. It does not occur with clang18
clang version 20.0.0git 14a259f
The text was updated successfully, but these errors were encountered: