mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
Reorganization directory structure [1/n]
Change-Id: Id1a94577437a4826a32411869f516fec20314ec0
This commit is contained in:
38
opencl/source/memory_manager/mem_obj_surface.h
Normal file
38
opencl/source/memory_manager/mem_obj_surface.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "core/memory_manager/surface.h"
|
||||
|
||||
#include "mem_obj/mem_obj.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
class MemObjSurface : public Surface {
|
||||
public:
|
||||
MemObjSurface(MemObj *memObj) : Surface(memObj->getGraphicsAllocation()->isCoherent()), memObj(memObj) {
|
||||
memObj->incRefInternal();
|
||||
}
|
||||
~MemObjSurface() override {
|
||||
memObj->decRefInternal();
|
||||
memObj = nullptr;
|
||||
};
|
||||
|
||||
void makeResident(CommandStreamReceiver &csr) override {
|
||||
DEBUG_BREAK_IF(!memObj);
|
||||
csr.makeResident(*memObj->getGraphicsAllocation());
|
||||
}
|
||||
|
||||
Surface *duplicate() override {
|
||||
return new MemObjSurface(this->memObj);
|
||||
};
|
||||
|
||||
protected:
|
||||
class MemObj *memObj;
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user