Skip to content

[SYCL] Deny pragma spelling for SYCL-specific attributes #1815

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 3 commits into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions clang/include/clang/Basic/Attr.td
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,7 @@ def SYCLDevice : InheritableAttr {
let Subjects = SubjectList<[Function]>;
let LangOpts = [SYCLIsDevice];
let Documentation = [SYCLDeviceDocs];
let PragmaAttributeSupport = 0;
}

def SYCLKernel : InheritableAttr {
Expand Down Expand Up @@ -1160,6 +1161,7 @@ def SYCLDeviceIndirectlyCallable : InheritableAttr {
let Subjects = SubjectList<[Function]>;
let LangOpts = [SYCLIsDevice];
let Documentation = [SYCLDeviceIndirectlyCallableDocs];
let PragmaAttributeSupport = 0;
}

def SYCLIntelKernelArgsRestrict : InheritableAttr {
Expand All @@ -1168,6 +1170,7 @@ def SYCLIntelKernelArgsRestrict : InheritableAttr {
let LangOpts = [ SYCLIsDevice, SYCLIsHost ];
let Documentation = [ SYCLIntelKernelArgsRestrictDocs ];
let SimpleHandler = 1;
let PragmaAttributeSupport = 0;
}

def SYCLIntelNumSimdWorkItems : InheritableAttr {
Expand Down Expand Up @@ -1266,6 +1269,7 @@ def IntelReqdSubGroupSize: InheritableAttr {
let Subjects = SubjectList<[Function, CXXMethod], ErrorDiag>;
let Documentation = [IntelReqdSubGroupSizeDocs];
let LangOpts = [OpenCL, SYCLIsDevice, SYCLIsHost];
let PragmaAttributeSupport = 0;
}

// This attribute is both a type attribute, and a declaration attribute (for
Expand Down Expand Up @@ -2550,6 +2554,7 @@ def ReqdWorkGroupSize : InheritableAttr {
DefaultUnsignedArgument<"ZDim", 1>];
let Subjects = SubjectList<[Function], ErrorDiag>;
let Documentation = [ReqdWorkGroupSizeAttrDocs];
let PragmaAttributeSupport = 0;
}

def WorkGroupSizeHint : InheritableAttr {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
// CHECK-NEXT: IBAction (SubjectMatchRule_objc_method_is_instance)
// CHECK-NEXT: IFunc (SubjectMatchRule_function)
// CHECK-NEXT: InitPriority (SubjectMatchRule_variable)
// CHECK-NEXT: IntelReqdSubGroupSize (SubjectMatchRule_function, SubjectMatchRule_function_is_member)
// CHECK-NEXT: InternalLinkage (SubjectMatchRule_variable, SubjectMatchRule_function, SubjectMatchRule_record)
// CHECK-NEXT: LTOVisibilityPublic (SubjectMatchRule_record)
// CHECK-NEXT: LoaderUninitialized (SubjectMatchRule_variable_is_global)
Expand Down Expand Up @@ -136,14 +135,10 @@
// CHECK-NEXT: Pointer (SubjectMatchRule_record_not_is_union)
// CHECK-NEXT: ReleaseHandle (SubjectMatchRule_variable_is_parameter)
// CHECK-NEXT: RenderScriptKernel (SubjectMatchRule_function)
// CHECK-NEXT: ReqdWorkGroupSize (SubjectMatchRule_function)
Copy link
Contributor

@Fznamznon Fznamznon Jun 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have OpenCL background, so I cannot say is correct this change or not, but this particular attribute ReqdWorkGroupSize is OpenCL specific and it is added not by us.
Suggest you go through community with change for this attribute first.
I think you will get answers on your questions regarding this attribute.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, lets stick with leaving reqd_work_group_size attribute alone.

// CHECK-NEXT: Restrict (SubjectMatchRule_function)
// CHECK-NEXT: ReturnTypestate (SubjectMatchRule_function, SubjectMatchRule_variable_is_parameter)
// CHECK-NEXT: ReturnsNonNull (SubjectMatchRule_objc_method, SubjectMatchRule_function)
// CHECK-NEXT: ReturnsTwice (SubjectMatchRule_function)
// CHECK-NEXT: SYCLDevice (SubjectMatchRule_function)
// CHECK-NEXT: SYCLDeviceIndirectlyCallable (SubjectMatchRule_function)
// CHECK-NEXT: SYCLIntelKernelArgsRestrict (SubjectMatchRule_function)
// CHECK-NEXT: ScopedLockable (SubjectMatchRule_record)
// CHECK-NEXT: Section (SubjectMatchRule_function, SubjectMatchRule_variable_is_global, SubjectMatchRule_objc_method, SubjectMatchRule_objc_property)
// CHECK-NEXT: SetTypestate (SubjectMatchRule_function_is_member)
Expand Down