mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Update api.cpp
Use UNRECOVERABLE_IF when checking for nullptr. Remove redundant object checks. Change-Id: I004663bcab9e682927206242fdd567a05c30992d Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
94a8345d3b
commit
a7dba34814
@ -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>(context);
|
||||
validateObject(pContext);
|
||||
auto pDevice = castToObject<ClDevice>(*deviceList);
|
||||
validateObject(pDevice);
|
||||
|
||||
program = pDevice->getExecutionEnvironment()->getBuiltIns()->createBuiltInProgram(
|
||||
*pContext,
|
||||
|
Reference in New Issue
Block a user