Skip to content

[SYCL] Add new spellings for SYCL FPGA attributes #2568

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 16 commits into from
Oct 8, 2020

Conversation

smanna12
Copy link
Contributor

@smanna12 smanna12 commented Sep 29, 2020

Currently, there is a mismatch between our namespace in SYCL (which use intel::)
and the prefixes we use for attributes in LLVM.

This patch updates the attribute spellings that currently use
intelfpga:: prefixes to intel:: in all lowercase and no change for the attribute spelling that use intel:: prefixes.

The patches make this in a three step change:

  1. Enable the intel:: prefix, without disabling the older versions.
  2. Provide a deprecation warning for the older versions.
  3. Disable intelfpga:: versions.

The affected attributes are:

•intelfpga::num_simd_work_items
•intelfpga::max_work_group_size
•intelfpga::max_global_work_dim
•intelfpga::no_global_work_offset
•intelfpga::ivdep
•intelfpga::ii
•intelfpga::max_concurrency
•intelfpga::loop_coalesce
•intelfpga::disable_loop_pipelining
•intelfpga::max_interleaving
•intelfpga::speculated_iterations
•intelfpga::doublepump
•intelfpga::singlepump
•intelfpga::memory
•intelfpga::register
•intelfpga::bankwidth
•intelfpga::numbanks
•intelfpga::private_copies
•intelfpga::merge
•intelfpga::max_replicates
•intelfpga::simple_dual_port
•intelfpga::bank_bits
•intelfpga::force_pow2_depth

  1. Additionally, the patches renames spelling for the following two attributes:

•intelfpga::memory -> intel::fpga_memory
•intelfpga::register -> intel::fpga_register

  1. Modify the tests and documentation.

Signed-off-by: Soumi Manna [email protected]

Currently, there is a mismatch between our namespace in SYCL (which use INTEL::)
and the prefixes we use for attributes in LLVM.

This patch updates the attribute spellings that currently use
intel:: and intelfpga:: prefixes to INTEL:: in all caps.

The patches make this in a three step change:

1. Enable the INTEL:: prefix, without disabling the older versions.
2. Provide a deprecation warning for the older versions.
3. Disable the intel:: and intelfpga:: versions.

The affected attributes are:

•intel::reqd_work_group_size
•intel::device_indirectly_callable
•intel::kernel_args_restrict
•intelfpga::num_simd_work_items
•intelfpga::max_work_group_size
•intelfpga::max_global_work_dim
•intelfpga::no_global_work_offset
•intelfpga::ivdep
•intelfpga::ii
•intelfpga::max_concurrency
•intelfpga::loop_coalesce
•intelfpga::disable_loop_pipelining
•intelfpga::max_interleaving
•intelfpga::speculated_iterations
•intelfpga::doublepump
•intelfpga::singlepump
•intelfpga::memory
•intelfpga::register
•intelfpga::bankwidth
•intelfpga::numbanks
•intelfpga::private_copies
•intelfpga::merge
•intelfpga::max_replicates
•intelfpga::simple_dual_port
•intelfpga::bank_bits
•intelfpga::force_pow2_depth

1. Additionally, the patches renames spelling for the following two attributes:

•intelfpga::memory -> INTEL::fpga_memory
•intelfpga::register -> INTEL::fpga_register

2. Modify the tests and documentation.

Signed-off-by: Soumi Manna <[email protected]>
@smanna12 smanna12 changed the title [SYCL] Add new spellings for SYCL attributes [WIP][SYCL] Add new spellings for SYCL attributes Sep 29, 2020
@keryell
Copy link
Contributor

keryell commented Sep 29, 2020

I think that the SYCL committee went back in the other direction last week: https://gitlab.khronos.org/sycl/Specification/-/merge_requests/537

Lowercase looks more like C++ and less like C macros.

Signed-off-by: Soumi Manna <[email protected]>
Signed-off-by: Soumi Manna <[email protected]>
Signed-off-by: Soumi Manna <[email protected]>
Signed-off-by: Soumi Manna <[email protected]>
@smanna12 smanna12 requested a review from erichkeane September 30, 2020 04:00
@smanna12 smanna12 marked this pull request as ready for review September 30, 2020 04:00
@smanna12 smanna12 changed the title [WIP][SYCL] Add new spellings for SYCL attributes [SYCL] Add new spellings for SYCL attributes Sep 30, 2020
@Fznamznon
Copy link
Contributor

I think that the SYCL committee went back in the other direction last week: https://gitlab.khronos.org/sycl/Specification/-/merge_requests/537

Lowercase looks more like C++ and less like C macros.

@jbrodman could you please comment on this?

erichkeane
erichkeane previously approved these changes Sep 30, 2020
@erichkeane
Copy link
Contributor

Code looks fine, @jbrodman / @mkinsner need to comment on this, our feature request was given telling us to do all capitals, but if the spec changed we should use this opportunity to go back to lowercase.

@smanna12 smanna12 requested a review from jbrodman September 30, 2020 14:45
@keryell
Copy link
Contributor

keryell commented Sep 30, 2020

By the way, @erichkeane since Intel is more motivated than me to have attributes everywhere (even if for any FPGA companies, it looks like any problem is solved by adding a #pragma or an attribute :-) ), would you be kind enough to write a paper for ISO C++23 to have multiple levels of namespace in the attributes, such as allowing things like [[sycl::intel::num_simd_work_items]]. Right now only 1 level is allowed.

@erichkeane
Copy link
Contributor

By the way, @erichkeane since Intel is more motivated than me to have attributes everywhere (even if for any FPGA companies, it looks like any problem is solved by adding a #pragma or an attribute :-) ), would you be kind enough to write a paper for ISO C++23 to have multiple levels of namespace in the attributes, such as allowing things like [[sycl::intel::num_simd_work_items]]. Right now only 1 level is allowed.

Not a bad idea. We're about to have someone on board who can help with that, and is an attribute expert (and managed it through WG14), so I'll see what he thinks.

@smanna12
Copy link
Contributor Author

smanna12 commented Oct 1, 2020

Code looks fine, @jbrodman / @mkinsner need to comment on this, our feature request was given telling us to do all capitals, but if the spec changed we should use this opportunity to go back to lowercase.

@mkinsner could you please comment on this? Should we bring the fpga specific ones under lowercase intel:: now?

@mkinsner
Copy link

mkinsner commented Oct 1, 2020

Code looks fine, @jbrodman / @mkinsner need to comment on this, our feature request was given telling us to do all capitals, but if the spec changed we should use this opportunity to go back to lowercase.

@mkinsner could you please comment on this? Should we bring the fpga specific ones under lowercase intel:: now?

Probably, but some details are being settled. Please contact me offline.

@mkinsner
Copy link

mkinsner commented Oct 1, 2020

By the way, @erichkeane since Intel is more motivated than me to have attributes everywhere

A number of these extensions should migrate to non-attribute representations, with attributes like these used to implement the abstraction behind the scenes when appropriate. I think that these should be a stepping stone. I've been pushing the non-attribute style internally within Intel FPGA recently.

@smanna12
Copy link
Contributor Author

smanna12 commented Oct 2, 2020

I have updated patch (renaming intelfpga -> intel:: and no change for intel:: attribute spelling) and summary above based on the discussion offline with @erichkeane @mkinsner @jbrodman.

@smanna12 smanna12 requested a review from erichkeane October 2, 2020 04:14
Signed-off-by: Soumi Manna <[email protected]>
@smanna12 smanna12 changed the title [SYCL] Add new spellings for SYCL attributes [SYCL] Add new spellings for SYCL FPGA attributes Oct 2, 2020
Signed-off-by: Soumi Manna <[email protected]>
@smanna12 smanna12 requested a review from Fznamznon October 6, 2020 04:00
Signed-off-by: Soumi Manna <[email protected]>
Signed-off-by: Soumi Manna <[email protected]>
Signed-off-by: Soumi Manna <[email protected]>
@smanna12 smanna12 requested review from MrSidims, Fznamznon and erichkeane and removed request for erichkeane October 7, 2020 01:51
Copy link
Contributor

@Fznamznon Fznamznon left a comment

Choose a reason for hiding this comment

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

LGTM overall, except small style nits.

@smanna12 smanna12 requested a review from Fznamznon October 7, 2020 16:49
Fznamznon
Fznamznon previously approved these changes Oct 7, 2020
Signed-off-by: Soumi Manna <[email protected]>
@smanna12 smanna12 requested a review from premanandrao October 7, 2020 18:27
@erichkeane
Copy link
Contributor

This looks fine as it is, though if we find ourselves wanting to do this MORE (that is, deprecating spellings), I think we should have a very significant look into adding a 'deprecated spelling' tag into Attr.td that gets taken care of automatically in the attribute infrastructure. I don't know of any attributes (@AaronBallman ??) that currently have any spelling 'deprecated' in our upstream, but it is likely a good idea to keep an eye out for that opportunity.

@AaronBallman
Copy link
Contributor

This looks fine as it is, though if we find ourselves wanting to do this MORE (that is, deprecating spellings), I think we should have a very significant look into adding a 'deprecated spelling' tag into Attr.td that gets taken care of automatically in the attribute infrastructure. I don't know of any attributes (@AaronBallman ??) that currently have any spelling 'deprecated' in our upstream, but it is likely a good idea to keep an eye out for that opportunity.

We have a few attributes that have deprecated spellings. For instance, the swift_wrapper spelling in https://github.com/llvm/llvm-project/blob/master/clang/include/clang/Basic/Attr.td#L2179 is a deprecated spelling that was recently added. IIRC, some of the thread safety annotations also have alternate spellings that may be deprecated-ish (or may just be discouraged as older spellings, I'd have to research it).

@smanna12
Copy link
Contributor Author

smanna12 commented Oct 8, 2020

Thank you everyone for the reviews.

@smanna12
Copy link
Contributor Author

smanna12 commented Oct 8, 2020

@bader, All BuildBot tests are completed and this PR is ready for your review/merge. Thanks.

@bader bader merged commit 5949228 into intel:sycl Oct 8, 2020
@bader
Copy link
Contributor

bader commented Oct 8, 2020

Thanks!

bader pushed a commit that referenced this pull request Sep 15, 2021
Several FPGA specific attributes in the intelfpga vendor namespace were deprecated in favor of a name in the intel vendor namespace on PR #2568. 

Specifically, we deprecated the
[[intelfpga::attr]] spellings in favor of [[intel::fpga_attr]],
[[intelfpga::register]] spelling in favor of [[intel::fpga_register]], and 
[[intelfpga::memory]] spelling in favor of [[intel::fpga_memory]].

This patch 

1. removes the deprecated functionality for the intelfpga:: spellings.
    The affected attributes are:
    intelfpga::num_simd_work_items
    intelfpga::max_work_group_size
    intelfpga::max_global_work_dim
    intelfpga::no_global_work_offset
    intelfpga::ivdep
    intelfpga::ii
    intelfpga::max_concurrency
    intelfpga::loop_coalesce
    intelfpga::disable_loop_pipelining
    intelfpga::max_interleaving
    intelfpga::speculated_iterations
    intelfpga::doublepump
    intelfpga::singlepump
    intelfpga::memory
    intelfpga::register
    intelfpga::bankwidth
    intelfpga::numbanks
    intelfpga::private_copies
    intelfpga::merge
    intelfpga::max_replicates
    intelfpga::simple_dual_port
    intelfpga::bank_bits
    intelfpga::force_pow2_depth
    intelfpga::scheduler_target_fmax_mhz

2. Updates tests so that tests use at least one removed spelling of each attributes and now shows a warning with unknown attribute spelling.

Signed-off-by: Soumi Manna [email protected]
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.

9 participants