Skip to content

Fix row-col major slides & add info on vec types #150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 68 additions & 28 deletions Lesson_Materials/Lecture_16_Coalesced_Global_Memory/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
#### Row-major vs Column-major
</div>
<div class="container" data-markdown>
* Coalescing global memory access is particularly important when wording in multiple dimensions.
* Coalescing global memory access is particularly important when working in multiple dimensions.
* This is because when doing so you have to convert from a position in 2d space to a linear memory space.
* There are two ways to do this; generally referred to as row-major and column-major.
</div>
Expand All @@ -148,44 +148,22 @@
<div class="hbox" data-markdown>
#### Row-major vs Column-major
</div>
<div class="container" data-markdown>
![SYCL](./row_major_column_major_1.png "SYCL")
</div>
</section>
<!--Slide 12-->
<section>
<div class="hbox" data-markdown>
#### Row-major vs Column-major
</div>
<div class="container" data-markdown>
![SYCL](./row_major_column_major_2.png "SYCL")
</div>
</section>
<!--Slide 13-->
<section>
<div class="hbox" data-markdown>
#### Row-major vs Column-major
</div>
<div class="container" data-markdown>
![SYCL](./row_major_column_major_3.png "SYCL")
![SYCL](./row_col_1.png "SYCL")
</div>
</section>
<!--Slide 14-->
<!--Slide 12-->
<section>
<div class="hbox" data-markdown>
#### Row-major vs Column-major
</div>
<div class="container" data-markdown>
![SYCL](./row_major_column_major_4.png "SYCL")
![SYCL](./row_col_2.png "SYCL")
</div>
</section>
<!--Slide 15-->
<!--Slide 13-->
<section>
<div class="hbox" data-markdown>
#### Row-major vs Column-major
</div>
<div class="container" data-markdown>
![SYCL](./row_major_column_major_5.png "SYCL")
![SYCL](./row_col_3.png "SYCL")
</div>
</section>
<!--Slide 16-->
Expand Down Expand Up @@ -299,6 +277,68 @@
</div>
</section>
<!--Slide 28-->
<section>
<div class="hbox" data-markdown>
#### Vec types
</div>
<div class="container">
<code class="code-100pc"><pre>
auto f4 = sycl::float4{1.0f, 2.0f, 3.0f, 4.0f}; // {1.0f, 2.0f, 3.0f, 4.0f}
</code></pre>
</div>
<div class="container">
<code class="code-100pc"><pre>
auto f2 = sycl::float2{2.0f, 3.0f}; // {2.0f, 3.0f}
auto f4 = sycl::float4{1.0f, f2, 4.0f}; // {1.0f, 2.0f, 3.0f, 4.0f}
</code></pre>
</div>
<div class="container">
<code class="code-100pc"><pre>
auto f4 = sycl::float4{0.0f}; // {0.0f, 0.0f, 0.0f, 0.0f}
</code></pre>
</div>
<div class="container" data-markdown>
* A `vec` can be constructed with any combination of scalar and vector values which add up to the correct number of elements.
* A `vec` can also be constructed from a single scalar in which case it will initialize every element to that value.
</div>
</section>
<!--Slide 11-->
<section>
<div class="hbox" data-markdown>
#### Vec operators
</div>
<div class="container">
<code class="code-100pc"><pre>
auto f4a = sycl::float4{1.0f, 2.0f, 3.0f, 4.0f}; // {1.0f, 2.0f, 3.0f, 4.0f}

auto f4b = sycl::float4{2.0f}; // {2.0f, 2.0f, 2.0f, 2.0f}

auto f4r = f4a * f4b; // {2.0f, 4.0f, 6.0f, 8.0f}
</code></pre>
</div>
<div class="container" data-markdown>
* The `vec` class provides a number of operators such as `+`, `-`, `*`, `/` and many more, which perform the operation elemeent-wise.
</div>
</section>
<section>
<div class="hbox" data-markdown>
#### Vec sizes
</div>
<div class="container">
<code class="code-100pc"><pre>
sycl::int2
sycl::int3 (N.B sizeof(int3) == sizeof(int4))
sycl::int4
sycl::int8
sycl::int16</code></pre>
</div>
<div class="container" data-markdown>
* Vectors can be made from all char, integer or floating point types.
* Using vector types:
* Can make code more readable
* Can give better memory access patterns.
</div>
</section>
<section>
<div class="hbox" data-markdown>
## Questions
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.