Skip to content

Commit 1bb1a91

Browse files
authored
add an alternate CL_DEVICE_HANDLE_LIST_END_KHR (#253)
1 parent 82b3142 commit 1bb1a91

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

intercept/src/intercept.cpp

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,26 +2293,32 @@ void CLIntercept::getMemPropertiesString(
22932293
{
22942294
++properties;
22952295
str += "{ ";
2296-
do
2296+
while( true )
22972297
{
22982298
if( *properties == CL_DEVICE_HANDLE_LIST_END_KHR )
22992299
{
23002300
str += "CL_DEVICE_HANDLE_LIST_END_KHR";
2301+
properties++;
2302+
break;
2303+
}
2304+
else if( *properties == 0x2052 )
2305+
{
2306+
str += "CL_DEVICE_HANDLE_LIST_END_KHR_0x2502";
2307+
properties++;
2308+
break;
23012309
}
23022310
else
23032311
{
2304-
auto pDevice = (const cl_device_id*)properties;
2312+
auto pDevice = (const cl_device_id*)properties++;
23052313
std::string deviceInfo;
23062314
getDeviceInfoString(
23072315
1,
23082316
pDevice,
23092317
deviceInfo );
23102318
str += deviceInfo;
23112319
str += ", ";
2312-
23132320
}
23142321
}
2315-
while( *properties++ != CL_DEVICE_HANDLE_LIST_END_KHR );
23162322
str += " }";
23172323
}
23182324
break;
@@ -2392,26 +2398,32 @@ void CLIntercept::getSemaphorePropertiesString(
23922398
{
23932399
++properties;
23942400
str += "{ ";
2395-
do
2401+
while( true )
23962402
{
23972403
if( *properties == CL_DEVICE_HANDLE_LIST_END_KHR )
23982404
{
23992405
str += "CL_DEVICE_HANDLE_LIST_END_KHR";
2406+
properties++;
2407+
break;
2408+
}
2409+
else if( *properties == 0x2052 )
2410+
{
2411+
str += "CL_DEVICE_HANDLE_LIST_END_KHR_0x2502";
2412+
properties++;
2413+
break;
24002414
}
24012415
else
24022416
{
2403-
auto pDevice = (const cl_device_id*)properties;
2417+
auto pDevice = (const cl_device_id*)properties++;
24042418
std::string deviceInfo;
24052419
getDeviceInfoString(
24062420
1,
24072421
pDevice,
24082422
deviceInfo );
24092423
str += deviceInfo;
24102424
str += ", ";
2411-
24122425
}
24132426
}
2414-
while( *properties++ != CL_DEVICE_HANDLE_LIST_END_KHR );
24152427
str += " }";
24162428
}
24172429
break;

0 commit comments

Comments
 (0)