Use std::move in Buffer at MultiGraphicsAllocation objects

Related-To: NEO-4672
Change-Id: I489df05a6ad48678c9aca7a36898dd8a2ae6b484
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
Krzysztof Gibala
2020-07-16 23:56:26 +02:00
committed by sys_ocldev
parent 47df60c067
commit a77b5458e5
7 changed files with 12 additions and 16 deletions

View File

@@ -305,7 +305,7 @@ Buffer *Buffer::create(Context *context,
size,
memory->getUnderlyingBuffer(),
(memoryProperties.flags.useHostPtr) ? hostPtr : nullptr,
multiGraphicsAllocation,
std::move(multiGraphicsAllocation),
zeroCopyAllowed,
isHostPtrSVM,
false);
@@ -376,9 +376,10 @@ Buffer *Buffer::create(Context *context,
Buffer *Buffer::createSharedBuffer(Context *context, cl_mem_flags flags, SharingHandler *sharingHandler,
MultiGraphicsAllocation multiGraphicsAllocation) {
auto rootDeviceIndex = context->getDevice(0)->getRootDeviceIndex();
auto size = multiGraphicsAllocation.getGraphicsAllocation(rootDeviceIndex)->getUnderlyingBufferSize();
auto sharedBuffer = createBufferHw(
context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags, 0, multiGraphicsAllocation.getGraphicsAllocation(rootDeviceIndex)->getUnderlyingBufferSize(), nullptr, nullptr, multiGraphicsAllocation,
flags, 0, size, nullptr, nullptr, std::move(multiGraphicsAllocation),
false, false, false);
sharedBuffer->setSharingHandler(sharingHandler);
@@ -606,7 +607,7 @@ Buffer *Buffer::createBufferHw(Context *context,
auto funcCreate = bufferFactory[hwInfo.platform.eRenderCoreFamily].createBufferFunction;
DEBUG_BREAK_IF(nullptr == funcCreate);
auto pBuffer = funcCreate(context, memoryProperties, flags, flagsIntel, size, memoryStorage, hostPtr, multiGraphicsAllocation,
auto pBuffer = funcCreate(context, memoryProperties, flags, flagsIntel, size, memoryStorage, hostPtr, std::move(multiGraphicsAllocation),
zeroCopy, isHostPtrSVM, isImageRedescribed);
DEBUG_BREAK_IF(nullptr == pBuffer);
if (pBuffer) {
@@ -710,7 +711,7 @@ void Buffer::setSurfaceState(const Device *device,
if (gfxAlloc) {
multiGraphicsAllocation.addAllocation(gfxAlloc);
}
auto buffer = Buffer::createBufferHwFromDevice(device, flags, flagsIntel, svmSize, svmPtr, svmPtr, multiGraphicsAllocation, offset, true, false, false);
auto buffer = Buffer::createBufferHwFromDevice(device, flags, flagsIntel, svmSize, svmPtr, svmPtr, std::move(multiGraphicsAllocation), offset, true, false, false);
buffer->setArgStateful(surfaceState, false, false, false, false, *device);
delete buffer;
}

View File

@@ -202,7 +202,7 @@ class BufferHw : public Buffer {
bool zeroCopy,
bool isHostPtrSVM,
bool isObjectRedescribed)
: Buffer(context, memoryProperties, flags, flagsIntel, size, memoryStorage, hostPtr, multiGraphicsAllocation,
: Buffer(context, memoryProperties, flags, flagsIntel, size, memoryStorage, hostPtr, std::move(multiGraphicsAllocation),
zeroCopy, isHostPtrSVM, isObjectRedescribed) {}
void setArgStateful(void *memory, bool forceNonAuxMode, bool disableL3, bool alignSizeForAuxTranslation, bool isReadOnlyArgument, const Device &device) override;
@@ -227,7 +227,7 @@ class BufferHw : public Buffer {
size,
memoryStorage,
hostPtr,
multiGraphicsAllocation,
std::move(multiGraphicsAllocation),
zeroCopy,
isHostPtrSVM,
isObjectRedescribed);