-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL][FPGA] Add support for two new function attributes #3441
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
This patch implements the support for two new FPGA function attributes: 1. disable_loop_pipelining 2. initiation_interval Both attributes alreday exist for loops as statement attributes. Function attribute "initiation_interval" takes a single unsigned integer argument. Syntax: [[intel::initiation_interval(n)]] void foo() {} The argument can be constexpr. The parameter n is a template parameter. The LLVM IR representation will be function metadata: !initiation_interval !0 !0 = !{!i32 n} Function attribute "disable_loop_pipelining" takes no arguments. Syntax: [[intel::disable_loop_pipelining]] void foo() {} The LLVM IR representation will be function metadata: !disable_loop_pipelining !0 !0 = !{!i32 1} Both attributes are only valid in device code and do not get propagated to the caller. The function attributes apply to a lambda function, or function definition. 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]>
let Args = [ExprArgument<"IntervalExpr", /*opt*/1>]; | ||
let LangOpts = [SYCLIsDevice, SilentlyIgnoreSYCLIsHost]; | ||
let HasCustomTypeTransform = 1; | ||
let Documentation = [SYCLIntelFPGAInitiationIntervalAttrDocs]; | ||
let SupportsNonconformingLambdaSyntax = 1; |
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.
i checked with feature request author, the attribute needs to apply in this position.
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.
Thanks for checking with the authors on these! Just to check -- when you ask their opinion, are you letting them know that a "yes" answer means their attribute isn't valid C++ code? (I have a suspicion that not everyone is thinking about the language design of these attributes so much as what immediate problem they think they're solving. Being asked if they want to add something that's not valid C++ may help them think a bit deeper about the problem.)
Signed-off-by: Soumi Manna <[email protected]>
let Args = [ExprArgument<"IntervalExpr", /*opt*/1>]; | ||
let LangOpts = [SYCLIsDevice, SilentlyIgnoreSYCLIsHost]; | ||
let HasCustomTypeTransform = 1; | ||
let Documentation = [SYCLIntelFPGAInitiationIntervalAttrDocs]; | ||
let SupportsNonconformingLambdaSyntax = 1; |
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.
Thanks for checking with the authors on these! Just to check -- when you ask their opinion, are you letting them know that a "yes" answer means their attribute isn't valid C++ code? (I have a suspicion that not everyone is thinking about the language design of these attributes so much as what immediate problem they think they're solving. Being asked if they want to add something that's not valid C++ may help them think a bit deeper about the problem.)
Signed-off-by: Soumi Manna <[email protected]>
This generally LGTM but it's still marked as a draft -- are you planning more changes? |
No, the feature is complete. |
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 aside from a commenting nit.
Signed-off-by: Soumi Manna <[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!
Signed-off-by: Soumi Manna <[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
Thanks for the reviews. |
…disable_loop_pipelining attribute The support for disable_loop_pipelining was implemented on intel#3441 This patch 1. removes FIXME 2. Updtaes document 3. adds tests 4. fixes typos Signed-off-by: Soumi Manna <[email protected]>
This patch implements the support for two new FPGA function attributes:
Both attributes alreday exist for loops as statement attributes.
Function attribute "initiation_interval" takes a single unsigned integer argument.
Syntax:
[[intel::initiation_interval(n)]] void foo() {}
The argument can be constexpr. The parameter n is a template parameter.
The LLVM IR representation will be function metadata:
!initiation_interval !0
!0 = !{!i32 n}
Function attribute "disable_loop_pipelining" takes no arguments.
Syntax:
[[intel::disable_loop_pipelining]] void foo() {}
The LLVM IR representation will be function metadata:
!disable_loop_pipelining !0
!0 = !{!i32 1}
Both attributes are only valid in device code and do not get propagated to the caller.
The function attributes apply to a lambda function, or function definition.
Signed-off-by: Soumi Manna [email protected]