P4 to Git Change 1211165 by gandryey@gera-ubuntu14 on 2015/11/13 14:36:37
SWDEV-78467 - OpenCL LiquidFlash feature - Add staging transfer support for invisible memory - Don't fallback to USWC memory if persistent allocation failed Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#262 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#231 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#390 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.hpp#137 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/command.cpp#73 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/command.hpp#80 edit
This commit is contained in:
@@ -445,6 +445,7 @@ Resource::create(MemoryType memType, CreateParams* params)
|
||||
desc.mipLevels = cal()->mipLevels_;
|
||||
desc.systemMemory = NULL;
|
||||
|
||||
uint allocAttempt = 0;
|
||||
do {
|
||||
// Find a type for allocation
|
||||
if (memoryType() == Persistent) {
|
||||
@@ -515,7 +516,8 @@ Resource::create(MemoryType memType, CreateParams* params)
|
||||
if (memoryType() == Local) {
|
||||
cal_.type_ = Persistent;
|
||||
}
|
||||
else if (memoryType() == Persistent) {
|
||||
// Don't switch to USWC if persistent memory was explicitly asked
|
||||
else if ((allocAttempt > 0) && (memoryType() == Persistent)) {
|
||||
cal_.type_ = RemoteUSWC;
|
||||
}
|
||||
// Remote cacheable to uncacheable
|
||||
@@ -525,6 +527,7 @@ Resource::create(MemoryType memType, CreateParams* params)
|
||||
else {
|
||||
break;
|
||||
}
|
||||
allocAttempt++;
|
||||
}
|
||||
}
|
||||
while (!calRes);
|
||||
|
||||
@@ -3491,4 +3491,30 @@ VirtualGPU::assignDebugTrapHandler(const DebugToolInfo& dbgSetting,
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
VirtualGPU::submitWriteBufferFromFile(amd::WriteBufferFromFileCommand& cmd)
|
||||
{
|
||||
size_t copySize = cmd.size()[0];
|
||||
size_t fileOffset = cmd.fileOffset();
|
||||
size_t dstOffset = cmd.origin()[0];
|
||||
Memory* mem = dev().getGpuMemory(&cmd.memory());
|
||||
uint idx = 0;
|
||||
while (copySize > 0) {
|
||||
Memory* staging = dev().getGpuMemory(&cmd.staging(idx));
|
||||
size_t dstSize = amd::WriteBufferFromFileCommand::StagingBufferSize;
|
||||
dstSize = std::min(dstSize, copySize);
|
||||
void* dstBuffer = staging->cpuMap(*this);
|
||||
if (!cmd.file()->readBlock(dstBuffer, fileOffset, 0, dstSize)) {
|
||||
return;
|
||||
}
|
||||
staging->cpuUnmap(*this);
|
||||
|
||||
bool result = blitMgr().copyBuffer(*staging, *mem,
|
||||
fileOffset, dstOffset, dstSize, false);
|
||||
flushDMA(getGpuEvent(staging->gslResource())->engineId_);
|
||||
dstOffset += dstSize;
|
||||
copySize -= dstSize;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace gpu
|
||||
|
||||
@@ -243,6 +243,7 @@ public:
|
||||
virtual void submitSvmFillMemory(amd::SvmFillMemoryCommand& cmd);
|
||||
virtual void submitSvmMapMemory(amd::SvmMapMemoryCommand& cmd);
|
||||
virtual void submitSvmUnmapMemory(amd::SvmUnmapMemoryCommand& cmd);
|
||||
virtual void submitWriteBufferFromFile(amd::WriteBufferFromFileCommand& cmd);
|
||||
|
||||
void releaseMemory(gslMemObject gslResource, bool wait = true);
|
||||
void releaseKernel(CALimage calImage);
|
||||
|
||||
Reference in New Issue
Block a user