Skip to content

Commit ce19c48

Browse files
committed
fix a few event command types
1 parent b7c0fb3 commit ce19c48

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

layers/99_svmplusplus/emulate.cpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ cl_int CL_API_CALL clEnqueueSVMMemcpy_override(
12911291
}
12921292

12931293
if (isUSMPtr(context, dst_ptr) || isUSMPtr(context, src_ptr)) {
1294-
return clEnqueueMemcpyINTEL(
1294+
cl_int ret = clEnqueueMemcpyINTEL(
12951295
command_queue,
12961296
blocking_copy,
12971297
dst_ptr,
@@ -1300,6 +1300,11 @@ cl_int CL_API_CALL clEnqueueSVMMemcpy_override(
13001300
num_events_in_wait_list,
13011301
event_wait_list,
13021302
event);
1303+
if (ret == CL_SUCCESS && event) {
1304+
auto& eventInfo = getLayerContext().getEventInfo(*event);
1305+
eventInfo.Type = CL_COMMAND_SVM_MEMCPY;
1306+
}
1307+
return ret;
13031308
}
13041309

13051310
return g_pNextDispatch->clEnqueueSVMMemcpy(
@@ -1342,7 +1347,7 @@ cl_int CL_API_CALL clEnqueueSVMMemFill_override(
13421347
}
13431348

13441349
if (isUSMPtr(context, svm_ptr)) {
1345-
return clEnqueueMemFillINTEL(
1350+
cl_int ret = clEnqueueMemFillINTEL(
13461351
command_queue,
13471352
svm_ptr,
13481353
pattern,
@@ -1351,6 +1356,11 @@ cl_int CL_API_CALL clEnqueueSVMMemFill_override(
13511356
num_events_in_wait_list,
13521357
event_wait_list,
13531358
event);
1359+
if (ret == CL_SUCCESS && event) {
1360+
auto& eventInfo = getLayerContext().getEventInfo(*event);
1361+
eventInfo.Type = CL_COMMAND_SVM_MEMFILL;
1362+
}
1363+
return ret;
13541364
}
13551365

13561366
return g_pNextDispatch->clEnqueueSVMMemFill(
@@ -1375,11 +1385,16 @@ cl_int CL_API_CALL clEnqueueSVMMigrateMem_override(
13751385
cl_event* event)
13761386
{
13771387
// for now, just emit a marker
1378-
return g_pNextDispatch->clEnqueueMarkerWithWaitList(
1388+
cl_int ret = g_pNextDispatch->clEnqueueMarkerWithWaitList(
13791389
command_queue,
13801390
num_events_in_wait_list,
13811391
event_wait_list,
13821392
event);
1393+
if (ret == CL_SUCCESS && event) {
1394+
auto& eventInfo = getLayerContext().getEventInfo(*event);
1395+
eventInfo.Type = CL_COMMAND_SVM_MIGRATE_MEM;
1396+
}
1397+
return ret;
13831398
}
13841399

13851400
cl_int CL_API_CALL clReleaseEvent_override(

0 commit comments

Comments
 (0)