Skip to content

Commit

Permalink
[SYCL] Don't force SPIRV format in device binary image.
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Lazarev <vladimir.lazarev@intel.com>
Signed-off-by: Konstantin S Bobrovsky <konstantin.s.bobrovsky@intel.com>
  • Loading branch information
kbobrovs authored and vladimirlaz committed Mar 22, 2019
1 parent 6818c7b commit 7858474
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6387,15 +6387,17 @@ void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA,
HostTripleOpt += getToolChain().getAuxTriple()->str();
WrapperArgs.push_back(C.getArgs().MakeArgString(HostTripleOpt));

// TODO forcing kind and format here is a simplification which assumes wrapper
// used only with SYCL and the only device code format is SPIRV (which is true
// at this point). Should be fixed together with supporting AOT in the driver.
// TODO forcing offload kind is a simplification which assumes wrapper used
// only with SYCL. Device binary format (-format=xxx) option should also come
// from the command line and/or the native compiler. Should be fixed together
// with supporting AOT in the driver.
// If format is not set, the default is "none" which means runtime must try
// to determine it automatically.
StringRef Kind = Action::GetOffloadKindName(JA.getOffloadingDeviceKind());
WrapperArgs.push_back(
C.getArgs().MakeArgString(Twine("-kind=") + Twine(Kind)));

for (auto I : Inputs) {
WrapperArgs.push_back("-format=spirv");
WrapperArgs.push_back(I.getFilename());
}

Expand Down

0 comments on commit 7858474

Please sign in to comment.