Skip to content
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

Connect support for dynamic linking to user options #14575

Merged
merged 26 commits into from
Aug 2, 2024

Conversation

LU-JOHN
Copy link
Contributor

@LU-JOHN LU-JOHN commented Jul 15, 2024

Add option "-fsycl-allow-device-dependencies" to enable support for dynamic linking.

Also:

  1. No functions are importable without "-fsycl-allow-device-dependencies"
  2. Deal with SYCL_EXTERNAL header decls that have lost SYCL_EXTERNAL attribute in LLVM IR
  3. SPIRV/SYCL/ESIMD builtins cannot be an imported function

Tested in three E2E test cases.

Minor change:
Change SYCL-EXTERNAL to SYCL_EXTERNAL in testcase comment.

Comment on lines 4191 to 4193
def fsycl_allow_split_with_dependencies : Flag<["-"], "fsycl-allow-split-with-dependencies">,
Group<sycl_Group>, HelpText<"Allow dependencies between device code images">;
def fno_sycl_allow_split_with_dependencies : Flag<["-"], "fno-sycl-allow-split-with-dependencies">,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we need approval from the options group for these, @mdtoguchi?

Copy link
Contributor

Choose a reason for hiding this comment

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

@sarnex and @LU-JOHN, any new option (that we are inventing) that is meant to be visible should go through the options team workgroup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add new option in separate PR.

clang/lib/Driver/ToolChains/Clang.cpp Outdated Show resolved Hide resolved
llvm/lib/SYCLLowerIR/ModuleSplitter.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@sarnex sarnex left a comment

Choose a reason for hiding this comment

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

lgtm only minor comments, the supportDynamicLinking function is a bit strange but i'm assuming this is an incremental change and it will be fleshed out soon, so it's fine with me

llvm/lib/SYCLLowerIR/ModuleSplitter.cpp Outdated Show resolved Hide resolved
@LU-JOHN
Copy link
Contributor Author

LU-JOHN commented Jul 17, 2024

lgtm only minor comments, the supportDynamicLinking function is a bit strange but i'm assuming this is an incremental change and it will be fleshed out soon, so it's fine with me

Yes, this function can only return true with the -shared option when the SYCL RT is ready. Otherwise, "-shared" tests may start failing.

Signed-off-by: Lu, John <john.lu@intel.com>
Signed-off-by: Lu, John <john.lu@intel.com>
…d for CUDA and hip

Signed-off-by: Lu, John <john.lu@intel.com>
Signed-off-by: Lu, John <john.lu@intel.com>
Signed-off-by: Lu, John <john.lu@intel.com>
Signed-off-by: Lu, John <john.lu@intel.com>
Signed-off-by: Lu, John <john.lu@intel.com>
Signed-off-by: Lu, John <john.lu@intel.com>
Signed-off-by: Lu, John <john.lu@intel.com>
Signed-off-by: Lu, John <john.lu@intel.com>
Signed-off-by: Lu, John <john.lu@intel.com>
@AlexeySachkov
Copy link
Contributor

All builds have successfully completed after merge with sycl branch. Considering that we had a fully green CI run on the second to last commit and that changes this PR introduces are into a feature that is not supported on CUDA and HIP, I think that we can merge this PR sooner without waiting for CUDA & HIP CI jobs to complete.

I will proceed with merge, but @LU-JOHN, @maarquitos14, please keep an eye on unfinished jobs in case they highlight any unexpected failures.

@AlexeySachkov AlexeySachkov merged commit 3c0532d into intel:sycl Aug 2, 2024
12 of 14 checks passed
ldrumm pushed a commit that referenced this pull request Aug 7, 2024
Most likely the clang-format checker was down when
#14575 ran CI, so a few changes
non-clang-format-compliant made it in. Applying fixes to those.

---------

Signed-off-by: Marcos Maronas <marcos.maronas@intel.com>
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.

None yet

5 participants