Skip to content

Commit 4727d87

Browse files
author
Hugh Delaney
committed
Responding to comments
1 parent 4b9148f commit 4727d87

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

Code_Exercises/Exercise_03_Scalar_Add/source.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
* ~~~~~~~~~~~~~~~~~~~~
1212
*
1313
* // Include SYCL header
14+
* #if __has_include(<SYCL/sycl.hpp>)
15+
* #include <SYCL/sycl.hpp>
16+
* #else
1417
* #include <CL/sycl.hpp>
18+
* #endif
1519
*
1620
* // Default construct a queue
1721
* auto q = sycl::queue{};

Lesson_Materials/Lecture_03_Managing_Data/index.html

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
</div>
6969
<div class="container" data-markdown>
7070
* In SYCL there are two models for managing data:
71-
* The buffer/accessor model.
72-
* The USM (unified shared memory) model.
71+
* The buffer/accessor model.
72+
* The USM (unified shared memory) model.
7373
* Which model you choose can have an effect on how you enqueue kernel functions.
7474
</div>
7575
</section>
@@ -81,12 +81,11 @@
8181
</div>
8282
<div class="container" data-markdown>
8383
* A GPU has its own memory, separate to CPU memory.
84-
* In order for the GPU to use memory from the CPU we need to:
85-
* Allocate memory on the GPU.
86-
* Memcpy data from the CPU to the allocation on the GPU.
87-
* Perform some computation on the GPU.
88-
* Memcpy the result back to CPU.
89-
84+
* In order for the GPU to use memory from the CPU, the following actions must take place (either explicitly or implicitly):
85+
* Memory allocation on the GPU.
86+
* Data migration from the CPU to the allocation on the GPU.
87+
* Some computation on the GPU.
88+
* Migration of the result back to the CPU.
9089
</div>
9190
<img src="../common-revealjs/images/gpu_cpu_memory.png" height="400">
9291
</section>
@@ -398,7 +397,7 @@
398397
auto accA = sycl::accessor{bufA, cgh, sycl::read_only};
399398
auto accB = sycl::accessor{bufA, cgh, sycl::no_init};
400399

401-
cgh.single_task(...); // Do some work
400+
cgh.single_task&lt;mykernel&gt;(...); // Do some work
402401
});
403402

404403
} // var updated here
@@ -423,7 +422,7 @@
423422
auto inA = sycl::accessor{bufA, cgh, sycl::read_only};
424423
auto inB = sycl::accessor{bufB, cgh, sycl::read_only};
425424
auto out = sycl::accessor{bufO, cgh, sycl::write_only};
426-
cgh.single_task([=]{
425+
cgh.single_task&lt;mykernel&gt;([=]{
427426
<mark>out[0] = inA[0] + inB[0];</mark>
428427
});
429428
});

0 commit comments

Comments
 (0)