Skip to content

Commit d1d9a1a

Browse files
committed
Fix unittest
Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 68ea80e commit d1d9a1a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

sycl/unittests/Extensions/IPC.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,20 @@ ur_result_t replace_urIPCCloseMemHandleExp(void *pParams) {
6868
return UR_RESULT_SUCCESS;
6969
}
7070

71+
ur_result_t after_urDeviceGetInfo(void *pParams) {
72+
auto params = *static_cast<ur_device_get_info_params_t *>(pParams);
73+
switch (*params.ppropName) {
74+
case UR_DEVICE_INFO_IPC_MEMORY_SUPPORT_EXP:
75+
if (*params.ppPropSizeRet)
76+
**params.ppPropSizeRet = sizeof(ur_bool_t);
77+
if (*params.ppPropValue)
78+
*static_cast<ur_bool_t *>(*params.ppPropValue) = ur_bool_t{true};
79+
return UR_RESULT_SUCCESS;
80+
default:
81+
return UR_RESULT_SUCCESS;
82+
}
83+
}
84+
7185
class IPCTests : public ::testing::Test {
7286
public:
7387
IPCTests() : Mock{}, Ctxt(sycl::platform()) {}
@@ -87,6 +101,8 @@ class IPCTests : public ::testing::Test {
87101
replace_urIPCOpenMemHandleExp);
88102
mock::getCallbacks().set_replace_callback("urIPCCloseMemHandleExp",
89103
replace_urIPCCloseMemHandleExp);
104+
mock::getCallbacks().set_after_callback("urDeviceGetInfo",
105+
after_urDeviceGetInfo);
90106
}
91107

92108
sycl::unittest::UrMock<> Mock;

0 commit comments

Comments
 (0)