[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-05 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann closed https://github.com/llvm/llvm-project/pull/111389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-04 Thread Tom Honermann via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-04 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,34 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(CanQualType KernelNameType, + const FunctionDecl *FD) { + return {KernelNameType, FD}; +} +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-04 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann updated https://github.com/llvm/llvm-project/pull/111389 >From 3c4a2b8a52d3f1c730df88a308dece21a67834ef Mon Sep 17 00:00:00 2001 From: Tom Honermann Date: Fri, 4 Oct 2024 11:10:32 -0700 Subject: [PATCH 1/9] [SYCL] The sycl_kernel_entry_point attribute. The `sycl_

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 1 nit, else LGTM. Please let @keryell chime in on the constexpr decision. https://github.com/llvm/llvm-project/pull/111389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-04 Thread Erich Keane via cfe-commits
@@ -14296,6 +14296,34 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(CanQualType KernelNameType, + const FunctionDecl *FD) { + return {KernelNameType, FD}; +} +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/111389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
tahonermann wrote: @erichkeane, I believe all of the concerns you raised have been resolved with the exception of the `constexpr` question for which you asked @keryell to weigh in. I hope we're close to consensus on no need for a change for that one. Please re-review when time permits. https:

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
@@ -1155,6 +1155,15 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) { for (unsigned I = 0; I != NumParams; ++I) Params.push_back(readDeclAs()); FD->setParams(Reader.getContext(), Params); + + // If the declaration is a SYCL kernel entry point function as ind

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann updated https://github.com/llvm/llvm-project/pull/111389 >From 3c4a2b8a52d3f1c730df88a308dece21a67834ef Mon Sep 17 00:00:00 2001 From: Tom Honermann Date: Fri, 4 Oct 2024 11:10:32 -0700 Subject: [PATCH 1/8] [SYCL] The sycl_kernel_entry_point attribute. The `sycl_

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Aaron Ballman via cfe-commits
@@ -407,7 +407,8 @@ def MicrosoftExt : LangOpt<"MicrosoftExt">; def Borland : LangOpt<"Borland">; def CUDA : LangOpt<"CUDA">; def HIP : LangOpt<"HIP">; -def SYCL : LangOpt<"SYCLIsDevice">; +def SYCLHost : LangOpt<"SYCLIsHost">; AaronBallman wrote: IMO, where w

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann updated https://github.com/llvm/llvm-project/pull/111389 >From 3c4a2b8a52d3f1c730df88a308dece21a67834ef Mon Sep 17 00:00:00 2001 From: Tom Honermann Date: Fri, 4 Oct 2024 11:10:32 -0700 Subject: [PATCH 1/7] [SYCL] The sycl_kernel_entry_point attribute. The `sycl_

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
@@ -407,7 +407,8 @@ def MicrosoftExt : LangOpt<"MicrosoftExt">; def Borland : LangOpt<"Borland">; def CUDA : LangOpt<"CUDA">; def HIP : LangOpt<"HIP">; -def SYCL : LangOpt<"SYCLIsDevice">; +def SYCLHost : LangOpt<"SYCLIsHost">; tahonermann wrote: Thanks, Erich

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Erich Keane via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Erich Keane via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Erich Keane via cfe-commits
@@ -407,7 +407,8 @@ def MicrosoftExt : LangOpt<"MicrosoftExt">; def Borland : LangOpt<"Borland">; def CUDA : LangOpt<"CUDA">; def HIP : LangOpt<"HIP">; -def SYCL : LangOpt<"SYCLIsDevice">; +def SYCLHost : LangOpt<"SYCLIsHost">; erichkeane wrote: Aaron chatted

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-31 Thread Tom Honermann via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-31 Thread Erich Keane via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-31 Thread Tom Honermann via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-31 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-31 Thread Erich Keane via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-31 Thread Erich Keane via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-31 Thread Tom Honermann via cfe-commits
@@ -0,0 +1,137 @@ +// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++17 -fsyntax-only -fsycl-is-device -verify %s tahonermann wrote: Erich, I'm going to resolve this conversation regarding tests and diagnostics (planned for the next PR). Please unresolve if t

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-31 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-31 Thread Erich Keane via cfe-commits
@@ -0,0 +1,137 @@ +// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++17 -fsyntax-only -fsycl-is-device -verify %s erichkeane wrote: I think that is fine for me. Again, sorry for not seeing this one :/ I would LOVE to see the list of 'things not diagnosed' d

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-31 Thread Erich Keane via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-31 Thread Erich Keane via cfe-commits
@@ -0,0 +1,144 @@ +// Tests without serialization: +// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown -fsycl-is-device \ +// RUN: -ast-dump %s \ +// RUN: | FileCheck --match-full-lines %s +// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown -fsycl-is-host \

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-31 Thread Erich Keane via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-31 Thread Erich Keane via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-31 Thread Erich Keane via cfe-commits
@@ -455,6 +455,64 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute specifies that a function defini

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-31 Thread Erich Keane via cfe-commits
@@ -455,6 +455,64 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute specifies that a function defini

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-31 Thread Aaron Ballman via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Ronan Keryell via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -455,6 +455,64 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute specifies that a function defini

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -198,3 +198,12 @@ void SemaSYCL::handleKernelAttr(Decl *D, const ParsedAttr &AL) { handleSimpleAttribute(*this, D, AL); } + +void SemaSYCL::handleKernelEntryPointAttr(Decl *D, const ParsedAttr &AL) { + ParsedType PT = AL.getTypeArg(); + TypeSourceInfo *TSI = nullptr; +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -455,6 +455,64 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute specifies that a function defini

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -455,6 +455,64 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute specifies that a function defini

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -0,0 +1,42 @@ +//===--- SYCLKernelInfo.h --- Information about SYCL kernels --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -407,7 +407,8 @@ def MicrosoftExt : LangOpt<"MicrosoftExt">; def Borland : LangOpt<"Borland">; def CUDA : LangOpt<"CUDA">; def HIP : LangOpt<"HIP">; -def SYCL : LangOpt<"SYCLIsDevice">; +def SYCLHost : LangOpt<"SYCLIsHost">; tahonermann wrote: With regard t

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -0,0 +1,144 @@ +// Tests without serialization: +// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown -fsycl-is-device \ +// RUN: -ast-dump %s \ +// RUN: | FileCheck --match-full-lines %s +// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown -fsycl-is-host \

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane requested changes to this pull request. See other comments/discussion. https://github.com/llvm/llvm-project/pull/111389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -407,7 +407,8 @@ def MicrosoftExt : LangOpt<"MicrosoftExt">; def Borland : LangOpt<"Borland">; def CUDA : LangOpt<"CUDA">; def HIP : LangOpt<"HIP">; -def SYCL : LangOpt<"SYCLIsDevice">; +def SYCLHost : LangOpt<"SYCLIsHost">; erichkeane wrote: To me, this is

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -407,7 +407,8 @@ def MicrosoftExt : LangOpt<"MicrosoftExt">; def Borland : LangOpt<"Borland">; def CUDA : LangOpt<"CUDA">; def HIP : LangOpt<"HIP">; -def SYCL : LangOpt<"SYCLIsDevice">; +def SYCLHost : LangOpt<"SYCLIsHost">; tahonermann wrote: The `SYCLIsDe

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -0,0 +1,144 @@ +// Tests without serialization: +// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown -fsycl-is-device \ +// RUN: -ast-dump %s \ +// RUN: | FileCheck --match-full-lines %s +// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown -fsycl-is-host \

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -407,7 +407,8 @@ def MicrosoftExt : LangOpt<"MicrosoftExt">; def Borland : LangOpt<"Borland">; def CUDA : LangOpt<"CUDA">; def HIP : LangOpt<"HIP">; -def SYCL : LangOpt<"SYCLIsDevice">; +def SYCLHost : LangOpt<"SYCLIsHost">; tahonermann wrote: I've never lo

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -14296,6 +14296,29 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(CanQualType KernelNameType, erichkeane wrote: Got it, thanks! https://github.com/llvm/llvm-project/pull/111389

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -0,0 +1,42 @@ +//===--- SYCLKernelInfo.h --- Information about SYCL kernels --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,29 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(CanQualType KernelNameType, tahonermann wrote: I agree it is silly as is. It will get bigger; see [here](https://gi

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -407,7 +407,8 @@ def MicrosoftExt : LangOpt<"MicrosoftExt">; def Borland : LangOpt<"Borland">; def CUDA : LangOpt<"CUDA">; def HIP : LangOpt<"HIP">; -def SYCL : LangOpt<"SYCLIsDevice">; +def SYCLHost : LangOpt<"SYCLIsHost">; erichkeane wrote: Those are a we

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-28 Thread Ronan Keryell via cfe-commits
@@ -407,7 +407,8 @@ def MicrosoftExt : LangOpt<"MicrosoftExt">; def Borland : LangOpt<"Borland">; def CUDA : LangOpt<"CUDA">; def HIP : LangOpt<"HIP">; -def SYCL : LangOpt<"SYCLIsDevice">; +def SYCLHost : LangOpt<"SYCLIsHost">; keryell wrote: On the other hand

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-28 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/111389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-28 Thread Erich Keane via cfe-commits
@@ -407,7 +407,8 @@ def MicrosoftExt : LangOpt<"MicrosoftExt">; def Borland : LangOpt<"Borland">; def CUDA : LangOpt<"CUDA">; def HIP : LangOpt<"HIP">; -def SYCL : LangOpt<"SYCLIsDevice">; +def SYCLHost : LangOpt<"SYCLIsHost">; erichkeane wrote: Is the `Is` we

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-28 Thread Erich Keane via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-28 Thread Erich Keane via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-28 Thread Erich Keane via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-28 Thread Erich Keane via cfe-commits
@@ -1155,6 +1155,15 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) { for (unsigned I = 0; I != NumParams; ++I) Params.push_back(readDeclAs()); FD->setParams(Reader.getContext(), Params); + + // If the declaration is a SYCL kernel entry point function as ind

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-28 Thread Erich Keane via cfe-commits
@@ -0,0 +1,42 @@ +//===--- SYCLKernelInfo.h --- Information about SYCL kernels --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-28 Thread Erich Keane via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-28 Thread Erich Keane via cfe-commits
@@ -14296,6 +14296,29 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(CanQualType KernelNameType, erichkeane wrote: This function seems a little silly. Is this because we intend for it

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-28 Thread Erich Keane via cfe-commits
@@ -0,0 +1,144 @@ +// Tests without serialization: +// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown -fsycl-is-device \ +// RUN: -ast-dump %s \ +// RUN: | FileCheck --match-full-lines %s +// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown -fsycl-is-host \

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-28 Thread Erich Keane via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-28 Thread Erich Keane via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-28 Thread Erich Keane via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-28 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: A handful of minor things, but overall I think this is alright. https://github.com/llvm/llvm-project/pull/111389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-27 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann updated https://github.com/llvm/llvm-project/pull/111389 >From 3c4a2b8a52d3f1c730df88a308dece21a67834ef Mon Sep 17 00:00:00 2001 From: Tom Honermann Date: Fri, 4 Oct 2024 11:10:32 -0700 Subject: [PATCH 1/5] [SYCL] The sycl_kernel_entry_point attribute. The `sycl_

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-27 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann updated https://github.com/llvm/llvm-project/pull/111389 >From 3c4a2b8a52d3f1c730df88a308dece21a67834ef Mon Sep 17 00:00:00 2001 From: Tom Honermann Date: Fri, 4 Oct 2024 11:10:32 -0700 Subject: [PATCH 1/4] [SYCL] The sycl_kernel_entry_point attribute. The `sycl_

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-27 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,30 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, tahonermann wrote: Done. https://github.com/llvm/llvm-project/pull/111389

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-22 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,30 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, tahonermann wrote: Oops, yes. It will be needed in future PRs, but should be added then. I'll

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-21 Thread Alexey Bader via cfe-commits
https://github.com/bader approved this pull request. LGTM, thanks! I second @keryell: thank you for the good documentation. https://github.com/llvm/llvm-project/pull/111389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-21 Thread Alexey Bader via cfe-commits
@@ -14296,6 +14296,30 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, bader wrote: `Context` parameter is unused. I suppose it might trigger a compiler warning. Can

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-21 Thread Alexey Bader via cfe-commits
https://github.com/bader edited https://github.com/llvm/llvm-project/pull/111389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-21 Thread Ronan Keryell via cfe-commits
https://github.com/keryell approved this pull request. LGTM. Thanks for the good documentation! https://github.com/llvm/llvm-project/pull/111389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-18 Thread Erich Keane via cfe-commits
erichkeane wrote: > @erichkeane, I think I have addressed or replied to all of your comments. > Another round of review feedback would be much appreciated! > > @bader, as SYCL code maintainer, I would appreciate if you can take a look. I didnt get a chance to get back to this during the week,

  1   2   >