Skip to content

Commit dfd64b6

Browse files
authored
[SYCL] Don't zero-initialize MImageObj in 1.2.1 image (#12012)
image_accessor constructor was generating following IR in O0 mode: ``` store target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0) zeroinitializer, ptr addrspace(4) %MImageObj, align 8 ``` As a target extension type, spirv.Image currently allows zeroinit. However, OpConstantNull in spirv spec doesn't allow image type. Therefore, we're not able to get sycl 1.2.1 image working in O0 mode. This PR solves the issue by not initializing MImageObj.
1 parent 1580c39 commit dfd64b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sycl/include/sycl/accessor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ class image_accessor
924924

925925
#ifdef __SYCL_DEVICE_ONLY__
926926
// Default constructor for objects later initialized with __init member.
927-
image_accessor() : MImageObj() {}
927+
image_accessor() {}
928928
#endif
929929

930930
// Available only when: accessTarget == access::target::host_image

0 commit comments

Comments
 (0)