-
Couldn't load subscription status.
- Fork 793
[NewOffloadModel] Fix argument parsing in Clang Linker Wrapper #20470
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
base: sycl
Are you sure you want to change the base?
Conversation
… new offloading model
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.
E2E tests LGTM
| /// Otherwise return 'false'. | ||
| bool Driver::GetUseNewOffloadDriverForSYCLOffload(Compilation &C, | ||
| const ArgList &Args) const { | ||
| // Check only if enabled with -fsycl |
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.
| // Check only if enabled with -fsycl | |
| // Check only if enabled with -fsycl. |
| /// Utility function to parse all devices passed via -fsycl-targets. | ||
| /// Return 'true' for JIT, AOT Intel CPU/GPUs and NVidia/AMD targets. | ||
| /// Otherwise return 'false'. | ||
| bool Driver::GetUseNewOffloadDriverForSYCLOffload(Compilation &C, |
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 the name doesn't describe very well what the function is doing, or at least doesn't align very well with the description in the comment above. I would expect something including the words Get and Devices at least.
| if (!BeforeOptions.empty()){ | ||
| SmallVector<StringRef, 8> BeforeArgs; | ||
| BeforeOptions.split(BeforeArgs, " ", /*MaxSplit=*/-1, /*KeepEmpty=*/false); | ||
| for (auto string : BeforeArgs) { |
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.
This is most likely introducing a copy for each arg. Can we try const auto & instead?
| CmdArgs.push_back(Args.MakeArgString(Replace)); | ||
| SmallVector<StringRef, 8> AfterArgs; | ||
| AfterOptions.split(AfterArgs, " ", /*MaxSplit=*/-1, /*KeepEmpty=*/false); | ||
| std::string JoinedOptions = llvm::join(AfterArgs, " "); |
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 this pass all tests? It was similar to this before and I had to add the , because it was causing trouble with ocloc. I added a specific test for that, so if it is passing, then I'm good.
| // RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_dg2_g10,intel_gpu_dg2_g11,intel_gpu_dg2_g12,intel_gpu_pvc,intel_gpu_mtl_h,intel_gpu_mtl_u -fsycl-fp64-conv-emu %O0 %s -o %t.out | ||
| // RUN: %{run} %t.out | ||
|
|
||
| // RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_dg2_g10,intel_gpu_dg2_g11,intel_gpu_dg2_g12,intel_gpu_pvc,intel_gpu_mtl_h,intel_gpu_mtl_u -fsycl-fp64-conv-emu --offload-new-driver %O0 %s -o %t.out |
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.
Could we also try with -g? The code you're changing used to have issues with -g, so just to be on the safe side.
This PR is still working in progress. Thanks for understanding :)