@@ -1774,7 +1774,8 @@ class SyclKernelIntHeaderCreator : public SyclKernelFieldHandler {
1774
1774
ArgTy = CAT->getElementType ();
1775
1775
Size = SemaRef.getASTContext ().getTypeSizeInChars (ArgTy).getQuantity ();
1776
1776
Header.addParamDesc (Kind, static_cast <unsigned >(Size),
1777
- static_cast <unsigned >(CurOffset), 1 );
1777
+ static_cast <unsigned >(CurOffset),
1778
+ /* NumOpenCLParams=*/ 1 );
1778
1779
}
1779
1780
1780
1781
public:
@@ -1785,14 +1786,11 @@ class SyclKernelIntHeaderCreator : public SyclKernelFieldHandler {
1785
1786
Header.startKernel (Name, NameType, StableName, KernelObj->getLocation ());
1786
1787
}
1787
1788
1788
- unsigned getNumOpenCLParams (const CXXRecordDecl *SamplerOrAccessorTy) {
1789
- assert (SamplerOrAccessorTy &&
1790
- " Sampler/Accessor type must be a C++ record type" );
1791
- CXXMethodDecl *InitMethod =
1792
- getMethodByName (SamplerOrAccessorTy, InitMethodName);
1793
- assert (InitMethod && " sampler/accessor must have __init method" );
1794
- unsigned NumOpenCLParams;
1795
- return NumOpenCLParams = InitMethod->param_size ();
1789
+ unsigned getNumOpenCLParams (const CXXRecordDecl *AccessorTy) {
1790
+ assert (AccessorTy && " Accessor type must be a C++ record type" );
1791
+ CXXMethodDecl *InitMethod = getMethodByName (AccessorTy, InitMethodName);
1792
+ assert (InitMethod && " accessor must have __init method" );
1793
+ return InitMethod->param_size ();
1796
1794
}
1797
1795
1798
1796
bool handleSyclAccessorType (const CXXBaseSpecifier &BC,
@@ -2726,14 +2724,11 @@ void SYCLIntegrationHeader::emit(raw_ostream &O) {
2726
2724
O << " { kernel_param_kind_t::" << TyStr << " , " ;
2727
2725
O << P.Info << " , " << P.Offset << " , " ;
2728
2726
O << " param_omit_table[" << CurIndex << " ]" ;
2727
+ ++CurIndex;
2729
2728
for (unsigned X = 1 ; X < P.NumOpenCLParams ; X++) {
2729
+ O << " | (param_omit_table[" << CurIndex << " ] << " << X << " )" ;
2730
2730
++CurIndex;
2731
- if (X < P.NumOpenCLParams )
2732
- O << " | " ;
2733
- O << " (param_omit_table[" << CurIndex << " ]"
2734
- << " << " << X << " )" ;
2735
2731
}
2736
- ++CurIndex;
2737
2732
O << " }" ;
2738
2733
O << " ,\n " ;
2739
2734
}
0 commit comments