Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/tools/clang-linker-wrapper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ set(LLVM_LINK_COMPONENTS
CodeGen
LTO
FrontendOffloading
FrontendSYCL
# FrontendSYCL
)

set(LLVM_TARGET_DEFINITIONS LinkerWrapperOpts.td)
Expand Down
6 changes: 3 additions & 3 deletions clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,9 +719,9 @@ wrapDeviceImages(ArrayRef<std::unique_ptr<MemoryBuffer>> Buffers,
return std::move(Err);
break;
case OFK_SYCL: {
offloading::sycl::SYCLWrappingOptions WrappingOptions;
if (Error Err = offloading::sycl::wrapSYCLBinaries(M, BuffersToWrap,
WrappingOptions))
offloading::SYCLWrappingOptions WrappingOptions;
if (Error Err =
offloading::wrapSYCLBinaries(M, BuffersToWrap, WrappingOptions))
return Err;
break;
}
Expand Down
19 changes: 19 additions & 0 deletions llvm/include/llvm/Frontend/Offloading/OffloadWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include "llvm/IR/Module.h"
#include "llvm/Support/Compiler.h"

#include <string>

namespace llvm {
namespace offloading {
using EntryArrayTy = std::pair<GlobalVariable *, GlobalVariable *>;
Expand Down Expand Up @@ -52,6 +54,23 @@ LLVM_ABI llvm::Error wrapHIPBinary(llvm::Module &M, llvm::ArrayRef<char> Images,
EntryArrayTy EntryArray,
llvm::StringRef Suffix = "",
bool EmitSurfacesAndTextures = true);

struct SYCLWrappingOptions {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the members description this structure holds options for the runtime compiler (aka JIT compiler). I think it's better to reflect in the structure name.

Suggested change
struct SYCLWrappingOptions {
struct SYCLJITOptions {

Or maybe even just "JITOptions". These are specific to the device code format rather than a programming model. If we use some intermediate representation (e.g. SPIR-V), which just be compiled to the executable format, these options are useful to configure the runtime compilation step.
@sarnex, does OpenMP offload to SPIR-V compiler allows setting JIT compiler options? If so, I think this structure should have a neutral name like "JITOptions" and re-used by different offloading modes.

Copy link
Member

@sarnex sarnex Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's supported and the generated device ELF contains it but I didn't hook it up to anything from the driver yet, see here.

// target/compiler specific options what are suggested to use to "compile"
// program at runtime.
std::string CompileOptions;
// Target/Compiler specific options that are suggested to use to "link"
// program at runtime.
std::string LinkOptions;
};

/// Wraps OffloadBinaries in the given \p Buffers into the module \p M
/// as global symbols and registers the images with the SYCL Runtime.
/// \param Options Settings that allows to turn on optional data and settings.
llvm::Error LLVM_ABI
wrapSYCLBinaries(llvm::Module &M, llvm::ArrayRef<llvm::ArrayRef<char>> Buffers,
SYCLWrappingOptions Options = SYCLWrappingOptions());

} // namespace offloading
} // namespace llvm

Expand Down
44 changes: 0 additions & 44 deletions llvm/include/llvm/Frontend/SYCL/OffloadWrapper.h

This file was deleted.

2 changes: 1 addition & 1 deletion llvm/lib/Frontend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ add_subdirectory(HLSL)
add_subdirectory(OpenACC)
add_subdirectory(OpenMP)
add_subdirectory(Offloading)
add_subdirectory(SYCL)
#add_subdirectory(SYCL)
Loading
Loading