-
Notifications
You must be signed in to change notification settings - Fork 790
[SYCL] Remove arbitrary range Part 1 #3133
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,20 +10,16 @@ template <int N> | |
[[intel::scheduler_target_fmax_mhz(N)]] void zoo() {} | ||
|
||
int main() { | ||
// CHECK-LABEL: FunctionDecl {{.*}}test_kernel1 'void ()' | ||
// CHECK: FunctionDecl {{.*}}test_kernel1 'void ()' | ||
// CHECK: SYCLIntelSchedulerTargetFmaxMhzAttr {{.*}} | ||
// CHECK-NEXT: ConstantExpr {{.*}} 'int' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AaronBallman @premanandrao Should the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it should be -- see my reasoning in #3134 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. Thanks for the review! I'll make the change! |
||
// CHECK-NEXT: value: Int 5 | ||
// CHECK-NEXT: IntegerLiteral {{.*}} 'int' 5 | ||
// expected-warning@+3 {{attribute 'intelfpga::scheduler_target_fmax_mhz' is deprecated}} | ||
// expected-note@+2 {{did you mean to use 'intel::scheduler_target_fmax_mhz' instead?}} | ||
cl::sycl::kernel_single_task<class test_kernel1>( | ||
[]() [[intelfpga::scheduler_target_fmax_mhz(5)]]{}); | ||
|
||
// CHECK-LABEL: FunctionDecl {{.*}}test_kernel2 'void ()' | ||
// CHECK: FunctionDecl {{.*}}test_kernel2 'void ()' | ||
// CHECK: SYCLIntelSchedulerTargetFmaxMhzAttr {{.*}} | ||
// CHECK-NEXT: ConstantExpr {{.*}} 'int' | ||
// CHECK-NEXT: value: Int 2 | ||
// CHECK-NEXT: IntegerLiteral {{.*}} 'int' 2 | ||
cl::sycl::kernel_single_task<class test_kernel2>( | ||
[]() { func(); }); | ||
|
@@ -39,10 +35,10 @@ int main() { | |
[[intel::scheduler_target_fmax_mhz(0)]] int Var = 0; // expected-error{{'scheduler_target_fmax_mhz' attribute only applies to functions}} | ||
|
||
cl::sycl::kernel_single_task<class test_kernel4>( | ||
[]() [[intel::scheduler_target_fmax_mhz(1048577)]]{}); // expected-error{{'scheduler_target_fmax_mhz' attribute requires integer constant between 0 and 1048576 inclusive}} | ||
[]() [[intel::scheduler_target_fmax_mhz(1048577)]]{}); // OK | ||
|
||
cl::sycl::kernel_single_task<class test_kernel5>( | ||
[]() [[intel::scheduler_target_fmax_mhz(-4)]]{}); // expected-error{{'scheduler_target_fmax_mhz' attribute requires integer constant between 0 and 1048576 inclusive}} | ||
[]() [[intel::scheduler_target_fmax_mhz(-4)]]{}); // expected-error{{'scheduler_target_fmax_mhz' attribute requires a non-negative integral compile time constant expression}} | ||
|
||
cl::sycl::kernel_single_task<class test_kernel6>( | ||
[]() [[intel::scheduler_target_fmax_mhz(1), intel::scheduler_target_fmax_mhz(2)]]{}); // expected-warning{{attribute 'scheduler_target_fmax_mhz' is already applied with different parameters}} | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
You can combine this inside addIntelSYCLSingleArgFunctionAttr () function :
if (CI.getParsedKind() == ParsedAttr::AT_SYCLIntelMaxGlobalWorkDim ||
CI.getParsedKind() == ParsedAttr::AT_SYCLIntelSchedulerTargetFmaxMhz ) {
if (ArgInt < 0) {
Diag(E->getExprLoc(), diag::err_attribute_requires_positive_integer)
<< CI.getAttrName() << /non-negative/ 1;
return;
}
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.
AT_SYCLIntelMaxGlobalWorkDim
also has an upper-bound check, which is why I keptAT_SYCLIntelSchedulerTargetFmaxMhz
in a separate check. There are actually also more FPGA attributes I am adding irefactoring in another patch, which will change this function even more. I will refactor this function then if that sounds ok to you.Uh oh!
There was an error while loading. Please reload this page.
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.
We definitely need to keep upper bound check for max_global_work_dim kernel attribute (which has a natural limitation of '3'). Several diagnostics and work_gorup_size attributes are dependent on this.
I agree with @MrSidims comments here #2911 (comment)
We should only remove the arbitrary upper bound here:
#2911 (comment)
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.
Yes we need to keep the upper bound of 3 for max_global_work_dim kernel attribute. I am removing only arbitrary upper bounds of 1024*1024 for the attributes mentioned here - #2911.
Uh oh!
There was an error while loading. Please reload this page.
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.
addIntelSYCLSingleArgFunctionAttr () - I added this function to handle template parameter support for SYCL FPGA function attributes. So we can add other new function attributes in future here.
The following attributes below are FPGA memory attributes, i think it would be better if we add something like addIntelSingleArgMemoryAttr () instead of adding them inside addIntelSYCLSingleArgFunctionAttr ().
IntelFPGAPrivateCopies
IntelFPGABankBits
1 - 1024*1024
IntelFPGABankWidth
IntelFPGANumBanks
IntelFPGAMaxReplicates
@AaronBallman any thought?
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 taking a look @smanna12 . I do plan to refactor the functions when I work on the IntelFPGA attributes. You can see #3134. I've uploaded a draft PR (with just one attribute. Others will follow) to get initial feedback from @AaronBallman.