Revert "Pass info betwean gtpin and igc"

This reverts commit 5654d5673fbff18b1f3c81a8eb3c8dfeb9add9e1.

Change-Id: I2df912fef15755b2e5bd11d3e18e595d71bfad98
This commit is contained in:
Kamil Diedrich
2018-07-30 12:00:06 +02:00
committed by sys_ocldev
parent e85e9535ff
commit ea92874a66
14 changed files with 14 additions and 208 deletions

View File

@@ -145,7 +145,7 @@ cl_int CompilerInterface::build(
auto igcTranslationCtx = createIgcTranslationCtx(device, intermediateCodeType, IGC::CodeType::oclGenBin);
auto igcOutput = translate(igcTranslationCtx.get(), intermediateRepresentation.get(),
fclOptions.get(), fclInternalOptions.get(), inputArgs.GTPinInput);
fclOptions.get(), fclInternalOptions.get());
if (igcOutput == nullptr) {
return CL_OUT_OF_HOST_MEMORY;

View File

@@ -49,24 +49,6 @@ inline CIF::RAII::UPtr_t<IGC::OclTranslationOutputTagOCL> translate(TranslationC
return ret;
}
template <typename TranslationCtx>
inline CIF::RAII::UPtr_t<IGC::OclTranslationOutputTagOCL> translate(TranslationCtx *tCtx, CIFBuffer *src, CIFBuffer *options,
CIFBuffer *internalOptions, void *gtpinInit) {
if (false == OCLRT::areNotNullptr(tCtx, src, options, internalOptions)) {
return nullptr;
}
auto ret = tCtx->Translate(src, options, internalOptions, nullptr, 0, gtpinInit);
if (ret == nullptr) {
return nullptr; // assume OOM or internal error
}
if ((ret->GetOutput() == nullptr) || (ret->GetBuildLog() == nullptr) || (ret->GetDebugData() == nullptr)) {
return nullptr; // assume OOM or internal error
}
return ret;
}
CIF::CIFMain *createMainNoSanitize(CIF::CreateCIFMainFunc_t createFunc);

View File

@@ -55,15 +55,4 @@ void gtpinNotifyUpdateResidencyList(void *pKernel, void *pResidencyVector) {
void gtpinNotifyPlatformShutdown() {
}
void *gtpinGetIgcInit() {
return nullptr;
}
void setIgcInfo(const void *igcInfo) {
}
const void *gtpinGetIgcInfo() {
return nullptr;
}
} // namespace OCLRT

View File

@@ -34,7 +34,6 @@
#include "runtime/mem_obj/buffer.h"
#include "runtime/memory_manager/surface.h"
#include "runtime/platform/platform.h"
#include "runtime/program/program.h"
#include "runtime/utilities/spinlock.h"
#include <deque>
#include <vector>
@@ -45,8 +44,7 @@ namespace OCLRT {
extern gtpin::ocl::gtpin_events_t GTPinCallbacks;
igc_init_t *pIgcInit = nullptr;
const igc_info_t *pIgcInfo = nullptr;
igc_init_t *pIgcInfo = nullptr;
std::atomic<int> sequenceCount(1);
CommandQueue *pCmdQueueForFlushTask = nullptr;
std::deque<gtpinkexec_t> kernelExecQueue;
@@ -61,7 +59,7 @@ void gtpinNotifyContextCreate(cl_context context) {
GTPinHwHelper &gtpinHelper = GTPinHwHelper::get(genFamily);
gtpinPlatformInfo.gen_version = (gtpin::GTPIN_GEN_VERSION)gtpinHelper.getGenVersion();
gtpinPlatformInfo.device_id = static_cast<uint32_t>(pDevice->getHardwareInfo().pPlatform->usDeviceID);
(*GTPinCallbacks.onContextCreate)((context_handle_t)context, &gtpinPlatformInfo, &pIgcInit);
(*GTPinCallbacks.onContextCreate)((context_handle_t)context, &gtpinPlatformInfo, &pIgcInfo);
}
}
@@ -92,8 +90,7 @@ void gtpinNotifyKernelCreate(cl_kernel kernel) {
Context *pContext = &(pKernel->getContext());
cl_context context = (cl_context)pContext;
auto &kernelInfo = pKernel->getKernelInfo();
instrument_params_in_t paramsIn = {};
instrument_params_in_t paramsIn;
paramsIn.kernel_type = GTPIN_KERNEL_TYPE_CS;
paramsIn.simd = (GTPIN_SIMD_WIDTH)kernelInfo.getMaxSimdSize();
paramsIn.orig_kernel_binary = (uint8_t *)pKernel->getKernelHeap();
@@ -102,9 +99,7 @@ void gtpinNotifyKernelCreate(cl_kernel kernel) {
paramsIn.buffer_desc.BTI = static_cast<uint32_t>(gtpinBTI);
paramsIn.igc_hash_id = kernelInfo.heapInfo.pKernelHeader->ShaderHashCode;
paramsIn.kernel_name = (char *)kernelInfo.name.c_str();
paramsIn.igc_info = pIgcInfo;
paramsIn.debug_data = pKernel->getProgram()->getDebugData();
paramsIn.debug_data_size = static_cast<uint32_t>(pKernel->getProgram()->getDebugDataSize());
paramsIn.igc_info = nullptr;
instrument_params_out_t paramsOut = {0};
(*GTPinCallbacks.onKernelCreate)((context_handle_t)(cl_context)context, &paramsIn, &paramsOut);
// Substitute ISA of created kernel with instrumented code
@@ -250,15 +245,4 @@ void gtpinNotifyPlatformShutdown() {
kernelExecQueue.clear();
}
}
void *gtpinGetIgcInit() {
return pIgcInit;
}
void setIgcInfo(const void *igcInfo) {
pIgcInfo = reinterpret_cast<const igc_info_t *>(igcInfo);
}
const void *gtpinGetIgcInfo() {
return pIgcInfo;
}
} // namespace OCLRT

View File

@@ -36,14 +36,13 @@ gtpin::ocl::gtpin_events_t GTPinCallbacks = {0};
} // namespace OCLRT
GTPIN_DI_STATUS GTPin_Init(gtpin::ocl::gtpin_events_t *pGtpinEvents, driver_services_t *pDriverServices,
interface_version_t *pDriverVersion) {
uint32_t *pDriverVersion) {
if (isGTPinInitialized) {
return GTPIN_DI_ERROR_INSTANCE_ALREADY_CREATED;
}
if (pDriverVersion != nullptr) {
// GT-Pin is asking to obtain GT-Pin Interface version that is supported
pDriverVersion->common = gtpin::GTPIN_COMMON_INTERFACE_VERSION;
pDriverVersion->specific = gtpin::ocl::GTPIN_OCL_INTERFACE_VERSION;
*pDriverVersion = gtpin::ocl::GTPIN_OCL_INTERFACE_VERSION;
if ((pDriverServices == nullptr) || (pGtpinEvents == nullptr)) {
return GTPIN_DI_SUCCESS;

View File

@@ -27,7 +27,7 @@
extern "C" {
#endif
gtpin::GTPIN_DI_STATUS GTPin_Init(gtpin::ocl::gtpin_events_t *pGtpinEvents, gtpin::driver_services_t *pDriverServices, gtpin::interface_version_t *pDriverVersion);
gtpin::GTPIN_DI_STATUS GTPin_Init(gtpin::ocl::gtpin_events_t *pGtpinEvents, gtpin::driver_services_t *pDriverServices, uint32_t *pDriverVersion);
#ifdef __cplusplus
}

View File

@@ -36,7 +36,4 @@ void gtpinNotifyMakeResident(void *pKernel, void *pCommandStreamReceiver);
void gtpinNotifyUpdateResidencyList(void *pKernel, void *pResidencyVector);
void gtpinNotifyPlatformShutdown();
inline bool gtpinIsGTPinInitialized() { return isGTPinInitialized; }
void *gtpinGetIgcInit();
void setIgcInfo(const void *igcInfo);
const void *gtpinGetIgcInfo();
} // namespace OCLRT

View File

@@ -26,7 +26,6 @@
#include "runtime/platform/platform.h"
#include "runtime/source_level_debugger/source_level_debugger.h"
#include "runtime/helpers/validators.h"
#include "runtime/gtpin/gtpin_notify.h"
#include "program.h"
#include <cstring>
@@ -119,7 +118,6 @@ cl_int Program::build(
inputArgs.InternalOptionsSize = (uint32_t)internalOptions.length();
inputArgs.pTracingOptions = nullptr;
inputArgs.TracingOptionsCount = 0;
inputArgs.GTPinInput = gtpinGetIgcInit();
DBG_LOG(LogApiCalls,
"Build Options", inputArgs.pOptions,
"\nBuild Internal Options", inputArgs.pInternalOptions);

View File

@@ -31,7 +31,6 @@
#include "runtime/helpers/string.h"
#include "runtime/kernel/kernel.h"
#include "runtime/memory_manager/memory_manager.h"
#include "runtime/gtpin/gtpin_notify.h"
#include <algorithm>
@@ -779,13 +778,7 @@ cl_int Program::parsePatchList(KernelInfo &kernelInfo) {
"\n .Offset", pPatchToken->Offset,
"\n .PerThreadSystemThreadSurfaceSize", pPatchToken->PerThreadSystemThreadSurfaceSize);
} break;
case PATCH_TOKEN_GTPIN_INFO: {
setIgcInfo(ptrOffset(pCurPatchListPtr, sizeof(SPatchItemHeader)));
DBG_LOG(LogPatchTokens,
"\n.PATCH_TOKEN_GTPIN_INFO", pPatch->Token,
"\n .Size", pPatch->Size);
break;
}
default:
printDebugString(DebugManager.flags.PrintDebugMessages.get(), stderr, " Program::parsePatchList. Unknown Patch Token: %d\n", pPatch->Token);
if (false == isSafeToSkipUnhandledToken(pPatch->Token)) {

View File

@@ -246,14 +246,6 @@ class Program : public BaseObject<_cl_program> {
return kernelDebugEnabled;
}
char *getDebugData() {
return debugData;
}
size_t getDebugDataSize() {
return debugDataSize;
}
protected:
Program();