Skip to content

Commit 3070b95

Browse files
[SYCL] Update image accessor constructor (#5312)
Changed image_accessor() constructor from "= default" to user defined to make it possible to use const references in parallel_for.
1 parent d99e957 commit 3070b95

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

sycl/include/CL/sycl/accessor.hpp

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

495495
#ifdef __SYCL_DEVICE_ONLY__
496496
// Default constructor for objects later initialized with __init member.
497-
image_accessor() = default;
497+
image_accessor() : MImageObj() {}
498498
#endif
499499

500500
// Available only when: accessTarget == access::target::host_image
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s
2+
3+
// expected-no-diagnostics
4+
5+
#include <sycl/sycl.hpp>
6+
7+
SYCL_EXTERNAL void func() {
8+
const sycl::accessor<sycl::float4, 2, sycl::access::mode::read,
9+
sycl::access::target::image>
10+
x;
11+
}

0 commit comments

Comments
 (0)