Forbid to rebuild program

Change-Id: I0fe5d8c9b39b3fc857bba0bde77ed4d9a4bb95af
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2020-04-20 10:52:26 +02:00
committed by sys_ocldev
parent 22831f40e9
commit aa957370da
3 changed files with 71 additions and 44 deletions

View File

@@ -1467,7 +1467,11 @@ cl_int CL_API_CALL clBuildProgram(cl_program program,
auto pProgram = castToObject<Program>(program);
if (pProgram) {
retVal = pProgram->build(numDevices, deviceList, options, funcNotify, userData, clCacheEnabled);
if (pProgram->getBuildStatus() == CL_BUILD_SUCCESS) {
retVal = CL_INVALID_OPERATION;
} else {
retVal = pProgram->build(numDevices, deviceList, options, funcNotify, userData, clCacheEnabled);
}
}
TRACING_EXIT(clBuildProgram, &retVal);