-
Notifications
You must be signed in to change notification settings - Fork 758
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
[WIP][Do not Review][SYCL] Decompose Kernel Parameters #1833
[WIP][Do not Review][SYCL] Decompose Kernel Parameters #1833
Conversation
fields. Currently, struct kernel parameters are passed as a whole, along with individual parameters for special SYCL types resulting in special SYCL paramters being passed twice. To avoid this, we now decompose structs, passing all fields as top level parameters. TO DO: in follow up commit: Add condition to decompose only if struct contains special SYCL type Signed-off-by: Elizabeth Andrews <elizabeth.andrews@intel.com>
Please note this crashes at the moment for multiple base classes. I am debugging this. I am not sure if the approach I've taken is correct, so any feedback is greatly appreciated. Wrapped arrays cause issue now since it is now a top level kernel argument which is not handled. I am pretty sure all special SYCL types crash too. I haven't had a chance to debug those. |
This is the AST I was using as a 'prototype' - https://godbolt.org/z/vRdcNw |
BTW, we started adding support for array kernel parameters #1764 . This change conflicts with yours. |
Signed-off-by: Elizabeth Andrews <elizabeth.andrews@intel.com>
CXXRecordDecl *RD = FieldTy->getAsCXXRecordDecl(); | ||
VisitAccessorWrapper(nullptr, Field, RD, handlers...); | ||
VisitRecord(nullptr, Field, RD, handlers...); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 3rd parameter 'RD' seems optimizable to me. I suggest removing it.
It always depends on the 2nd parameter, and defined as Field->getType()->getAsCXXRecordDecl().
VisitRecord(nullptr, Field, RD, handlers...); | |
VisitRecord(nullptr, Field, handlers...); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead, inside VisitRecord func you can write:
CXXRecordDecl *Wrapper = Parent->getType()->getAsCXXRecordDecl();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I will take a look
Signed-off-by: Elizabeth Andrews <elizabeth.andrews@intel.com>
Signed-off-by: Elizabeth Andrews <elizabeth.andrews@intel.com>
Signed-off-by: Elizabeth Andrews <elizabeth.andrews@intel.com>
void leaveStruct(const CXXRecordDecl *, FieldDecl *FD) final { | ||
MemberExprBases.pop_back(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should leave it.
} | ||
// if (MemberExprBases.size() == 1) { | ||
InitializedEntity Entity = | ||
InitializedEntity::InitializeMember(FD, &VarEntity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit concerned about this place since VarEntity
is some stuff created for kernel object clone variable. I think we need to create corresponding InitializedEntity
for each structure when we enter it.
Work moved to PR#1877 |
JointMatrixMadINTEL will stand for signed/signed Matrix type JointMatrixSUMadINTEL will stand for signed/signed Matrix type JointMatrixUSMadINTEL will stand for unsigned/signed Matrix type JointMatrixUUMadINTEL will stand for unsigned/unsigned Matrix type Spec update: intel#8175 Signed-off-by: Dmitry Sidorov dmitry.sidorov@intel.com Original commit: KhronosGroup/SPIRV-LLVM-Translator@a7a1d2f
[OpenCL] Add OpenCL version check for independent forward progress query
First (incomplete) patch decomposing base classes and structfields.
Currently, struct kernel parameters are passed as a whole, along with
individual parameters for special SYCL types resulting in special SYCL
paramters being passed twice. To avoid this, we now decompose structs,
passing all fields as top level parameters.
TO DO: in follow up commit: Add condition to decompose only if struct
contains special SYCL type
Signed-off-by: Elizabeth Andrews elizabeth.andrews@intel.com