Files
compute-runtime/opencl/source/memory_manager/mem_obj_surface.cpp
Warchulski, Jaroslaw d1b2311207 Cleanup includes 49
Cleaned up files:
opencl/source/command_queue/command_queue_hw.h
opencl/source/gtpin/gtpin_defs.h
opencl/source/mem_obj/mem_obj_helper.h
opencl/source/memory_manager/mem_obj_surface.h
opencl/source/sharings/unified/unified_sharing.h
opencl/test/unit_test/api/cl_enqueue_migrate_mem_objects_tests.inl
opencl/test/unit_test/aub_tests/fixtures/unified_memory_fixture.h
opencl/test/unit_test/command_queue/command_queue_fixture.h

Related-To: NEO-5548

Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-02-10 17:26:49 +01:00

34 lines
799 B
C++

/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "opencl/source/memory_manager/mem_obj_surface.h"
#include "shared/source/command_stream/command_stream_receiver.h"
#include "opencl/source/mem_obj/mem_obj.h"
namespace NEO {
MemObjSurface::MemObjSurface(MemObj *memObj) : Surface(memObj->getMultiGraphicsAllocation().isCoherent()), memObj(memObj) {
memObj->incRefInternal();
}
MemObjSurface::~MemObjSurface() {
memObj->decRefInternal();
memObj = nullptr;
};
void MemObjSurface::makeResident(CommandStreamReceiver &csr) {
DEBUG_BREAK_IF(!memObj);
csr.makeResident(*memObj->getGraphicsAllocation(csr.getRootDeviceIndex()));
}
Surface *MemObjSurface::duplicate() {
return new MemObjSurface(this->memObj);
};
} // namespace NEO