Skip to content

Commit eee8b0f

Browse files
committed
consolidate SYCL wrapper with others.
1 parent e19602e commit eee8b0f

File tree

8 files changed

+483
-576
lines changed

8 files changed

+483
-576
lines changed

clang/tools/clang-linker-wrapper/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ set(LLVM_LINK_COMPONENTS
1616
CodeGen
1717
LTO
1818
FrontendOffloading
19-
FrontendSYCL
19+
# FrontendSYCL
2020
)
2121

2222
set(LLVM_TARGET_DEFINITIONS LinkerWrapperOpts.td)

clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,9 +719,9 @@ wrapDeviceImages(ArrayRef<std::unique_ptr<MemoryBuffer>> Buffers,
719719
return std::move(Err);
720720
break;
721721
case OFK_SYCL: {
722-
offloading::sycl::SYCLWrappingOptions WrappingOptions;
723-
if (Error Err = offloading::sycl::wrapSYCLBinaries(M, BuffersToWrap,
724-
WrappingOptions))
722+
offloading::SYCLWrappingOptions WrappingOptions;
723+
if (Error Err =
724+
offloading::wrapSYCLBinaries(M, BuffersToWrap, WrappingOptions))
725725
return Err;
726726
break;
727727
}

llvm/include/llvm/Frontend/Offloading/OffloadWrapper.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include "llvm/IR/Module.h"
1414
#include "llvm/Support/Compiler.h"
1515

16+
#include <string>
17+
1618
namespace llvm {
1719
namespace offloading {
1820
using EntryArrayTy = std::pair<GlobalVariable *, GlobalVariable *>;
@@ -52,6 +54,23 @@ LLVM_ABI llvm::Error wrapHIPBinary(llvm::Module &M, llvm::ArrayRef<char> Images,
5254
EntryArrayTy EntryArray,
5355
llvm::StringRef Suffix = "",
5456
bool EmitSurfacesAndTextures = true);
57+
58+
struct SYCLWrappingOptions {
59+
// target/compiler specific options what are suggested to use to "compile"
60+
// program at runtime.
61+
std::string CompileOptions;
62+
// Target/Compiler specific options that are suggested to use to "link"
63+
// program at runtime.
64+
std::string LinkOptions;
65+
};
66+
67+
/// Wraps OffloadBinaries in the given \p Buffers into the module \p M
68+
/// as global symbols and registers the images with the SYCL Runtime.
69+
/// \param Options Settings that allows to turn on optional data and settings.
70+
llvm::Error LLVM_ABI
71+
wrapSYCLBinaries(llvm::Module &M, llvm::ArrayRef<llvm::ArrayRef<char>> Buffers,
72+
SYCLWrappingOptions Options = SYCLWrappingOptions());
73+
5574
} // namespace offloading
5675
} // namespace llvm
5776

llvm/include/llvm/Frontend/SYCL/OffloadWrapper.h

Lines changed: 0 additions & 44 deletions
This file was deleted.

llvm/lib/Frontend/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ add_subdirectory(HLSL)
55
add_subdirectory(OpenACC)
66
add_subdirectory(OpenMP)
77
add_subdirectory(Offloading)
8-
add_subdirectory(SYCL)
8+
#add_subdirectory(SYCL)

0 commit comments

Comments
 (0)