File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ class Util {
81
81
static bool isSyclHalfType (const QualType &Ty);
82
82
83
83
// / Checks whether given clang type is a full specialization of the SYCL
84
- // / property_list class.
84
+ // / buffer_location class.
85
85
static bool isSyclBufferLocation (const QualType &Ty);
86
86
87
87
// / Checks whether given clang type is a standard SYCL API class with given
@@ -1335,8 +1335,16 @@ class SyclKernelDeclCreator : public SyclKernelFieldHandler {
1335
1335
// Don't do -1 here because we count on this to be the first parameter added
1336
1336
// (if any).
1337
1337
size_t ParamIndex = Params.size ();
1338
- for (const ParmVarDecl *Param : InitMethod->parameters ())
1339
- addParam (BS, Param->getType ().getCanonicalType (), 42 );
1338
+ auto ParamIt = InitMethod->parameters ().begin ();
1339
+ if (*ParamIt) {
1340
+ // Add meaningful argument (not '-1') to buffer_location attribute only
1341
+ // for an accessor pointer
1342
+ size_t BufferLocAttrArg = handleBufferLocationProperty (FieldTy);
1343
+ addParam (BS, (*ParamIt)->getType ().getCanonicalType (), BufferLocAttrArg);
1344
+ ++ParamIt;
1345
+ for (; ParamIt != InitMethod->parameters ().end (); ++ParamIt)
1346
+ addParam (BS, (*ParamIt)->getType ().getCanonicalType (), -1 );
1347
+ }
1340
1348
LastParamIndex = ParamIndex;
1341
1349
return true ;
1342
1350
}
You can’t perform that action at this time.
0 commit comments