mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-20 13:11:34 +08:00
Revert "Fallback to cpu copy when filling work partition allocation"
This reverts commit 93e3d948f5
.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
f3afde1153
commit
782a287b27
@ -1111,17 +1111,8 @@ bool DrmMemoryManager::copyMemoryToAllocation(GraphicsAllocation *graphicsAlloca
|
||||
if (graphicsAllocation->getUnderlyingBuffer() || !isLocalMemorySupported(graphicsAllocation->getRootDeviceIndex())) {
|
||||
return MemoryManager::copyMemoryToAllocation(graphicsAllocation, destinationOffset, memoryToCopy, sizeToCopy);
|
||||
}
|
||||
return copyMemoryToAllocationBanks(graphicsAllocation, destinationOffset, memoryToCopy, sizeToCopy, graphicsAllocation->storageInfo.memoryBanks);
|
||||
}
|
||||
bool DrmMemoryManager::copyMemoryToAllocationBanks(GraphicsAllocation *graphicsAllocation, size_t destinationOffset, const void *memoryToCopy, size_t sizeToCopy, DeviceBitfield dstMemoryBanks) {
|
||||
if (MemoryPool::isSystemMemoryPool(graphicsAllocation->getMemoryPool())) {
|
||||
return false;
|
||||
}
|
||||
auto drmAllocation = static_cast<DrmAllocation *>(graphicsAllocation);
|
||||
for (auto handleId = 0u; handleId < graphicsAllocation->storageInfo.getTotalBanksCnt(); handleId++) {
|
||||
if (!dstMemoryBanks.test(handleId)) {
|
||||
continue;
|
||||
}
|
||||
for (auto handleId = 0u; handleId < graphicsAllocation->storageInfo.getNumBanks(); handleId++) {
|
||||
auto ptr = lockResourceInLocalMemoryImpl(drmAllocation->getBOs()[handleId]);
|
||||
if (!ptr) {
|
||||
return false;
|
||||
|
@ -57,7 +57,6 @@ class DrmMemoryManager : public MemoryManager {
|
||||
|
||||
DrmGemCloseWorker *peekGemCloseWorker() const { return this->gemCloseWorker.get(); }
|
||||
bool copyMemoryToAllocation(GraphicsAllocation *graphicsAllocation, size_t destinationOffset, const void *memoryToCopy, size_t sizeToCopy) override;
|
||||
bool copyMemoryToAllocationBanks(GraphicsAllocation *graphicsAllocation, size_t destinationOffset, const void *memoryToCopy, size_t sizeToCopy, DeviceBitfield dstMemoryBanks) override;
|
||||
|
||||
MOCKABLE_VIRTUAL int obtainFdFromHandle(int boHandle, uint32_t rootDeviceindex);
|
||||
AddressRange reserveGpuAddress(size_t size, uint32_t rootDeviceIndex) override;
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "shared/source/helpers/heap_assigner.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
#include "shared/source/helpers/string.h"
|
||||
#include "shared/source/helpers/surface_format_info.h"
|
||||
#include "shared/source/memory_manager/deferrable_deletion.h"
|
||||
#include "shared/source/memory_manager/deferred_deleter.h"
|
||||
@ -858,30 +857,4 @@ bool WddmMemoryManager::isCpuCopyRequired(const void *ptr) {
|
||||
return inputPointerReadDelta > slownessFactor * fastestLocalRead;
|
||||
}
|
||||
|
||||
bool WddmMemoryManager::copyMemoryToAllocation(GraphicsAllocation *graphicsAllocation, size_t destinationOffset, const void *memoryToCopy, size_t sizeToCopy) {
|
||||
if (graphicsAllocation->getUnderlyingBuffer()) {
|
||||
return MemoryManager::copyMemoryToAllocation(graphicsAllocation, destinationOffset, memoryToCopy, sizeToCopy);
|
||||
}
|
||||
return copyMemoryToAllocationBanks(graphicsAllocation, destinationOffset, memoryToCopy, sizeToCopy, graphicsAllocation->storageInfo.memoryBanks);
|
||||
}
|
||||
|
||||
bool WddmMemoryManager::copyMemoryToAllocationBanks(GraphicsAllocation *graphicsAllocation, size_t destinationOffset, const void *memoryToCopy, size_t sizeToCopy, DeviceBitfield dstMemoryBanks) {
|
||||
if (MemoryPool::isSystemMemoryPool(graphicsAllocation->getMemoryPool())) {
|
||||
return false;
|
||||
}
|
||||
auto wddmAllocation = static_cast<WddmAllocation *>(graphicsAllocation);
|
||||
for (auto handleId = 0u; handleId < graphicsAllocation->storageInfo.getTotalBanksCnt(); handleId++) {
|
||||
if (!dstMemoryBanks.test(handleId)) {
|
||||
continue;
|
||||
}
|
||||
auto ptr = getWddm(graphicsAllocation->getRootDeviceIndex()).lockResource(wddmAllocation->getHandles()[handleId], wddmAllocation->needsMakeResidentBeforeLock, wddmAllocation->getAlignedSize());
|
||||
if (!ptr) {
|
||||
return false;
|
||||
}
|
||||
memcpy_s(ptrOffset(ptr, destinationOffset), graphicsAllocation->getUnderlyingBufferSize() - destinationOffset, memoryToCopy, sizeToCopy);
|
||||
getWddm(graphicsAllocation->getRootDeviceIndex()).unlockResource(wddmAllocation->getHandles()[handleId]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
@ -65,7 +65,6 @@ class WddmMemoryManager : public MemoryManager {
|
||||
AlignedMallocRestrictions *getAlignedMallocRestrictions() override;
|
||||
|
||||
bool copyMemoryToAllocation(GraphicsAllocation *graphicsAllocation, size_t destinationOffset, const void *memoryToCopy, size_t sizeToCopy) override;
|
||||
bool copyMemoryToAllocationBanks(GraphicsAllocation *graphicsAllocation, size_t destinationOffset, const void *memoryToCopy, size_t sizeToCopy, DeviceBitfield dstMemoryBanks) override;
|
||||
void *reserveCpuAddressRange(size_t size, uint32_t rootDeviceIndex) override;
|
||||
void releaseReservedCpuAddressRange(void *reserved, size_t size, uint32_t rootDeviceIndex) override;
|
||||
bool isCpuCopyRequired(const void *ptr) override;
|
||||
|
@ -13,6 +13,9 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryInDevicePool(const
|
||||
status = AllocationStatus::RetryInNonDevicePool;
|
||||
return nullptr;
|
||||
}
|
||||
bool WddmMemoryManager::copyMemoryToAllocation(GraphicsAllocation *graphicsAllocation, size_t destinationOffset, const void *memoryToCopy, size_t sizeToCopy) {
|
||||
return MemoryManager::copyMemoryToAllocation(graphicsAllocation, destinationOffset, memoryToCopy, sizeToCopy);
|
||||
}
|
||||
bool WddmMemoryManager::mapGpuVirtualAddress(WddmAllocation *allocation, const void *requiredPtr) {
|
||||
if (allocation->getNumGmms() > 1) {
|
||||
return mapMultiHandleAllocationWithRetry(allocation, requiredPtr);
|
||||
|
Reference in New Issue
Block a user