Skip to content
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

[SYCL] Link and include LLVM utility headers in SYCL library #16763

Draft
wants to merge 8 commits into
base: sycl
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
14 changes: 12 additions & 2 deletions sycl/source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
if (SYCL_ENABLE_STACK_PRINTING)
if(NOT MSVC OR (CMAKE_BUILD_TYPE STREQUAL "Debug" AND ARG_COMPILE_OPTIONS MATCHES ".*MDd.*") OR
(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT ARG_COMPILE_OPTIONS MATCHES ".*MDd.*"))
add_dependencies(${LIB_NAME} LLVMSupport)
target_compile_definitions(${LIB_OBJ_NAME} PUBLIC ENABLE_STACK_TRACE)
target_link_libraries(${LIB_NAME} PRIVATE LLVMSupport)
endif()
endif()

Expand Down Expand Up @@ -147,6 +145,18 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
PRIVATE OpenCL-Headers
)

# Link with LLVMSupport and LLVMObject for shared utilities.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm skeptical about linking LLVM libraries with SYCL RT. I had a similar discussion with @stdale-intel and @AlexeySachkov while implementing device image compression (like: #15124 (comment)) and one of the major concerns was potential version mismatch between LLVM libraries linked to SYCL RT and other components like ocloc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I spoke to @AlexeySachkov about this and I agree that it could potentially be a problem if we were to link with it dynamically, but I doubt we would ever want to do that. We already ship enough libraries, and I don't imagine ocloc links dynamically with the LLVM libraries either. The only reason we want to link with these are to have some common utilities, so the binary size increase should also be minor as we link privately and won't leak any of the symbols from the libraries.

Copy link
Contributor

Choose a reason for hiding this comment

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

Linking LLVM libraries statically still can be a problem if we export any LLVM symbols from the SYCL runtime library. AFAIK, we have some measures to force SYCL runtime to export only explicitly marked symbols, but I would explicitly test compatibly with the projects linking against both SYCL runtime and LLVM libraries.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Linking LLVM libraries statically still can be a problem if we export any LLVM symbols from the SYCL runtime library. AFAIK, we have some measures to force SYCL runtime to export only explicitly marked symbols, but I would explicitly test compatibly with the projects linking against both SYCL runtime and LLVM libraries.

I do believe that should be avoided due to the PRIVATE linkage. We should also see it in our ABI symbols tests if there were any new symbols added to the binary after this link, but it seems to not be the case on neither Windows nor Linux.

add_dependencies(${LIB_NAME} LLVMSupport LLVMObject)
target_include_directories(${LIB_NAME} SYSTEM PRIVATE ${LLVM_MAIN_INCLUDE_DIR})
target_link_libraries(${LIB_NAME} PRIVATE LLVMSupport LLVMObject)
target_compile_definitions(${LIB_NAME} PRIVATE LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1)

if (NOT MSVC)
Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC, you can mark headers as SYSTEM in CMake to avoid warning being emitted for them. We do this with the LLVM headers in SYCL-JIT: https://github.com/intel/llvm/blob/sycl/sycl-jit/jit-compiler/CMakeLists.txt#L57-L63

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh neat! Much better. 😄

# LLVM library increases the size of the SYCL library quite significantly
# without the following link options.
target_link_options(${LIB_NAME} PRIVATE -Wl,--gc-sections)
endif()

if(SYCL_ENABLE_EXTENSION_JIT)
if(NOT DEFINED LLVM_EXTERNAL_SYCL_JIT_SOURCE_DIR)
message(FATAL_ERROR "Undefined LLVM_EXTERNAL_SYCL_JIT_SOURCE_DIR variable: Must be set when extension to JIT SYCL kernels is enabled")
Expand Down
34 changes: 0 additions & 34 deletions sycl/source/detail/compiler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,40 +35,6 @@
#define __SYCL_DEVICE_BINARY_TARGET_LLVM_NVPTX64 "llvm_nvptx64"
#define __SYCL_DEVICE_BINARY_TARGET_LLVM_AMDGCN "llvm_amdgcn"

/// Device binary image property set names recognized by the SYCL runtime.
/// Name must be consistent with
/// PropertySetRegistry::SYCL_SPECIALIZATION_CONSTANTS defined in
/// PropertySetIO.h
#define __SYCL_PROPERTY_SET_SPEC_CONST_MAP "SYCL/specialization constants"
/// PropertySetRegistry::SYCL_SPEC_CONSTANTS_DEFAULT_VALUES defined in
/// PropertySetIO.h
#define __SYCL_PROPERTY_SET_SPEC_CONST_DEFAULT_VALUES_MAP \
"SYCL/specialization constants default values"
/// PropertySetRegistry::SYCL_DEVICELIB_REQ_MASK defined in PropertySetIO.h
#define __SYCL_PROPERTY_SET_DEVICELIB_REQ_MASK "SYCL/devicelib req mask"
/// PropertySetRegistry::SYCL_KERNEL_PARAM_OPT_INFO defined in PropertySetIO.h
#define __SYCL_PROPERTY_SET_KERNEL_PARAM_OPT_INFO "SYCL/kernel param opt"
/// PropertySetRegistry::SYCL_KERNEL_PROGRAM_METADATA defined in PropertySetIO.h
#define __SYCL_PROPERTY_SET_PROGRAM_METADATA "SYCL/program metadata"
/// PropertySetRegistry::SYCL_MISC_PROP defined in PropertySetIO.h
#define __SYCL_PROPERTY_SET_SYCL_MISC_PROP "SYCL/misc properties"
/// PropertySetRegistry::SYCL_ASSERT_USED defined in PropertySetIO.h
#define __SYCL_PROPERTY_SET_SYCL_ASSERT_USED "SYCL/assert used"
/// PropertySetRegistry::SYCL_EXPORTED_SYMBOLS defined in PropertySetIO.h
#define __SYCL_PROPERTY_SET_SYCL_EXPORTED_SYMBOLS "SYCL/exported symbols"
/// PropertySetRegistry::SYCL_IMPORTED_SYMBOLS defined in PropertySetIO.h
#define __SYCL_PROPERTY_SET_SYCL_IMPORTED_SYMBOLS "SYCL/imported symbols"
/// PropertySetRegistry::SYCL_DEVICE_GLOBALS defined in PropertySetIO.h
#define __SYCL_PROPERTY_SET_SYCL_DEVICE_GLOBALS "SYCL/device globals"
/// PropertySetRegistry::SYCL_DEVICE_REQUIREMENTS defined in PropertySetIO.h
#define __SYCL_PROPERTY_SET_SYCL_DEVICE_REQUIREMENTS "SYCL/device requirements"
/// PropertySetRegistry::SYCL_HOST_PIPES defined in PropertySetIO.h
#define __SYCL_PROPERTY_SET_SYCL_HOST_PIPES "SYCL/host pipes"
/// PropertySetRegistry::SYCL_VIRTUAL_FUNCTIONS defined in PropertySetIO.h
#define __SYCL_PROPERTY_SET_SYCL_VIRTUAL_FUNCTIONS "SYCL/virtual functions"
/// PropertySetRegistry::SYCL_IMPLICIT_LOCAL_ARG defined in PropertySetIO.h
#define __SYCL_PROPERTY_SET_SYCL_IMPLICIT_LOCAL_ARG "SYCL/implicit local arg"

/// Program metadata tags recognized by the PI backends. For kernels the tag
/// must appear after the kernel name.
#define __SYCL_PROGRAM_METADATA_TAG_REQD_WORK_GROUP_SIZE "@reqd_work_group_size"
Expand Down
39 changes: 25 additions & 14 deletions sycl/source/detail/device_binary_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// For device image compression.
#include <detail/compression.hpp>

#include <llvm/Support/PropertySetIO.h>

#include <algorithm>
#include <cstring>
#include <memory>
Expand Down Expand Up @@ -147,7 +149,7 @@ void RTDeviceBinaryImage::dump(std::ostream &Out) const {
sycl_device_binary_property
RTDeviceBinaryImage::getProperty(const char *PropName) const {
RTDeviceBinaryImage::PropertyRange BoolProp;
BoolProp.init(Bin, __SYCL_PROPERTY_SET_SYCL_MISC_PROP);
BoolProp.init(Bin, llvm::util::PropertySetRegistry::SYCL_MISC_PROP);
if (!BoolProp.isAvailable())
return nullptr;
auto It = std::find_if(BoolProp.begin(), BoolProp.end(),
Expand Down Expand Up @@ -176,25 +178,34 @@ void RTDeviceBinaryImage::init(sycl_device_binary Bin) {
// try to determine the format; may remain "NONE"
Format = ur::getBinaryImageFormat(Bin->BinaryStart, getSize());

SpecConstIDMap.init(Bin, __SYCL_PROPERTY_SET_SPEC_CONST_MAP);
SpecConstIDMap.init(
Bin, llvm::util::PropertySetRegistry::SYCL_SPECIALIZATION_CONSTANTS);
SpecConstDefaultValuesMap.init(
Bin, __SYCL_PROPERTY_SET_SPEC_CONST_DEFAULT_VALUES_MAP);
DeviceLibReqMask.init(Bin, __SYCL_PROPERTY_SET_DEVICELIB_REQ_MASK);
KernelParamOptInfo.init(Bin, __SYCL_PROPERTY_SET_KERNEL_PARAM_OPT_INFO);
AssertUsed.init(Bin, __SYCL_PROPERTY_SET_SYCL_ASSERT_USED);
ImplicitLocalArg.init(Bin, __SYCL_PROPERTY_SET_SYCL_IMPLICIT_LOCAL_ARG);
ProgramMetadata.init(Bin, __SYCL_PROPERTY_SET_PROGRAM_METADATA);
Bin, llvm::util::PropertySetRegistry::SYCL_SPEC_CONSTANTS_DEFAULT_VALUES);
DeviceLibReqMask.init(
Bin, llvm::util::PropertySetRegistry::SYCL_DEVICELIB_REQ_MASK);
KernelParamOptInfo.init(
Bin, llvm::util::PropertySetRegistry::SYCL_KERNEL_PARAM_OPT_INFO);
AssertUsed.init(Bin, llvm::util::PropertySetRegistry::SYCL_ASSERT_USED);
ImplicitLocalArg.init(
Bin, llvm::util::PropertySetRegistry::SYCL_IMPLICIT_LOCAL_ARG);
ProgramMetadata.init(Bin,
llvm::util::PropertySetRegistry::SYCL_PROGRAM_METADATA);
// Convert ProgramMetadata into the UR format
for (const auto &Prop : ProgramMetadata) {
ProgramMetadataUR.push_back(
ur::mapDeviceBinaryPropertyToProgramMetadata(Prop));
}
ExportedSymbols.init(Bin, __SYCL_PROPERTY_SET_SYCL_EXPORTED_SYMBOLS);
ImportedSymbols.init(Bin, __SYCL_PROPERTY_SET_SYCL_IMPORTED_SYMBOLS);
DeviceGlobals.init(Bin, __SYCL_PROPERTY_SET_SYCL_DEVICE_GLOBALS);
DeviceRequirements.init(Bin, __SYCL_PROPERTY_SET_SYCL_DEVICE_REQUIREMENTS);
HostPipes.init(Bin, __SYCL_PROPERTY_SET_SYCL_HOST_PIPES);
VirtualFunctions.init(Bin, __SYCL_PROPERTY_SET_SYCL_VIRTUAL_FUNCTIONS);
ExportedSymbols.init(Bin,
llvm::util::PropertySetRegistry::SYCL_EXPORTED_SYMBOLS);
ImportedSymbols.init(Bin,
llvm::util::PropertySetRegistry::SYCL_IMPORTED_SYMBOLS);
DeviceGlobals.init(Bin, llvm::util::PropertySetRegistry::SYCL_DEVICE_GLOBALS);
DeviceRequirements.init(
Bin, llvm::util::PropertySetRegistry::SYCL_DEVICE_REQUIREMENTS);
HostPipes.init(Bin, llvm::util::PropertySetRegistry::SYCL_HOST_PIPES);
VirtualFunctions.init(
Bin, llvm::util::PropertySetRegistry::SYCL_VIRTUAL_FUNCTIONS);

ImageId = ImageCounter++;
}
Expand Down
9 changes: 6 additions & 3 deletions sycl/source/detail/jit_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <sycl/detail/ur.hpp>
#include <sycl/kernel_bundle.hpp>

#include <llvm/Support/PropertySetIO.h>

namespace sycl {
inline namespace _V1 {
namespace detail {
Expand Down Expand Up @@ -1083,7 +1085,7 @@ sycl_device_binaries jit_compiler::createPIDeviceBinary(
// Create a property set for the argument usage masks of all kernels
// (currently only one).
PropertySetContainer ArgMaskPropSet{
__SYCL_PROPERTY_SET_KERNEL_PARAM_OPT_INFO};
llvm::util::PropertySetRegistry::SYCL_KERNEL_PARAM_OPT_INFO};

ArgMaskPropSet.addProperty(std::move(ArgMaskProp));

Expand All @@ -1108,15 +1110,16 @@ sycl_device_binaries jit_compiler::createPIDeviceBinary(
PropName.str(), Encoded.data(), Encoded.size(),
sycl_property_type::SYCL_PROPERTY_TYPE_BYTE_ARRAY};
PropertySetContainer ProgramMetadata{
__SYCL_PROPERTY_SET_PROGRAM_METADATA};
llvm::util::PropertySetRegistry::SYCL_PROGRAM_METADATA};
ProgramMetadata.addProperty(std::move(ReqdWorkGroupSizeProp));
Binary.addProperty(std::move(ProgramMetadata));
}
}
if (Format == ::jit_compiler::BinaryFormat::AMDGCN) {
PropertyContainer NeedFinalization{
__SYCL_PROGRAM_METADATA_TAG_NEED_FINALIZATION, 1};
PropertySetContainer ProgramMetadata{__SYCL_PROPERTY_SET_PROGRAM_METADATA};
PropertySetContainer ProgramMetadata{
llvm::util::PropertySetRegistry::SYCL_PROGRAM_METADATA};
ProgramMetadata.addProperty(std::move(NeedFinalization));
Binary.addProperty(std::move(ProgramMetadata));
}
Expand Down
1 change: 1 addition & 0 deletions sycl/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ set(SYCL_THREADS_LIB ${CMAKE_THREAD_LIBS_INIT})
# TEST_INCLUDE_PATH is used for syntax-only verification of type information.
list(APPEND test_includes ${SYCL_INCLUDE})
list(APPEND test_includes ${SYCL_SOURCE_DIR}/source)
list(APPEND test_includes ${LLVM_MAIN_INCLUDE_DIR})
list(APPEND test_includes ${BOOST_UNORDERED_INCLUDE_DIRS})
if(SYCL_ENABLE_EXTENSION_JIT)
list(APPEND test_includes ${LLVM_EXTERNAL_SYCL_JIT_SOURCE_DIR}/jit-compiler/include)
Expand Down
6 changes: 4 additions & 2 deletions sycl/unittests/Extensions/DeviceGlobal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include <sycl/sycl.hpp>

#include <llvm/Support/PropertySetIO.h>

#include "detail/context_impl.hpp"
#include "detail/kernel_program_cache.hpp"

Expand Down Expand Up @@ -64,7 +66,7 @@ static sycl::unittest::MockDeviceImage generateDeviceGlobalImage() {
MockPropertySet PropSet;
MockProperty DevGlobInfo =
makeDeviceGlobalInfo(DeviceGlobalName, sizeof(int) * 2, 0);
PropSet.insert(__SYCL_PROPERTY_SET_SYCL_DEVICE_GLOBALS,
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_DEVICE_GLOBALS,
std::vector<MockProperty>{std::move(DevGlobInfo)});

std::vector<MockOffloadEntry> Entries =
Expand All @@ -87,7 +89,7 @@ static sycl::unittest::MockDeviceImage generateDeviceGlobalImgScopeImage() {
MockPropertySet PropSet;
MockProperty DevGlobInfo =
makeDeviceGlobalInfo(DeviceGlobalImgScopeName, sizeof(int) * 2, 1);
PropSet.insert(__SYCL_PROPERTY_SET_SYCL_DEVICE_GLOBALS,
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_DEVICE_GLOBALS,
std::vector<MockProperty>{std::move(DevGlobInfo)});

std::vector<MockOffloadEntry> Entries =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include "ur_mock_helpers.hpp"
#include <sycl/sycl.hpp>

#include <llvm/Support/PropertySetIO.h>

#include <helpers/MockDeviceImage.hpp>
#include <helpers/MockKernelInfo.hpp>
#include <helpers/RuntimeLinkingCommon.hpp>
Expand Down Expand Up @@ -65,7 +67,8 @@ generateImage(std::initializer_list<std::string> KernelNames,
SYCL_PROPERTY_TYPE_BYTE_ARRAY);

Props.push_back(Prop);
PropSet.insert(__SYCL_PROPERTY_SET_SYCL_VIRTUAL_FUNCTIONS, std::move(Props));
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_VIRTUAL_FUNCTIONS,
std::move(Props));

std::vector<unsigned char> Bin{Magic};

Expand Down
22 changes: 15 additions & 7 deletions sycl/unittests/helpers/MockDeviceImage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#include <sycl/detail/defines_elementary.hpp>

#include <llvm/Support/PropertySetIO.h>

namespace sycl {
inline namespace _V1 {
namespace unittest {
Expand Down Expand Up @@ -179,7 +181,8 @@ class MockPropertySet {
// Value must be an all-zero 32-bit mask, which would mean that no fallback
// libraries are needed to be loaded.
MockProperty DeviceLibReqMask("", Data, SYCL_PROPERTY_TYPE_UINT32);
insert(__SYCL_PROPERTY_SET_DEVICELIB_REQ_MASK, std::move(DeviceLibReqMask));
insert(llvm::util::PropertySetRegistry::SYCL_DEVICELIB_REQ_MASK,
std::move(DeviceLibReqMask));
}

/// Adds a new property to the set.
Expand Down Expand Up @@ -448,7 +451,8 @@ inline void setKernelUsesAssert(const std::vector<std::string> &Names,
std::vector<MockProperty> Value;
for (const std::string &N : Names)
Value.push_back({N, {0, 0, 0, 0}, SYCL_PROPERTY_TYPE_UINT32});
Set.insert(__SYCL_PROPERTY_SET_SYCL_ASSERT_USED, std::move(Value));
Set.insert(llvm::util::PropertySetRegistry::SYCL_ASSERT_USED,
std::move(Value));
}

/// Utility function to add specialization constants to property set.
Expand All @@ -457,12 +461,14 @@ inline void setKernelUsesAssert(const std::vector<std::string> &Names,
inline void addSpecConstants(std::vector<MockProperty> &&SpecConstants,
std::vector<char> ValData,
MockPropertySet &Props) {
Props.insert(__SYCL_PROPERTY_SET_SPEC_CONST_MAP, std::move(SpecConstants));
Props.insert(llvm::util::PropertySetRegistry::SYCL_SPECIALIZATION_CONSTANTS,
std::move(SpecConstants));

MockProperty Prop{"all", std::move(ValData), SYCL_PROPERTY_TYPE_BYTE_ARRAY};

Props.insert(__SYCL_PROPERTY_SET_SPEC_CONST_DEFAULT_VALUES_MAP,
std::move(Prop));
Props.insert(
llvm::util::PropertySetRegistry::SYCL_SPEC_CONSTANTS_DEFAULT_VALUES,
std::move(Prop));
}

/// Utility function to add ESIMD kernel flag to property set.
Expand All @@ -471,7 +477,8 @@ inline void addESIMDFlag(MockPropertySet &Props) {
ValData[0] = 1;
MockProperty Prop{"isEsimdImage", ValData, SYCL_PROPERTY_TYPE_UINT32};

Props.insert(__SYCL_PROPERTY_SET_SYCL_MISC_PROP, std::move(Prop));
Props.insert(llvm::util::PropertySetRegistry::SYCL_MISC_PROP,
std::move(Prop));
}

/// Utility function to generate offload entries for kernels without arguments.
Expand Down Expand Up @@ -584,7 +591,8 @@ addDeviceRequirementsProps(MockPropertySet &Props,
std::vector<MockProperty> Value{makeAspectsProp(Aspects)};
if (!ReqdWGSize.empty())
Value.push_back(makeReqdWGSizeProp(ReqdWGSize));
Props.insert(__SYCL_PROPERTY_SET_SYCL_DEVICE_REQUIREMENTS, std::move(Value));
Props.insert(llvm::util::PropertySetRegistry::SYCL_DEVICE_REQUIREMENTS,
std::move(Value));
}

inline MockDeviceImage
Expand Down
4 changes: 3 additions & 1 deletion sycl/unittests/pipes/host_pipe_registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <cstring>
#include <sycl/sycl.hpp>

#include <llvm/Support/PropertySetIO.h>

#include <detail/device_binary_image.hpp>
#include <detail/host_pipe_map_entry.hpp>
#include <gtest/gtest.h>
Expand Down Expand Up @@ -38,7 +40,7 @@ static sycl::unittest::MockDeviceImage generateDefaultImage() {
MockPropertySet PropSet;
MockProperty HostPipeInfo =
makeHostPipeInfo("test_host_pipe_unique_id", sizeof(int));
PropSet.insert(__SYCL_PROPERTY_SET_SYCL_HOST_PIPES,
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_HOST_PIPES,
std::vector<MockProperty>{std::move(HostPipeInfo)});

std::vector<MockOffloadEntry> Entries = makeEmptyKernels({"TestKernel"});
Expand Down
4 changes: 3 additions & 1 deletion sycl/unittests/program_manager/CompileTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include <helpers/MockKernelInfo.hpp>
#include <helpers/UrMock.hpp>

#include <llvm/Support/PropertySetIO.h>

#include <gtest/gtest.h>

using namespace sycl;
Expand All @@ -27,7 +29,7 @@ generateImageWithCompileTarget(std::string KernelName,
MockProperty CompileTargetProperty("compile_target", Data,
SYCL_PROPERTY_TYPE_BYTE_ARRAY);
MockPropertySet PropSet;
PropSet.insert(__SYCL_PROPERTY_SET_SYCL_DEVICE_REQUIREMENTS,
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_DEVICE_REQUIREMENTS,
std::move(CompileTargetProperty));

std::vector<unsigned char> Bin(CompileTarget.begin(), CompileTarget.end());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <sycl/sycl.hpp>

#include <llvm/Support/PropertySetIO.h>

#include <detail/device_image_impl.hpp>
#include <helpers/MockDeviceImage.hpp>
#include <helpers/MockKernelInfo.hpp>
Expand Down Expand Up @@ -76,10 +78,10 @@ generateImage(std::initializer_list<std::string> KernelNames,
const char *DeviceTargetSpec,
sycl::unittest::MockPropertySet PropSet) {
if (!ExportedSymbols.empty())
PropSet.insert(__SYCL_PROPERTY_SET_SYCL_EXPORTED_SYMBOLS,
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_EXPORTED_SYMBOLS,
createPropertySet(ExportedSymbols));
if (!ImportedSymbols.empty())
PropSet.insert(__SYCL_PROPERTY_SET_SYCL_IMPORTED_SYMBOLS,
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_IMPORTED_SYMBOLS,
createPropertySet(ImportedSymbols));

std::vector<unsigned char> Bin{Magic};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <detail/scheduler/commands.hpp>
#include <sycl/sycl.hpp>

#include <llvm/Support/PropertySetIO.h>

#include <helpers/MockDeviceImage.hpp>
#include <helpers/MockKernelInfo.hpp>
#include <helpers/ScopedEnvVar.hpp>
Expand Down Expand Up @@ -64,7 +66,8 @@ static sycl::unittest::MockDeviceImage generateEAMTestKernelImage() {
std::vector<MockProperty> ImgKPOI{std::move(EAMKernelPOI)};

MockPropertySet PropSet;
PropSet.insert(__SYCL_PROPERTY_SET_KERNEL_PARAM_OPT_INFO, std::move(ImgKPOI));
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_KERNEL_PARAM_OPT_INFO,
std::move(ImgKPOI));

std::vector<MockOffloadEntry> Entries = makeEmptyKernels({EAMTestKernelName});

Expand All @@ -83,7 +86,8 @@ static sycl::unittest::MockDeviceImage generateEAMTestKernel3Image() {
std::vector<MockProperty> ImgKPOI{std::move(EAMKernelPOI)};

MockPropertySet PropSet;
PropSet.insert(__SYCL_PROPERTY_SET_KERNEL_PARAM_OPT_INFO, std::move(ImgKPOI));
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_KERNEL_PARAM_OPT_INFO,
std::move(ImgKPOI));

std::vector<MockOffloadEntry> Entries =
makeEmptyKernels({EAMTestKernel3Name});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <helpers/MockKernelInfo.hpp>
#include <helpers/UrMock.hpp>

#include <llvm/Support/PropertySetIO.h>

#include <gtest/gtest.h>

std::string current_link_options, current_compile_options, current_build_opts;
Expand Down Expand Up @@ -67,7 +69,8 @@ generateEAMTestKernelImage(std::string _cmplOptions, std::string _lnkOptions) {
std::vector<MockProperty> ImgKPOI{std::move(EAMKernelPOI)};

MockPropertySet PropSet;
PropSet.insert(__SYCL_PROPERTY_SET_KERNEL_PARAM_OPT_INFO, std::move(ImgKPOI));
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_KERNEL_PARAM_OPT_INFO,
std::move(ImgKPOI));

std::vector<unsigned char> Bin{0, 1, 2, 3, 4, 5}; // Random data

Expand Down
Loading