-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][FPGA] Allowing max-concurrency attribute on functions. #3388
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
Conversation
Signed-off-by: Zahira Ammarguellat <[email protected]>
Signed-off-by: Zahira Ammarguellat <[email protected]>
Signed-off-by: Zahira Ammarguellat <[email protected]>
Signed-off-by: Zahira Ammarguellat <[email protected]>
Signed-off-by: Zahira Ammarguellat <[email protected]>
Signed-off-by: Zahira Ammarguellat <[email protected]>
Signed-off-by: Zahira Ammarguellat <[email protected]>
Signed-off-by: Zahira Ammarguellat <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@zahiraam, could you please update summary since we are not naming this attribute to component_max_concurrency? |
Signed-off-by: Zahira Ammarguellat <[email protected]>
Signed-off-by: Zahira Ammarguellat <[email protected]>
Signed-off-by: Zahira Ammarguellat <[email protected]>
Signed-off-by: Zahira Ammarguellat <[email protected]>
Signed-off-by: Zahira Ammarguellat <[email protected]>
LGTM, but the review is still marked as a draft. |
So that's my next challenge. Not sure how to make it a "real" PR. |
Wow! That was fast. I was still reading the doc. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM more officially now. :-D
be applied multiple times to the same loop. | ||
This attribute applies to a loop or a function. Indicates that the loop/function | ||
should allow no more than N threads or iterations to execute it simultaneously. | ||
N must be a non negative integer. '0' indicates the max_concurrency case to b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: 'be'
clang/lib/Sema/SemaDeclAttr.cpp
Outdated
E = Res.get(); | ||
|
||
// This attribute requires a strictly positive value. | ||
if (ArgVal <= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be ArgVal < 0, I think (or the document is wrong). 0 indicates unbounded concurrency.
|
||
// expected-error@+1 {{'max_concurrency' attribute takes one argument}} | ||
[[intel::max_concurrency(3, 3)]] void goo() {} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test for '0'.
Signed-off-by: Zahira Ammarguellat <[email protected]>
clang/lib/Sema/SemaDeclAttr.cpp
Outdated
return; | ||
E = Res.get(); | ||
|
||
// This attribute requires a strictly positive value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor: comment is incorrect. We need a non-negative value.
But otherwise looks good to me.
Signed-off-by: Zahira Ammarguellat <[email protected]>
Signed-off-by: Zahira Ammarguellat <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This patch implements the support of a new FPGA function attribute ‘max_concurrency”. The attribute exists already for loops. It takes a single unsigned integer argument and has the following syntax:
[[intel::max_concurrency(n)]]
An example of it use:
[[intel::max_concurrency(n)]]
void foo() {
}
The LLVM IR representation will be function metadata:
!max_concurrency !0
!0 = !{!i32 n}
Max_concurrency applies to functions in device code. It is not be propagated to the caller.