From dfd64b6cb3d4ce3d02e3cffa963bbc06fb4b355c Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu, 30 Nov 2023 23:53:50 +0800 Subject: [PATCH] [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. --- sycl/include/sycl/accessor.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/include/sycl/accessor.hpp b/sycl/include/sycl/accessor.hpp index b807f27f44d2a..51d3172e33e5b 100644 --- a/sycl/include/sycl/accessor.hpp +++ b/sycl/include/sycl/accessor.hpp @@ -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