Skip to content

Commit cd97612

Browse files
committed
Fix missed return values
Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 7e8c469 commit cd97612

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

source/adapters/opencl/command_buffer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferCreateExp(
2626
CLContext, cl_ext::ExtFuncPtrCache->clCreateCommandBufferKHRCache,
2727
cl_ext::CreateCommandBufferName, &clCreateCommandBufferKHR));
2828

29+
cl_int Res = CL_SUCCESS;
2930
auto CLCommandBuffer = clCreateCommandBufferKHR(
3031
1, cl_adapter::cast<cl_command_queue *>(&Queue), nullptr, &Res);
3132
CL_RETURN_ON_FAILURE_AND_SET_NULL(Res, phCommandBuffer);

source/adapters/opencl/enqueue.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -409,15 +409,15 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueReadHostPipe(
409409
cl_ext::EnqueueReadHostPipeName, &FuncPtr));
410410

411411
if (FuncPtr) {
412-
RetVal = mapCLErrorToUR(
412+
CL_RETURN_ON_FAILURE(mapCLErrorToUR(
413413
FuncPtr(cl_adapter::cast<cl_command_queue>(hQueue),
414414
cl_adapter::cast<cl_program>(hProgram), pipe_symbol, blocking,
415415
pDst, size, numEventsInWaitList,
416416
cl_adapter::cast<const cl_event *>(phEventWaitList),
417-
cl_adapter::cast<cl_event *>(phEvent)));
417+
cl_adapter::cast<cl_event *>(phEvent))));
418418
}
419419

420-
return RetVal;
420+
return UR_RESULT_SUCCESS;
421421
}
422422

423423
UR_APIEXPORT ur_result_t UR_APICALL urEnqueueWriteHostPipe(
@@ -441,13 +441,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueWriteHostPipe(
441441
cl_ext::EnqueueWriteHostPipeName, &FuncPtr));
442442

443443
if (FuncPtr) {
444-
RetVal = mapCLErrorToUR(
444+
CL_RETURN_ON_FAILURE(mapCLErrorToUR(
445445
FuncPtr(cl_adapter::cast<cl_command_queue>(hQueue),
446446
cl_adapter::cast<cl_program>(hProgram), pipe_symbol, blocking,
447447
pSrc, size, numEventsInWaitList,
448448
cl_adapter::cast<const cl_event *>(phEventWaitList),
449-
cl_adapter::cast<cl_event *>(phEvent)));
449+
cl_adapter::cast<cl_event *>(phEvent))));
450450
}
451451

452-
return RetVal;
452+
return UR_RESULT_SUCCESS;
453453
}

0 commit comments

Comments
 (0)