P4 to Git Change 1131897 by wchau@wchau_WINDOWS7_OCL on 2015/03/18 10:50:41

ECR #399840 - OpenCL Runtime HW Debug support development -  add support to the VI asics &  support the use case of debug registeration in a pre-dispatch callback function

	** Cross branch check-in with CL1131894

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_debugger_amd.cpp#7 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudebugmanager.cpp#9 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#501 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.hpp#139 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gputrap.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#355 edit
Bu işleme şunda yer alıyor:
foreman
2015-03-18 11:26:04 -04:00
ebeveyn 3da2bd1161
işleme 95596795fc
5 değiştirilmiş dosya ile 105 ekleme ve 63 silme
+19 -11
Dosyayı Görüntüle
@@ -97,8 +97,11 @@ GpuDebugManager::executePreDispatchCallBack(void* aqlPacket,
preDispatchCallBackArgs_);
}
// Copy the various info set by the debugger/profiler to the tool info structure
setupTrapInformation(info);
// setup the trap handler information only if the debugger has been registered
if (isRegistered()) {
// Copy the various info set by the debugger/profiler to the tool info structure
setupTrapInformation(info);
}
}
void
@@ -234,12 +237,6 @@ DebugEvent
GpuDebugManager::createDebugEvent(
const bool autoReset)
{
if (!isRegistered()) {
LogError("debugmanager: Failed to flush cache - hw debug is not available");
return 0;
}
// create the event object
osEventHandle shaderEvent = osEventCreate(!autoReset);
@@ -348,8 +345,19 @@ GpuDebugManager::setGlobalMemory(
cl_int
GpuDebugManager::createRuntimeTrapHandler()
{
uint32_t codeSize = sizeof(RuntimeTrapCode);
uint32_t numCodes = sizeof(RuntimeTrapCode) / sizeof(RuntimeTrapCode[0]);
size_t codeSize = 0;
const uint32_t* rtTrapCode = NULL;
if (device()->settings().viPlus_) {
codeSize = sizeof(RuntimeTrapCodeVi);
rtTrapCode = RuntimeTrapCodeVi;
}
else {
codeSize = sizeof(RuntimeTrapCode);
rtTrapCode = RuntimeTrapCode;
}
uint32_t numCodes = codeSize / sizeof(uint32_t);
// Handle TMA corruption hw bug workaround -
// The trap handler buffer has extra 256 bytes allocated, the TMA address
@@ -389,7 +397,7 @@ GpuDebugManager::createRuntimeTrapHandler()
// save the trap handler code
uint32_t* trapHandlerPtr = (uint32_t*)(tbaAddress + TbaStartOffset);
for (uint32_t i = 0; i < numCodes; i++) {
trapHandlerPtr[i] = RuntimeTrapCode[i];
trapHandlerPtr[i] = rtTrapCode[i];
}
rtTBA->unmap(NULL);