Skip to content

[SYCL] Update image accessor constructor #5312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sycl/include/CL/sycl/accessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ class image_accessor

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

// Available only when: accessTarget == access::target::host_image
Expand Down
11 changes: 11 additions & 0 deletions sycl/test/check_device_code/const_ref_image_accessor.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s

// expected-no-diagnostics

#include <sycl/sycl.hpp>

SYCL_EXTERNAL void func() {
const sycl::accessor<sycl::float4, 2, sycl::access::mode::read,
sycl::access::target::image>
x;
}