Files
rocm-systems/rocclr/runtime/device/gpu/gputhreadtrace.cpp
T
foreman 727fc38bbb P4 to Git Change 1184379 by gandryey@gera-dev-w7 on 2015/08/25 13:11:13
ECR #304775 - Remove the passthrough interfaces from CALGSLContext

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpucounters.cpp#11 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#293 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.hpp#114 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#224 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gputhreadtrace.cpp#8 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gputhreadtrace.hpp#6 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gputimestamp.cpp#26 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#374 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.hpp#132 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLContext.cpp#77 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLContext.h#49 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/backend.h#9 edit
2015-08-25 13:22:29 -04:00

68 строки
1.6 KiB
C++

//
// Copyright (c) 2008 Advanced Micro Devices, Inc. All rights reserved.
//
#include "device/gpu/gputhreadtrace.hpp"
#include "device/gpu/gpuvirtual.hpp"
namespace gpu {
CalThreadTraceReference::~CalThreadTraceReference() {
// The thread trace object is always associated with a particular queue,
// so we have to lock just this queue
amd::ScopedLock lock(gpu_.execution());
if (0 != threadTrace_) {
//gpu().cs()->destroyQuery(gslThreadTrace());
}
}
ThreadTrace::~ThreadTrace()
{
if (calRef_ == NULL) {
return;
}
for(uint i = 0; i < amdThreadTraceMemObjsNum_;++i) {
threadTraceBufferObjs_[i]->attachMemObject(gpu().cs(), NULL, 0, 0, 0, i);
gpu().cs()->destroyShaderTraceBuffer(threadTraceBufferObjs_[i]);
}
// Release the thread trace reference object
//calRef_->release();
}
bool
ThreadTrace::create(CalThreadTraceReference* calRef)
{
assert(&gpu() == &calRef->gpu());
calRef_ = calRef;
threadTrace_ = calRef->gslThreadTrace();
return true;
}
bool
ThreadTrace::info(uint infoType, uint* info, uint infoSize) const
{
switch (infoType) {
case CL_THREAD_TRACE_BUFFERS_SIZE: {
if (infoSize < amdThreadTraceMemObjsNum_) {
LogError("The amount of buffers should be equal to the amount of Shader Engines");
return false;
}
else {
gslThreadTrace()->GetResultAll(gpu().cs(), info);
}
break;
}
default:
LogError("Wrong ThreadTrace::getInfo parameter");
return false;
}
return true;
}
} // namespace gpu