Skip to content

Commit 740103e

Browse files
committed
fix
1 parent 4ceb2d7 commit 740103e

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

sycl/unittests/Extensions/VirtualMemory/Exceptions.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ ur_result_t setup_urDeviceGet(void *pParams) {
3838

3939
template <bool VirtualMemSupported>
4040
ur_result_t after_urDeviceGetInfo_AllDevices(void *pParams) {
41-
auto params = *static_cast<ur_device_get_info_params_t *>(pParams);
42-
switch (*params.ppropName) {
41+
auto params = reinterpret_cast<ur_device_get_info_params_t *>(pParams);
42+
switch (*params->ppropName) {
4343
case UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT: {
44-
if (*params.ppPropValue)
45-
*static_cast<ur_bool_t *>(*params.ppPropValue) = VirtualMemSupported;
44+
if (*params->ppPropValue)
45+
*static_cast<ur_bool_t *>(*params->ppPropValue) = VirtualMemSupported;
46+
if (*params->ppPropSizeRet)
47+
**params->ppPropSizeRet = sizeof(ur_bool_t);
4648
return UR_RESULT_SUCCESS;
4749
}
4850
default:;
@@ -52,14 +54,16 @@ ur_result_t after_urDeviceGetInfo_AllDevices(void *pParams) {
5254

5355
template <bool VirtualMemSupported>
5456
ur_result_t after_urDeviceGetInfo_SingleDevice(void *pParams) {
55-
auto params = *static_cast<ur_device_get_info_params_t *>(pParams);
56-
switch (*params.ppropName) {
57+
auto params = reinterpret_cast<ur_device_get_info_params_t *>(pParams);
58+
switch (*params->ppropName) {
5759
case UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT: {
58-
if (*params.ppPropValue) {
59-
if (*params.phDevice == GlobalDevicesHandle[0]) {
60-
*static_cast<ur_bool_t *>(*params.ppPropValue) = VirtualMemSupported;
61-
}
60+
if (*params->ppPropValue) {
61+
if (*params->phDevice == GlobalDevicesHandle[0]) {
62+
*static_cast<ur_bool_t *>(*params->ppPropValue) =VirtualMemSupported;
63+
}
6264
}
65+
if (*params->ppPropSizeRet)
66+
**params->ppPropSizeRet = sizeof(ur_bool_t);
6367
return UR_RESULT_SUCCESS;
6468
}
6569
default:;

0 commit comments

Comments
 (0)