diff --git a/sycl/doc/extensions/supported/sycl_ext_oneapi_accessor_properties.asciidoc b/sycl/doc/extensions/supported/sycl_ext_oneapi_accessor_properties.asciidoc index 57be57150514f..3d6b43bbb6239 100644 --- a/sycl/doc/extensions/supported/sycl_ext_oneapi_accessor_properties.asciidoc +++ b/sycl/doc/extensions/supported/sycl_ext_oneapi_accessor_properties.asciidoc @@ -335,6 +335,20 @@ class accessor { ... ``` +The `handler::require` function is modified to reflect this type change: + +```c++ +namespace sycl { +class handler { +public: + template + void require(accessor acc); +}; +} // namespace sycl +``` + Modify the code listing to add variants of all the accessor constructors that take a property_list that instead take an accessor_property_list: diff --git a/sycl/include/sycl/handler.hpp b/sycl/include/sycl/handler.hpp index bd91b9dc755ec..755e6573c25c0 100644 --- a/sycl/include/sycl/handler.hpp +++ b/sycl/include/sycl/handler.hpp @@ -1586,8 +1586,11 @@ class __SYCL_EXPORT handler { /// /// \param Acc is a SYCL accessor describing required memory region. template - void require(accessor Acc) { + access::target AccTarget, access::placeholder isPlaceholder, + typename propertyListT> + void require( + accessor + Acc) { if (Acc.is_placeholder()) associateWithHandler(&Acc, AccTarget); } diff --git a/sycl/test-e2e/Basic/accessor/accessor_property_list_placeholder.cpp b/sycl/test-e2e/Basic/accessor/accessor_property_list_placeholder.cpp new file mode 100644 index 0000000000000..d4abf844cfa19 --- /dev/null +++ b/sycl/test-e2e/Basic/accessor/accessor_property_list_placeholder.cpp @@ -0,0 +1,22 @@ +// RUN: %{build} -o %t.out +// RUN: %{run} %t.out + +#include + +constexpr int Val = 42; + +int main() { + sycl::queue Q; + int OutVal = 0; + { + sycl::buffer Buffer(&OutVal, sycl::range{1}); + sycl::accessor Acc(Buffer, sycl::ext::oneapi::accessor_property_list{ + sycl::ext::oneapi::no_alias}); + Q.submit([&](sycl::handler &CGH) { + CGH.require(Acc); + CGH.single_task([=]() { Acc[0] = Val; }); + }); + } + assert(OutVal == Val); + return 0; +}