Skip to content

Commit ec12e08

Browse files
authored
Update 07-sycl-intro.md
1 parent 460377c commit ec12e08

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

docs/07-sycl-intro.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -60,31 +60,6 @@ lang: en
6060
- Nvidia GPUs (via CUDA), AMD GPUs (via ROCM)
6161

6262

63-
# Anatomy of a SYCL code
64-
65-
<small>
66-
```cpp
67-
#include <sycl/sycl.hpp>
68-
using namespace sycl;
69-
70-
template <typename T>
71-
void axpy(queue &q, const T &a, const std::vector<T> &x, std::vector<T> &y) {
72-
range<1> N{x.size()};
73-
buffer x_buf(x.data(), N);
74-
buffer y_buf(y.data(), N);
75-
76-
q.submit([&](handler &h) {
77-
auto x = x_buf.template get_access<access::mode::read>(h); // accessor x(x_buf, h, read_only);
78-
auto y = y_buf.template get_access<access::mode::read_write>(h); // accessor y(y_buf, h, read_write);
79-
80-
h.parallel_for(N, [=](id<1> i) {
81-
y[i] += a * x[i];
82-
});
83-
});
84-
q.wait_and_throw();
85-
}
86-
```
87-
</small>
8863

8964
# Summary
9065

0 commit comments

Comments
 (0)