Skip to content

Commit 4c0780e

Browse files
authored
[SYCL][UR] Combined CTS fixes for CL adapter. (#11794)
Pulls in fixes from oneapi-src/unified-runtime#1044
1 parent a220848 commit 4c0780e

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

sycl/plugins/unified_runtime/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT)
5454
include(FetchContent)
5555

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

6565
if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO)
6666
set(UNIFIED_RUNTIME_REPO "${SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO}")

sycl/plugins/unified_runtime/pi2ur.hpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2336,8 +2336,18 @@ inline pi_result piKernelGetInfo(pi_kernel Kernel, pi_kernel_info ParamName,
23362336
break;
23372337
}
23382338
case PI_KERNEL_INFO_NUM_ARGS: {
2339-
UrParamName = UR_KERNEL_INFO_NUM_ARGS;
2340-
break;
2339+
size_t NumArgs = 0;
2340+
HANDLE_ERRORS(urKernelGetInfo(UrKernel, UR_KERNEL_INFO_NUM_ARGS,
2341+
sizeof(NumArgs), &NumArgs, nullptr));
2342+
if (ParamValueSizeRet) {
2343+
*ParamValueSizeRet = sizeof(uint32_t);
2344+
}
2345+
if (ParamValue) {
2346+
if (ParamValueSize != sizeof(uint32_t))
2347+
return PI_ERROR_INVALID_BUFFER_SIZE;
2348+
*static_cast<uint32_t *>(ParamValue) = static_cast<uint32_t>(NumArgs);
2349+
}
2350+
return PI_SUCCESS;
23412351
}
23422352
case PI_KERNEL_INFO_REFERENCE_COUNT: {
23432353
UrParamName = UR_KERNEL_INFO_REFERENCE_COUNT;

sycl/source/backend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@ make_kernel_bundle(pi_native_handle NativeHandle, const context &TargetContext,
174174
Plugin->call<PiApiKind::piProgramRetain>(PiProgram);
175175

176176
std::vector<pi::PiDevice> ProgramDevices;
177-
size_t NumDevices = 0;
177+
uint32_t NumDevices = 0;
178178

179179
Plugin->call<PiApiKind::piProgramGetInfo>(
180-
PiProgram, PI_PROGRAM_INFO_NUM_DEVICES, sizeof(size_t), &NumDevices,
180+
PiProgram, PI_PROGRAM_INFO_NUM_DEVICES, sizeof(NumDevices), &NumDevices,
181181
nullptr);
182182
ProgramDevices.resize(NumDevices);
183183
Plugin->call<PiApiKind::piProgramGetInfo>(PiProgram, PI_PROGRAM_INFO_DEVICES,

sycl/source/detail/context_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ context_impl::context_impl(sycl::detail::pi::PiContext PiContext,
7777
MSupportBufferLocationByDevices(NotChecked) {
7878

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

0 commit comments

Comments
 (0)