From 933007a341602b40897ae30a7e1a2c590c55cb56 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Mon, 27 Nov 2023 20:36:25 +0800 Subject: [PATCH] [SYCL] Don't zero-initialize MImageObj in 1.2.1 image image_accessor constructor was generating following IR in O0 mode: ``` store target("spirv.Image", void, 0, 0, 0, 0, 0, 0, 1) zeroinitializer, ptr %0, align 8 ``` As a target extension type, spirv.Image currently allows zeroinit. However, OpConstantNull in spirv spec doesn't allows 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 cd36b740d939d..f74fef4e412b4 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