Skip to content

[SYCL] Deprecate get_access for host_accessor in SYCL2020 #8005

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
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
4 changes: 4 additions & 0 deletions sycl/include/sycl/buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,8 @@ class buffer : public detail::buffer_plain,
}

template <access::mode mode>
__SYCL2020_DEPRECATED("get_access for host_accessor is deprecated, please "
"use get_host_access instead")
accessor<T, dimensions, mode, access::target::host_buffer,
access::placeholder::false_t, ext::oneapi::accessor_property_list<>>
get_access(
Expand Down Expand Up @@ -531,6 +533,8 @@ class buffer : public detail::buffer_plain,
}

template <access::mode mode>
__SYCL2020_DEPRECATED("get_access for host_accessor is deprecated, please "
"use get_host_access instead")
accessor<T, dimensions, mode, access::target::host_buffer,
access::placeholder::false_t, ext::oneapi::accessor_property_list<>>
get_access(
Expand Down
11 changes: 11 additions & 0 deletions sycl/test/warnings/sycl_2020_deprecations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ int main() {
size_t BufferSize = Buffer.size();
// expected-warning@+1 {{'get_size' is deprecated: get_size() is deprecated, please use byte_size() instead}}
size_t BufferGetSize = Buffer.get_size();
{
// expected-warning@+2 {{'get_access' is deprecated: get_access for host_accessor is deprecated, please use get_host_access instead}}
// expected-warning@+1 {{'get_access<sycl::access::mode::read_write>' is deprecated: get_access for host_accessor is deprecated, please use get_host_access instead}}
auto acc = Buffer.get_access<sycl::access_mode::read_write>();
}
{
// expected-warning@+3 {{'get_access' is deprecated: get_access for host_accessor is deprecated, please use get_host_access instead}}
// expected-warning@+2 {{'get_access<sycl::access::mode::read_write>' is deprecated: get_access for host_accessor is deprecated, please use get_host_access instead}}
auto acc =
Buffer.get_access<sycl::access_mode::read_write>(sycl::range<1>(0));
}

sycl::vec<int, 2> Vec(1, 2);
// expected-warning@+1{{'get_count' is deprecated: get_count() is deprecated, please use size() instead}}
Expand Down