Skip to content

[SYCL][Doc] Add FPGA properties to device global spec #4675

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 3 commits into from
Oct 19, 2021

Conversation

gmlueck
Copy link
Contributor

@gmlueck gmlueck commented Sep 30, 2021

Although these properties are intended mostly for FPGA users, there
is no prohibition against using them for other devices. Therefore,
we describe them in the main device global spec, rather than creating
a separate add-on spec for FPGA.

Although these properties are intended mostly for FPGA users, there
is no prohibition against using them for other devices.  Therefore,
we describe them in the main device global spec, rather than creating
a separate add-on spec for FPGA.
@gmlueck gmlueck requested a review from a team as a code owner September 30, 2021 14:24
@gmlueck
Copy link
Contributor Author

gmlueck commented Sep 30, 2021

@GarveyJoe: Could you review this PR from the FPGA side? In particular, I changed the wording of device_image_life considerably.

@rolandschulz @Pennycook: Could you review synopsis for the compile-time-constant properties? I think these are the first properties whose value is an enum, so it would be good to consider if we like the style I chose here. Also, we should consider which namespace contains the properties. I put all of the properties in the top of the extension namespace (::sycl::ext::oneapi), which follows #4280, however I wonder if that namespace will get too crowded. Should we define a sub-namespace like ::sycl::ext::oneapi::property?

@Pennycook
Copy link
Contributor

Pennycook commented Sep 30, 2021

Also, we should consider which namespace contains the properties. I put all of the properties in the top of the extension namespace (::sycl::ext::oneapi), which follows #4280, however I wonder if that namespace will get too crowded. Should we define a sub-namespace like ::sycl::ext::oneapi::property?

I'm not sure how I feel about this, but looking to ISO C++ for inspiration they've had no problems with a single top-level std:: namespace containing everything. Conversely, I feel like SYCL's use of nested namespaces confuses a lot of people -- it's not enough to remember what a class is called, you also have to remember where it lives.

I've listed the different options I see below, ordered by preference. Where I say sycl:: I mean "sycl:: for standard features, sycl::ext::oneapi:: for extensions".

  1. Everything in sycl:: namespace
  2. Properties designed to be general in sycl::, class-specific properties defined in the class itself
  3. Properties in sycl::property
  4. Properties in nested namespaces like sycl::property::class_name

Note that 1) requires long names to avoid clashes (e.g. sycl::device_global_visibility) while 2) allows for shorter names with an obvious connection to the class (e.g. sycl::device_global::visibility).

EDIT: To properly finish the thought... I view the (existing) kernel properties as being generally applicable -- we already have many dispatch functions that care about things like work-group size and sub-group size, and we'll be able to re-use sycl::work_group_size everywhere we a property to describe that concept. But it's hard to imagine any other class except sycl::device_global caring about whether it is allocated per device or per device image.

Copy link
Contributor

@keryell keryell left a comment

Choose a reason for hiding this comment

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

Always interesting to see more FPGA stuff.

@gmlueck
Copy link
Contributor Author

gmlueck commented Oct 1, 2021

I like the naming suggestions that @keryell and @Pennycook made. This would result in the following property names:

  • device_image_scope
  • host_access (with values: read, write, read_write, none)
  • init_mode (with the same values as before : reprogram, reset)
  • implement_in_csr (with the same values as before: true, false)

Any objections from the FPGA team: @GarveyJoe, @mohammadfawaz, @mkinsner ?

@mohammadfawaz
Copy link
Contributor

I like the naming suggestions that @keryell and @Pennycook made. This would result in the following property names:

  • device_image_scope
  • host_access (with values: read, write, read_write, none)
  • init_mode (with the same values as before : reprogram, reset)
  • implement_in_csr (with the same values as before: true, false)

Any objections from the FPGA team: @GarveyJoe, @mohammadfawaz, @mkinsner ?

The new names seem reasonable to me. I'll let @GarveyJoe and @mkinsner make the final call though.

Rename properties to address review comments.
@gmlueck
Copy link
Contributor Author

gmlueck commented Oct 1, 2021

The new names seem reasonable to me. I'll let @GarveyJoe and @mkinsner make the final call though.

I renamed the properties because I want the names in this PR to align with the names in the design doc I just submitted, and these proposed names seemed like the most likely outcome. I'm still happy to get feedback and alternatives from @GarveyJoe, @mkinsner, or anyone else, though. It's easy enough to update both PRs.

@GarveyJoe
Copy link
Contributor

device_image_scope and host_access both sound better to me than the old versions. And I'm also happy with init_mode so long as we agree that it's still clear that it affects how initialization happens and not when it happens. I think the text makes that clear.

@artemrad
Copy link
Contributor

artemrad commented Oct 5, 2021

I haven't read the Design Specification in full yet (it might get answered there), but wasn't there a need to template the copy operations on the instance of the device_global?

@gmlueck
Copy link
Contributor Author

gmlueck commented Oct 5, 2021

I haven't read the Design Specification in full yet (it might get answered there), but wasn't there a need to template the copy operations on the instance of the device_global?

@GarveyJoe proposed a solution that doesn't require this templating, and we decided that the API was nicer without the template parameter. The design doc describes how it works (see the section on integration header/footer).

GarveyJoe
GarveyJoe previously approved these changes Oct 12, 2021
@gmlueck
Copy link
Contributor Author

gmlueck commented Oct 18, 2021

Can I get an approval from someone on @intel/dpcpp-specification-reviewers? Maybe @Pennycook or @rolandschulz?

keryell
keryell previously approved these changes Oct 18, 2021
Pennycook
Pennycook previously approved these changes Oct 18, 2021
Clarify default behavior when `init_mode` or `implement_in_csr` are not
specified.
@gmlueck gmlueck dismissed stale reviews from Pennycook, keryell, and GarveyJoe via 539edbf October 19, 2021 16:38
@bader bader changed the title Add FPGA properties to device global spec [SYCL][Doc] Add FPGA properties to device global spec Oct 19, 2021
@bader bader added the spec extension All issues/PRs related to extensions specifications label Oct 19, 2021
@bader bader merged commit fd2bd6e into intel:sycl Oct 19, 2021
@gmlueck gmlueck deleted the gmlueck/device-global-props branch January 18, 2022 22:49
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.

7 participants