P4 to Git Change 1281192 by jatang@jatang-opencl-hsa-stg2 on 2016/06/17 15:19:04
SWDEV-1 - Back out changelist 1281189.
Made a mistake. Was trying to shelve the CL.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palbe/src/core/hw/gfxip/computeCmdBuffer.cpp#4 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palbe/src/core/hw/gfxip/computeCmdBuffer.h#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palbe/src/core/hw/gfxip/gfx6/gfx6ComputeCmdBuffer.cpp#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palbe/src/core/hw/gfxip/gfx6/gfx6ComputeCmdBuffer.h#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palbe/src/core/hw/gfxip/gfx6/gfx6PerfCounter.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palbe/src/core/hw/gfxip/gfx6/gfx6PerfTrace.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcounters.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcounters.hpp#4 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#13 edit
[ROCm/clr commit: 2a8a6888a9]
Этот коммит содержится в:
@@ -33,8 +33,7 @@ PalCounterReference::Create(
|
||||
return memRef;
|
||||
}
|
||||
|
||||
PalCounterReference::~PalCounterReference()
|
||||
{
|
||||
PalCounterReference::~PalCounterReference() {
|
||||
// The counter object is always associated with a particular queue,
|
||||
// so we have to lock just this queue
|
||||
amd::ScopedLock lock(gpu_.execution());
|
||||
@@ -44,8 +43,7 @@ PalCounterReference::~PalCounterReference()
|
||||
}
|
||||
|
||||
bool
|
||||
PalCounterReference::growResultArray(uint index)
|
||||
{
|
||||
PalCounterReference::growResultArray(uint index) {
|
||||
if (results_ != nullptr) {
|
||||
delete [] results_;
|
||||
}
|
||||
@@ -56,68 +54,6 @@ PalCounterReference::growResultArray(uint index)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PalCounterReference::finalize()
|
||||
{
|
||||
iPerf()->Finalize();
|
||||
|
||||
// Acquire GPU memory for the query from the pool and bind it.
|
||||
Pal::GpuMemoryRequirements gpuMemReqs = {};
|
||||
iPerf()->GetGpuMemoryRequirements(&gpuMemReqs);
|
||||
|
||||
Pal::GpuMemoryCreateInfo createInfo = {};
|
||||
createInfo.size = amd::alignUp(gpuMemReqs.size, gpuMemReqs.alignment);
|
||||
createInfo.alignment = gpuMemReqs.alignment;
|
||||
createInfo.vaRange = Pal::VaRange::Default;
|
||||
createInfo.heapCount = 1;
|
||||
//createInfo.heaps[0] = Pal::GpuHeapGartCacheable;
|
||||
createInfo.heaps[0] = gpuMemReqs.heaps[0];
|
||||
createInfo.priority = Pal::GpuMemPriority::Normal;
|
||||
|
||||
Pal::Result result;
|
||||
size_t gpuMemSize = gpu().dev().iDev()->GetGpuMemorySize(createInfo, &result);
|
||||
if (result != Pal::Result::Success) {
|
||||
return false;
|
||||
}
|
||||
|
||||
char* pMemory = new char[gpuMemSize];
|
||||
|
||||
if (pMemory != nullptr) {
|
||||
result = gpu().dev().iDev()->CreateGpuMemory(createInfo, pMemory, &pGpuMemory);
|
||||
|
||||
if (result == Pal::Result::Success) {
|
||||
// GPU profiler memory is perma-resident.
|
||||
result = gpu().dev().iDev()->AddGpuMemoryReferences(1, &pGpuMemory, nullptr, Pal::GpuMemoryRefCantTrim);
|
||||
|
||||
if (result == Pal::Result::Success) {
|
||||
// GPU profiler memory is perma-mapped.
|
||||
result = pGpuMemory->Map(&pCpuAddr);
|
||||
}
|
||||
}
|
||||
|
||||
if (result != Pal::Result::Success) {
|
||||
if (pGpuMemory != nullptr) {
|
||||
pGpuMemory->Destroy();
|
||||
pGpuMemory = nullptr;
|
||||
pCpuAddr = nullptr;
|
||||
}
|
||||
|
||||
delete pMemory;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
result = iPerf()->BindGpuMemory(pGpuMemory, 0);
|
||||
if (result == Pal::Result::Success) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
PerfCounter::~PerfCounter()
|
||||
{
|
||||
if (calRef_ == nullptr) {
|
||||
@@ -170,9 +106,8 @@ PerfCounter::getInfo(uint64_t infoType) const
|
||||
return info()->eventIndex_;
|
||||
}
|
||||
case CL_PERFCOUNTER_DATA: {
|
||||
Pal::GlobalCounterLayout layout = {};
|
||||
counter_->GetGlobalCounterLayout(&layout);
|
||||
|
||||
Unimplemented();
|
||||
//gslCounter()->GetResult(gpu().cs(), reinterpret_cast<uint64*>(calRef_->results()));
|
||||
return calRef_->results()[index_];
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -38,7 +38,11 @@ public:
|
||||
uint maxIndex //!< the maximum HW counter index in the PAL counter
|
||||
);
|
||||
|
||||
bool finalize();
|
||||
void finalize() {
|
||||
iPerf()->Finalize();
|
||||
Pal::GlobalCounterLayout layout = {};
|
||||
layout.sampleCount = referenceCount() - 1;
|
||||
iPerf()->GetGlobalCounterLayout(&layout); }
|
||||
|
||||
//! Returns the PAL counter results
|
||||
uint64_t* results() const { return results_; }
|
||||
@@ -58,8 +62,6 @@ private:
|
||||
|
||||
VirtualGPU& gpu_; //!< The virtual GPU device object
|
||||
uint64_t* results_; //!< Counter results
|
||||
Pal::IGpuMemory* pGpuMemory;
|
||||
void* pCpuAddr;
|
||||
};
|
||||
|
||||
//! Performance counter implementation on GPU
|
||||
|
||||
@@ -2303,12 +2303,6 @@ VirtualGPU::submitPerfCounter(amd::PerfCounterCommand& vcmd)
|
||||
|
||||
// Create performance experiment
|
||||
Pal::PerfExperimentCreateInfo createInfo = {};
|
||||
|
||||
createInfo.optionFlags.sampleInternalOperations = 1;
|
||||
createInfo.optionFlags.cacheFlushOnCounterCollection = 1;
|
||||
createInfo.optionFlags.sqShaderMask = 1;
|
||||
createInfo.optionValues.sampleInternalOperations = true;
|
||||
createInfo.optionValues.cacheFlushOnCounterCollection = true;
|
||||
createInfo.optionValues.sqShaderMask = Pal::PerfShaderMaskCs;
|
||||
|
||||
PalCounterReference* palRef = PalCounterReference::Create(*this, createInfo);
|
||||
|
||||
Ссылка в новой задаче
Block a user