Skip to content

Commit

Permalink
[SYCL][ClangLinkerWrapper] Fix SYCL binary creation with spirv64 trip…
Browse files Browse the repository at this point in the history
…le (intel#14686)

I hit this working on thinLTO using the SPIR-V backend, but it's
reproducible just with the triple.

Signed-off-by: Sarnie, Nick <[email protected]>
  • Loading branch information
sarnex authored Jul 24, 2024
1 parent 58f829a commit 9bb2b34
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -967,10 +967,12 @@ wrapSYCLBinariesFromFile(std::vector<module_split::SplitModule> &SplitModules,

SmallVector<llvm::offloading::SYCLImage> Images;
// SYCL runtime currently works for spir64 target triple and not for
// spir64-unknown-unknown.
// TODO: Fix SYCL runtime to accept both triple
// spir64-unknown-unknown/spirv64-unknown-unknown/spirv64.
// TODO: Fix SYCL runtime to accept other triples
llvm::Triple T(Target);
StringRef A(T.getArchName());
if(A == "spirv64")
A = "spir64";
for (auto &SI : SplitModules) {
auto MBOrDesc = MemoryBuffer::getFile(SI.ModuleFilePath);
if (!MBOrDesc)
Expand Down
3 changes: 3 additions & 0 deletions sycl/test-e2e/NewOffloadDriver/buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// RUN: %clangxx -fsycl --offload-new-driver %s -o %t.out
// RUN: %{run} %t.out

// RUN: %clangxx -fsycl -fsycl-targets=spirv64 --offload-new-driver %s -o %t1.out
// RUN: %{run} %t1.out

#include <sycl/detail/core.hpp>

int main() {
Expand Down

0 comments on commit 9bb2b34

Please sign in to comment.