Skip to content

[SYCL][FPGA] Fix the way we handle duplicate vs conflicting values with loop attributes #14342

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 6 commits into from
Jun 29, 2024

Conversation

smanna12
Copy link
Contributor

@smanna12 smanna12 commented Jun 28, 2024

This patch improves diagnostic supports by resolving bugs the way we handle duplicate vs conflicting values with the following SYCL FPGA loop attributes:

  [[intel::max_reinvocation_delay()]]
  [[intel::initiation_interval()]]
  [[intel::max_concurrency()]]
  [[intel::speculated_iterations()]]
  [[intel::max_interleaving()]]

The patch addresses issues in the test case below, which previously missed diagnostics due to a discontinuation in the while loop while checking for duplicate versus conflicting attribute values in the routine CheckForDuplicateAttrs().

Example with `speculated_iterations' attribute:

   Before the fix:

    [[intel::speculated_iterations(1)]] // expected-note {{previous attribute is here}}
    [[intel::speculated_iterations(1)]] // OK
    [[intel::speculated_iterations(2)]] // expected-error {{conflicting loop attribute 'speculated_iterations'}}
    [[intel::speculated_iterations(4)]] // OK
    for (int i = 0; i != 10; ++i) { a[i] = 0; }

    After the fix:

    [[intel::speculated_iterations(1)]] // expected-note 2 {{previous attribute is here}}
    [[intel::speculated_iterations(1)]] // OK
    [[intel::speculated_iterations(2)]] // expected-error {{conflicting loop attribute 'speculated_iterations'}}
    [[intel::speculated_iterations(4)]] // expected-error {{conflicting loop attribute 'speculated_iterations'}}
    for (int i = 0; i != 10; ++i) { a[i] = 0; }

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

…LIntelRegister, SYCLIntelMemory)

This patch uses MutualExclusions tablegen support to allow us to remove a
custom diagnostic checking codes with FPGA attributes:
[[intel:fpga_register]] and [[intel::fpga_memory]].

No test is added as we alreday have an existing LIT test (SemaSYCL/local.cpp) that shows the behavior.
…es with loop attributes

This patch improves diagnostic supports by resolving bugs the way we handle duplicate vs conflicting values with the following SYCL FPGA loop attributes:

  [[intel::max_reinvocation_delay()]]
  [[intel::initiation_interval()]]
  [[intel::max_concurrency()]]
  [[intel::speculated_iterations()]]
  [[intel::max_interleaving()]]

  The patch addresses issues in the test case below, which previously missed diagnostics due to a discontinuation in the while loop while checking for duplicate versus conflicting attribute values in the routine CheckForDuplicateAttrs().

   Example with `speculated_iterations` attribute:

   Before the fix:

    [[intel::speculated_iterations(1)]] // expected-note {{previous attribute is here}}
    [[intel::speculated_iterations(1)]] // OK
    [[intel::speculated_iterations(2)]] // expected-error {{conflicting loop attribute 'speculated_iterations'}}
    [[intel::speculated_iterations(4)]] // OK
    for (int i = 0; i != 10; ++i) { a[i] = 0; }

    After the fix:

    [[intel::speculated_iterations(1)]] // expected-note 2 {{previous attribute is here}}
    [[intel::speculated_iterations(1)]] // OK
    [[intel::speculated_iterations(2)]] // expected-error {{conflicting loop attribute 'speculated_iterations'}}
    [[intel::speculated_iterations(4)]] // expected-error {{conflicting loop attribute 'speculated_iterations'}}
    for (int i = 0; i != 10; ++i) { a[i] = 0; }

Signed-off-by: Soumi Manna <[email protected]>
@smanna12 smanna12 changed the title Fix loop bug [SYCL][FPGA] Fix bugs the way we handle duplicate vs conflicting values with loop attributes Jun 28, 2024
@smanna12 smanna12 marked this pull request as ready for review June 28, 2024 02:46
@smanna12 smanna12 requested a review from a team as a code owner June 28, 2024 02:46
@smanna12 smanna12 requested a review from premanandrao June 28, 2024 17:27
@smanna12
Copy link
Contributor Author

Thank you @premanandrao for reviews!

@smanna12
Copy link
Contributor Author

@intel/llvm-gatekeepers, this PR is ready to merge. Thank you

@bader bader changed the title [SYCL][FPGA] Fix bugs the way we handle duplicate vs conflicting values with loop attributes [SYCL][FPGA] Fix the way we handle duplicate vs conflicting values with loop attributes Jun 29, 2024
@bader bader merged commit c3402c9 into intel:sycl Jun 29, 2024
14 checks passed
@smanna12 smanna12 deleted the FixLoopBug branch June 30, 2024 05:26
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.

3 participants