Remove command queue, completion stamp and device from mem obj

Remove setCompletionStamp function from Surface

Change-Id: I25f3040a91892495e55cb4924f1538276de6264e
This commit is contained in:
Mateusz Jablonski
2018-07-31 09:52:48 +02:00
committed by sys_ocldev
parent 97b215440a
commit 9ae4f390d1
21 changed files with 22 additions and 204 deletions

View File

@@ -26,13 +26,12 @@
#include "runtime/memory_manager/graphics_allocation.h"
namespace OCLRT {
class CommandQueue;
class Surface {
public:
Surface(bool isCoherent = false) : IsCoherent(isCoherent) {}
virtual ~Surface() = default;
virtual void makeResident(CommandStreamReceiver &csr) = 0;
virtual void setCompletionStamp(CompletionStamp &cs, Device *pDevice, CommandQueue *pCmdQ) = 0;
virtual Surface *duplicate() = 0;
const bool IsCoherent;
};
@@ -43,7 +42,6 @@ class NullSurface : public Surface {
~NullSurface() override = default;
void makeResident(CommandStreamReceiver &csr) override{};
void setCompletionStamp(CompletionStamp &cs, Device *pDevice, CommandQueue *pCmdQ) override{};
Surface *duplicate() override { return new NullSurface(); };
};
@@ -67,10 +65,6 @@ class HostPtrSurface : public Surface {
DEBUG_BREAK_IF(!gfxAllocation);
csr.makeResidentHostPtrAllocation(gfxAllocation);
}
void setCompletionStamp(CompletionStamp &cs, Device *pDevice, CommandQueue *pCmdQ) override {
DEBUG_BREAK_IF(!gfxAllocation);
gfxAllocation->taskCount = cs.taskCount;
}
Surface *duplicate() override {
return new HostPtrSurface(this->memoryPointer, this->surfaceSize, this->gfxAllocation);
};
@@ -103,28 +97,25 @@ class HostPtrSurface : public Surface {
class MemObjSurface : public Surface {
public:
MemObjSurface(MemObj *memObj) : Surface(memObj->getGraphicsAllocation()->isCoherent()), memory_object(memObj) {
memory_object->retain();
MemObjSurface(MemObj *memObj) : Surface(memObj->getGraphicsAllocation()->isCoherent()), memObj(memObj) {
memObj->retain();
}
~MemObjSurface() override {
memory_object->release();
memory_object = nullptr;
memObj->release();
memObj = nullptr;
};
void makeResident(CommandStreamReceiver &csr) override {
DEBUG_BREAK_IF(!memory_object);
csr.makeResident(*memory_object->getGraphicsAllocation());
}
void setCompletionStamp(CompletionStamp &cs, Device *pDevice, CommandQueue *pCmdQ) override {
DEBUG_BREAK_IF(!memory_object);
memory_object->setCompletionStamp(cs, pDevice, pCmdQ);
DEBUG_BREAK_IF(!memObj);
csr.makeResident(*memObj->getGraphicsAllocation());
}
Surface *duplicate() override {
return new MemObjSurface(this->memory_object);
return new MemObjSurface(this->memObj);
};
protected:
class MemObj *memory_object;
class MemObj *memObj;
};
class GeneralSurface : public Surface {
@@ -137,9 +128,6 @@ class GeneralSurface : public Surface {
void makeResident(CommandStreamReceiver &csr) override {
csr.makeResident(*gfxAllocation);
};
void setCompletionStamp(CompletionStamp &cs, Device *pDevice, CommandQueue *pCmdQ) override {
gfxAllocation->taskCount = cs.taskCount;
};
Surface *duplicate() override { return new GeneralSurface(gfxAllocation); };
protected: