Skip to content

[SYCL][Doc] Add named sub-group sizes extension #5714

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 9 commits into from
Mar 5, 2022

Conversation

Pennycook
Copy link
Contributor

This extension aims to simplify the process of using sub-groups by
introducing the notion of named sub-group sizes, allowing developers
to request a sub-group size that meets certain requirements at host
compile-time and deferring the selection of a specific sub-group size
until the kernel is compiled for a specific device.

Signed-off-by: John Pennycook [email protected]

This extension aims to simplify the process of using sub-groups by
introducing the notion of named sub-group sizes, allowing developers
to request a sub-group size that meets certain requirements at host
compile-time and deferring the selection of a specific sub-group size
until the kernel is compiled for a specific device.

Signed-off-by: John Pennycook <[email protected]>
@Pennycook Pennycook added the spec extension All issues/PRs related to extensions specifications label Mar 2, 2022
@Pennycook Pennycook requested a review from a team as a code owner March 2, 2022 22:38
Misunderstood the directory structure. This shouldn't be in
"experimental" yet, because it isn't implemented.
enum named_sub_group_size : uint32_t {
primary = /* implementation-defined */,
automatic = /* implementation-defined */,
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Because this is an unscoped enum, the names primary and automatic are also in the sycl::ext::oneapi::experimental namespace. I suspect that was not your intent? Unfortunately, you cannot just make this a scoped enum because then the type of primary and automatic are no longer implicitly convertible to uint32_t. Maybe this is better?

static constexpr uint32_t named_sub_group_primary = /*unspecified*/;
static constexpr uint32_t named_sub_group_automatic = /*unspecified*/;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, you're right... I avoided making it a scoped enum precisely because of the uint32_t issue.

What about:

struct named_sub_group_size {
  static constexpr uint32_t primary = /* unspecified */;
  static constexpr uint32_t automatic = /* unspecified */;
};

I don't have a strong preference here, just floating this idea because I think it would allow the same syntax (named_sub_group_size::primary).

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that looks good too. I don't have a strong preference between the two styles.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've gone with the struct approach in 23cca73, simply because it meant changing fewer lines.

I'd be happy to revisit this later.

units together.


=== Compiler flags
Copy link
Contributor

Choose a reason for hiding this comment

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

This should not be a normative section of the specification. Other implementations should be allowed to choose their own command line switches. Maybe retitle the section "DPC++ compiler flags" and start with these sentences:

This non-normative section describes command line flags that the DPC++ compiler supports. Other compilers are free to provide their own command line flags (if any).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in b2585f5.

specification are implemented in {dpcpp}, but they are not finalized and may
change incompatibly in future versions of {dpcpp} without prior notice.
*Shipping software products should not rely on APIs defined in this
specification.*
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be updated to the "proposed" language from the template.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in ee068fa.

@bader bader merged commit 4f3d7e1 into intel:sycl Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec extension All issues/PRs related to extensions specifications
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants