Skip to content

Commit 41d8977

Browse files
authored
[SYCL][AMD] Propagate metadata in createURProgram (#14831)
SYCL properties weren't converted when calling creatreURProgram, leading to issue in finalization during KernelFusion for AMD. Fixes #14841
1 parent 132f763 commit 41d8977

File tree

9 files changed

+13
-20
lines changed

9 files changed

+13
-20
lines changed

sycl/source/detail/device_binary_image.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ void RTDeviceBinaryImage::init(sycl_device_binary Bin) {
178178
KernelParamOptInfo.init(Bin, __SYCL_PROPERTY_SET_KERNEL_PARAM_OPT_INFO);
179179
AssertUsed.init(Bin, __SYCL_PROPERTY_SET_SYCL_ASSERT_USED);
180180
ProgramMetadata.init(Bin, __SYCL_PROPERTY_SET_PROGRAM_METADATA);
181+
// Convert ProgramMetadata into the UR format
182+
for (const auto &Prop : ProgramMetadata) {
183+
ProgramMetadataUR.push_back(
184+
ur::mapDeviceBinaryPropertyToProgramMetadata(Prop));
185+
}
181186
ExportedSymbols.init(Bin, __SYCL_PROPERTY_SET_SYCL_EXPORTED_SYMBOLS);
182187
ImportedSymbols.init(Bin, __SYCL_PROPERTY_SET_SYCL_IMPORTED_SYMBOLS);
183188
DeviceGlobals.init(Bin, __SYCL_PROPERTY_SET_SYCL_DEVICE_GLOBALS);

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -500,11 +500,9 @@ std::pair<ur_program_handle_t, bool> ProgramManager::getOrCreateURProgram(
500500
// Get program metadata from properties
501501
std::vector<ur_program_metadata_t> ProgMetadataVector;
502502
for (const RTDeviceBinaryImage *Img : AllImages) {
503-
auto ProgMetadata = Img->getProgramMetadata();
504-
for (const auto &Prop : ProgMetadata) {
505-
ProgMetadataVector.push_back(
506-
ur::mapDeviceBinaryPropertyToProgramMetadata(Prop));
507-
}
503+
auto &ImgProgMetadata = Img->getProgramMetadataUR();
504+
ProgMetadataVector.insert(ProgMetadataVector.end(),
505+
ImgProgMetadata.begin(), ImgProgMetadata.end());
508506
}
509507
// TODO: Build for multiple devices once supported by program manager
510508
NativePrg = createBinaryProgram(getSyclObjImpl(Context), Device,

sycl/test-e2e/Basic/reqd_work_group_size.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// RUN: %{build} -o %t.out
22
// RUN: %{run} %t.out
33

4-
// TODO: Reenable, see https://github.com/intel/llvm/issues/14598
5-
// UNSUPPORTED: linux, windows
6-
74
#include <sycl/detail/core.hpp>
85

96
#include <iostream>

sycl/test-e2e/DeviceGlobal/device_global_arrow.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
//
44
// The OpenCL GPU backends do not currently support device_global backend
55
// calls.
6-
// TODO: Reenable linux/windows, see https://github.com/intel/llvm/issues/14598
7-
// UNSUPPORTED: opencl && gpu, linux, windows
6+
// UNSUPPORTED: opencl && gpu
87
//
98
// Tests operator-> on device_global.
109

sycl/test-e2e/DeviceGlobal/device_global_device_only.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
//
44
// The OpenCL GPU backends do not currently support device_global backend
55
// calls.
6-
// TODO: Reenable linux/windows, see https://github.com/intel/llvm/issues/14598
7-
// UNSUPPORTED: opencl && gpu, linux, windows
6+
// UNSUPPORTED: opencl && gpu
87
//
98
// Tests basic device_global access through device kernels.
109

sycl/test-e2e/DeviceGlobal/device_global_operator_passthrough.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
//
44
// The OpenCL GPU backends do not currently support device_global backend
55
// calls.
6-
// TODO: Reenable linux/windows, see https://github.com/intel/llvm/issues/14598
7-
// UNSUPPORTED: opencl && gpu, linux, windows
6+
// UNSUPPORTED: opencl && gpu
87
//
98
// Tests the passthrough of operators on device_global.
109

sycl/test-e2e/DeviceGlobal/device_global_subscript.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
//
44
// The OpenCL GPU backends do not currently support device_global backend
55
// calls.
6-
// TODO: Reenable linux/windows, see https://github.com/intel/llvm/issues/14598
7-
// UNSUPPORTED: opencl && gpu, linux, windows
6+
// UNSUPPORTED: opencl && gpu
87
//
98
// Tests operator[] on device_global.
109

sycl/test-e2e/KernelFusion/lit.local.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import platform
22

33
config.required_features += ['fusion']
4-
# TODO: Reenable hip, see https://github.com/intel/llvm/issues/14598
5-
config.unsupported_features += ['accelerator', 'hip']
4+
config.unsupported_features += ['accelerator']
65

76
# TODO: enable on Windows once kernel fusion is supported on Windows.
87
if platform.system() != "Linux":

sycl/test-e2e/NewOffloadDriver/diamond_shape.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// REQUIRES: fusion
2-
// TODO: Reenable, see https://github.com/intel/llvm/issues/14598
3-
// UNSUPPORTED: hip
42

53
// RUN: %{build} %{embed-ir} -O2 --offload-new-driver -o %t.out
64
// RUN: %{run} %t.out

0 commit comments

Comments
 (0)