-
Notifications
You must be signed in to change notification settings - Fork 795
[SYCL] Add template parameter support for intel_reqd_sub_group_size a… #1807
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 1 commit
d96007d
60c7b00
57d61ce
462320e
257f6ee
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 |
|---|---|---|
|
|
@@ -35,7 +35,7 @@ kernel __attribute__((reqd_work_group_size(1,0,2))) void kernel12(){} // expecte | |
| kernel __attribute__((reqd_work_group_size(0,1,2))) void kernel13(){} // expected-error {{'reqd_work_group_size' attribute must be greater than 0}} | ||
|
|
||
| __attribute__((intel_reqd_sub_group_size(8))) void kernel14(){} // expected-error {{attribute 'intel_reqd_sub_group_size' can only be applied to an OpenCL kernel}} | ||
| kernel __attribute__((intel_reqd_sub_group_size(0))) void kernel15(){} // expected-error {{'intel_reqd_sub_group_size' attribute must be greater than 0}} | ||
bader marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| kernel __attribute__((intel_reqd_sub_group_size(0))) void kernel15(){} // expected-error {{'intel_reqd_sub_group_size' attribute requires a positive integral compile time constant expression}} | ||
|
||
| kernel __attribute__((intel_reqd_sub_group_size(8))) __attribute__((intel_reqd_sub_group_size(16))) void kernel16() {} //expected-warning{{attribute 'intel_reqd_sub_group_size' is already applied with different parameters}} | ||
|
|
||
| __kernel __attribute__((work_group_size_hint(8,-16,32))) void neg1() {} //expected-error{{'work_group_size_hint' attribute requires a non-negative integral compile time constant expression}} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // RUN: %clang_cc1 -fsycl -fsycl-is-device -fsyntax-only -verify -pedantic %s | ||
| // RUN: %clang_cc1 -fsycl -fsycl-is-device -fsyntax-only -ast-dump -verify -pedantic %s | FileCheck %s | ||
|
||
|
|
||
| // Test that checkes template parameter support for 'intel_reqd_sub_group_size' attribute on sycl device. | ||
|
|
||
| template <int SIZE> | ||
| class KernelFunctor { | ||
| public: | ||
| //expected-error@+1{{'intel_reqd_sub_group_size' attribute requires a positive integral compile time constant expression}} | ||
| [[cl::intel_reqd_sub_group_size(SIZE)]] void operator()() {} | ||
| }; | ||
|
|
||
| int main() { | ||
| //expected-note@+1{{in instantiation of template class 'KernelFunctor<-1>' requested here}} | ||
| KernelFunctor<-1>(); | ||
| // no error expected | ||
| KernelFunctor<10>(); | ||
| } | ||
|
|
||
| // CHECK: ClassTemplateDecl {{.*}} {{.*}} KernelFunctor | ||
| // CHECK: ClassTemplateSpecializationDecl {{.*}} {{.*}} class KernelFunctor definition | ||
| // CHECK: CXXRecordDecl {{.*}} {{.*}} implicit class KernelFunctor | ||
| // CHECK: IntelReqdSubGroupSizeAttr {{.*}} | ||
| // CHECK: SubstNonTypeTemplateParmExpr {{.*}} | ||
| // CHECK-NEXT: IntegerLiteral{{.*}}10{{$}} | ||
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.
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.
Done