Skip to content

Commit cb3c395

Browse files
authored
Add introduction and final slides (#403)
* Updates for README and solutions * Fix formatting
1 parent 72e122f commit cb3c395

File tree

9 files changed

+324
-12
lines changed

9 files changed

+324
-12
lines changed
Loading
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<!DOCTYPE html>
2+
3+
<html>
4+
<head>
5+
<meta charset="utf-8">
6+
<link rel="stylesheet" href="../common-revealjs/css/reveal.css">
7+
<link rel="stylesheet" href="../common-revealjs/css/theme/white.css">
8+
<link rel="stylesheet" href="../common-revealjs/css/custom.css">
9+
<script>
10+
// This is needed when printing the slides to pdf
11+
var link = document.createElement( 'link' );
12+
link.rel = 'stylesheet';
13+
link.type = 'text/css';
14+
link.href = window.location.search.match( /print-pdf/gi ) ? '../common-revealjs/css/print/pdf.css' : '../common-revealjs/css/print/paper.css';
15+
document.getElementsByTagName( 'head' )[0].appendChild( link );
16+
</script>
17+
<script>
18+
// This is used to display the static images on each slide,
19+
// See global-images in this html file and custom.css
20+
(function() {
21+
if(window.addEventListener) {
22+
window.addEventListener('load', () => {
23+
let slides = document.getElementsByClassName("slide-background");
24+
25+
if (slides.length === 0) {
26+
slides = document.getElementsByClassName("pdf-page")
27+
}
28+
29+
// Insert global images on each slide
30+
for(let i = 0, max = slides.length; i < max; i++) {
31+
let cln = document.getElementById("global-images").cloneNode(true);
32+
cln.removeAttribute("id");
33+
slides[i].appendChild(cln);
34+
}
35+
36+
// Remove top level global images
37+
let elem = document.getElementById("global-images");
38+
elem.parentElement.removeChild(elem);
39+
}, false);
40+
}
41+
})();
42+
</script>
43+
44+
</head>
45+
<body>
46+
<div class="reveal">
47+
<div class="slides">
48+
<div id="global-images" class="global-images">
49+
<img src="../common-revealjs/images/sycl_academy.png" />
50+
<img src="../common-revealjs/images/sycl_logo.png" />
51+
<img src="../common-revealjs/images/trademarks.png" />
52+
</div>
53+
<!--Slide 1-->
54+
<section class="hbox" data-markdown>
55+
# Welcome! Please take a seat
56+
</section>
57+
<!--Slide 2-->
58+
<section class="hbox">
59+
<div class="hbox" data-markdown>
60+
## The ISC 25 Team
61+
</div>
62+
<div class="container">
63+
<div class="col" data-markdown>
64+
![SYCL](isc25-team.png "Your Tutorial Team")
65+
</div>
66+
</div>
67+
</section>
68+
<!--Slide 3-->
69+
<section class="hbox">
70+
<div class="hbox" data-markdown>
71+
## Schedule
72+
</div>
73+
<div class="container">
74+
<div class="col" data-markdown>
75+
![schedule](isc25-schedule.png "Schedule")
76+
</div>
77+
</div>
78+
</section>
79+
<!--Slide 4-->
80+
<section class="hbox">
81+
<div class="hbox" data-markdown>
82+
## Hands On Setup
83+
</div>
84+
<div class="container">
85+
<div class="col" data-markdown>
86+
![compiler-explorer](compiler-explorer.png "Compiler Explorer")
87+
</div>
88+
<div class="col" data-markdown>
89+
* To reduce setup effort we will use Compiler Explorer
90+
* There are links to the exercises and slides on the GitHub repo branch
91+
* We'll explain how to access this
92+
</div>
93+
</div>
94+
</section>
95+
</div>
96+
</div>
97+
<script src="../common-revealjs/js/reveal.js"></script>
98+
<script src="../common-revealjs/plugin/markdown/marked.js"></script>
99+
<script src="../common-revealjs/plugin/markdown/markdown.js"></script>
100+
<script src="../common-revealjs/plugin/notes/notes.js"></script>
101+
<script>
102+
Reveal.initialize({mouseWheel: true, defaultNotes: true});
103+
Reveal.configure({ slideNumber: true });
104+
</script>
105+
</body>
106+
</html>
Loading
Loading
Binary file not shown.
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
<!DOCTYPE html>
2+
3+
<html>
4+
<head>
5+
<meta charset="utf-8">
6+
<link rel="stylesheet" href="../common-revealjs/css/reveal.css">
7+
<link rel="stylesheet" href="../common-revealjs/css/theme/white.css">
8+
<link rel="stylesheet" href="../common-revealjs/css/custom.css">
9+
<script>
10+
// This is needed when printing the slides to pdf
11+
var link = document.createElement( 'link' );
12+
link.rel = 'stylesheet';
13+
link.type = 'text/css';
14+
link.href = window.location.search.match( /print-pdf/gi ) ? '../common-revealjs/css/print/pdf.css' : '../common-revealjs/css/print/paper.css';
15+
document.getElementsByTagName( 'head' )[0].appendChild( link );
16+
</script>
17+
<script>
18+
// This is used to display the static images on each slide,
19+
// See global-images in this html file and custom.css
20+
(function() {
21+
if(window.addEventListener) {
22+
window.addEventListener('load', () => {
23+
let slides = document.getElementsByClassName("slide-background");
24+
25+
if (slides.length === 0) {
26+
slides = document.getElementsByClassName("pdf-page")
27+
}
28+
29+
// Insert global images on each slide
30+
for(let i = 0, max = slides.length; i < max; i++) {
31+
let cln = document.getElementById("global-images").cloneNode(true);
32+
cln.removeAttribute("id");
33+
slides[i].appendChild(cln);
34+
}
35+
36+
// Remove top level global images
37+
let elem = document.getElementById("global-images");
38+
elem.parentElement.removeChild(elem);
39+
}, false);
40+
}
41+
})();
42+
</script>
43+
44+
</head>
45+
<body>
46+
<div class="reveal">
47+
<div class="slides">
48+
<div id="global-images" class="global-images">
49+
<img src="../common-revealjs/images/sycl_academy.png" />
50+
<img src="../common-revealjs/images/sycl_logo.png" />
51+
<img src="../common-revealjs/images/trademarks.png" />
52+
</div>
53+
<!--Slide 1-->
54+
<section class="hbox" data-markdown>
55+
# Summary
56+
</section>
57+
<!--Slide 2-->
58+
<section class="hbox">
59+
<div class="hbox" data-markdown>
60+
## 1. What is SYCL?
61+
</div>
62+
<div class="container">
63+
<div class="col" data-markdown>
64+
![SYCL](sycl_ecosystem.png "What is SYCL")
65+
</div>
66+
<div class="col" data-markdown>
67+
* Single source, high-level, standard C++ programming model,
68+
that can target a range of heterogeneous platforms
69+
* Provides high-level abstractions over common boilerplate code
70+
</div>
71+
</div>
72+
</section>
73+
<!--Slide 3-->
74+
<section class="hbox">
75+
<div class="hbox" data-markdown>
76+
## 2. Enqueueing a Kernel
77+
</div>
78+
<div class="container">
79+
<div class="col">
80+
<code><pre>
81+
class my_kernel;
82+
83+
queue deviceQueue;
84+
deviceQueue.submit([&](handler& cgh){
85+
86+
auto os = sycl::stream(1024, 128, cgh);
87+
88+
cgh.single_task&lt;my_kernel&gt;([=]() {
89+
os << "Hello world!\n";
90+
});
91+
}).wait();
92+
</code></pre>
93+
</div>
94+
<div class="col" data-markdown>
95+
* Series of commands are enqueued via command groups
96+
* Performed via `sycl::queue::submit`
97+
* Commands are scheduled for execution on a device
98+
* Kernels submitted as kernel functions, either as C++ lambdas or function objects
99+
* There are restrictions on kernel code because of device limitations
100+
* Can use a `sycl::stream` to write text on device
101+
</div>
102+
</div>
103+
</section>
104+
<!--Slide 4-->
105+
<section class="hbox">
106+
<div class="hbox" data-markdown>
107+
## 3. Managing Data
108+
</div>
109+
<div class="container">
110+
<div class="col">
111+
<code><pre>
112+
113+
class my_kernel;
114+
queue deviceQueue;
115+
116+
// Create a buffer and allocate USM memory
117+
buffer&lt;int&gt; user_buffer{range{128}};
118+
int* usm_ptr = malloc_device&lt;int&gt;(128, deviceQueue);
119+
120+
deviceQueue.submit([&](handler& cgh){
121+
// Request access to buffer
122+
accessor user_acc{user_buffer, cgh, write_only};
123+
124+
// USM pointer doesn't need to request access
125+
126+
cgh.single_task&lt;my_kernel&gt;([=]() {
127+
user_acc[0] = 1;
128+
usm_ptr[0] = 2;
129+
});
130+
}).wait();
131+
132+
</code></pre>
133+
</div>
134+
<div class="col" data-markdown>
135+
* Two models for managing data: Buffer/accessor model and Unified Shared Memory
136+
* SYCL separates the storage (buffer) and access of data (accessor)
137+
* Different types of accessor provide different ways to access data
138+
* In buffer/accessor model the scheduler takes care of data movement
139+
* Access modes specify how to access data (read/write/no_init)
140+
* USM memory can be allocated as host, device, or shared
141+
* USM requires manual operations
142+
</div>
143+
</div>
144+
</section>
145+
<!--Slide 5-->
146+
<section class="hbox">
147+
<div class="hbox" data-markdown>
148+
## 4. DATA PARALLELISM and ND-Range Kernels
149+
</div>
150+
<div class="container">
151+
<div class="col" data-markdown>
152+
![SYCL](../common-revealjs/images/ndrange.png "ND range")
153+
</div>
154+
<div class="col" data-markdown>
155+
* Task parallelism: Executes separate tasks simultaneously
156+
* Data parallelism: Performs the same task on multiple data elements
157+
* Work-items perform computation, execute independently (threads)
158+
* Work-items grouped into work-groups. Work-groups invoked within an ND-range. Work-items within a group can synchronize
159+
* Each work-item has private memory, can't access others'
160+
</div>
161+
</div>
162+
</section>
163+
<!--Slide 6-->
164+
<section class="hbox">
165+
<div class="hbox" data-markdown>
166+
## Further Resources
167+
</div>
168+
<div class="container">
169+
<div class="col" data-markdown>
170+
* The SYCL Academy "main" branch contains many more materials to learn from
171+
* You can follow the guides to install SYCL on your own machine or cluster
172+
* There is a free SYCL book that can be downloaded
173+
* The sycl.tech website has a SYCL playground and lots of videos and resources
174+
* You can find information about SYCL libraries for math and DNN to use alongside your SYCL code (see uxlfoundation.org or Google oneAPI)
175+
* Search for oneAPI to find Jupyter notebook exercises in SYCL and using the oneAPI libraries
176+
</div>
177+
</div>
178+
</section>
179+
</div>
180+
</div>
181+
<script src="../common-revealjs/js/reveal.js"></script>
182+
<script src="../common-revealjs/plugin/markdown/marked.js"></script>
183+
<script src="../common-revealjs/plugin/markdown/markdown.js"></script>
184+
<script src="../common-revealjs/plugin/notes/notes.js"></script>
185+
<script>
186+
Reveal.initialize({mouseWheel: true, defaultNotes: true});
187+
Reveal.configure({ slideNumber: true });
188+
</script>
189+
</body>
190+
</html>
Loading

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,42 @@ International" license.
1010
This specific branch of SYCL Academy is being used for ISC25 and contains a subset
1111
of the materials available in the main branch.
1212

13+
To clone this repository locally, use the following command:
14+
15+
`git clone --branch isc25 https://github.com/codeplaysoftware/syclacademy.git`
16+
17+
You can open the presentations by opening the index.html file in each folder under the "Lesson_Materials" folder.
18+
1319
## Lesson Curriculum
1420

1521
The SYCL Academy curriculum is divided up into a number of short lessons
1622
consisting of slides for presenting the material and a more detailed write-up,
1723
each accompanied by a tutorial for getting hands on experience with the subject
1824
matter. The code is available in both the repository and as a Compiler Explorer link.
1925

20-
| Lesson | Title | Slides | Exercise | Repository | CompilerExplorer |
21-
|--------|-------|--------|----------|------------|------------------|
22-
| 01 | A Fast Introduction to SYCL | [slides][lesson-1-slides] | [exercise][lesson-1-exercise] | [source][lesson-1-source] [solution][lesson-1-solution] | [source][lesson-1-CEsource] [solution][lesson-1-CEsolution] |
23-
| 02 | ND Range Kernels and Concepts | [slides][lesson-2-slides] | [exercise][lesson-2-exercise] | [source][lesson-2-source] [solution][lesson-2-solution] | [source][lesson-2-CEsource] [solution][lesson-2-CEsolution] |
24-
| 03 | Data Flow with SYCL | [slides][lesson-3-slides] | [exercise][lesson-3-exercise] | [source][lesson-3-source] [solution][lesson-3-solution] |
26+
| Lesson | Title | Slides | Exercise | Compiler Explorer Source |
27+
|--------|-------|--------|----------|--------------------------|
28+
| 01 | A Fast Introduction to SYCL | [slides][lesson-1-slides] | [exercise][lesson-1-exercise] | [source][lesson-1-CEsource] |
29+
| 02 | ND Range Kernels and Concepts | [slides][lesson-2-slides] | [exercise][lesson-2-exercise] | [source][lesson-2-CEsource] |
30+
| 03 | Data Flow with SYCL | [slides][lesson-3-slides] | [exercise][lesson-3-exercise] | [source][lesson-3-CEsource] |
2531
| 04 | Recap and Further Learning | [slides][lesson-4-slides] | NA | NA |
2632

33+
If you really need to look at the solutions for the exercises go to [this page][isc25-solutions].
34+
2735
[lesson-1-slides]: ./Lesson_Materials/Fast_Track/
2836
[lesson-1-exercise]: ./Code_Exercises/Asynchronous_Execution/README.md
2937
[lesson-1-source]: ./Code_Exercises/Asynchronous_Execution/source.cpp
30-
[lesson-1-solution]: ./Code_Exercises/Asynchronous_Execution/solution.cpp
3138
[lesson-1-CEsource]: https://godbolt.org/z/Mxb5zj6zW
32-
[lesson-1-CEsolution]: https://godbolt.org/z/Knn4ef9b4
33-
3439

3540
[lesson-2-slides]: ./Lesson_Materials/Data_Parallelism/
3641
[lesson-2-exercise]: ./Code_Exercises/Data_Parallelism/README.md
3742
[lesson-2-source]: ./Code_Exercises/Data_Parallelism/source.cpp
38-
[lesson-2-solution]: ./Code_Exercises/Data_Parallelism/solution.cpp
3943
[lesson-2-CEsource]: https://godbolt.org/z/rWEee49rP
40-
[lesson-2-CEsolution]: https://godbolt.org/z/TeY38q9vh
4144

4245
[lesson-3-slides]: ./Lesson_Materials/Data_and_Dependencies/
4346
[lesson-3-exercise]: ./Code_Exercises/Data_and_Dependencies/README.md
4447
[lesson-3-source]: ./Code_Exercises/Data_and_Dependencies/source.cpp
45-
[lesson-3-solution]: ./Code_Exercises/Data_and_Dependencies/solution.cpp
4648
[lesson-3-CEsource]: https://godbolt.org/z/ajErrMccv
47-
[lesson-3-CEsolution]: https://godbolt.org/z/djc7zK9bG
4849

4950
[lesson-4-slides]: ./Lesson_Materials/Recap_and_Further_Learning/
51+
[isc25-solutions]: ./Solutions/solutions.md

Solutions/solutions.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SYCL Academy @ ISC25 Solutions
2+
3+
If you are stuck, here is a list of the solution source files for the exercises, loaded into Compiler Explorer.
4+
5+
6+
| Lesson | Title | Compiler Explorer Solution |
7+
|--------|-------|----------------------------|
8+
| 01 | A Fast Introduction to SYCL | [solution][lesson-1-CEsolution] |
9+
| 02 | ND Range Kernels and Concepts | [solution][lesson-2-CEsolution] |
10+
| 03 | Data Flow with SYCL | [solution][lesson-3-CEsolution] |
11+
12+
[lesson-1-CEsolution]: https://godbolt.org/z/Knn4ef9b4
13+
[lesson-2-CEsolution]: https://godbolt.org/z/TeY38q9vh
14+
[lesson-3-CEsolution]: https://godbolt.org/z/djc7zK9bG

0 commit comments

Comments
 (0)