@@ -397,7 +397,7 @@ class KernelBodyTransform : public TreeTransform<KernelBodyTransform> {
397
397
};
398
398
399
399
static FunctionDecl *
400
- CreateSYCLKernelDeclaration (ASTContext &Context, StringRef Name,
400
+ CreateOpenCLKernelDeclaration (ASTContext &Context, StringRef Name,
401
401
ArrayRef<ParamDesc> ParamDescs) {
402
402
403
403
DeclContext *DC = Context.getTranslationUnitDecl ();
@@ -412,30 +412,30 @@ CreateSYCLKernelDeclaration(ASTContext &Context, StringRef Name,
412
412
QualType FuncTy = Context.getFunctionType (RetTy, ArgTys, Info);
413
413
DeclarationName DN = DeclarationName (&Context.Idents .get (Name));
414
414
415
- FunctionDecl *SYCLKernel = FunctionDecl::Create (
415
+ FunctionDecl *OpenCLKernel = FunctionDecl::Create (
416
416
Context, DC, SourceLocation (), SourceLocation (), DN, FuncTy,
417
417
Context.getTrivialTypeSourceInfo (RetTy), SC_None);
418
418
419
419
llvm::SmallVector<ParmVarDecl *, 16 > Params;
420
420
int i = 0 ;
421
421
for (const auto &PD : ParamDescs) {
422
- auto P = ParmVarDecl::Create (Context, SYCLKernel , SourceLocation (),
422
+ auto P = ParmVarDecl::Create (Context, OpenCLKernel , SourceLocation (),
423
423
SourceLocation (), std::get<1 >(PD),
424
424
std::get<0 >(PD), std::get<2 >(PD), SC_None, 0 );
425
425
P->setScopeInfo (0 , i++);
426
426
P->setIsUsed ();
427
427
Params.push_back (P);
428
428
}
429
- SYCLKernel ->setParams (Params);
429
+ OpenCLKernel ->setParams (Params);
430
430
431
- SYCLKernel ->addAttr (SYCLDeviceAttr::CreateImplicit (Context));
432
- SYCLKernel ->addAttr (OpenCLKernelAttr::CreateImplicit (Context));
433
- SYCLKernel ->addAttr (AsmLabelAttr::CreateImplicit (Context, Name));
434
- SYCLKernel ->addAttr (ArtificialAttr::CreateImplicit (Context));
431
+ OpenCLKernel ->addAttr (SYCLDeviceAttr::CreateImplicit (Context));
432
+ OpenCLKernel ->addAttr (OpenCLKernelAttr::CreateImplicit (Context));
433
+ OpenCLKernel ->addAttr (AsmLabelAttr::CreateImplicit (Context, Name));
434
+ OpenCLKernel ->addAttr (ArtificialAttr::CreateImplicit (Context));
435
435
436
436
// Add kernel to translation unit to see it in AST-dump
437
- DC->addDecl (SYCLKernel );
438
- return SYCLKernel ;
437
+ DC->addDecl (OpenCLKernel );
438
+ return OpenCLKernel ;
439
439
}
440
440
// / Return __init method
441
441
static CXXMethodDecl *getInitMethod (const CXXRecordDecl *CRD) {
@@ -448,12 +448,12 @@ static CXXMethodDecl *getInitMethod(const CXXRecordDecl *CRD) {
448
448
return InitMethod;
449
449
}
450
450
451
- // Creates body for new SYCL kernel. This body contains initialization of kernel
452
- // object fields with kernel parameters and a little bit transformed body of the
453
- // kernel caller function.
454
- static CompoundStmt *CreateSYCLKernelBody (Sema &S,
455
- FunctionDecl *KernelCallerFunc,
456
- DeclContext *KernelDecl) {
451
+ // Creates body for new OpenCL kernel. This body contains initialization of SYCL
452
+ // kernel object fields with kernel parameters and a little bit transformed body
453
+ // of the kernel caller function.
454
+ static CompoundStmt *CreateOpenCLKernelBody (Sema &S,
455
+ FunctionDecl *KernelCallerFunc,
456
+ DeclContext *KernelDecl) {
457
457
llvm::SmallVector<Stmt *, 16 > BodyStmts;
458
458
CXXRecordDecl *LC = getKernelObjectType (KernelCallerFunc);
459
459
assert (LC && " Kernel object must be available" );
@@ -882,13 +882,13 @@ static std::string constructKernelName(QualType KernelNameType,
882
882
return Out.str ();
883
883
}
884
884
885
- // Generates the "kernel wrapper" using KernelCallerFunc (kernel caller
885
+ // Generates the OpenCL kernel using KernelCallerFunc (kernel caller
886
886
// function) defined is SYCL headers.
887
- // A "kernel wrapper" function contains the body of the kernel caller function,
887
+ // Generated OpenCL kernel contains the body of the kernel caller function,
888
888
// receives OpenCL like parameters and additionally does some manipulation to
889
889
// initialize captured lambda/functor fields with these parameters.
890
890
// SYCL runtime marks kernel caller function with sycl_kernel attribute.
891
- // To be able to generate "kernel wrapper" from KernelCallerFunc we put
891
+ // To be able to generate OpenCL kernel from KernelCallerFunc we put
892
892
// the following requirements to the function which SYCL runtime can mark with
893
893
// sycl_kernel attribute:
894
894
// - Must be template function with at least two template parameters.
@@ -903,9 +903,8 @@ static std::string constructKernelName(QualType KernelNameType,
903
903
// KernelFuncObj();
904
904
// }
905
905
//
906
- // In the code below we call "kernel wrapper" SYCLKernel.
907
906
//
908
- void Sema::ConstructSYCLKernel (FunctionDecl *KernelCallerFunc) {
907
+ void Sema::ConstructOpenCLKernel (FunctionDecl *KernelCallerFunc) {
909
908
CXXRecordDecl *LE = getKernelObjectType (KernelCallerFunc);
910
909
assert (LE && " invalid kernel caller" );
911
910
@@ -924,16 +923,16 @@ void Sema::ConstructSYCLKernel(FunctionDecl *KernelCallerFunc) {
924
923
// TODO Maybe don't emit integration header inside the Sema?
925
924
populateIntHeader (getSyclIntegrationHeader (), Name, KernelNameType, LE);
926
925
927
- FunctionDecl *SYCLKernel =
928
- CreateSYCLKernelDeclaration (getASTContext (), Name, ParamDescs);
926
+ FunctionDecl *OpenCLKernel =
927
+ CreateOpenCLKernelDeclaration (getASTContext (), Name, ParamDescs);
929
928
930
929
// Let's copy source location of a functor/lambda to emit nicer diagnostics
931
- SYCLKernel ->setLocation (LE->getLocation ());
930
+ OpenCLKernel ->setLocation (LE->getLocation ());
932
931
933
- CompoundStmt *SYCLKernelBody =
934
- CreateSYCLKernelBody (*this , KernelCallerFunc, SYCLKernel );
935
- SYCLKernel ->setBody (SYCLKernelBody );
936
- AddSyclKernel (SYCLKernel );
932
+ CompoundStmt *OpenCLKernelBody =
933
+ CreateOpenCLKernelBody (*this , KernelCallerFunc, OpenCLKernel );
934
+ OpenCLKernel ->setBody (OpenCLKernelBody );
935
+ AddSyclKernel (OpenCLKernel );
937
936
}
938
937
939
938
void Sema::MarkDevice (void ) {
0 commit comments