-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Optimize operator[] method of host accessor #6853
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
[SYCL] Optimize operator[] method of host accessor #6853
Conversation
Compiler cannot optimize out calls to getPtr(), getOffset() and getMemoryRange(), that were used in accessor::operator[], because they may have side effects(e.g. printf). The patch adds a member in the accessor which points to the actual data stored in the accessor_impl. This pointer is initialized once during construction and used instead of functions mentioned above.
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.
LGTM
@@ -0,0 +1,26 @@ | |||
// RUN: %clangxx -O2 -fsycl -S -emit-llvm %s -o - | FileCheck %s |
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 this test is supposed to call only a host compiler.
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.
Modified the compile line. Is there a convenient way to call the host compiler only?
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 -fsycl-host-only
might be helpful.
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.
Cannot find this option in the clang's help.
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.
https://github.com/intel/llvm/blob/sycl/sycl/test/lit.cfg.py#L89 - it looks like it's a front-end option.
@romanovvlad, post commit issues: https://github.com/intel/llvm/actions/runs/3113733433/jobs/5048727706 |
Fix for them #6875 |
Compiler cannot optimize out calls to getPtr(), getOffset() and getMemoryRange(), that were used in accessor::operator[], because they may have side effects(e.g. printf). The patch adds a member in the accessor which points to the actual data stored in the accessor_impl. This pointer is initialized once during construction and used instead of functions mentioned above.