Skip to content

[Driver] Use clang-offload-deps tool for generating device dependencies #2935

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

Merged

Conversation

sndmitriev
Copy link
Contributor

This patch changes driver to use clang-offload-deps tool for generating
dependence objects for SYCL and OpenMP programs when static fat libraries
are used. Driver adds an additional link step on the host side to create
host image which serves as an input for the clang-offload-deps tool.
Dependence bitcode files produced by the tool are then compiled to
objects where necessary and added to the device linker inputs.

Signed-off-by: Sergey Dmitriev [email protected]

@sndmitriev sndmitriev force-pushed the public/sndmitriev/link-offload-deps branch from f370ae6 to 371034f Compare December 22, 2020 10:10
This patch changes driver to use clang-offload-deps tool for generating
dependence objects for SYCL and OpenMP programs when static fat libraries
are used. Driver adds an additional link step on the host side to create
host image which serves as an input for the clang-offload-deps tool.
Dependence bitcode files produced by the tool are then compiled to
objects where necessary and added to the device linker inputs.

Signed-off-by: Sergey Dmitriev <[email protected]>
@sndmitriev sndmitriev force-pushed the public/sndmitriev/link-offload-deps branch from 371034f to b6374c7 Compare December 22, 2020 11:38
@sndmitriev sndmitriev requested a review from bader as a code owner December 22, 2020 18:02
Use @llvm.used global variable for representing a reference for 'sycl'
offloading kind.

Signed-off-by: Sergey Dmitriev <[email protected]>
@sndmitriev sndmitriev force-pushed the public/sndmitriev/link-offload-deps branch from 804616c to ed4d6ec Compare December 23, 2020 02:26
@@ -4742,6 +4774,28 @@ class OffloadingActionBuilder final {
return false;
}

void addDeviceDependencies(ActionList &LinkerInputs) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name addDeviceDependencies threw me for a loop as it is similar to the existing addDeviceDepences. is there a better name we can use here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does addDeviceLinkDependenciesFromHost look better?

Signed-off-by: Sergey Dmitriev <[email protected]>
kbobrovs
kbobrovs previously approved these changes Dec 24, 2020
mdtoguchi
mdtoguchi previously approved these changes Dec 28, 2020
Copy link
Contributor

@mdtoguchi mdtoguchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

AGindinson
AGindinson previously approved these changes Dec 28, 2020
Copy link
Contributor

@AGindinson AGindinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may have missed some design nuances, but the overall structure LGTM.

Signed-off-by: Sergey Dmitriev <[email protected]>
@sndmitriev sndmitriev dismissed stale reviews from AGindinson, mdtoguchi, and kbobrovs via e8dd5a8 December 29, 2020 03:19
@sndmitriev
Copy link
Contributor Author

Is it possible for somebody else to approve this patch while @bader is on vacation?

@romanovvlad romanovvlad merged commit 08a1c00 into intel:sycl Dec 30, 2020
@sndmitriev sndmitriev deleted the public/sndmitriev/link-offload-deps branch December 30, 2020 16:25
jsji pushed a commit that referenced this pull request Feb 25, 2025
For in-tree builds with shared libraries, setting the rpath not only
works, but is required.

Fixes #2906

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@7c0db925422d1f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants