Skip to content

Commit 391607c

Browse files
authored
only log MDAPI event profiling errors for kernel events (intel#379)
1 parent 67d4c97 commit 391607c

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

intercept/mdapi/intercept_mdapi.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,21 @@ void CLIntercept::getMDAPICountersFromEvent(
458458
}
459459
else
460460
{
461-
logf("Couldn't get MDAPI data! clGetEventProfilingInfo returned '%s' (%08X)!\n",
462-
enumName().name(errorCode).c_str(),
463-
errorCode );
461+
// Currently, MDAPI data is only included for kernels, so only
462+
// report an errors for kernel events.
463+
cl_command_type type = 0;
464+
dispatch().clGetEventInfo(
465+
event,
466+
CL_EVENT_COMMAND_TYPE,
467+
sizeof(type),
468+
&type,
469+
NULL );
470+
if( type == CL_COMMAND_NDRANGE_KERNEL )
471+
{
472+
logf("Couldn't get MDAPI data for kernel! clGetEventProfilingInfo returned '%s' (%08X)!\n",
473+
enumName().name(errorCode).c_str(),
474+
errorCode );
475+
}
464476
}
465477

466478
delete [] pReport;

0 commit comments

Comments
 (0)