P4 to Git Change 1552704 by gandryey@gera-w8 on 2018/05/09 15:11:23

SWDEV-79445 - OCL generic changes and code clean-up
	- Following CL#1552596. Make sure virtual GPU is set for the internal allocations before the create() call, since the deferred alloc is disabled.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpublit.cpp#128 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#416 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.hpp#144 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palblit.cpp#22 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#96 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#51 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocblit.cpp#21 edit
Bu işleme şunda yer alıyor:
foreman
2018-05-09 15:16:40 -04:00
ebeveyn 61d898a8a5
işleme c11b2d52b7
7 değiştirilmiş dosya ile 21 ekleme ve 40 silme
+2 -9
Dosyayı Görüntüle
@@ -626,7 +626,6 @@ void VirtualGPU::submitReadMemory(amd::ReadMemoryCommand& vcmd) {
LogError("We should not fail buffer creation from image_buffer!");
} else {
type = CL_COMMAND_READ_BUFFER;
bufferFromImage->setVirtualDevice(this);
memory = dev().getGpuMemory(bufferFromImage);
}
}
@@ -724,7 +723,6 @@ void VirtualGPU::submitWriteMemory(amd::WriteMemoryCommand& vcmd) {
LogError("We should not fail buffer creation from image_buffer!");
} else {
type = CL_COMMAND_WRITE_BUFFER;
bufferFromImage->setVirtualDevice(this);
memory = dev().getGpuMemory(bufferFromImage);
}
}
@@ -816,7 +814,6 @@ bool VirtualGPU::copyMemory(cl_command_type type, amd::Memory& srcMem, amd::Memo
LogError("We should not fail buffer creation from image_buffer!");
} else {
type = CL_COMMAND_COPY_BUFFER;
bufferFromImageSrc->setVirtualDevice(this);
srcMemory = dev().getGpuMemory(bufferFromImageSrc);
}
}
@@ -827,7 +824,6 @@ bool VirtualGPU::copyMemory(cl_command_type type, amd::Memory& srcMem, amd::Memo
LogError("We should not fail buffer creation from image_buffer!");
} else {
type = CL_COMMAND_COPY_BUFFER;
bufferFromImageDst->setVirtualDevice(this);
dstMemory = dev().getGpuMemory(bufferFromImageDst);
}
}
@@ -1034,7 +1030,6 @@ void VirtualGPU::submitMapMemory(amd::MapMemoryCommand& vcmd) {
if (NULL == bufferFromImage) {
LogError("We should not fail buffer creation from image_buffer!");
} else {
bufferFromImage->setVirtualDevice(this);
memoryBuf = dev().getGpuMemory(bufferFromImage);
}
if (!blitMgr().copyBuffer(*memoryBuf, *memory->mapMemory(), origin, dstOrigin, size,
@@ -1134,7 +1129,6 @@ void VirtualGPU::submitUnmapMemory(amd::UnmapMemoryCommand& vcmd) {
if (NULL == bufferFromImage) {
LogError("We should not fail buffer creation from image_buffer!");
} else {
bufferFromImage->setVirtualDevice(this);
memoryBuf = dev().getGpuMemory(bufferFromImage);
}
if (!blitMgr().copyBuffer(*memory->mapMemory(), *memoryBuf, srcOrigin, origin, size,
@@ -1191,7 +1185,6 @@ bool VirtualGPU::fillMemory(cl_command_type type, amd::Memory* amdMemory, const
LogError("We should not fail buffer creation from image_buffer!");
} else {
type = CL_COMMAND_FILL_BUFFER;
bufferFromImage->setVirtualDevice(this);
memory = dev().getGpuMemory(bufferFromImage);
}
}
@@ -3054,9 +3047,9 @@ bool VirtualGPU::processMemObjectsHSA(const amd::Kernel& kernel, const_address p
return true;
}
amd::Memory* VirtualGPU::createBufferFromImage(amd::Memory& amdImage) const {
amd::Memory* VirtualGPU::createBufferFromImage(amd::Memory& amdImage) {
amd::Memory* mem = new (amdImage.getContext()) amd::Buffer(amdImage, 0, 0, amdImage.getSize());
mem->setVirtualDevice(this);
if ((mem != NULL) && !mem->create()) {
mem->release();
}