Skip to content

Commit c476710

Browse files
[SYCL] Link and include LLVMSupport in SYCL library (#16763)
These changes propose that the SYCL runtime library privately links against LLVMSupport to avoid the need for replicating common utility code. In the initial version we can use this to remove the property-set names, making it more safely consistent. These changes intend to aid the implementation of loading SYCL-based kernel binary files at runtime. --------- Signed-off-by: Larsen, Steffen <[email protected]>
1 parent e2409fe commit c476710

File tree

15 files changed

+96
-90
lines changed

15 files changed

+96
-90
lines changed

sycl/source/CMakeLists.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,8 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
9191

9292
# Feature-specific compilation and link step setup
9393

94-
# Unlike for sycl library, for LLVMSupport we have only one version for a given build,
95-
# so, we link LLVMSupport lib to matching sycl version only.
9694
if (SYCL_ENABLE_STACK_PRINTING)
97-
if(NOT MSVC OR (CMAKE_BUILD_TYPE STREQUAL "Debug" AND ARG_COMPILE_OPTIONS MATCHES ".*MDd.*") OR
98-
(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT ARG_COMPILE_OPTIONS MATCHES ".*MDd.*"))
99-
add_dependencies(${LIB_NAME} LLVMSupport)
100-
target_compile_definitions(${LIB_OBJ_NAME} PUBLIC ENABLE_STACK_TRACE)
101-
target_link_libraries(${LIB_NAME} PRIVATE LLVMSupport)
102-
endif()
95+
target_compile_definitions(${LIB_OBJ_NAME} PUBLIC ENABLE_STACK_TRACE)
10396
endif()
10497

10598
# TODO: Enabled for MSVC
@@ -193,6 +186,11 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
193186
endif()
194187
endif()
195188

189+
# Link with LLVMSupport for shared utilities.
190+
add_dependencies(${LIB_NAME} LLVMSupport)
191+
target_link_libraries(${LIB_NAME} PRIVATE LLVMSupport)
192+
target_include_directories(${LIB_OBJ_NAME} SYSTEM PRIVATE ${LLVM_MAIN_INCLUDE_DIR})
193+
196194
check_linker_flag(CXX "-Wl,--gc-sections" LINKER_SUPPORTS_WL_GC_SECTIONS)
197195
if(LINKER_SUPPORTS_WL_GC_SECTIONS)
198196
# Reduces the size of the resulting library by having the linker perform

sycl/source/detail/compiler.hpp

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -35,45 +35,6 @@
3535
#define __SYCL_DEVICE_BINARY_TARGET_LLVM_NVPTX64 "llvm_nvptx64"
3636
#define __SYCL_DEVICE_BINARY_TARGET_LLVM_AMDGCN "llvm_amdgcn"
3737

38-
/// Device binary image property set names recognized by the SYCL runtime.
39-
/// Name must be consistent with
40-
/// PropertySetRegistry::SYCL_SPECIALIZATION_CONSTANTS defined in
41-
/// PropertySetIO.h
42-
#define __SYCL_PROPERTY_SET_SPEC_CONST_MAP "SYCL/specialization constants"
43-
/// PropertySetRegistry::SYCL_SPEC_CONSTANTS_DEFAULT_VALUES defined in
44-
/// PropertySetIO.h
45-
#define __SYCL_PROPERTY_SET_SPEC_CONST_DEFAULT_VALUES_MAP \
46-
"SYCL/specialization constants default values"
47-
/// TODO: remove req mask when sycl devicelib online linking path is removed.
48-
/// PropertySetRegistry::SYCL_DEVICELIB_REQ_MASK defined in PropertySetIO.h
49-
#define __SYCL_PROPERTY_SET_DEVICELIB_REQ_MASK "SYCL/devicelib req mask"
50-
/// PropertySetRegistry::SYCL_DEVICELIB_METADATA defined in PropertySetIO.h
51-
#define __SYCL_PROPERTY_SET_DEVICELIB_METADATA "SYCL/devicelib metadata"
52-
/// PropertySetRegistry::SYCL_KERNEL_PARAM_OPT_INFO defined in PropertySetIO.h
53-
#define __SYCL_PROPERTY_SET_KERNEL_PARAM_OPT_INFO "SYCL/kernel param opt"
54-
/// PropertySetRegistry::SYCL_KERNEL_PROGRAM_METADATA defined in PropertySetIO.h
55-
#define __SYCL_PROPERTY_SET_PROGRAM_METADATA "SYCL/program metadata"
56-
/// PropertySetRegistry::SYCL_MISC_PROP defined in PropertySetIO.h
57-
#define __SYCL_PROPERTY_SET_SYCL_MISC_PROP "SYCL/misc properties"
58-
/// PropertySetRegistry::SYCL_ASSERT_USED defined in PropertySetIO.h
59-
#define __SYCL_PROPERTY_SET_SYCL_ASSERT_USED "SYCL/assert used"
60-
/// PropertySetRegistry::SYCL_EXPORTED_SYMBOLS defined in PropertySetIO.h
61-
#define __SYCL_PROPERTY_SET_SYCL_EXPORTED_SYMBOLS "SYCL/exported symbols"
62-
/// PropertySetRegistry::SYCL_IMPORTED_SYMBOLS defined in PropertySetIO.h
63-
#define __SYCL_PROPERTY_SET_SYCL_IMPORTED_SYMBOLS "SYCL/imported symbols"
64-
/// PropertySetRegistry::SYCL_DEVICE_GLOBALS defined in PropertySetIO.h
65-
#define __SYCL_PROPERTY_SET_SYCL_DEVICE_GLOBALS "SYCL/device globals"
66-
/// PropertySetRegistry::SYCL_DEVICE_REQUIREMENTS defined in PropertySetIO.h
67-
#define __SYCL_PROPERTY_SET_SYCL_DEVICE_REQUIREMENTS "SYCL/device requirements"
68-
/// PropertySetRegistry::SYCL_HOST_PIPES defined in PropertySetIO.h
69-
#define __SYCL_PROPERTY_SET_SYCL_HOST_PIPES "SYCL/host pipes"
70-
/// PropertySetRegistry::SYCL_VIRTUAL_FUNCTIONS defined in PropertySetIO.h
71-
#define __SYCL_PROPERTY_SET_SYCL_VIRTUAL_FUNCTIONS "SYCL/virtual functions"
72-
/// PropertySetRegistry::SYCL_IMPLICIT_LOCAL_ARG defined in PropertySetIO.h
73-
#define __SYCL_PROPERTY_SET_SYCL_IMPLICIT_LOCAL_ARG "SYCL/implicit local arg"
74-
/// PropertySetRegistry::SYCL_REGISTERED_KERNELS defined in PropertySetIO.h
75-
#define __SYCL_PROPERTY_SET_SYCL_REGISTERED_KERNELS "SYCL/registered kernels"
76-
7738
/// Program metadata tags recognized by the PI backends. For kernels the tag
7839
/// must appear after the kernel name.
7940
#define __SYCL_PROGRAM_METADATA_TAG_REQD_WORK_GROUP_SIZE "@reqd_work_group_size"

sycl/source/detail/device_binary_image.cpp

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// For device image compression.
1313
#include <detail/compression.hpp>
1414

15+
#include <llvm/Support/PropertySetIO.h>
16+
1517
#include <algorithm>
1618
#include <cstdlib>
1719
#include <cstring>
@@ -185,28 +187,39 @@ void RTDeviceBinaryImage::init(sycl_device_binary Bin) {
185187
// try to determine the format; may remain "NONE"
186188
Format = ur::getBinaryImageFormat(Bin->BinaryStart, getSize());
187189

188-
SpecConstIDMap.init(Bin, __SYCL_PROPERTY_SET_SPEC_CONST_MAP);
190+
SpecConstIDMap.init(
191+
Bin, llvm::util::PropertySetRegistry::SYCL_SPECIALIZATION_CONSTANTS);
189192
SpecConstDefaultValuesMap.init(
190-
Bin, __SYCL_PROPERTY_SET_SPEC_CONST_DEFAULT_VALUES_MAP);
191-
DeviceLibReqMask.init(Bin, __SYCL_PROPERTY_SET_DEVICELIB_REQ_MASK);
192-
DeviceLibMetadata.init(Bin, __SYCL_PROPERTY_SET_DEVICELIB_METADATA);
193-
KernelParamOptInfo.init(Bin, __SYCL_PROPERTY_SET_KERNEL_PARAM_OPT_INFO);
194-
AssertUsed.init(Bin, __SYCL_PROPERTY_SET_SYCL_ASSERT_USED);
195-
ImplicitLocalArg.init(Bin, __SYCL_PROPERTY_SET_SYCL_IMPLICIT_LOCAL_ARG);
196-
ProgramMetadata.init(Bin, __SYCL_PROPERTY_SET_PROGRAM_METADATA);
193+
Bin, llvm::util::PropertySetRegistry::SYCL_SPEC_CONSTANTS_DEFAULT_VALUES);
194+
DeviceLibReqMask.init(
195+
Bin, llvm::util::PropertySetRegistry::SYCL_DEVICELIB_REQ_MASK);
196+
DeviceLibMetadata.init(
197+
Bin, llvm::util::PropertySetRegistry::SYCL_DEVICELIB_METADATA);
198+
KernelParamOptInfo.init(
199+
Bin, llvm::util::PropertySetRegistry::SYCL_KERNEL_PARAM_OPT_INFO);
200+
AssertUsed.init(Bin, llvm::util::PropertySetRegistry::SYCL_ASSERT_USED);
201+
ImplicitLocalArg.init(
202+
Bin, llvm::util::PropertySetRegistry::SYCL_IMPLICIT_LOCAL_ARG);
203+
ProgramMetadata.init(Bin,
204+
llvm::util::PropertySetRegistry::SYCL_PROGRAM_METADATA);
197205
// Convert ProgramMetadata into the UR format
198206
for (const auto &Prop : ProgramMetadata) {
199207
ProgramMetadataUR.push_back(
200208
ur::mapDeviceBinaryPropertyToProgramMetadata(Prop));
201209
}
202-
ExportedSymbols.init(Bin, __SYCL_PROPERTY_SET_SYCL_EXPORTED_SYMBOLS);
203-
ImportedSymbols.init(Bin, __SYCL_PROPERTY_SET_SYCL_IMPORTED_SYMBOLS);
204-
DeviceGlobals.init(Bin, __SYCL_PROPERTY_SET_SYCL_DEVICE_GLOBALS);
205-
DeviceRequirements.init(Bin, __SYCL_PROPERTY_SET_SYCL_DEVICE_REQUIREMENTS);
206-
HostPipes.init(Bin, __SYCL_PROPERTY_SET_SYCL_HOST_PIPES);
207-
VirtualFunctions.init(Bin, __SYCL_PROPERTY_SET_SYCL_VIRTUAL_FUNCTIONS);
208-
RegisteredKernels.init(Bin, __SYCL_PROPERTY_SET_SYCL_REGISTERED_KERNELS);
209-
Misc.init(Bin, __SYCL_PROPERTY_SET_SYCL_MISC_PROP);
210+
ExportedSymbols.init(Bin,
211+
llvm::util::PropertySetRegistry::SYCL_EXPORTED_SYMBOLS);
212+
ImportedSymbols.init(Bin,
213+
llvm::util::PropertySetRegistry::SYCL_IMPORTED_SYMBOLS);
214+
DeviceGlobals.init(Bin, llvm::util::PropertySetRegistry::SYCL_DEVICE_GLOBALS);
215+
DeviceRequirements.init(
216+
Bin, llvm::util::PropertySetRegistry::SYCL_DEVICE_REQUIREMENTS);
217+
HostPipes.init(Bin, llvm::util::PropertySetRegistry::SYCL_HOST_PIPES);
218+
VirtualFunctions.init(
219+
Bin, llvm::util::PropertySetRegistry::SYCL_VIRTUAL_FUNCTIONS);
220+
RegisteredKernels.init(
221+
Bin, llvm::util::PropertySetRegistry::SYCL_REGISTERED_KERNELS);
222+
Misc.init(Bin, llvm::util::PropertySetRegistry::SYCL_MISC_PROP);
210223
}
211224

212225
std::atomic<uintptr_t> RTDeviceBinaryImage::ImageCounter = 1;

sycl/source/detail/jit_compiler.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include <sycl/detail/os_util.hpp>
1313
#include <sycl/detail/ur.hpp>
1414

15+
#include <llvm/Support/PropertySetIO.h>
16+
1517
namespace sycl {
1618
inline namespace _V1 {
1719
namespace detail {
@@ -265,7 +267,7 @@ sycl_device_binaries jit_compiler::createDeviceBinaries(
265267

266268
for (const auto &FPS : DevImgInfo.Properties) {
267269
bool IsDeviceGlobalsPropSet =
268-
FPS.Name == __SYCL_PROPERTY_SET_SYCL_DEVICE_GLOBALS;
270+
FPS.Name == llvm::util::PropertySetRegistry::SYCL_DEVICE_GLOBALS;
269271
PropertySetContainer PropSet{FPS.Name.c_str()};
270272
for (const auto &FPV : FPS.Values) {
271273
if (FPV.IsUIntValue) {

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333

3434
#include <sycl/ext/oneapi/matrix/query-types.hpp>
3535

36+
#include <llvm/Support/PropertySetIO.h>
37+
3638
#include <algorithm>
3739
#include <cassert>
3840
#include <cstdint>
@@ -1860,7 +1862,8 @@ static bool isBfloat16DeviceLibImage(sycl_device_binary RawImg,
18601862
for (ImgPS = RawImg->PropertySetsBegin; ImgPS != RawImg->PropertySetsEnd;
18611863
++ImgPS) {
18621864
if (ImgPS->Name &&
1863-
!strcmp(__SYCL_PROPERTY_SET_DEVICELIB_METADATA, ImgPS->Name)) {
1865+
!strcmp(llvm::util::PropertySetRegistry::SYCL_DEVICELIB_METADATA,
1866+
ImgPS->Name)) {
18641867
if (!LibVersion)
18651868
return true;
18661869

@@ -1888,7 +1891,8 @@ getExportedSymbolPS(sycl_device_binary RawImg) {
18881891
for (ImgPS = RawImg->PropertySetsBegin; ImgPS != RawImg->PropertySetsEnd;
18891892
++ImgPS) {
18901893
if (ImgPS->Name &&
1891-
!strcmp(__SYCL_PROPERTY_SET_SYCL_EXPORTED_SYMBOLS, ImgPS->Name))
1894+
!strcmp(llvm::util::PropertySetRegistry::SYCL_EXPORTED_SYMBOLS,
1895+
ImgPS->Name))
18921896
return ImgPS;
18931897
}
18941898

sycl/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ set(SYCL_THREADS_LIB ${CMAKE_THREAD_LIBS_INIT})
1616
# TEST_INCLUDE_PATH is used for syntax-only verification of type information.
1717
list(APPEND test_includes ${SYCL_INCLUDE})
1818
list(APPEND test_includes ${SYCL_SOURCE_DIR}/source)
19+
list(APPEND test_includes ${LLVM_MAIN_INCLUDE_DIR})
1920
list(APPEND test_includes ${BOOST_UNORDERED_INCLUDE_DIRS})
2021
if(SYCL_ENABLE_EXTENSION_JIT)
2122
list(APPEND test_includes ${LLVM_EXTERNAL_SYCL_JIT_SOURCE_DIR}/jit-compiler/include)

sycl/unittests/Extensions/DeviceGlobal.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#include <sycl/sycl.hpp>
1010

11+
#include <llvm/Support/PropertySetIO.h>
12+
1113
#include "detail/context_impl.hpp"
1214
#include "detail/kernel_program_cache.hpp"
1315

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

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

9395
std::vector<MockOffloadEntry> Entries =

sycl/unittests/Extensions/VirtualFunctions/RuntimeLinking.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#include "ur_mock_helpers.hpp"
33
#include <sycl/sycl.hpp>
44

5+
#include <llvm/Support/PropertySetIO.h>
6+
57
#include <helpers/MockDeviceImage.hpp>
68
#include <helpers/MockKernelInfo.hpp>
79
#include <helpers/RuntimeLinkingCommon.hpp>
@@ -65,7 +67,8 @@ generateImage(std::initializer_list<std::string> KernelNames,
6567
SYCL_PROPERTY_TYPE_BYTE_ARRAY);
6668

6769
Props.push_back(Prop);
68-
PropSet.insert(__SYCL_PROPERTY_SET_SYCL_VIRTUAL_FUNCTIONS, std::move(Props));
70+
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_VIRTUAL_FUNCTIONS,
71+
std::move(Props));
6972

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

sycl/unittests/helpers/MockDeviceImage.hpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
#include <sycl/detail/defines_elementary.hpp>
2222

23+
#include <llvm/Support/PropertySetIO.h>
24+
2325
namespace sycl {
2426
inline namespace _V1 {
2527
namespace unittest {
@@ -191,7 +193,8 @@ class MockPropertySet {
191193
// Value must be an all-zero 32-bit mask, which would mean that no fallback
192194
// libraries are needed to be loaded.
193195
MockProperty DeviceLibReqMask("", Data, SYCL_PROPERTY_TYPE_UINT32);
194-
insert(__SYCL_PROPERTY_SET_DEVICELIB_REQ_MASK, std::move(DeviceLibReqMask));
196+
insert(llvm::util::PropertySetRegistry::SYCL_DEVICELIB_REQ_MASK,
197+
std::move(DeviceLibReqMask));
195198
}
196199

197200
/// Adds a new property to the set.
@@ -461,7 +464,8 @@ inline void setKernelUsesAssert(const std::vector<std::string> &Names,
461464
std::vector<MockProperty> Value;
462465
for (const std::string &N : Names)
463466
Value.push_back({N, {0, 0, 0, 0}, SYCL_PROPERTY_TYPE_UINT32});
464-
Set.insert(__SYCL_PROPERTY_SET_SYCL_ASSERT_USED, std::move(Value));
467+
Set.insert(llvm::util::PropertySetRegistry::SYCL_ASSERT_USED,
468+
std::move(Value));
465469
}
466470

467471
/// Utility function to add specialization constants to property set.
@@ -470,12 +474,14 @@ inline void setKernelUsesAssert(const std::vector<std::string> &Names,
470474
inline void addSpecConstants(std::vector<MockProperty> &&SpecConstants,
471475
std::vector<char> ValData,
472476
MockPropertySet &Props) {
473-
Props.insert(__SYCL_PROPERTY_SET_SPEC_CONST_MAP, std::move(SpecConstants));
477+
Props.insert(llvm::util::PropertySetRegistry::SYCL_SPECIALIZATION_CONSTANTS,
478+
std::move(SpecConstants));
474479

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

477-
Props.insert(__SYCL_PROPERTY_SET_SPEC_CONST_DEFAULT_VALUES_MAP,
478-
std::move(Prop));
482+
Props.insert(
483+
llvm::util::PropertySetRegistry::SYCL_SPEC_CONSTANTS_DEFAULT_VALUES,
484+
std::move(Prop));
479485
}
480486

481487
/// Utility function to add ESIMD kernel flag to property set.
@@ -484,7 +490,8 @@ inline void addESIMDFlag(MockPropertySet &Props) {
484490
ValData[0] = 1;
485491
MockProperty Prop{"isEsimdImage", ValData, SYCL_PROPERTY_TYPE_UINT32};
486492

487-
Props.insert(__SYCL_PROPERTY_SET_SYCL_MISC_PROP, std::move(Prop));
493+
Props.insert(llvm::util::PropertySetRegistry::SYCL_MISC_PROP,
494+
std::move(Prop));
488495
}
489496

490497
/// Utility function to generate offload entries for kernels without arguments.
@@ -597,7 +604,8 @@ addDeviceRequirementsProps(MockPropertySet &Props,
597604
std::vector<MockProperty> Value{makeAspectsProp(Aspects)};
598605
if (!ReqdWGSize.empty())
599606
Value.push_back(makeReqdWGSizeProp(ReqdWGSize));
600-
Props.insert(__SYCL_PROPERTY_SET_SYCL_DEVICE_REQUIREMENTS, std::move(Value));
607+
Props.insert(llvm::util::PropertySetRegistry::SYCL_DEVICE_REQUIREMENTS,
608+
std::move(Value));
601609
}
602610

603611
inline MockDeviceImage

sycl/unittests/pipes/host_pipe_registration.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include <cstring>
1010
#include <sycl/sycl.hpp>
1111

12+
#include <llvm/Support/PropertySetIO.h>
13+
1214
#include <detail/device_binary_image.hpp>
1315
#include <detail/host_pipe_map_entry.hpp>
1416
#include <gtest/gtest.h>
@@ -38,7 +40,7 @@ static sycl::unittest::MockDeviceImage generateDefaultImage() {
3840
MockPropertySet PropSet;
3941
MockProperty HostPipeInfo =
4042
makeHostPipeInfo("test_host_pipe_unique_id", sizeof(int));
41-
PropSet.insert(__SYCL_PROPERTY_SET_SYCL_HOST_PIPES,
43+
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_HOST_PIPES,
4244
std::vector<MockProperty>{std::move(HostPipeInfo)});
4345

4446
std::vector<MockOffloadEntry> Entries = makeEmptyKernels({"TestKernel"});

sycl/unittests/program_manager/Cleanup.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,28 +169,29 @@ sycl::unittest::MockDeviceImage generateImage(const std::string &ImageId) {
169169
KernelEAM);
170170
std::vector<sycl::unittest::MockProperty> ImgKPOI{std::move(EAMKernelPOI)};
171171

172-
PropSet.insert(__SYCL_PROPERTY_SET_SYCL_EXPORTED_SYMBOLS,
172+
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_EXPORTED_SYMBOLS,
173173
createPropertySet(ExportedSymbols));
174174

175-
PropSet.insert(__SYCL_PROPERTY_SET_SYCL_IMPORTED_SYMBOLS,
175+
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_IMPORTED_SYMBOLS,
176176
createPropertySet(ImportedSymbols));
177177

178-
PropSet.insert(__SYCL_PROPERTY_SET_SYCL_VIRTUAL_FUNCTIONS,
178+
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_VIRTUAL_FUNCTIONS,
179179
createVFPropertySet(VirtualFunctions));
180180
setKernelUsesAssert(std::vector<std::string>{KernelNames.begin()[0]},
181181
PropSet);
182182

183-
PropSet.insert(__SYCL_PROPERTY_SET_SYCL_IMPLICIT_LOCAL_ARG,
183+
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_IMPLICIT_LOCAL_ARG,
184184
createPropertySet(ImplicitLocalArg));
185-
PropSet.insert(__SYCL_PROPERTY_SET_KERNEL_PARAM_OPT_INFO, std::move(ImgKPOI));
185+
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_KERNEL_PARAM_OPT_INFO,
186+
std::move(ImgKPOI));
186187

187188
PropSet.insert(
188-
__SYCL_PROPERTY_SET_SYCL_DEVICE_GLOBALS,
189+
llvm::util::PropertySetRegistry::SYCL_DEVICE_GLOBALS,
189190
std::vector<sycl::unittest::MockProperty>{
190191
sycl::unittest::makeDeviceGlobalInfo(
191192
generateRefName(ImageId, "DeviceGlobal"), sizeof(int), 0)});
192193

193-
PropSet.insert(__SYCL_PROPERTY_SET_SYCL_HOST_PIPES,
194+
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_HOST_PIPES,
194195
std::vector<sycl::unittest::MockProperty>{
195196
sycl::unittest::makeHostPipeInfo(
196197
generateRefName(ImageId, "HostPipe"), sizeof(int))});

sycl/unittests/program_manager/CompileTarget.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include <helpers/MockKernelInfo.hpp>
1010
#include <helpers/UrMock.hpp>
1111

12+
#include <llvm/Support/PropertySetIO.h>
13+
1214
#include <gtest/gtest.h>
1315

1416
using namespace sycl;
@@ -24,7 +26,7 @@ generateImageWithCompileTarget(std::string KernelName,
2426
MockProperty CompileTargetProperty("compile_target", Data,
2527
SYCL_PROPERTY_TYPE_BYTE_ARRAY);
2628
MockPropertySet PropSet;
27-
PropSet.insert(__SYCL_PROPERTY_SET_SYCL_DEVICE_REQUIREMENTS,
29+
PropSet.insert(llvm::util::PropertySetRegistry::SYCL_DEVICE_REQUIREMENTS,
2830
std::move(CompileTargetProperty));
2931

3032
std::vector<unsigned char> Bin(CompileTarget.begin(), CompileTarget.end());

0 commit comments

Comments
 (0)