Skip to content

Commit a2dfaf8

Browse files
committed
Replace get_access w/ accessor ctor in slides
1 parent dfeb909 commit a2dfaf8

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

Lesson_Materials/Lecture_10_Data_and_Dependencies/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
});
158158

159159
gpuQueue.submit([&](sycl::handler &cgh) {
160-
auto acc = buf.get_access(cgh);
160+
sycl::accessor acc{buf, cgh};
161161

162162
cgh.parallel_for<kernel_b>(sycl::range{1024},
163163
[=](sycl::id<1> idx) {
@@ -195,7 +195,7 @@
195195
});
196196

197197
gpuQueue.submit([&](sycl::handler &cgh) {
198-
auto acc = buf.get_access(cgh);
198+
sycl::accessor acc {buf, cgh};
199199

200200
cgh.parallel_for<kernel_b>(sycl::range{1024},
201201
[=](sycl::id<1> idx) {
@@ -225,7 +225,7 @@
225225
sycl::buffer buf {data, sycl::range{1024}};
226226

227227
gpuQueue.submit([&](sycl::handler &cgh) {
228-
<mark>sycl::accessor acc {buf, cgh};</mark>
228+
<mark>sycl::accessor acc{buf, cgh};</mark>
229229

230230
cgh.parallel_for&lt;my_kernel&gt;(sycl::range{1024},
231231
[=](sycl::id&lt;1&gt; idx) {
@@ -234,7 +234,7 @@
234234
});
235235

236236
gpuQueue.submit([&](sycl::handler &cgh) {
237-
<mark>auto acc = buf.get_access(cgh);</mark>
237+
<mark>sycl::accessor acc{buf, cgh};</mark>
238238

239239
cgh.parallel_for&lt;my_kernel&gt;(sycl::range{1024},
240240
[=](sycl::id&lt;1&gt; idx) {
@@ -272,7 +272,7 @@
272272
});
273273

274274
gpuQueue.submit([&](sycl::handler &cgh) {
275-
auto acc = buf.get_access(<mark>cgh</mark>);
275+
sycl::accessor acc {buf, <mark>cgh</mark>};
276276

277277
cgh.parallel_for&lt;my_kernel&gt;(sycl::range{1024},
278278
[=](sycl::id&lt;1&gt; idx) {
@@ -424,7 +424,7 @@
424424
sycl::buffer bufB {dataB, sycl::range{1024}};
425425

426426
gpuQueue.submit([&](sycl::handler &cgh) {
427-
<mark>auto accA = bufA.get_access(cgh);</mark>
427+
<mark>sycl::accessor accA {bufA, cgh};</mark>
428428

429429
cgh.parallel_for&lt;kernel_a&gt;(sycl::range{1024},
430430
[=](sycl::id&lt;1&gt; idx) {
@@ -433,7 +433,7 @@
433433
});
434434

435435
gpuQueue.submit([&](sycl::handler &cgh) {
436-
<mark>auto accB = bufB.get_access(cgh);</mark>
436+
<mark>sycl::accessor accB {bufB, cgh};</mark>
437437

438438
cgh.parallel_for&lt;kernel_b&gt;(sycl::range{1024},
439439
[=](sycl::id&lt;1&gt; idx) {

Lesson_Materials/Lecture_11_In_Order_Queue/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
buf = sycl::buffer(data, sycl::range{1024});
122122

123123
inOrderQueue.submit([&](sycl::handler &cgh){
124-
auto acc = buf.get_access(cgh);
124+
sycl::accessor acc{buf, cgh};
125125

126126
cgh.parallel_for&lt;kernel_a&gt;(sycl::range{1024},
127127
[=](sycl::id&lt;1&gt; idx){
@@ -130,7 +130,7 @@
130130
});
131131

132132
inOrderQueue.submit([&](sycl::handler &cgh){
133-
auto acc = buf.get_access(cgh);
133+
sycl::accessor acc{buf, cgh};
134134

135135
cgh.parallel_for&lt;kernel_b&gt;(sycl::range{1024},
136136
[=](sycl::id&lt;1&gt; idx){

Lesson_Materials/Lecture_14_ND_Range_Kernel/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,9 @@
346346
buffer&ltfloat, 1&gt bufO(dO.data(), range&lt1&gt(dO.size()));
347347

348348
gpuQueue.submit([&](handler &cgh){
349-
auto inA = bufA.get_access&ltaccess::mode::read&gt(cgh);
350-
auto inB = bufB.get_access&ltaccess::mode::read&gt(cgh);
351-
auto out = bufO.get_access&ltaccess::mode::write&gt(cgh);
349+
sycl::accessor inA{bufA, cgh, sycl::read_only};
350+
sycl::accessor inB{bufB, cgh, sycl::read_only};
351+
sycl::accessor out{bufO, cgh, sycl::write_only};
352352
cgh.parallel_for&ltadd&gt(range&lt1&gt(dA.size()),
353353
[=](id&lt1&gt i){
354354
<mark>out[i] = inA[i] + inB[i];</mark>
@@ -376,9 +376,9 @@
376376
buffer&ltfloat, 1&gt bufO(dO.data(), range&lt1&gt(dO.size()));
377377

378378
gpuQueue.submit([&](handler &cgh){
379-
auto inA = bufA.get_access&ltaccess::mode::read&gt(cgh);
380-
auto inB = bufB.get_access&ltaccess::mode::read&gt(cgh);
381-
auto out = bufO.get_access&ltaccess::mode::write&gt(cgh);
379+
sycl::accessor inA{bufA, cgh, sycl::read_only};
380+
sycl::accessor inB{bufB, cgh, sycl::read_only};
381+
sycl::accessor out{bufO, cgh, sycl::write_only};
382382
cgh.parallel_for&ltadd&gt(rng, [=](id&lt3&gt i){
383383
<mark>auto ptrA = inA.get_pointer();</mark>
384384
<mark>auto ptrB = inB.get_pointer();</mark>

0 commit comments

Comments
 (0)