From a7dba34814385e41f1096d34f50887f6a16658e7 Mon Sep 17 00:00:00 2001 From: Filip Hazubski Date: Fri, 17 Jan 2020 15:53:36 +0100 Subject: [PATCH] Update api.cpp Use UNRECOVERABLE_IF when checking for nullptr. Remove redundant object checks. Change-Id: I004663bcab9e682927206242fdd567a05c30992d Signed-off-by: Filip Hazubski --- runtime/api/api.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/runtime/api/api.cpp b/runtime/api/api.cpp index f245d39697..bbe1c75872 100644 --- a/runtime/api/api.cpp +++ b/runtime/api/api.cpp @@ -208,7 +208,7 @@ cl_int CL_API_CALL clGetDeviceIDs(cl_platform_id platform, for (auto rootDeviceIndex = 0u; rootDeviceIndex < numDev; rootDeviceIndex++) { ClDevice *device = pPlatform->getClDevice(rootDeviceIndex); - DEBUG_BREAK_IF(device == nullptr); + UNRECOVERABLE_IF(device == nullptr); if (deviceType & device->getDeviceInfo().deviceType) { if (devices) { @@ -1345,9 +1345,7 @@ cl_program CL_API_CALL clCreateProgramWithBuiltInKernels(cl_context context, for (cl_uint i = 0; i < numDevices; i++) { auto pContext = castToObject(context); - validateObject(pContext); auto pDevice = castToObject(*deviceList); - validateObject(pDevice); program = pDevice->getExecutionEnvironment()->getBuiltIns()->createBuiltInProgram( *pContext,