Add support for GT-Pin Callbacks [3/n]

Change-Id: Iea4b49efc9a666fde310ece15a9c69686d22f627
This commit is contained in:
hjnapiat
2018-02-08 16:00:20 +01:00
committed by sys_ocldev
parent 3e9a43fcb3
commit 5909a6b3d3
33 changed files with 1993 additions and 44 deletions

View File

@ -359,7 +359,6 @@ cl_int CL_API_CALL clReleaseContext(cl_context context) {
Context *pContext = castToObject<Context>(context);
if (pContext) {
pContext->release();
gtpinNotifyContextDestroy(context);
return CL_SUCCESS;
}
@ -1294,7 +1293,6 @@ cl_kernel CL_API_CALL clCreateKernel(cl_program clProgram,
Program *pProgram = nullptr;
cl_kernel kernel = nullptr;
cl_int retVal = CL_SUCCESS;
DBG_LOG_INPUTS("clProgram", clProgram, "kernelName", kernelName);
do {
@ -1350,6 +1348,9 @@ cl_int CL_API_CALL clCreateKernelsInProgram(cl_program clProgram,
program,
*kernelInfo,
nullptr);
if (kernels[ordinal] != nullptr) {
gtpinNotifyKernelCreate(kernels[ordinal]);
}
}
}
@ -2559,6 +2560,11 @@ cl_int CL_API_CALL clEnqueueNDRangeKernel(cl_command_queue commandQueue,
return retVal;
}
auto pKernel = castToObjectOrAbort<Kernel>(kernel);
TakeOwnershipWrapper<Kernel> kernelOwnership(*pKernel, gtpinIsGTPinInitialized());
gtpinNotifyKernelSubmit(kernel, pCommandQueue);
retVal = pCommandQueue->enqueueKernel(
kernel,
workDim,
@ -3767,6 +3773,9 @@ cl_kernel CL_API_CALL clCloneKernel(cl_kernel sourceKernel,
if (errcodeRet) {
*errcodeRet = retVal;
}
if (pClonedKernel != nullptr) {
gtpinNotifyKernelCreate(pClonedKernel);
}
return pClonedKernel;
}