-
Notifications
You must be signed in to change notification settings - Fork 798
[SYCL] Treat only SYCL kernels as entry points for FPGA target #4693
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] Treat only SYCL kernels as entry points for FPGA target #4693
Conversation
Added a flag `-emit-non-kernel-entry-points`, which is on by default and can be turned off to disable treating `SYCL_EXTERNAL` functions with `sycl-module-id` attribute as entry points.
@@ -29,6 +29,22 @@ | |||
// CHK-RANGE-ROUNDING: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-disable-range-rounding" | |||
// CHK-RANGE-ROUNDING: clang{{.*}} "-fsycl-disable-range-rounding"{{.*}} "-fsycl-is-host" | |||
|
|||
/// FPGA target implies -emit-non-kernel-entry-points=0 in sycl-post-link |
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.
would be good to add a test case which checks that the default for other targets if no option
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 believe that's already being done on line 39. Nevertheless, if the default behavior of sycl-post-link gets changed, these checks will have to be adjusted accordingly.
@@ -175,6 +175,13 @@ static cl::opt<bool> EmitExportedSymbols{"emit-exported-symbols", | |||
cl::desc("emit exported symbols"), | |||
cl::cat(PostLinkCat)}; | |||
|
|||
static cl::opt<bool> EmitNonKernelEntryPoints{ | |||
"emit-non-kernel-entry-points", |
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 would suggest to reverse the semantic of the option, as "normal" behavior is to treat SYCL external functions just like kernels. "emit-only-kernel-entries" with default 0.
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.
Yes, that makes sense, applied in 4cdb830
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!
The test failed in intel/llvm#4693 and intel/llvm#4649. I wasn't able to reproduce the failure locally and restart made the issue dissappear. Therefore, disabled the test until the flakiness is analyzed/root caused.
I don't believe that the failure in |
Restarted test passed, merging |
Returned back small piece of code which was accidentally reverted in intel#4693
Returned back small piece of code which was accidentally reverted in #4693
Introduced new
sycl-post-link
option-emit-only-kernels-as-entry-points
,which allows to stop treating
SYCL_EXTERNAL
functions as entry points.Updated clang driver to pass the new option for
spir64_fpga
target, becauseon FPGA, there are no use cases for preserving
SYCL_EXTERNAL
functionsas separate entries in device images if they are not referenced and it only
causes compilation slowdowns due to increased amount of device code.