-
Notifications
You must be signed in to change notification settings - Fork 796
[Driver][SYCL] Address issue with code splitting and FPGA Archives #15794
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
Changes from 4 commits
a494866
1b40ef2
bf4613e
3ae148e
1378478
e12ef19
d9b86b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10263,8 +10263,18 @@ void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA, | |
| const InputInfo &I = Inputs[0]; | ||
| assert(I.isFilename() && "Invalid input."); | ||
|
|
||
| if (I.getType() == types::TY_Tempfiletable || | ||
| I.getType() == types::TY_Tempfilelist || IsEmbeddedIR) | ||
| // TODO: The embedded compilation step after the wrapping step restricts | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this a TODO? Is this not more of a restriction? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is a restriction - but in my opinion it would be best to pull the compile step out of the wrapping step which provides a cleaner picture of the toolchain. We shouldn't expect the wrapping step to do the compilation too (it isn't embedded for OpenMP) |
||
| // the ability to control the 'for each' methodology used when performing | ||
| // device code splitting. We set the individual wrap behavior when we know | ||
| // the wrapping and compile step should be done individually. Ideally this | ||
| // would be controlled at the JobAction creation, but we cannot do that | ||
| // until the compilation of the wrap is it's own JobAction. | ||
| bool IndividualWrapCompile = WrapperJob.getIndividualWrap(); | ||
| const InputInfo TempOutput(types::TY_LLVM_BC, WrapperFileName, | ||
| WrapperFileName); | ||
| if (!IndividualWrapCompile && | ||
| (I.getType() == types::TY_Tempfiletable || | ||
| I.getType() == types::TY_Tempfilelist || IsEmbeddedIR)) | ||
| // Input files are passed via the batch job file table. | ||
| WrapperArgs.push_back(C.getArgs().MakeArgString("-batch")); | ||
| WrapperArgs.push_back(C.getArgs().MakeArgString(I.getFilename())); | ||
|
|
@@ -10273,7 +10283,17 @@ void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA, | |
| JA, *this, ResponseFileSupport::None(), | ||
| TCArgs.MakeArgString(getToolChain().GetProgramPath(getShortName())), | ||
| WrapperArgs, std::nullopt); | ||
| C.addCommand(std::move(Cmd)); | ||
|
|
||
| if (IndividualWrapCompile) { | ||
| // When wrapping FPGA device binaries for FPGA archives, create individual | ||
| // wrapped and compiled entries for the archive. | ||
| StringRef ParallelJobs = | ||
| C.getArgs().getLastArgValue(options::OPT_fsycl_max_parallel_jobs_EQ); | ||
| clang::driver::tools::SYCL::constructLLVMForeachCommand( | ||
| C, JA, std::move(Cmd), Inputs, TempOutput, this, "", "bc", | ||
| ParallelJobs); | ||
| } else | ||
| C.addCommand(std::move(Cmd)); | ||
|
|
||
| if (WrapperCompileEnabled) { | ||
| // TODO Use TC.SelectTool(). | ||
|
|
@@ -10296,9 +10316,19 @@ void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA, | |
| SmallString<128> ClangPath(C.getDriver().Dir); | ||
| llvm::sys::path::append(ClangPath, "clang"); | ||
| const char *Clang = C.getArgs().MakeArgString(ClangPath); | ||
| C.addCommand(std::make_unique<Command>(JA, *this, | ||
| ResponseFileSupport::None(), Clang, | ||
| ClangArgs, std::nullopt)); | ||
| auto Cmd = | ||
mdtoguchi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| std::make_unique<Command>(JA, *this, ResponseFileSupport::None(), | ||
| Clang, ClangArgs, std::nullopt); | ||
| if (IndividualWrapCompile) { | ||
| StringRef ParallelJobs = C.getArgs().getLastArgValue( | ||
| options::OPT_fsycl_max_parallel_jobs_EQ); | ||
| InputInfoList Inputs; | ||
| Inputs.push_back(TempOutput); | ||
| clang::driver::tools::SYCL::constructLLVMForeachCommand( | ||
| C, JA, std::move(Cmd), Inputs, Output, this, "", "bc", | ||
| ParallelJobs); | ||
| } else | ||
| C.addCommand(std::move(Cmd)); | ||
| } | ||
| return; | ||
| } // end of SYCL flavor of offload wrapper command creation | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.