Skip to content

Commit

Permalink
[SYCL] Don't zero-initialize MImageObj in 1.2.1 image (#12012)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wenju-he authored Nov 30, 2023
1 parent 1580c39 commit dfd64b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sycl/include/sycl/accessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ class image_accessor

#ifdef __SYCL_DEVICE_ONLY__
// Default constructor for objects later initialized with __init member.
image_accessor() : MImageObj() {}
image_accessor() {}
#endif

// Available only when: accessTarget == access::target::host_image
Expand Down

0 comments on commit dfd64b6

Please sign in to comment.