P4 to Git Change 1210047 by wchau@wchau_WINDOWS7_OCL on 2015/11/11 13:06:48

SWDEV-80450 - Fix the issue of app context reference count > 0 after app termination by using device context for the mapped buffer/image resource.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.hpp#155 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpumemory.cpp#123 edit
This commit is contained in:
foreman
2015-11-11 13:14:27 -05:00
parent 98f48d3a6d
commit 7237cf514f
2 changed files with 7 additions and 4 deletions
+3
View File
@@ -467,6 +467,9 @@ public:
//! Gets the GPU resource associated with the global heap
const Memory& globalMem() const { return heap_.resource(); }
//! Gets the device context object
amd::Context& context() const { return *context_; }
//! Gets the global heap object
const Heap& heap() const { return heap_; }
+4 -4
View File
@@ -900,8 +900,8 @@ Memory::allocMapTarget(
if (memory == NULL) {
// for map target of svm buffer , we need use svm host ptr
memory = new(owner()->getContext())
amd::Buffer(owner()->getContext(), flag, owner()->getSize());
memory = new(dev().context())
amd::Buffer(dev().context(), flag, owner()->getSize());
Memory* gpuMemory;
do {
@@ -1242,8 +1242,8 @@ Image::allocMapTarget(
// Allocate a new buffer to use as the map target
//! @note Allocate a 1D buffer, since CAL issues with 3D
//! Also HW doesn't support untiled images
memory = new (owner()->getContext())
amd::Buffer(owner()->getContext(), 0,
memory = new (dev().context())
amd::Buffer(dev().context(), 0,
cal()->width_ * height * depth * elementSize());
memory->setVirtualDevice(owner()->getVirtualDevice());