mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
refactor: correct naming of unified memory enums
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
2eba5b35e4
commit
27fbdde4c5
@@ -1882,8 +1882,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryFill(void *ptr,
|
||||
NEO::SvmAllocationData *allocData = nullptr;
|
||||
bool dstAllocFound = device->getDriverHandle()->findAllocationDataForRange(ptr, size, allocData);
|
||||
if (dstAllocFound) {
|
||||
if (allocData->memoryType == InternalMemoryType::HOST_UNIFIED_MEMORY ||
|
||||
allocData->memoryType == InternalMemoryType::SHARED_UNIFIED_MEMORY) {
|
||||
if (allocData->memoryType == InternalMemoryType::hostUnifiedMemory ||
|
||||
allocData->memoryType == InternalMemoryType::sharedUnifiedMemory) {
|
||||
hostPointerNeedsFlush = true;
|
||||
}
|
||||
} else {
|
||||
@@ -2274,15 +2274,15 @@ inline AlignedAllocationData CommandListCoreFamily<gfxCoreFamily>::getAlignedAll
|
||||
alloc = driverHandle->getPeerAllocation(device, allocData, reinterpret_cast<void *>(pbase), &alignedPtr, nullptr);
|
||||
alignedPtr += offset;
|
||||
|
||||
if (allocData->memoryType == InternalMemoryType::SHARED_UNIFIED_MEMORY) {
|
||||
if (allocData->memoryType == InternalMemoryType::sharedUnifiedMemory) {
|
||||
commandContainer.addToResidencyContainer(allocData->gpuAllocations.getDefaultGraphicsAllocation());
|
||||
}
|
||||
} else {
|
||||
alignedPtr = sourcePtr;
|
||||
}
|
||||
|
||||
if (allocData->memoryType == InternalMemoryType::HOST_UNIFIED_MEMORY ||
|
||||
allocData->memoryType == InternalMemoryType::SHARED_UNIFIED_MEMORY) {
|
||||
if (allocData->memoryType == InternalMemoryType::hostUnifiedMemory ||
|
||||
allocData->memoryType == InternalMemoryType::sharedUnifiedMemory) {
|
||||
hostPointerNeedsFlush = true;
|
||||
}
|
||||
if (allocData->virtualReservationData) {
|
||||
|
||||
@@ -974,8 +974,8 @@ bool CommandListCoreFamilyImmediate<gfxCoreFamily>::preferCopyThroughLockedPtr(C
|
||||
bool cpuMemCopyEnabled = false;
|
||||
|
||||
switch (transferType) {
|
||||
case HOST_USM_TO_DEVICE_USM:
|
||||
case DEVICE_USM_TO_HOST_USM: {
|
||||
case TransferType::hostUsmToDeviceUsm:
|
||||
case TransferType::deviceUsmToHostUsm: {
|
||||
if (this->dependenciesPresent) {
|
||||
cpuMemCopyEnabled = false;
|
||||
break;
|
||||
@@ -990,8 +990,8 @@ bool CommandListCoreFamilyImmediate<gfxCoreFamily>::preferCopyThroughLockedPtr(C
|
||||
cpuMemCopyEnabled = allEventsCompleted;
|
||||
break;
|
||||
}
|
||||
case HOST_NON_USM_TO_DEVICE_USM:
|
||||
case DEVICE_USM_TO_HOST_NON_USM:
|
||||
case TransferType::hostNonUsmToDeviceUsm:
|
||||
case TransferType::deviceUsmToHostNonUsm:
|
||||
cpuMemCopyEnabled = true;
|
||||
break;
|
||||
default:
|
||||
@@ -1004,19 +1004,19 @@ bool CommandListCoreFamilyImmediate<gfxCoreFamily>::preferCopyThroughLockedPtr(C
|
||||
|
||||
template <GFXCORE_FAMILY gfxCoreFamily>
|
||||
bool CommandListCoreFamilyImmediate<gfxCoreFamily>::isSuitableUSMHostAlloc(NEO::SvmAllocationData *alloc) {
|
||||
return alloc && (alloc->memoryType == InternalMemoryType::HOST_UNIFIED_MEMORY);
|
||||
return alloc && (alloc->memoryType == InternalMemoryType::hostUnifiedMemory);
|
||||
}
|
||||
|
||||
template <GFXCORE_FAMILY gfxCoreFamily>
|
||||
bool CommandListCoreFamilyImmediate<gfxCoreFamily>::isSuitableUSMDeviceAlloc(NEO::SvmAllocationData *alloc) {
|
||||
return alloc && (alloc->memoryType == InternalMemoryType::DEVICE_UNIFIED_MEMORY) &&
|
||||
return alloc && (alloc->memoryType == InternalMemoryType::deviceUnifiedMemory) &&
|
||||
alloc->gpuAllocations.getGraphicsAllocation(this->device->getRootDeviceIndex()) &&
|
||||
alloc->gpuAllocations.getGraphicsAllocation(this->device->getRootDeviceIndex())->storageInfo.getNumBanks() == 1;
|
||||
}
|
||||
|
||||
template <GFXCORE_FAMILY gfxCoreFamily>
|
||||
bool CommandListCoreFamilyImmediate<gfxCoreFamily>::isSuitableUSMSharedAlloc(NEO::SvmAllocationData *alloc) {
|
||||
return alloc && (alloc->memoryType == InternalMemoryType::SHARED_UNIFIED_MEMORY);
|
||||
return alloc && (alloc->memoryType == InternalMemoryType::sharedUnifiedMemory);
|
||||
}
|
||||
|
||||
template <GFXCORE_FAMILY gfxCoreFamily>
|
||||
@@ -1138,58 +1138,58 @@ TransferType CommandListCoreFamilyImmediate<gfxCoreFamily>::getTransferType(cons
|
||||
const bool dstHostNonUSM = (cpuMemCopyInfo.dstAllocData == nullptr) && !cpuMemCopyInfo.dstIsImportedHostPtr;
|
||||
|
||||
if (srcHostNonUSM && dstHostUSM) {
|
||||
return HOST_NON_USM_TO_HOST_USM;
|
||||
return TransferType::hostNonUsmToHostUsm;
|
||||
}
|
||||
if (srcHostNonUSM && dstDeviceUSM) {
|
||||
return HOST_NON_USM_TO_DEVICE_USM;
|
||||
return TransferType::hostNonUsmToDeviceUsm;
|
||||
}
|
||||
if (srcHostNonUSM && dstSharedUSM) {
|
||||
return HOST_NON_USM_TO_SHARED_USM;
|
||||
return TransferType::hostNonUsmToSharedUsm;
|
||||
}
|
||||
if (srcHostNonUSM && dstHostNonUSM) {
|
||||
return HOST_NON_USM_TO_HOST_NON_USM;
|
||||
return TransferType::hostNonUsmToHostNonUsm;
|
||||
}
|
||||
|
||||
if (srcHostUSM && dstHostUSM) {
|
||||
return HOST_USM_TO_HOST_USM;
|
||||
return TransferType::hostUsmToHostUsm;
|
||||
}
|
||||
if (srcHostUSM && dstDeviceUSM) {
|
||||
return HOST_USM_TO_DEVICE_USM;
|
||||
return TransferType::hostUsmToDeviceUsm;
|
||||
}
|
||||
if (srcHostUSM && dstSharedUSM) {
|
||||
return HOST_USM_TO_SHARED_USM;
|
||||
return TransferType::hostUsmToSharedUsm;
|
||||
}
|
||||
if (srcHostUSM && dstHostNonUSM) {
|
||||
return HOST_USM_TO_HOST_NON_USM;
|
||||
return TransferType::hostUsmToHostNonUsm;
|
||||
}
|
||||
|
||||
if (srcDeviceUSM && dstHostUSM) {
|
||||
return DEVICE_USM_TO_HOST_USM;
|
||||
return TransferType::deviceUsmToHostUsm;
|
||||
}
|
||||
if (srcDeviceUSM && dstDeviceUSM) {
|
||||
return DEVICE_USM_TO_DEVICE_USM;
|
||||
return TransferType::deviceUsmToDeviceUsm;
|
||||
}
|
||||
if (srcDeviceUSM && dstSharedUSM) {
|
||||
return DEVICE_USM_TO_SHARED_USM;
|
||||
return TransferType::deviceUsmToSharedUsm;
|
||||
}
|
||||
if (srcDeviceUSM && dstHostNonUSM) {
|
||||
return DEVICE_USM_TO_HOST_NON_USM;
|
||||
return TransferType::deviceUsmToHostNonUsm;
|
||||
}
|
||||
|
||||
if (srcSharedUSM && dstHostUSM) {
|
||||
return SHARED_USM_TO_HOST_USM;
|
||||
return TransferType::sharedUsmToHostUsm;
|
||||
}
|
||||
if (srcSharedUSM && dstDeviceUSM) {
|
||||
return SHARED_USM_TO_DEVICE_USM;
|
||||
return TransferType::sharedUsmToDeviceUsm;
|
||||
}
|
||||
if (srcSharedUSM && dstSharedUSM) {
|
||||
return SHARED_USM_TO_SHARED_USM;
|
||||
return TransferType::sharedUsmToSharedUsm;
|
||||
}
|
||||
if (srcSharedUSM && dstHostNonUSM) {
|
||||
return SHARED_USM_TO_HOST_NON_USM;
|
||||
return TransferType::sharedUsmToHostNonUsm;
|
||||
}
|
||||
|
||||
return TRANSFER_TYPE_UNKNOWN;
|
||||
return TransferType::unknown;
|
||||
}
|
||||
|
||||
template <GFXCORE_FAMILY gfxCoreFamily>
|
||||
@@ -1197,52 +1197,52 @@ size_t CommandListCoreFamilyImmediate<gfxCoreFamily>::getTransferThreshold(Trans
|
||||
size_t retVal = 0u;
|
||||
|
||||
switch (transferType) {
|
||||
case HOST_NON_USM_TO_HOST_USM:
|
||||
case TransferType::hostNonUsmToHostUsm:
|
||||
retVal = 1 * MemoryConstants::megaByte;
|
||||
break;
|
||||
case HOST_NON_USM_TO_DEVICE_USM:
|
||||
case TransferType::hostNonUsmToDeviceUsm:
|
||||
retVal = 4 * MemoryConstants::megaByte;
|
||||
if (NEO::debugManager.flags.ExperimentalH2DCpuCopyThreshold.get() != -1) {
|
||||
retVal = NEO::debugManager.flags.ExperimentalH2DCpuCopyThreshold.get();
|
||||
}
|
||||
break;
|
||||
case HOST_NON_USM_TO_SHARED_USM:
|
||||
case TransferType::hostNonUsmToSharedUsm:
|
||||
retVal = 0u;
|
||||
break;
|
||||
case HOST_NON_USM_TO_HOST_NON_USM:
|
||||
case TransferType::hostNonUsmToHostNonUsm:
|
||||
retVal = 1 * MemoryConstants::megaByte;
|
||||
break;
|
||||
case HOST_USM_TO_HOST_USM:
|
||||
case TransferType::hostUsmToHostUsm:
|
||||
retVal = 200 * MemoryConstants::kiloByte;
|
||||
break;
|
||||
case HOST_USM_TO_DEVICE_USM:
|
||||
case TransferType::hostUsmToDeviceUsm:
|
||||
retVal = 50 * MemoryConstants::kiloByte;
|
||||
break;
|
||||
case HOST_USM_TO_SHARED_USM:
|
||||
case TransferType::hostUsmToSharedUsm:
|
||||
retVal = 0u;
|
||||
break;
|
||||
case HOST_USM_TO_HOST_NON_USM:
|
||||
case TransferType::hostUsmToHostNonUsm:
|
||||
retVal = 500 * MemoryConstants::kiloByte;
|
||||
break;
|
||||
case DEVICE_USM_TO_DEVICE_USM:
|
||||
case TransferType::deviceUsmToDeviceUsm:
|
||||
retVal = 0u;
|
||||
break;
|
||||
case DEVICE_USM_TO_SHARED_USM:
|
||||
case TransferType::deviceUsmToSharedUsm:
|
||||
retVal = 0u;
|
||||
break;
|
||||
case DEVICE_USM_TO_HOST_USM:
|
||||
case TransferType::deviceUsmToHostUsm:
|
||||
retVal = 128u;
|
||||
break;
|
||||
case DEVICE_USM_TO_HOST_NON_USM:
|
||||
case TransferType::deviceUsmToHostNonUsm:
|
||||
retVal = 1 * MemoryConstants::kiloByte;
|
||||
if (NEO::debugManager.flags.ExperimentalD2HCpuCopyThreshold.get() != -1) {
|
||||
retVal = NEO::debugManager.flags.ExperimentalD2HCpuCopyThreshold.get();
|
||||
}
|
||||
break;
|
||||
case SHARED_USM_TO_HOST_USM:
|
||||
case SHARED_USM_TO_DEVICE_USM:
|
||||
case SHARED_USM_TO_SHARED_USM:
|
||||
case SHARED_USM_TO_HOST_NON_USM:
|
||||
case TransferType::sharedUsmToHostUsm:
|
||||
case TransferType::sharedUsmToDeviceUsm:
|
||||
case TransferType::sharedUsmToSharedUsm:
|
||||
case TransferType::sharedUsmToHostNonUsm:
|
||||
retVal = 0u;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -28,11 +28,11 @@ struct Image;
|
||||
struct Context : _ze_context_handle_t {
|
||||
inline static ze_memory_type_t parseUSMType(InternalMemoryType memoryType) {
|
||||
switch (memoryType) {
|
||||
case InternalMemoryType::SHARED_UNIFIED_MEMORY:
|
||||
case InternalMemoryType::sharedUnifiedMemory:
|
||||
return ZE_MEMORY_TYPE_SHARED;
|
||||
case InternalMemoryType::DEVICE_UNIFIED_MEMORY:
|
||||
case InternalMemoryType::deviceUnifiedMemory:
|
||||
return ZE_MEMORY_TYPE_DEVICE;
|
||||
case InternalMemoryType::HOST_UNIFIED_MEMORY:
|
||||
case InternalMemoryType::hostUnifiedMemory:
|
||||
return ZE_MEMORY_TYPE_HOST;
|
||||
default:
|
||||
return ZE_MEMORY_TYPE_UNKNOWN;
|
||||
|
||||
@@ -119,7 +119,7 @@ ze_result_t ContextImp::allocHostMem(const ze_host_mem_alloc_desc_t *hostDesc,
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY,
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::hostUnifiedMemory,
|
||||
alignment,
|
||||
this->rootDeviceIndices,
|
||||
this->deviceBitfields);
|
||||
@@ -246,7 +246,7 @@ ze_result_t ContextImp::allocDeviceMem(ze_device_handle_t hDevice,
|
||||
}
|
||||
|
||||
deviceBitfields[rootDeviceIndex] = neoDevice->getDeviceBitfield();
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY, alignment, this->driverHandle->rootDeviceIndices, deviceBitfields);
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::deviceUnifiedMemory, alignment, this->driverHandle->rootDeviceIndices, deviceBitfields);
|
||||
unifiedMemoryProperties.allocationFlags.flags.shareable = isShareableMemory(deviceDesc->pNext, static_cast<uint32_t>(lookupTable.exportMemory), neoDevice);
|
||||
unifiedMemoryProperties.device = neoDevice;
|
||||
unifiedMemoryProperties.allocationFlags.flags.compressedHint = isAllocationSuitableForCompression(lookupTable, *device, size);
|
||||
@@ -323,7 +323,7 @@ ze_result_t ContextImp::allocSharedMem(ze_device_handle_t hDevice,
|
||||
deviceBitfields[rootDeviceIndex] = neoDevice->getDeviceBitfield();
|
||||
}
|
||||
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::SHARED_UNIFIED_MEMORY,
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory,
|
||||
alignment,
|
||||
this->rootDeviceIndices,
|
||||
deviceBitfields);
|
||||
@@ -478,7 +478,7 @@ ze_result_t ContextImp::makeMemoryResident(ze_device_handle_t hDevice, void *ptr
|
||||
|
||||
if (ZE_RESULT_SUCCESS == res) {
|
||||
auto allocData = device->getDriverHandle()->getSvmAllocsManager()->getSVMAlloc(ptr);
|
||||
if (allocData && allocData->memoryType == InternalMemoryType::SHARED_UNIFIED_MEMORY) {
|
||||
if (allocData && allocData->memoryType == InternalMemoryType::sharedUnifiedMemory) {
|
||||
DriverHandleImp *driverHandleImp = static_cast<DriverHandleImp *>(device->getDriverHandle());
|
||||
std::lock_guard<std::mutex> lock(driverHandleImp->sharedMakeResidentAllocationsLock);
|
||||
driverHandleImp->sharedMakeResidentAllocations.insert({ptr, allocation});
|
||||
@@ -609,8 +609,8 @@ ze_result_t ContextImp::getIpcMemHandle(const void *ptr,
|
||||
IpcMemoryData &ipcData = *reinterpret_cast<IpcMemoryData *>(pIpcHandle->data);
|
||||
auto type = allocData->memoryType;
|
||||
uint8_t ipcType = 0;
|
||||
if (type == HOST_UNIFIED_MEMORY) {
|
||||
ipcType = static_cast<uint8_t>(InternalIpcMemoryType::IPC_HOST_UNIFIED_MEMORY);
|
||||
if (type == InternalMemoryType::hostUnifiedMemory) {
|
||||
ipcType = static_cast<uint8_t>(InternalIpcMemoryType::hostUnifiedMemory);
|
||||
}
|
||||
setIPCHandleData(graphicsAllocation, handle, ipcData, reinterpret_cast<uint64_t>(ptr), ipcType);
|
||||
|
||||
@@ -663,9 +663,9 @@ ze_result_t ContextImp::getIpcMemHandles(const void *ptr,
|
||||
}
|
||||
|
||||
auto type = allocData->memoryType;
|
||||
auto ipcType = InternalIpcMemoryType::IPC_DEVICE_UNIFIED_MEMORY;
|
||||
if (type == HOST_UNIFIED_MEMORY) {
|
||||
ipcType = InternalIpcMemoryType::IPC_HOST_UNIFIED_MEMORY;
|
||||
auto ipcType = InternalIpcMemoryType::deviceUnifiedMemory;
|
||||
if (type == InternalMemoryType::hostUnifiedMemory) {
|
||||
ipcType = InternalIpcMemoryType::hostUnifiedMemory;
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < *numIpcHandles; i++) {
|
||||
@@ -694,9 +694,9 @@ ze_result_t ContextImp::openIpcMemHandle(ze_device_handle_t hDevice,
|
||||
uint8_t type = ipcData.type;
|
||||
|
||||
NEO::AllocationType allocationType = NEO::AllocationType::unknown;
|
||||
if (type == static_cast<uint8_t>(InternalIpcMemoryType::IPC_DEVICE_UNIFIED_MEMORY)) {
|
||||
if (type == static_cast<uint8_t>(InternalIpcMemoryType::deviceUnifiedMemory)) {
|
||||
allocationType = NEO::AllocationType::buffer;
|
||||
} else if (type == static_cast<uint8_t>(InternalIpcMemoryType::IPC_HOST_UNIFIED_MEMORY)) {
|
||||
} else if (type == static_cast<uint8_t>(InternalIpcMemoryType::hostUnifiedMemory)) {
|
||||
allocationType = NEO::AllocationType::bufferHostMemory;
|
||||
} else {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
@@ -725,7 +725,7 @@ ze_result_t ContextImp::openIpcMemHandles(ze_device_handle_t hDevice,
|
||||
const IpcMemoryData &ipcData = *reinterpret_cast<const IpcMemoryData *>(pIpcHandles[i].data);
|
||||
uint64_t handle = ipcData.handle;
|
||||
|
||||
if (ipcData.type != static_cast<uint8_t>(InternalIpcMemoryType::IPC_DEVICE_UNIFIED_MEMORY)) {
|
||||
if (ipcData.type != static_cast<uint8_t>(InternalIpcMemoryType::deviceUnifiedMemory)) {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
@@ -1178,7 +1178,7 @@ ze_result_t ContextImp::mapVirtualMem(const void *ptr,
|
||||
allocData.size = size;
|
||||
allocData.pageSizeForAlignment = MemoryConstants::pageSize64k;
|
||||
allocData.setAllocId(this->driverHandle->svmAllocsManager->allocationsCounter++);
|
||||
allocData.memoryType = InternalMemoryType::RESERVED_DEVICE_MEMORY;
|
||||
allocData.memoryType = InternalMemoryType::reservedDeviceMemory;
|
||||
allocData.virtualReservationData = virtualMemoryReservation;
|
||||
NEO::MemoryMappedRange *mappedRange = new NEO::MemoryMappedRange;
|
||||
mappedRange->ptr = ptr;
|
||||
|
||||
@@ -1476,7 +1476,7 @@ NEO::GraphicsAllocation *DeviceImp::allocateManagedMemoryFromHostPtr(void *buffe
|
||||
allocData.gpuAllocations.addAllocation(allocation);
|
||||
allocData.cpuAllocation = nullptr;
|
||||
allocData.size = size;
|
||||
allocData.memoryType = InternalMemoryType::NOT_SPECIFIED;
|
||||
allocData.memoryType = InternalMemoryType::notSpecified;
|
||||
allocData.device = nullptr;
|
||||
driverHandle->getSvmAllocsManager()->insertSVMAlloc(allocData);
|
||||
|
||||
|
||||
@@ -621,7 +621,7 @@ void *DriverHandleImp::importFdHandle(NEO::Device *neoDevice,
|
||||
allocDataTmp->cpuAllocation = nullptr;
|
||||
allocDataTmp->size = alloc->getUnderlyingBufferSize();
|
||||
allocDataTmp->memoryType =
|
||||
isHostIpcAllocation ? InternalMemoryType::HOST_UNIFIED_MEMORY : InternalMemoryType::DEVICE_UNIFIED_MEMORY;
|
||||
isHostIpcAllocation ? InternalMemoryType::hostUnifiedMemory : InternalMemoryType::deviceUnifiedMemory;
|
||||
allocDataTmp->device = neoDevice;
|
||||
allocDataTmp->isImportedAllocation = true;
|
||||
allocDataTmp->setAllocId(this->getSvmAllocsManager()->allocationsCounter++);
|
||||
@@ -675,7 +675,7 @@ void *DriverHandleImp::importFdHandles(NEO::Device *neoDevice, ze_ipc_memory_fla
|
||||
allocDataTmp->gpuAllocations.addAllocation(alloc);
|
||||
allocDataTmp->cpuAllocation = nullptr;
|
||||
allocDataTmp->size = alloc->getUnderlyingBufferSize();
|
||||
allocDataTmp->memoryType = InternalMemoryType::DEVICE_UNIFIED_MEMORY;
|
||||
allocDataTmp->memoryType = InternalMemoryType::deviceUnifiedMemory;
|
||||
allocDataTmp->device = neoDevice;
|
||||
allocDataTmp->isImportedAllocation = true;
|
||||
allocDataTmp->setAllocId(this->getSvmAllocsManager()->allocationsCounter++);
|
||||
@@ -767,7 +767,7 @@ NEO::GraphicsAllocation *DriverHandleImp::getPeerAllocation(Device *device,
|
||||
uint32_t numHandles = alloc->getNumHandles();
|
||||
|
||||
// Don't attempt to use the peerMapAddress for reserved memory due to the limitations in the address reserved.
|
||||
if (allocData->memoryType == InternalMemoryType::RESERVED_DEVICE_MEMORY) {
|
||||
if (allocData->memoryType == InternalMemoryType::reservedDeviceMemory) {
|
||||
peerMapAddress = nullptr;
|
||||
}
|
||||
|
||||
@@ -847,7 +847,7 @@ void *DriverHandleImp::importNTHandle(ze_device_handle_t hDevice, void *handle,
|
||||
allocData.cpuAllocation = nullptr;
|
||||
allocData.size = alloc->getUnderlyingBufferSize();
|
||||
allocData.memoryType =
|
||||
isHostIpcAllocation ? InternalMemoryType::HOST_UNIFIED_MEMORY : InternalMemoryType::DEVICE_UNIFIED_MEMORY;
|
||||
isHostIpcAllocation ? InternalMemoryType::hostUnifiedMemory : InternalMemoryType::deviceUnifiedMemory;
|
||||
allocData.device = neoDevice;
|
||||
allocData.isImportedAllocation = true;
|
||||
allocData.setAllocId(this->getSvmAllocsManager()->allocationsCounter++);
|
||||
@@ -863,8 +863,8 @@ ze_result_t DriverHandleImp::checkMemoryAccessFromDevice(Device *device, const v
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (allocation->memoryType == InternalMemoryType::HOST_UNIFIED_MEMORY ||
|
||||
allocation->memoryType == InternalMemoryType::SHARED_UNIFIED_MEMORY)
|
||||
if (allocation->memoryType == InternalMemoryType::hostUnifiedMemory ||
|
||||
allocation->memoryType == InternalMemoryType::sharedUnifiedMemory)
|
||||
return ZE_RESULT_SUCCESS;
|
||||
|
||||
if (allocation->gpuAllocations.getGraphicsAllocation(device->getRootDeviceIndex()) != nullptr) {
|
||||
|
||||
@@ -23,7 +23,7 @@ TEST_F(AUBHelloWorldL0, whenAppendMemoryCopyIsCalledThenMemoryIsProperlyCopied)
|
||||
uint8_t size = 8;
|
||||
uint8_t val = 255;
|
||||
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY,
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::hostUnifiedMemory,
|
||||
1,
|
||||
context->rootDeviceIndices,
|
||||
context->deviceBitfields);
|
||||
|
||||
@@ -69,7 +69,7 @@ HWTEST_F(L0BindlessAub, DISABLED_GivenBindlessKernelWhenExecutedThenOutputIsCorr
|
||||
|
||||
NEO::debugManager.flags.UpdateCrossThreadDataSize.set(true);
|
||||
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY,
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::hostUnifiedMemory,
|
||||
1,
|
||||
context->rootDeviceIndices,
|
||||
context->deviceBitfields);
|
||||
|
||||
@@ -56,7 +56,7 @@ TEST_F(AUBAppendKernelIndirectL0, whenAppendKernelIndirectThenGlobalWorkSizeIsPr
|
||||
groupSize[2] * groupCount[2]};
|
||||
uint8_t size = 3 * sizeof(uint32_t);
|
||||
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY,
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::hostUnifiedMemory,
|
||||
1,
|
||||
context->rootDeviceIndices,
|
||||
context->deviceBitfields);
|
||||
@@ -101,7 +101,7 @@ TEST_F(AUBAppendKernelIndirectL0, whenAppendKernelIndirectThenGroupCountIsProper
|
||||
const uint32_t groupCount[] = {4, 3, 1};
|
||||
uint8_t size = 3 * sizeof(uint32_t);
|
||||
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY,
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::hostUnifiedMemory,
|
||||
1,
|
||||
context->rootDeviceIndices,
|
||||
context->deviceBitfields);
|
||||
@@ -147,7 +147,7 @@ TEST_F(AUBAppendKernelIndirectL0, whenAppendMultipleKernelsIndirectThenGroupCoun
|
||||
const uint32_t groupCount2[] = {7, 6, 4};
|
||||
uint8_t size = 3 * sizeof(uint32_t);
|
||||
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY,
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::hostUnifiedMemory,
|
||||
1,
|
||||
context->rootDeviceIndices,
|
||||
context->deviceBitfields);
|
||||
@@ -206,7 +206,7 @@ TEST_F(AUBAppendKernelIndirectL0, whenAppendMultipleKernelsIndirectThenGroupCoun
|
||||
}
|
||||
|
||||
TEST_F(AUBAppendKernelIndirectL0, whenAppendKernelIndirectThenWorkDimIsProperlyProgrammed) {
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY,
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::hostUnifiedMemory,
|
||||
1,
|
||||
context->rootDeviceIndices,
|
||||
context->deviceBitfields);
|
||||
|
||||
@@ -98,7 +98,7 @@ HWTEST2_F(DebuggerSingleAddressSpaceAub, GivenSingleAddressSpaceWhenCmdListIsExe
|
||||
|
||||
NEO::debugManager.flags.UpdateCrossThreadDataSize.set(true);
|
||||
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY,
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::hostUnifiedMemory,
|
||||
1,
|
||||
context->rootDeviceIndices,
|
||||
context->deviceBitfields);
|
||||
|
||||
@@ -302,7 +302,7 @@ ze_result_t ContextGetIpcHandleMock::getIpcMemHandle(const void *ptr, ze_ipc_mem
|
||||
ipcData.handle = handle;
|
||||
auto type = Context::parseUSMType(allocData->memoryType);
|
||||
if (type == ZE_MEMORY_TYPE_HOST) {
|
||||
ipcData.type = static_cast<uint8_t>(InternalIpcMemoryType::IPC_HOST_UNIFIED_MEMORY);
|
||||
ipcData.type = static_cast<uint8_t>(InternalIpcMemoryType::hostUnifiedMemory);
|
||||
}
|
||||
|
||||
return ZE_RESULT_SUCCESS;
|
||||
@@ -393,7 +393,7 @@ ze_result_t ContextIpcMock::getIpcMemHandle(const void *ptr, ze_ipc_mem_handle_t
|
||||
ipcData.handle = handle;
|
||||
auto type = Context::parseUSMType(allocData->memoryType);
|
||||
if (type == ZE_MEMORY_TYPE_HOST) {
|
||||
ipcData.type = static_cast<uint8_t>(InternalIpcMemoryType::IPC_HOST_UNIFIED_MEMORY);
|
||||
ipcData.type = static_cast<uint8_t>(InternalIpcMemoryType::hostUnifiedMemory);
|
||||
}
|
||||
|
||||
return ZE_RESULT_SUCCESS;
|
||||
|
||||
@@ -45,7 +45,7 @@ ze_result_t Mock<DriverHandle>::getDevice(uint32_t *pCount, ze_device_handle_t *
|
||||
|
||||
ze_result_t Mock<DriverHandle>::allocDeviceMem(ze_device_handle_t hDevice, const ze_device_mem_alloc_desc_t *deviceDesc,
|
||||
size_t size, size_t alignment, void **ptr) {
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY, alignment, rootDeviceIndices, deviceBitfields);
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::deviceUnifiedMemory, alignment, rootDeviceIndices, deviceBitfields);
|
||||
|
||||
auto allocation = svmAllocsManager->createUnifiedMemoryAllocation(size, unifiedMemoryProperties);
|
||||
|
||||
|
||||
@@ -470,146 +470,146 @@ HWTEST2_F(AppendMemoryLockedCopyTest, givenImmediateCommandListWhenGetTransferTy
|
||||
const auto hostUSM2Found = device->getDriverHandle()->findAllocationDataForRange(hostPtr2, 1024, notSpecifiedAllocData);
|
||||
EXPECT_TRUE(hostUSM2Found);
|
||||
|
||||
notSpecifiedAllocData->memoryType = InternalMemoryType::NOT_SPECIFIED;
|
||||
notSpecifiedAllocData->memoryType = InternalMemoryType::notSpecified;
|
||||
CpuMemCopyInfo copyInfoHostNonUsmToNotSpecified(hostPtr2, nonUsmHostPtr, 1024);
|
||||
copyInfoHostNonUsmToNotSpecified.dstAllocData = notSpecifiedAllocData;
|
||||
copyInfoHostNonUsmToNotSpecified.srcAllocData = hostNonUSMAllocData;
|
||||
EXPECT_EQ(TRANSFER_TYPE_UNKNOWN, cmdList.getTransferType(copyInfoHostNonUsmToNotSpecified));
|
||||
EXPECT_EQ(TransferType::unknown, cmdList.getTransferType(copyInfoHostNonUsmToNotSpecified));
|
||||
|
||||
CpuMemCopyInfo copyInfoHostNonUsmToHostUsm(hostPtr, nonUsmHostPtr, 1024);
|
||||
copyInfoHostNonUsmToHostUsm.dstAllocData = hostUSMAllocData;
|
||||
copyInfoHostNonUsmToHostUsm.srcAllocData = hostNonUSMAllocData;
|
||||
EXPECT_EQ(HOST_NON_USM_TO_HOST_USM, cmdList.getTransferType(copyInfoHostNonUsmToHostUsm));
|
||||
EXPECT_EQ(TransferType::hostNonUsmToHostUsm, cmdList.getTransferType(copyInfoHostNonUsmToHostUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoHostNonUsmToDeviceUsm(devicePtr, nonUsmHostPtr, 1024);
|
||||
copyInfoHostNonUsmToDeviceUsm.dstAllocData = deviceUSMAllocData;
|
||||
copyInfoHostNonUsmToDeviceUsm.srcAllocData = hostNonUSMAllocData;
|
||||
EXPECT_EQ(HOST_NON_USM_TO_DEVICE_USM, cmdList.getTransferType(copyInfoHostNonUsmToDeviceUsm));
|
||||
EXPECT_EQ(TransferType::hostNonUsmToDeviceUsm, cmdList.getTransferType(copyInfoHostNonUsmToDeviceUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoHostNonUsmToSharedUsm(sharedPtr, nonUsmHostPtr, 1024);
|
||||
copyInfoHostNonUsmToSharedUsm.dstAllocData = sharedUSMAllocData;
|
||||
copyInfoHostNonUsmToSharedUsm.srcAllocData = hostNonUSMAllocData;
|
||||
EXPECT_EQ(HOST_NON_USM_TO_SHARED_USM, cmdList.getTransferType(copyInfoHostNonUsmToSharedUsm));
|
||||
EXPECT_EQ(TransferType::hostNonUsmToSharedUsm, cmdList.getTransferType(copyInfoHostNonUsmToSharedUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoHostNonUsmToHostNonUsm(nonUsmHostPtr, nonUsmHostPtr, 1024);
|
||||
copyInfoHostNonUsmToHostNonUsm.dstAllocData = hostNonUSMAllocData;
|
||||
copyInfoHostNonUsmToHostNonUsm.srcAllocData = hostNonUSMAllocData;
|
||||
EXPECT_EQ(HOST_NON_USM_TO_HOST_NON_USM, cmdList.getTransferType(copyInfoHostNonUsmToHostNonUsm));
|
||||
EXPECT_EQ(TransferType::hostNonUsmToHostNonUsm, cmdList.getTransferType(copyInfoHostNonUsmToHostNonUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoHostNonUsmToHostImported(importedPtr, nonUsmHostPtr, 1024);
|
||||
copyInfoHostNonUsmToHostImported.dstIsImportedHostPtr = true;
|
||||
copyInfoHostNonUsmToHostImported.dstAllocData = nullptr;
|
||||
copyInfoHostNonUsmToHostImported.srcAllocData = hostNonUSMAllocData;
|
||||
EXPECT_EQ(HOST_NON_USM_TO_HOST_USM, cmdList.getTransferType(copyInfoHostNonUsmToHostImported));
|
||||
EXPECT_EQ(TransferType::hostNonUsmToHostUsm, cmdList.getTransferType(copyInfoHostNonUsmToHostImported));
|
||||
|
||||
CpuMemCopyInfo copyInfoHostImportedToHostUsm(hostPtr, importedPtr, 1024);
|
||||
copyInfoHostImportedToHostUsm.dstAllocData = hostUSMAllocData;
|
||||
copyInfoHostImportedToHostUsm.srcIsImportedHostPtr = true;
|
||||
copyInfoHostImportedToHostUsm.srcAllocData = nullptr;
|
||||
EXPECT_EQ(HOST_USM_TO_HOST_USM, cmdList.getTransferType(copyInfoHostImportedToHostUsm));
|
||||
EXPECT_EQ(TransferType::hostUsmToHostUsm, cmdList.getTransferType(copyInfoHostImportedToHostUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoHostImportedToDeviceUsm(devicePtr, importedPtr, 1024);
|
||||
copyInfoHostImportedToDeviceUsm.dstAllocData = deviceUSMAllocData;
|
||||
copyInfoHostImportedToDeviceUsm.srcIsImportedHostPtr = true;
|
||||
copyInfoHostImportedToDeviceUsm.srcAllocData = nullptr;
|
||||
EXPECT_EQ(HOST_USM_TO_DEVICE_USM, cmdList.getTransferType(copyInfoHostImportedToDeviceUsm));
|
||||
EXPECT_EQ(TransferType::hostUsmToDeviceUsm, cmdList.getTransferType(copyInfoHostImportedToDeviceUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoHostImportedToSharedUsm(sharedPtr, importedPtr, 1024);
|
||||
copyInfoHostImportedToSharedUsm.dstAllocData = sharedUSMAllocData;
|
||||
copyInfoHostImportedToSharedUsm.srcIsImportedHostPtr = true;
|
||||
copyInfoHostImportedToSharedUsm.srcAllocData = nullptr;
|
||||
EXPECT_EQ(HOST_USM_TO_SHARED_USM, cmdList.getTransferType(copyInfoHostImportedToSharedUsm));
|
||||
EXPECT_EQ(TransferType::hostUsmToSharedUsm, cmdList.getTransferType(copyInfoHostImportedToSharedUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoHostImportedToHostNonUsm(nonUsmHostPtr, importedPtr, 1024);
|
||||
copyInfoHostImportedToHostNonUsm.dstAllocData = hostNonUSMAllocData;
|
||||
copyInfoHostImportedToHostNonUsm.srcIsImportedHostPtr = true;
|
||||
copyInfoHostImportedToHostNonUsm.srcAllocData = nullptr;
|
||||
EXPECT_EQ(HOST_USM_TO_HOST_NON_USM, cmdList.getTransferType(copyInfoHostImportedToHostNonUsm));
|
||||
EXPECT_EQ(TransferType::hostUsmToHostNonUsm, cmdList.getTransferType(copyInfoHostImportedToHostNonUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoHostImportedToHostImported(importedPtr, importedPtr, 1024);
|
||||
copyInfoHostImportedToHostImported.dstIsImportedHostPtr = true;
|
||||
copyInfoHostImportedToHostImported.dstAllocData = nullptr;
|
||||
copyInfoHostImportedToHostImported.srcIsImportedHostPtr = true;
|
||||
copyInfoHostImportedToHostImported.srcAllocData = nullptr;
|
||||
EXPECT_EQ(HOST_USM_TO_HOST_USM, cmdList.getTransferType(copyInfoHostImportedToHostImported));
|
||||
EXPECT_EQ(TransferType::hostUsmToHostUsm, cmdList.getTransferType(copyInfoHostImportedToHostImported));
|
||||
|
||||
CpuMemCopyInfo copyInfoHostUsmToHostUsm(hostPtr, hostPtr, 1024);
|
||||
copyInfoHostUsmToHostUsm.dstAllocData = hostUSMAllocData;
|
||||
copyInfoHostUsmToHostUsm.srcAllocData = hostUSMAllocData;
|
||||
EXPECT_EQ(HOST_USM_TO_HOST_USM, cmdList.getTransferType(copyInfoHostUsmToHostUsm));
|
||||
EXPECT_EQ(TransferType::hostUsmToHostUsm, cmdList.getTransferType(copyInfoHostUsmToHostUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoHostUsmToDeviceUsm(devicePtr, hostPtr, 1024);
|
||||
copyInfoHostUsmToDeviceUsm.dstAllocData = deviceUSMAllocData;
|
||||
copyInfoHostUsmToDeviceUsm.srcAllocData = hostUSMAllocData;
|
||||
EXPECT_EQ(HOST_USM_TO_DEVICE_USM, cmdList.getTransferType(copyInfoHostUsmToDeviceUsm));
|
||||
EXPECT_EQ(TransferType::hostUsmToDeviceUsm, cmdList.getTransferType(copyInfoHostUsmToDeviceUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoHostUsmToSharedUsm(sharedPtr, hostPtr, 1024);
|
||||
copyInfoHostUsmToSharedUsm.dstAllocData = sharedUSMAllocData;
|
||||
copyInfoHostUsmToSharedUsm.srcAllocData = hostUSMAllocData;
|
||||
EXPECT_EQ(HOST_USM_TO_SHARED_USM, cmdList.getTransferType(copyInfoHostUsmToSharedUsm));
|
||||
EXPECT_EQ(TransferType::hostUsmToSharedUsm, cmdList.getTransferType(copyInfoHostUsmToSharedUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoHostUsmToHostNonUsm(nonUsmHostPtr, hostPtr, 1024);
|
||||
copyInfoHostUsmToHostNonUsm.dstAllocData = hostNonUSMAllocData;
|
||||
copyInfoHostUsmToHostNonUsm.srcAllocData = hostUSMAllocData;
|
||||
EXPECT_EQ(HOST_USM_TO_HOST_NON_USM, cmdList.getTransferType(copyInfoHostUsmToHostNonUsm));
|
||||
EXPECT_EQ(TransferType::hostUsmToHostNonUsm, cmdList.getTransferType(copyInfoHostUsmToHostNonUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoHostUsmToHostImported(importedPtr, hostPtr, 1024);
|
||||
copyInfoHostUsmToHostImported.dstIsImportedHostPtr = true;
|
||||
copyInfoHostUsmToHostImported.dstAllocData = nullptr;
|
||||
copyInfoHostUsmToHostImported.srcAllocData = hostUSMAllocData;
|
||||
EXPECT_EQ(HOST_USM_TO_HOST_USM, cmdList.getTransferType(copyInfoHostUsmToHostImported));
|
||||
EXPECT_EQ(TransferType::hostUsmToHostUsm, cmdList.getTransferType(copyInfoHostUsmToHostImported));
|
||||
|
||||
CpuMemCopyInfo copyInfoDeviceUsmToHostUsm(hostPtr, devicePtr, 1024);
|
||||
copyInfoDeviceUsmToHostUsm.dstAllocData = hostUSMAllocData;
|
||||
copyInfoDeviceUsmToHostUsm.srcAllocData = deviceUSMAllocData;
|
||||
EXPECT_EQ(DEVICE_USM_TO_HOST_USM, cmdList.getTransferType(copyInfoDeviceUsmToHostUsm));
|
||||
EXPECT_EQ(TransferType::deviceUsmToHostUsm, cmdList.getTransferType(copyInfoDeviceUsmToHostUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoDeviceUsmToDeviceUsm(devicePtr, devicePtr, 1024);
|
||||
copyInfoDeviceUsmToDeviceUsm.dstAllocData = deviceUSMAllocData;
|
||||
copyInfoDeviceUsmToDeviceUsm.srcAllocData = deviceUSMAllocData;
|
||||
EXPECT_EQ(DEVICE_USM_TO_DEVICE_USM, cmdList.getTransferType(copyInfoDeviceUsmToDeviceUsm));
|
||||
EXPECT_EQ(TransferType::deviceUsmToDeviceUsm, cmdList.getTransferType(copyInfoDeviceUsmToDeviceUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoDeviceUsmToSharedUsm(sharedPtr, devicePtr, 1024);
|
||||
copyInfoDeviceUsmToSharedUsm.dstAllocData = sharedUSMAllocData;
|
||||
copyInfoDeviceUsmToSharedUsm.srcAllocData = deviceUSMAllocData;
|
||||
EXPECT_EQ(DEVICE_USM_TO_SHARED_USM, cmdList.getTransferType(copyInfoDeviceUsmToSharedUsm));
|
||||
EXPECT_EQ(TransferType::deviceUsmToSharedUsm, cmdList.getTransferType(copyInfoDeviceUsmToSharedUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoDeviceUsmToHostNonUsm(nonUsmHostPtr, devicePtr, 1024);
|
||||
copyInfoDeviceUsmToHostNonUsm.dstAllocData = hostNonUSMAllocData;
|
||||
copyInfoDeviceUsmToHostNonUsm.srcAllocData = deviceUSMAllocData;
|
||||
EXPECT_EQ(DEVICE_USM_TO_HOST_NON_USM, cmdList.getTransferType(copyInfoDeviceUsmToHostNonUsm));
|
||||
EXPECT_EQ(TransferType::deviceUsmToHostNonUsm, cmdList.getTransferType(copyInfoDeviceUsmToHostNonUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoDeviceUsmToHostImported(importedPtr, devicePtr, 1024);
|
||||
copyInfoDeviceUsmToHostImported.dstIsImportedHostPtr = true;
|
||||
copyInfoDeviceUsmToHostImported.dstAllocData = nullptr;
|
||||
copyInfoDeviceUsmToHostImported.srcAllocData = deviceUSMAllocData;
|
||||
EXPECT_EQ(DEVICE_USM_TO_HOST_USM, cmdList.getTransferType(copyInfoDeviceUsmToHostImported));
|
||||
EXPECT_EQ(TransferType::deviceUsmToHostUsm, cmdList.getTransferType(copyInfoDeviceUsmToHostImported));
|
||||
|
||||
CpuMemCopyInfo copyInfoSharedUsmToHostUsm(hostPtr, sharedPtr, 1024);
|
||||
copyInfoSharedUsmToHostUsm.dstAllocData = hostUSMAllocData;
|
||||
copyInfoSharedUsmToHostUsm.srcAllocData = sharedUSMAllocData;
|
||||
EXPECT_EQ(SHARED_USM_TO_HOST_USM, cmdList.getTransferType(copyInfoSharedUsmToHostUsm));
|
||||
EXPECT_EQ(TransferType::sharedUsmToHostUsm, cmdList.getTransferType(copyInfoSharedUsmToHostUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoSharedUsmToDeviceUsm(devicePtr, sharedPtr, 1024);
|
||||
copyInfoSharedUsmToDeviceUsm.dstAllocData = deviceUSMAllocData;
|
||||
copyInfoSharedUsmToDeviceUsm.srcAllocData = sharedUSMAllocData;
|
||||
EXPECT_EQ(SHARED_USM_TO_DEVICE_USM, cmdList.getTransferType(copyInfoSharedUsmToDeviceUsm));
|
||||
EXPECT_EQ(TransferType::sharedUsmToDeviceUsm, cmdList.getTransferType(copyInfoSharedUsmToDeviceUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoSharedUsmToSharedUsm(sharedPtr, sharedPtr, 1024);
|
||||
copyInfoSharedUsmToSharedUsm.dstAllocData = sharedUSMAllocData;
|
||||
copyInfoSharedUsmToSharedUsm.srcAllocData = sharedUSMAllocData;
|
||||
EXPECT_EQ(SHARED_USM_TO_SHARED_USM, cmdList.getTransferType(copyInfoSharedUsmToSharedUsm));
|
||||
EXPECT_EQ(TransferType::sharedUsmToSharedUsm, cmdList.getTransferType(copyInfoSharedUsmToSharedUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoSharedUsmToHostNonUsm(nonUsmHostPtr, sharedPtr, 1024);
|
||||
copyInfoSharedUsmToHostNonUsm.dstAllocData = hostNonUSMAllocData;
|
||||
copyInfoSharedUsmToHostNonUsm.srcAllocData = sharedUSMAllocData;
|
||||
EXPECT_EQ(SHARED_USM_TO_HOST_NON_USM, cmdList.getTransferType(copyInfoSharedUsmToHostNonUsm));
|
||||
EXPECT_EQ(TransferType::sharedUsmToHostNonUsm, cmdList.getTransferType(copyInfoSharedUsmToHostNonUsm));
|
||||
|
||||
CpuMemCopyInfo copyInfoSharedUsmToHostImported(importedPtr, sharedPtr, 1024);
|
||||
copyInfoSharedUsmToHostImported.dstIsImportedHostPtr = true;
|
||||
copyInfoSharedUsmToHostImported.dstAllocData = nullptr;
|
||||
copyInfoSharedUsmToHostImported.srcAllocData = sharedUSMAllocData;
|
||||
EXPECT_EQ(SHARED_USM_TO_HOST_USM, cmdList.getTransferType(copyInfoSharedUsmToHostImported));
|
||||
EXPECT_EQ(TransferType::sharedUsmToHostUsm, cmdList.getTransferType(copyInfoSharedUsmToHostImported));
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, device->getDriverHandle()->releaseImportedPointer(importedPtr));
|
||||
free(importedPtr);
|
||||
@@ -620,41 +620,41 @@ HWTEST2_F(AppendMemoryLockedCopyTest, givenImmediateCommandListWhenGetTransferTh
|
||||
MockCommandListImmediateHw<gfxCoreFamily> cmdList;
|
||||
cmdList.copyThroughLockedPtrEnabled = true;
|
||||
cmdList.initialize(device, NEO::EngineGroupType::renderCompute, 0u);
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(TRANSFER_TYPE_UNKNOWN));
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(TransferType::unknown));
|
||||
|
||||
EXPECT_EQ(1 * MemoryConstants::megaByte, cmdList.getTransferThreshold(HOST_NON_USM_TO_HOST_USM));
|
||||
EXPECT_EQ(4 * MemoryConstants::megaByte, cmdList.getTransferThreshold(HOST_NON_USM_TO_DEVICE_USM));
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(HOST_NON_USM_TO_SHARED_USM));
|
||||
EXPECT_EQ(1 * MemoryConstants::megaByte, cmdList.getTransferThreshold(HOST_NON_USM_TO_HOST_NON_USM));
|
||||
EXPECT_EQ(1 * MemoryConstants::megaByte, cmdList.getTransferThreshold(TransferType::hostNonUsmToHostUsm));
|
||||
EXPECT_EQ(4 * MemoryConstants::megaByte, cmdList.getTransferThreshold(TransferType::hostNonUsmToDeviceUsm));
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(TransferType::hostNonUsmToSharedUsm));
|
||||
EXPECT_EQ(1 * MemoryConstants::megaByte, cmdList.getTransferThreshold(TransferType::hostNonUsmToHostNonUsm));
|
||||
|
||||
EXPECT_EQ(200 * MemoryConstants::kiloByte, cmdList.getTransferThreshold(HOST_USM_TO_HOST_USM));
|
||||
EXPECT_EQ(50 * MemoryConstants::kiloByte, cmdList.getTransferThreshold(HOST_USM_TO_DEVICE_USM));
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(HOST_USM_TO_SHARED_USM));
|
||||
EXPECT_EQ(500 * MemoryConstants::kiloByte, cmdList.getTransferThreshold(HOST_USM_TO_HOST_NON_USM));
|
||||
EXPECT_EQ(200 * MemoryConstants::kiloByte, cmdList.getTransferThreshold(TransferType::hostUsmToHostUsm));
|
||||
EXPECT_EQ(50 * MemoryConstants::kiloByte, cmdList.getTransferThreshold(TransferType::hostUsmToDeviceUsm));
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(TransferType::hostUsmToSharedUsm));
|
||||
EXPECT_EQ(500 * MemoryConstants::kiloByte, cmdList.getTransferThreshold(TransferType::hostUsmToHostNonUsm));
|
||||
|
||||
EXPECT_EQ(128u, cmdList.getTransferThreshold(DEVICE_USM_TO_HOST_USM));
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(DEVICE_USM_TO_DEVICE_USM));
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(DEVICE_USM_TO_SHARED_USM));
|
||||
EXPECT_EQ(1 * MemoryConstants::kiloByte, cmdList.getTransferThreshold(DEVICE_USM_TO_HOST_NON_USM));
|
||||
EXPECT_EQ(128u, cmdList.getTransferThreshold(TransferType::deviceUsmToHostUsm));
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(TransferType::deviceUsmToDeviceUsm));
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(TransferType::deviceUsmToSharedUsm));
|
||||
EXPECT_EQ(1 * MemoryConstants::kiloByte, cmdList.getTransferThreshold(TransferType::deviceUsmToHostNonUsm));
|
||||
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(SHARED_USM_TO_HOST_USM));
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(SHARED_USM_TO_DEVICE_USM));
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(SHARED_USM_TO_SHARED_USM));
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(SHARED_USM_TO_HOST_NON_USM));
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(TransferType::sharedUsmToHostUsm));
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(TransferType::sharedUsmToDeviceUsm));
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(TransferType::sharedUsmToSharedUsm));
|
||||
EXPECT_EQ(0u, cmdList.getTransferThreshold(TransferType::sharedUsmToHostNonUsm));
|
||||
}
|
||||
|
||||
HWTEST2_F(AppendMemoryLockedCopyTest, givenImmediateCommandListAndThresholdDebugFlagSetWhenGetTransferThresholdThenReturnCorrectValue, IsAtLeastSkl) {
|
||||
MockCommandListImmediateHw<gfxCoreFamily> cmdList;
|
||||
cmdList.copyThroughLockedPtrEnabled = true;
|
||||
cmdList.initialize(device, NEO::EngineGroupType::renderCompute, 0u);
|
||||
EXPECT_EQ(4 * MemoryConstants::megaByte, cmdList.getTransferThreshold(HOST_NON_USM_TO_DEVICE_USM));
|
||||
EXPECT_EQ(1 * MemoryConstants::kiloByte, cmdList.getTransferThreshold(DEVICE_USM_TO_HOST_NON_USM));
|
||||
EXPECT_EQ(4 * MemoryConstants::megaByte, cmdList.getTransferThreshold(TransferType::hostNonUsmToDeviceUsm));
|
||||
EXPECT_EQ(1 * MemoryConstants::kiloByte, cmdList.getTransferThreshold(TransferType::deviceUsmToHostNonUsm));
|
||||
|
||||
debugManager.flags.ExperimentalH2DCpuCopyThreshold.set(5 * MemoryConstants::megaByte);
|
||||
EXPECT_EQ(5 * MemoryConstants::megaByte, cmdList.getTransferThreshold(HOST_NON_USM_TO_DEVICE_USM));
|
||||
EXPECT_EQ(5 * MemoryConstants::megaByte, cmdList.getTransferThreshold(TransferType::hostNonUsmToDeviceUsm));
|
||||
|
||||
debugManager.flags.ExperimentalD2HCpuCopyThreshold.set(6 * MemoryConstants::megaByte);
|
||||
EXPECT_EQ(6 * MemoryConstants::megaByte, cmdList.getTransferThreshold(DEVICE_USM_TO_HOST_NON_USM));
|
||||
EXPECT_EQ(6 * MemoryConstants::megaByte, cmdList.getTransferThreshold(TransferType::deviceUsmToHostNonUsm));
|
||||
}
|
||||
|
||||
HWTEST2_F(AppendMemoryLockedCopyTest, givenImmediateCommandListAndNonUsmHostPtrWhenCopyH2DThenLockPtr, IsAtLeastSkl) {
|
||||
|
||||
@@ -963,7 +963,7 @@ HWTEST_F(ContextMakeMemoryResidentAndMigrationTests,
|
||||
RootDeviceIndicesContainer rootDeviceIndices = {mockRootDeviceIndex};
|
||||
std::map<uint32_t, DeviceBitfield> deviceBitfields{{mockRootDeviceIndex, mockDeviceBitfield}};
|
||||
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::SHARED_UNIFIED_MEMORY, 1, rootDeviceIndices, deviceBitfields);
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::sharedUnifiedMemory, 1, rootDeviceIndices, deviceBitfields);
|
||||
auto sharedPtr = svmManager->createSharedUnifiedMemoryAllocation(4096u, unifiedMemoryProperties, device);
|
||||
EXPECT_NE(nullptr, sharedPtr);
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ TEST_F(HostPointerManagerTest, givenPointerRegisteredWhenSvmAllocationExistsThen
|
||||
allocData.gpuAllocations.addAllocation(usmAllocation);
|
||||
allocData.cpuAllocation = nullptr;
|
||||
allocData.size = usmSize;
|
||||
allocData.memoryType = InternalMemoryType::NOT_SPECIFIED;
|
||||
allocData.memoryType = InternalMemoryType::notSpecified;
|
||||
allocData.device = nullptr;
|
||||
hostDriverHandle->getSvmAllocsManager()->insertSVMAlloc(allocData);
|
||||
|
||||
@@ -123,7 +123,7 @@ TEST_F(HostPointerManagerTest, givenSvmAllocationExistsWhenGettingExistingAlloca
|
||||
allocData.gpuAllocations.addAllocation(usmAllocation);
|
||||
allocData.cpuAllocation = nullptr;
|
||||
allocData.size = usmSize;
|
||||
allocData.memoryType = InternalMemoryType::NOT_SPECIFIED;
|
||||
allocData.memoryType = InternalMemoryType::notSpecified;
|
||||
allocData.device = nullptr;
|
||||
hostDriverHandle->getSvmAllocsManager()->insertSVMAlloc(allocData);
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ HWTEST_F(ImportNTHandle, givenCallToImportNTHandleWithHostBufferMemoryAllocation
|
||||
|
||||
auto allocData = driverHandle->svmAllocsManager->getSVMAlloc(ptr);
|
||||
EXPECT_NE(allocData, nullptr);
|
||||
EXPECT_EQ(allocData->memoryType, InternalMemoryType::HOST_UNIFIED_MEMORY);
|
||||
EXPECT_EQ(allocData->memoryType, InternalMemoryType::hostUnifiedMemory);
|
||||
|
||||
ze_result_t result = context->freeMem(ptr);
|
||||
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
|
||||
@@ -250,7 +250,7 @@ HWTEST_F(ImportNTHandle, givenCallToImportNTHandleWithBufferMemoryAllocationType
|
||||
|
||||
auto allocData = driverHandle->svmAllocsManager->getSVMAlloc(ptr);
|
||||
EXPECT_NE(allocData, nullptr);
|
||||
EXPECT_EQ(allocData->memoryType, InternalMemoryType::DEVICE_UNIFIED_MEMORY);
|
||||
EXPECT_EQ(allocData->memoryType, InternalMemoryType::deviceUnifiedMemory);
|
||||
|
||||
ze_result_t result = context->freeMem(ptr);
|
||||
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
|
||||
|
||||
@@ -3083,7 +3083,7 @@ TEST_F(MemoryExportImportFailTest,
|
||||
TEST_F(MemoryExportImportFailTest,
|
||||
whenParsingMemoryTypeWithNotSpecifidTypeThenUnknownTypeIsReturned) {
|
||||
|
||||
InternalMemoryType memoryType = InternalMemoryType::NOT_SPECIFIED;
|
||||
InternalMemoryType memoryType = InternalMemoryType::notSpecified;
|
||||
ze_memory_type_t usmType = L0::Context::parseUSMType(memoryType);
|
||||
EXPECT_EQ(usmType, ZE_MEMORY_TYPE_UNKNOWN);
|
||||
}
|
||||
@@ -4048,7 +4048,7 @@ HWTEST2_F(MultipleDevicePeerAllocationTest,
|
||||
|
||||
auto &residentAllocations = csr->getResidencyAllocations();
|
||||
EXPECT_EQ(0u, residentAllocations.size());
|
||||
svmManager->makeInternalAllocationsResident(*csr, InternalMemoryType::DEVICE_UNIFIED_MEMORY);
|
||||
svmManager->makeInternalAllocationsResident(*csr, static_cast<uint32_t>(InternalMemoryType::deviceUnifiedMemory));
|
||||
EXPECT_EQ(1u, residentAllocations.size());
|
||||
EXPECT_EQ(residentAllocations[0]->getGpuAddress(), reinterpret_cast<uint64_t>(ptr1));
|
||||
|
||||
@@ -5439,7 +5439,7 @@ TEST_F(ImportFdUncachedTests,
|
||||
|
||||
auto allocData = driverHandle->svmAllocsManager->getSVMAlloc(ptr);
|
||||
EXPECT_NE(allocData, nullptr);
|
||||
EXPECT_EQ(allocData->memoryType, InternalMemoryType::HOST_UNIFIED_MEMORY);
|
||||
EXPECT_EQ(allocData->memoryType, InternalMemoryType::hostUnifiedMemory);
|
||||
|
||||
context->freeMem(ptr);
|
||||
}
|
||||
@@ -5454,7 +5454,7 @@ TEST_F(ImportFdUncachedTests,
|
||||
|
||||
auto allocData = driverHandle->svmAllocsManager->getSVMAlloc(ptr);
|
||||
EXPECT_NE(allocData, nullptr);
|
||||
EXPECT_EQ(allocData->memoryType, InternalMemoryType::DEVICE_UNIFIED_MEMORY);
|
||||
EXPECT_EQ(allocData->memoryType, InternalMemoryType::deviceUnifiedMemory);
|
||||
|
||||
context->freeMem(ptr);
|
||||
}
|
||||
|
||||
@@ -3139,8 +3139,8 @@ kernels:
|
||||
auto svmAllocsManager = device->getDriverHandle()->getSvmAllocsManager();
|
||||
auto globalConstBufferAllocType = svmAllocsManager->getSVMAlloc(reinterpret_cast<void *>(moduleTu.globalConstBuffer->getGpuAddress()))->memoryType;
|
||||
auto globalVarBufferAllocType = svmAllocsManager->getSVMAlloc(reinterpret_cast<void *>(moduleTu.globalVarBuffer->getGpuAddress()))->memoryType;
|
||||
EXPECT_EQ(DEVICE_UNIFIED_MEMORY, globalConstBufferAllocType);
|
||||
EXPECT_EQ(DEVICE_UNIFIED_MEMORY, globalVarBufferAllocType);
|
||||
EXPECT_EQ(InternalMemoryType::deviceUnifiedMemory, globalConstBufferAllocType);
|
||||
EXPECT_EQ(InternalMemoryType::deviceUnifiedMemory, globalVarBufferAllocType);
|
||||
}
|
||||
|
||||
HWTEST_F(ModuleTranslationUnitTest, WithNoCompilerWhenCallingBuildFromSpirvThenFailureReturned) {
|
||||
|
||||
Reference in New Issue
Block a user