mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 01:35:20 +08:00
refactor: Unify GTPin initialization logic between APIs
Add support for new GTPin loading logic in OCL path, similar to existing in L0 - invoking exposed, dedicated API call (OpenGTPinOCL). - Move logic to shared, including unit tests - Check whether instrumentation is required on clGetPlatformIDs API call, and if yes, make a call to OpenGTPinOCL function. Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
05fb8e9c00
commit
68a5108e05
@@ -297,6 +297,7 @@ cl_int CL_API_CALL clGetDeviceIDs(cl_platform_id platform,
|
||||
/* If no suitable device, set a error. */
|
||||
if (retNum == 0)
|
||||
retVal = CL_DEVICE_NOT_FOUND;
|
||||
|
||||
} while (false);
|
||||
TRACING_EXIT(ClGetDeviceIDs, &retVal);
|
||||
return retVal;
|
||||
@@ -438,6 +439,13 @@ cl_context CL_API_CALL clCreateContext(const cl_context_properties *properties,
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* At this point we can safely notify GTPin to allow initialization */
|
||||
EnvironmentVariableReader envReader;
|
||||
if (envReader.getSetting("ZET_ENABLE_PROGRAM_INSTRUMENTATION", false)) {
|
||||
if (false == pPlatform->notifyGtpinInit()) {
|
||||
retVal = CL_INVALID_OPERATION;
|
||||
}
|
||||
}
|
||||
if (CL_SUCCESS != retVal) {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user