mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-27 07:44:16 +08:00
Reuse graphics allocation from mapped buffers in OpenCL
Related-To: NEO-6352 Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
f164acad0b
commit
f1b6b733f0
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/mock_gmm.h"
|
||||
|
||||
#include "opencl/source/command_queue/command_queue_hw.h"
|
||||
#include "opencl/source/context/context.h"
|
||||
@@ -57,6 +58,15 @@ CommandQueue *CommandQueueHwFixture::createCommandQueue(
|
||||
return funcCreate(pContext, pDevice, properties, false);
|
||||
}
|
||||
|
||||
void CommandQueueHwFixture::forceMapBufferOnGpu(Buffer &buffer) {
|
||||
ClDevice *clDevice = buffer.getContext()->getDevice(0);
|
||||
buffer.setSharingHandler(new SharingHandler());
|
||||
auto gfxAllocation = buffer.getGraphicsAllocation(clDevice->getRootDeviceIndex());
|
||||
for (auto handleId = 0u; handleId < gfxAllocation->getNumGmms(); handleId++) {
|
||||
gfxAllocation->setGmm(new MockGmm(clDevice->getGmmClientContext()), handleId);
|
||||
}
|
||||
}
|
||||
|
||||
void CommandQueueHwFixture::SetUp() {
|
||||
ASSERT_NE(nullptr, pCmdQ);
|
||||
context = new MockContext();
|
||||
|
||||
Reference in New Issue
Block a user