-
Notifications
You must be signed in to change notification settings - Fork 796
[Driver][SYCL] Host objects usage improvements with -fsycl-link=image #15539
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
Conversation
When using -fintelfpga -fsycl-link=image, the host objects were packaged as objects as they would a regular archive. This was not handled in the same way as -fsycl-link=early, causing an issue with how the objects can be read in, especially on Windows. Update the -fsycl-link=image behavior when packaging the host objects to match that of -fsycl-link=early. This allows for the host objects to be unbundled and used as actual objects during the link. The Microsoft linker does not expect 'main' to be in a library, so breaking this out allows for proper linking with -fsycl-link=image archives.
|
@intel/dpcpp-clang-driver-reviewers, please take a look |
| // RUN: %clangxx -### -target x86_64-unknown-linux-gnu -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fintelfpga -fsycl-link -Xshardware %t.o -o libfoo.a 2>&1 \ | ||
| // RUN: | FileCheck -check-prefixes=CHK-FPGA-LINK,CHK-FPGA-EARLY %s | ||
| // RUN: %clangxx -### -O2 -target x86_64-unknown-linux-gnu -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fintelfpga -fsycl-link=early -Xshardware %t.o -o libfoo.a 2>&1 \ | ||
| // RUN: | FileCheck -check-prefixes=CHK-FPGA-LINK,CHK-FPGA-EARLY %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.
Does RUN at L5 require check-prefix CHK-FPGA-LINK?
Same for RUN at L3.
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, CHK-FPGA-LINK usage is generic in nature. The -fsycl-link=early and -fsycl-link=image behaviors are now more closely matched and the CHK-FPGA-LINK checks cover the lines that are common.
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.
nit: I think -O2 is probably not needed at L5
|
@intel/llvm-gatekeepers, this should be ready for merge - thanks! |
|
@mdtoguchi - It looks like the following started failing after this patch: Could you please investigate ASAP? |
Thanks for the heads up @steffenlarsen, looking... |
|
PR for fpga-aoc-archive-early2.cpp failure here: #15661 |
When using -fintelfpga -fsycl-link=image, the host objects were packaged as objects as they would a regular archive. This was not handled in the same way as -fsycl-link=early, causing an issue with how the objects can be read in, especially on Windows.
Update the -fsycl-link=image behavior when packaging the host objects to match that of -fsycl-link=early. This allows for the host objects to be unbundled and used as actual objects during the link. The Microsoft linker does not expect 'main' to be in a library, so breaking this out allows for proper linking with -fsycl-link=image archives.