diff --git a/sycl/cmake/modules/FetchUnifiedRuntime.cmake b/sycl/cmake/modules/FetchUnifiedRuntime.cmake index 7dbb2f4c604ea..920419088f3c3 100644 --- a/sycl/cmake/modules/FetchUnifiedRuntime.cmake +++ b/sycl/cmake/modules/FetchUnifiedRuntime.cmake @@ -116,14 +116,13 @@ if(SYCL_UR_USE_FETCH_CONTENT) CACHE PATH "Path to external '${name}' adapter source dir" FORCE) endfunction() - set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git") - # commit c742ca49efb12380a35b8b0b467e6577ab8174ce - # Merge: 3a8bf2c5 504d3b63 - # Author: Kenneth Benzie (Benie) - # Date: Mon Oct 21 11:55:23 2024 +0100 - # Merge pull request #2131 from Bensuo/ben/command-handle-fix - # [EXP][CMDBUF] Make command handle behaviour consistent - set(UNIFIED_RUNTIME_TAG c742ca49efb12380a35b8b0b467e6577ab8174ce) + set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime") + # commit 3db3a5e2d935630f2ffddd93a72ae0aa9af89acb + # Author: Artur Gainullin + # Date: Tue Oct 22 03:30:08 2024 -0700 + # + # Support UR program creation from multiple device binaries (#2147) + set(UNIFIED_RUNTIME_TAG 3db3a5e2d935630f2ffddd93a72ae0aa9af89acb) set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES") # Due to the use of dependentloadflag and no installer for UMF and hwloc we need diff --git a/sycl/source/detail/program_manager/program_manager.cpp b/sycl/source/detail/program_manager/program_manager.cpp index e48255682749c..825d52218b518 100644 --- a/sycl/source/detail/program_manager/program_manager.cpp +++ b/sycl/source/detail/program_manager/program_manager.cpp @@ -96,7 +96,8 @@ createBinaryProgram(const ContextImplPtr Context, const device &Device, Properties.count = Metadata.size(); Properties.pMetadatas = Metadata.data(); Adapter->call( - Context->getHandleRef(), UrDevice, DataLen, Data, &Properties, &Program); + Context->getHandleRef(), 1, &UrDevice, &DataLen, &Data, &Properties, + &Program); if (BinaryStatus != UR_RESULT_SUCCESS) { throw detail::set_ur_error( diff --git a/sycl/unittests/SYCL2020/KernelBundleStateFiltering.cpp b/sycl/unittests/SYCL2020/KernelBundleStateFiltering.cpp index d7623b857978f..aae58e6319972 100644 --- a/sycl/unittests/SYCL2020/KernelBundleStateFiltering.cpp +++ b/sycl/unittests/SYCL2020/KernelBundleStateFiltering.cpp @@ -105,7 +105,8 @@ ur_result_t redefinedUrProgramCreate(void *pParams) { ur_result_t redefinedUrProgramCreateWithBinary(void *pParams) { auto params = *static_cast(pParams); - redefinedUrProgramCreateCommon(*params.ppBinary); + for (uint32_t i = 0; i < *params.pnumDevices; ++i) + redefinedUrProgramCreateCommon(*params.pppBinaries[i]); return UR_RESULT_SUCCESS; } diff --git a/sycl/unittests/helpers/RuntimeLinkingCommon.hpp b/sycl/unittests/helpers/RuntimeLinkingCommon.hpp index 87f0f980119f0..7299836dd15cf 100644 --- a/sycl/unittests/helpers/RuntimeLinkingCommon.hpp +++ b/sycl/unittests/helpers/RuntimeLinkingCommon.hpp @@ -40,7 +40,7 @@ static ur_result_t redefined_urProgramCreateWithIL(void *pParams) { static ur_result_t redefined_urProgramCreateWithBinary(void *pParams) { auto Params = *static_cast(pParams); - auto *Magic = reinterpret_cast(*Params.ppBinary); + auto *Magic = reinterpret_cast(*Params.pppBinaries[0]); ur_program_handle_t *res = *Params.pphProgram; *res = mock::createDummyHandle(sizeof(unsigned)); reinterpret_cast(*res)->setDataAs(*Magic); diff --git a/sycl/unittests/program_manager/CompileTarget.cpp b/sycl/unittests/program_manager/CompileTarget.cpp index 53a48acaf28d8..39f8d64499c7f 100644 --- a/sycl/unittests/program_manager/CompileTarget.cpp +++ b/sycl/unittests/program_manager/CompileTarget.cpp @@ -138,8 +138,9 @@ static ur_result_t redefinedDeviceGet(void *pParams) { std::vector createWithBinaryLog; static ur_result_t redefinedProgramCreateWithBinary(void *pParams) { auto params = *static_cast(pParams); - createWithBinaryLog.push_back( - reinterpret_cast(*params.ppBinary)); + for (uint32_t i = 0; i < *params.pnumDevices; ++i) + createWithBinaryLog.push_back( + reinterpret_cast(*params.pppBinaries[i])); return UR_RESULT_SUCCESS; }