Skip to content

Conversation

@EwanC
Copy link
Contributor

@EwanC EwanC commented Jan 16, 2026

The slides on "Coalesced Global Memory" have 3 slides of content at the end on vectors, 2 of which are duplicates of content in the following "Vectors" lesson (see slides 10 & 11 in vectors lesson)

This PR removes those slides from the coalesced lesson, as it's out of scope, and adds the non-duplicate slide "Vector Types" to the vector lesson. As well as updating a couple of typos in the "Vectors" lesson.

The slides on "Coalesced Global Memory" have 3 slides of content at the
end on vectors, 2 of which are duplicates of content in the following "Vectors" lesson.
See slides 10 & 11 in vectors lesson.

This PR removes those slides from the coalesced lesson, and adds the
non-duplicate slide "Vector Types" to the vector lesson. As well as updating a
couple of typos in the "Vectors" lesson.
<div class="container">
<code class="code-100pc"><pre>
sycl::int2
sycl::int3 (N.B sizeof(int3) == sizeof(int4))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: Is it actually guaranteed that sizeof(int3) == sizeof(int4)? As far as I know, the SYCL spec only says that the alignment must be the same. I agree that in many cases sizes will also be the same due to padding, but I'm not sure if the C++ standard guarantees this (?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment, there was also a bullet in a previous slide which said this. I don't think we need to say something that may be controversial if we can avoid it. So I've removed this parenthesis note in the code snippet and moved the bullet point from the previous slide here but alignment say alignment

Digging in the spec for more references to this, https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#memory-layout-and-alignment is indeed all about alignment. vec::byte_size() has some wording about size, but I don't think it's fair to infer about a sizeof() C++ operator from that.

* 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should mention: contrary to its name, it does not guarantee vectorization, and SYCL will implementations will typically implement vec in non-vectorized fashion because often vectorization already is done across work items?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an interesting point, there's an earlier slide on "Horizontal vs vertical vectorization" which touches more on this kind of relationship, i've added a bullet point on this in there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants