mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-27 15:53:13 +08:00
Correct callback API functions
Add implementation to clSetProgramReleaseCallback and clSetContextDestructorCallback functions. Resolves: NEO-4962, NEO-5051 Change-Id: Iad6fffc663665a3cf16b96aa90065140cf8c5477 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
5358f2cf9c
commit
d889c599b2
@@ -5381,11 +5381,12 @@ cl_int CL_API_CALL clSetProgramReleaseCallback(cl_program program,
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
API_ENTER(&retVal);
|
||||
|
||||
retVal = validateObjects(program,
|
||||
Program *pProgram = nullptr;
|
||||
retVal = validateObjects(WithCastToInternal(program, &pProgram),
|
||||
reinterpret_cast<void *>(pfnNotify));
|
||||
|
||||
if (retVal == CL_SUCCESS) {
|
||||
retVal = CL_INVALID_OPERATION;
|
||||
retVal = pProgram->setReleaseCallback(pfnNotify, userData);
|
||||
}
|
||||
|
||||
return retVal;
|
||||
@@ -5597,11 +5598,12 @@ cl_int CL_API_CALL clSetContextDestructorCallback(cl_context context,
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
API_ENTER(&retVal);
|
||||
|
||||
retVal = validateObjects(context,
|
||||
Context *pContext = nullptr;
|
||||
retVal = validateObjects(WithCastToInternal(context, &pContext),
|
||||
reinterpret_cast<void *>(pfnNotify));
|
||||
|
||||
if (retVal == CL_SUCCESS) {
|
||||
retVal = CL_OUT_OF_HOST_MEMORY;
|
||||
retVal = pContext->setDestructorCallback(pfnNotify, userData);
|
||||
}
|
||||
|
||||
return retVal;
|
||||
|
||||
Reference in New Issue
Block a user