Skip to content

Commit

Permalink
[SYCL][UR] Combined CTS fixes for CL adapter. (#11794)
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongreig authored Nov 14, 2023
1 parent a220848 commit 4c0780e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
12 changes: 6 additions & 6 deletions sycl/plugins/unified_runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT)
include(FetchContent)

set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
# commit ec7982bac6cb3a6b9ed610cd6b7cb41fcbc780dc
# Merge: 62e6d2f9 5fb82924
# commit 192e9404392c38ac43d09116d6c97e153c66f46b
# Merge: 2f44433c f65473d9
# Author: Kenneth Benzie (Benie) <k.benzie@codeplay.com>
# Date: Wed Nov 8 13:32:46 2023 +0000
# Merge pull request #1022 from 0x12CC/l0_usm_error_checking_2
# [UR][L0] Propagate OOM errors from `USMAllocationMakeResident`
set(UNIFIED_RUNTIME_TAG ec7982bac6cb3a6b9ed610cd6b7cb41fcbc780dc)
# Date: Fri Nov 10 13:25:42 2023 +0000
# Merge pull request #1044 from aarongreig/aaron/clCTSFixMegaBranch
# [OpenCL] Combined CTS fixes
set(UNIFIED_RUNTIME_TAG 192e9404392c38ac43d09116d6c97e153c66f46b)

if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO)
set(UNIFIED_RUNTIME_REPO "${SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO}")
Expand Down
14 changes: 12 additions & 2 deletions sycl/plugins/unified_runtime/pi2ur.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2336,8 +2336,18 @@ inline pi_result piKernelGetInfo(pi_kernel Kernel, pi_kernel_info ParamName,
break;
}
case PI_KERNEL_INFO_NUM_ARGS: {
UrParamName = UR_KERNEL_INFO_NUM_ARGS;
break;
size_t NumArgs = 0;
HANDLE_ERRORS(urKernelGetInfo(UrKernel, UR_KERNEL_INFO_NUM_ARGS,
sizeof(NumArgs), &NumArgs, nullptr));
if (ParamValueSizeRet) {
*ParamValueSizeRet = sizeof(uint32_t);
}
if (ParamValue) {
if (ParamValueSize != sizeof(uint32_t))
return PI_ERROR_INVALID_BUFFER_SIZE;
*static_cast<uint32_t *>(ParamValue) = static_cast<uint32_t>(NumArgs);
}
return PI_SUCCESS;
}
case PI_KERNEL_INFO_REFERENCE_COUNT: {
UrParamName = UR_KERNEL_INFO_REFERENCE_COUNT;
Expand Down
4 changes: 2 additions & 2 deletions sycl/source/backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ make_kernel_bundle(pi_native_handle NativeHandle, const context &TargetContext,
Plugin->call<PiApiKind::piProgramRetain>(PiProgram);

std::vector<pi::PiDevice> ProgramDevices;
size_t NumDevices = 0;
uint32_t NumDevices = 0;

Plugin->call<PiApiKind::piProgramGetInfo>(
PiProgram, PI_PROGRAM_INFO_NUM_DEVICES, sizeof(size_t), &NumDevices,
PiProgram, PI_PROGRAM_INFO_NUM_DEVICES, sizeof(NumDevices), &NumDevices,
nullptr);
ProgramDevices.resize(NumDevices);
Plugin->call<PiApiKind::piProgramGetInfo>(PiProgram, PI_PROGRAM_INFO_DEVICES,
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/detail/context_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ context_impl::context_impl(sycl::detail::pi::PiContext PiContext,
MSupportBufferLocationByDevices(NotChecked) {

std::vector<sycl::detail::pi::PiDevice> DeviceIds;
size_t DevicesNum = 0;
uint32_t DevicesNum = 0;
// TODO catch an exception and put it to list of asynchronous exceptions
Plugin->call<PiApiKind::piContextGetInfo>(
MContext, PI_CONTEXT_INFO_NUM_DEVICES, sizeof(DevicesNum), &DevicesNum,
Expand Down

0 comments on commit 4c0780e

Please sign in to comment.