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
  context creation and if yes,
  make a call to OpenGTPinOCL function.
  Handle potential errors gracefully without exiting.
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
This commit is contained in:
Kacper Nowak
2023-08-02 19:33:48 +02:00
committed by Compute-Runtime-Automation
parent c43b827702
commit 1afaf37f78
22 changed files with 218 additions and 142 deletions

View File

@@ -21,6 +21,7 @@
#include "opencl/source/kernel/kernel.h"
#include "opencl/source/kernel/multi_device_kernel.h"
#include "opencl/source/mem_obj/buffer.h"
#include "opencl/source/platform/platform.h"
#include "opencl/source/program/program.h"
#include "CL/cl.h"
@@ -281,4 +282,12 @@ void gtpinRemoveCommandQueue(void *pCmdQueue) {
}
}
void gtPinTryNotifyInit() {
if (platformsImpl->empty()) {
return;
}
auto &pPlatform = *(*platformsImpl)[0];
pPlatform.tryNotifyGtpinInit();
}
} // namespace NEO

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*

View File

@@ -28,4 +28,6 @@ inline bool gtpinIsGTPinInitialized() { return isGTPinInitialized; }
void *gtpinGetIgcInit();
void gtpinSetIgcInit(void *pIgcInitPtr);
void gtpinRemoveCommandQueue(void *pCmdQueue);
void gtPinTryNotifyInit();
} // namespace NEO