Skip to content

Commit 59f157d

Browse files
Use mode deduction tags
1 parent 686c92e commit 59f157d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

documentation/library_guide/api_for_sycl_kernels/tested_standard_cpp_api.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Below is an example code that shows how to use ``oneapi::dpl::swap`` in SYCL dev
1818
#include <sycl/sycl.hpp>
1919
#include <iostream>
2020
#include <cstdint>
21-
2221
int main()
2322
{
2423
sycl::queue queue;
@@ -27,16 +26,17 @@ Below is an example code that shows how to use ``oneapi::dpl::swap`` in SYCL dev
2726
std::cout << "Initial data: " << data[0] << ", " << data[1] << std::endl;
2827
sycl::buffer<std::uint32_t> buffer(data, size);
2928
queue.submit([&](sycl::handler& cgh) {
30-
auto access = buffer.template get_access<sycl::access::mode::read_write>(cgh);
29+
auto access = buffer.get_access(cgh, sycl::read_write);
3130
cgh.single_task<class KernelSwap>([=]() {
3231
oneapi::dpl::swap(access[0], access[1]);
3332
});
3433
}).wait();
35-
auto host_access = buffer.template get_access<sycl::access::mode::read>();
34+
auto host_access = buffer.get_host_access(sycl::read_only);
3635
std::cout << "After swap: " << host_access[0] << ", " << host_access[1] << std::endl;
3736
return 0;
3837
}
3938
39+
4040
Use the following command to build and run the program (assuming it resides in the ``kernel_swap.cpp file``):
4141

4242
.. code:: cpp

0 commit comments

Comments
 (0)