Skip to content

[SYCL] Add template parameter support for max_global_work_dim attribute #2816

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 14 commits into from
Nov 28, 2020

Conversation

smanna12
Copy link
Contributor

@smanna12 smanna12 commented Nov 24, 2020

This patch

adds support for template parameter on [[intel::max_global_work_dim)]] attribute

splits test/SemaSYCL/intel-max-global-work-dim.cpp to separate files for
host compilation (test/SemaSYCL/intel-max-global-work-dim.cpp-host.cpp) and
device compilation (test/SemaSYCL/intel-max-global-work-dim.cpp-device.cpp)

updates sema/codegen tests with mock headers on device.

uses existing function "sema::addIntelSYCLSingleArgFunctionAttr" from
other single argument function attributes such as num_simd_work_items
and intel_reqd_sub_group_size to avoid source codes duplication and
reuse for the template parameter support.

addresses special diagnostics in case the value of ‘max_global_work_dim’
attribute equals to 0, we shall ensure that if max_work_group_size and
reqd_work_group_size attributes exist, they hold equal values (1, 1, 1).

additionally updates sema/codegen tests for "reqd-sub-group-size" and
"num-simd-work-items" attributes with mock headers.

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

This patch

adds support for template parameter on [[intel::max_global_work_dim)]] attribute

splits test/SemaSYCL/intel-max-global-work-dim.cpp to separate files for
host compilation (test/SemaSYCL/intel-max-global-work-dim.cpp-host.cpp) and
device compilation (test/SemaSYCL/intel-max-global-work-dim.cpp-device.cpp)

updates sema/codegen tests with mock headers on device.

uses existing function "addIntelSYCLSingleArgFunctionAttr" of other
single argument function attributes such as num_simd_work_items and
intel_reqd_sub_group_size source codes to avoid duplication and
reuse for the template parameter support.

Signed-off-by: Soumi Manna <[email protected]>
@smanna12 smanna12 changed the title [SYCL] Add template parameter support for max_global_work_dim attribute [WIP][SYCL] Add template parameter support for max_global_work_dim attribute Nov 24, 2020
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]>
Signed-off-by: Soumi Manna <[email protected]>
Signed-off-by: Soumi Manna <[email protected]>
@smanna12 smanna12 marked this pull request as ready for review November 26, 2020 05:45
@smanna12 smanna12 requested a review from Fznamznon November 26, 2020 05:45
@smanna12 smanna12 changed the title [WIP][SYCL] Add template parameter support for max_global_work_dim attribute [SYCL] Add template parameter support for max_global_work_dim attribute Nov 26, 2020
@smanna12 smanna12 requested a review from MrSidims November 26, 2020 14:27
Copy link
Contributor

@MrSidims MrSidims left a comment

Choose a reason for hiding this comment

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

LGTM, just two nits.

@smanna12 smanna12 requested a review from MrSidims November 26, 2020 21:17
MrSidims
MrSidims previously approved these changes Nov 27, 2020
Fznamznon
Fznamznon previously approved these changes Nov 27, 2020
Copy link
Contributor

@bader bader left a comment

Choose a reason for hiding this comment

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

One suggestion.

Signed-off-by: Soumi Manna <[email protected]>
@smanna12 smanna12 dismissed stale reviews from Fznamznon and MrSidims via a60cd4f November 27, 2020 20:40
Signed-off-by: Soumi Manna <[email protected]>
@smanna12 smanna12 requested a review from MrSidims November 27, 2020 20:54
@smanna12 smanna12 requested review from Fznamznon and bader November 27, 2020 20:54
Signed-off-by: Soumi Manna <[email protected]>
@smanna12 smanna12 force-pushed the AddTemplateParamSupport branch from 17bb689 to f11d097 Compare November 28, 2020 15:03
@smanna12
Copy link
Contributor Author

smanna12 commented Nov 28, 2020

Sorry for the force push (not able to publish commit by git push)

@smanna12 smanna12 requested a review from bader November 28, 2020 15:08
@bader
Copy link
Contributor

bader commented Nov 28, 2020

Please, remove err_intel_attribute_argument_is_not_in_range attribute declaration - it's not used anymore.

Yes, it is removed now.

@bader bader merged commit bd8fcc7 into intel:sycl Nov 28, 2020
smanna12 added a commit to smanna12/llvm that referenced this pull request Jan 25, 2021
Template parameter support was added for

 1. [[intel::max_global_work_dim)]] attribute on intel#2816
 2. [[intel::num_simd_work_items()]] attribute on intel#2510
 3. [[intel::reqd_sub_group_size()]] attribute on intel#1807

This patch adds the following new test cases that were not there before to improve the support:

 1. Test that checks wrong function template instantiation and ensures that the type
    is checked properly when instantiating from the template definition.
 2. Test that checks expression is not a constant expression.
 3. Test that checks expression is a constant expression.
 4. Test that checks template parameter support on function.

NOTE: No change in compiler. All new test cases have already been supported.

Signed-off-by: Soumi Manna <[email protected]>
romanovvlad pushed a commit that referenced this pull request Jan 26, 2021
…3089)

Template parameter support was added for

 1. [[intel::max_global_work_dim)]] attribute on #2816
 2. [[intel::num_simd_work_items()]] attribute on #2510
 3. [[intel::reqd_sub_group_size()]] attribute on #1807

This patch adds the following new test cases that were not there before to improve the support:

 1. Test that checks wrong function template instantiation and ensures that the type
    is checked properly when instantiating from the template definition.
 2. Test that checks expression is not a constant expression.
 3. Test that checks expression is a constant expression.
 4. Test that checks template parameter support on function.

NOTE: No change in compiler. All new test cases have already been supported.

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.

4 participants