Skip to content

Commit a372941

Browse files
committed
[UR] Uplift tag to bring urProgramCreateWithBinary change
1 parent c6001ee commit a372941

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

sycl/cmake/modules/FetchUnifiedRuntime.cmake

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,13 @@ if(SYCL_UR_USE_FETCH_CONTENT)
116116
CACHE PATH "Path to external '${name}' adapter source dir" FORCE)
117117
endfunction()
118118

119-
set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
120-
# commit c742ca49efb12380a35b8b0b467e6577ab8174ce
121-
# Merge: 3a8bf2c5 504d3b63
122-
# Author: Kenneth Benzie (Benie) <[email protected]>
123-
# Date: Mon Oct 21 11:55:23 2024 +0100
124-
# Merge pull request #2131 from Bensuo/ben/command-handle-fix
125-
# [EXP][CMDBUF] Make command handle behaviour consistent
126-
set(UNIFIED_RUNTIME_TAG c742ca49efb12380a35b8b0b467e6577ab8174ce)
119+
set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime")
120+
# commit 3db3a5e2d935630f2ffddd93a72ae0aa9af89acb
121+
# Author: Artur Gainullin <[email protected]>
122+
# Date: Tue Oct 22 03:30:08 2024 -0700
123+
#
124+
# Support UR program creation from multiple device binaries (#2147)
125+
set(UNIFIED_RUNTIME_TAG 3db3a5e2d935630f2ffddd93a72ae0aa9af89acb)
127126

128127
set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES")
129128
# Due to the use of dependentloadflag and no installer for UMF and hwloc we need

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ createBinaryProgram(const ContextImplPtr Context, const device &Device,
9696
Properties.count = Metadata.size();
9797
Properties.pMetadatas = Metadata.data();
9898
Adapter->call<UrApiKind::urProgramCreateWithBinary>(
99-
Context->getHandleRef(), UrDevice, DataLen, Data, &Properties, &Program);
99+
Context->getHandleRef(), 1, &UrDevice, &DataLen, &Data, &Properties,
100+
&Program);
100101

101102
if (BinaryStatus != UR_RESULT_SUCCESS) {
102103
throw detail::set_ur_error(

sycl/unittests/SYCL2020/KernelBundleStateFiltering.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ ur_result_t redefinedUrProgramCreate(void *pParams) {
105105

106106
ur_result_t redefinedUrProgramCreateWithBinary(void *pParams) {
107107
auto params = *static_cast<ur_program_create_with_binary_params_t *>(pParams);
108-
redefinedUrProgramCreateCommon(*params.ppBinary);
108+
for (uint32_t i = 0; i < *params.pnumDevices; ++i)
109+
redefinedUrProgramCreateCommon(*params.pppBinaries[i]);
109110
return UR_RESULT_SUCCESS;
110111
}
111112

sycl/unittests/helpers/RuntimeLinkingCommon.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static ur_result_t redefined_urProgramCreateWithIL(void *pParams) {
4040

4141
static ur_result_t redefined_urProgramCreateWithBinary(void *pParams) {
4242
auto Params = *static_cast<ur_program_create_with_binary_params_t *>(pParams);
43-
auto *Magic = reinterpret_cast<const unsigned char *>(*Params.ppBinary);
43+
auto *Magic = reinterpret_cast<const unsigned char *>(*Params.pppBinaries[0]);
4444
ur_program_handle_t *res = *Params.pphProgram;
4545
*res = mock::createDummyHandle<ur_program_handle_t>(sizeof(unsigned));
4646
reinterpret_cast<mock::dummy_handle_t>(*res)->setDataAs<unsigned>(*Magic);

sycl/unittests/program_manager/CompileTarget.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,9 @@ static ur_result_t redefinedDeviceGet(void *pParams) {
138138
std::vector<std::string> createWithBinaryLog;
139139
static ur_result_t redefinedProgramCreateWithBinary(void *pParams) {
140140
auto params = *static_cast<ur_program_create_with_binary_params_t *>(pParams);
141-
createWithBinaryLog.push_back(
142-
reinterpret_cast<const char *>(*params.ppBinary));
141+
for (uint32_t i = 0; i < *params.pnumDevices; ++i)
142+
createWithBinaryLog.push_back(
143+
reinterpret_cast<const char *>(*params.pppBinaries[i]));
143144
return UR_RESULT_SUCCESS;
144145
}
145146

0 commit comments

Comments
 (0)