mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
refactor: correct naming of allocation types
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
eac3d2130d
commit
b182917d9d
@@ -80,7 +80,7 @@ NEO::GraphicsAllocation *CommandList::getAllocationFromHostPtrMap(const void *bu
|
||||
}
|
||||
}
|
||||
if (this->storeExternalPtrAsTemporary()) {
|
||||
auto allocation = this->csr->getInternalAllocationStorage()->obtainTemporaryAllocationWithPtr(bufferSize, buffer, NEO::AllocationType::EXTERNAL_HOST_PTR);
|
||||
auto allocation = this->csr->getInternalAllocationStorage()->obtainTemporaryAllocationWithPtr(bufferSize, buffer, NEO::AllocationType::externalHostPtr);
|
||||
if (allocation != nullptr) {
|
||||
auto alloc = allocation.get();
|
||||
alloc->hostPtrTaskCountAssignment++;
|
||||
@@ -111,7 +111,7 @@ NEO::GraphicsAllocation *CommandList::getHostPtrAlloc(const void *buffer, uint64
|
||||
if (this->storeExternalPtrAsTemporary()) {
|
||||
alloc->hostPtrTaskCountAssignment++;
|
||||
this->csr->getInternalAllocationStorage()->storeAllocationWithTaskCount(std::unique_ptr<NEO::GraphicsAllocation>(alloc), NEO::AllocationUsage::TEMPORARY_ALLOCATION, this->csr->peekTaskCount());
|
||||
} else if (alloc->getAllocationType() == NEO::AllocationType::EXTERNAL_HOST_PTR) {
|
||||
} else if (alloc->getAllocationType() == NEO::AllocationType::externalHostPtr) {
|
||||
hostPtrMap.insert(std::make_pair(buffer, alloc));
|
||||
} else {
|
||||
commandContainer.getDeallocationContainer().push_back(alloc);
|
||||
@@ -130,8 +130,8 @@ void CommandList::removeDeallocationContainerData() {
|
||||
if (allocData) {
|
||||
device->getDriverHandle()->getSvmAllocsManager()->removeSVMAlloc(*allocData);
|
||||
}
|
||||
if (!((deallocation->getAllocationType() == NEO::AllocationType::INTERNAL_HEAP) ||
|
||||
(deallocation->getAllocationType() == NEO::AllocationType::LINEAR_STREAM))) {
|
||||
if (!((deallocation->getAllocationType() == NEO::AllocationType::internalHeap) ||
|
||||
(deallocation->getAllocationType() == NEO::AllocationType::linearStream))) {
|
||||
memoryManager->freeGraphicsMemory(deallocation);
|
||||
eraseDeallocationContainerEntry(deallocation);
|
||||
}
|
||||
|
||||
@@ -913,8 +913,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendImageCopyToMemory(void *
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
launchParams.isBuiltInKernel = true;
|
||||
launchParams.isDestinationAllocationInSystemMemory =
|
||||
(dstAllocationType == NEO::AllocationType::BUFFER_HOST_MEMORY) ||
|
||||
(dstAllocationType == NEO::AllocationType::EXTERNAL_HOST_PTR);
|
||||
(dstAllocationType == NEO::AllocationType::bufferHostMemory) ||
|
||||
(dstAllocationType == NEO::AllocationType::externalHostPtr);
|
||||
ret = CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernel(builtinKernel->toHandle(), kernelArgs,
|
||||
event, numWaitEvents, phWaitEvents, launchParams, relaxedOrderingDispatch);
|
||||
addToMappedEventList(event);
|
||||
@@ -1193,9 +1193,9 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyKernelWithGA(v
|
||||
auto dstAllocationType = dstPtrAlloc->getAllocationType();
|
||||
launchParams.isBuiltInKernel = true;
|
||||
launchParams.isDestinationAllocationInSystemMemory =
|
||||
(dstAllocationType == NEO::AllocationType::BUFFER_HOST_MEMORY) ||
|
||||
(dstAllocationType == NEO::AllocationType::SVM_CPU) ||
|
||||
(dstAllocationType == NEO::AllocationType::EXTERNAL_HOST_PTR);
|
||||
(dstAllocationType == NEO::AllocationType::bufferHostMemory) ||
|
||||
(dstAllocationType == NEO::AllocationType::svmCpu) ||
|
||||
(dstAllocationType == NEO::AllocationType::externalHostPtr);
|
||||
|
||||
return CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelSplit(builtinKernel, dispatchKernelArgs, signalEvent, launchParams);
|
||||
}
|
||||
@@ -1720,8 +1720,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyKernel3d(Align
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
launchParams.isBuiltInKernel = true;
|
||||
launchParams.isDestinationAllocationInSystemMemory =
|
||||
(dstAllocationType == NEO::AllocationType::BUFFER_HOST_MEMORY) ||
|
||||
(dstAllocationType == NEO::AllocationType::EXTERNAL_HOST_PTR);
|
||||
(dstAllocationType == NEO::AllocationType::bufferHostMemory) ||
|
||||
(dstAllocationType == NEO::AllocationType::externalHostPtr);
|
||||
return CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernel(builtinKernel->toHandle(), dispatchKernelArgs, signalEvent, numWaitEvents,
|
||||
phWaitEvents, launchParams, relaxedOrderingDispatch);
|
||||
}
|
||||
@@ -1787,8 +1787,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyKernel2d(Align
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
launchParams.isBuiltInKernel = true;
|
||||
launchParams.isDestinationAllocationInSystemMemory =
|
||||
(dstAllocationType == NEO::AllocationType::BUFFER_HOST_MEMORY) ||
|
||||
(dstAllocationType == NEO::AllocationType::EXTERNAL_HOST_PTR);
|
||||
(dstAllocationType == NEO::AllocationType::bufferHostMemory) ||
|
||||
(dstAllocationType == NEO::AllocationType::externalHostPtr);
|
||||
return CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernel(builtinKernel->toHandle(),
|
||||
dispatchKernelArgs, signalEvent,
|
||||
numWaitEvents,
|
||||
@@ -1978,11 +1978,11 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryFill(void *ptr,
|
||||
builtinKernel->setGroupSize(static_cast<uint32_t>(fillArguments.mainGroupSize), 1, 1);
|
||||
|
||||
size_t patternAllocationSize = alignUp(patternSize, MemoryConstants::cacheLineSize);
|
||||
auto patternGfxAlloc = device->obtainReusableAllocation(patternAllocationSize, NEO::AllocationType::FILL_PATTERN);
|
||||
auto patternGfxAlloc = device->obtainReusableAllocation(patternAllocationSize, NEO::AllocationType::fillPattern);
|
||||
if (patternGfxAlloc == nullptr) {
|
||||
NEO::AllocationProperties allocationProperties{device->getNEODevice()->getRootDeviceIndex(),
|
||||
patternAllocationSize,
|
||||
NEO::AllocationType::FILL_PATTERN,
|
||||
NEO::AllocationType::fillPattern,
|
||||
device->getNEODevice()->getDeviceBitfield()};
|
||||
allocationProperties.alignment = MemoryConstants::pageSize;
|
||||
patternGfxAlloc = device->getDriverHandle()->getMemoryManager()->allocateGraphicsMemoryWithProperties(allocationProperties);
|
||||
@@ -2254,7 +2254,7 @@ inline AlignedAllocationData CommandListCoreFamily<gfxCoreFamily>::getAlignedAll
|
||||
return {0u, 0, nullptr, false};
|
||||
}
|
||||
alignedPtr = static_cast<uintptr_t>(alignDown(alloc->getGpuAddress(), NEO::EncodeSurfaceState<GfxFamily>::getSurfaceBaseAddressAlignment()));
|
||||
if (alloc->getAllocationType() == NEO::AllocationType::EXTERNAL_HOST_PTR) {
|
||||
if (alloc->getAllocationType() == NEO::AllocationType::externalHostPtr) {
|
||||
auto hostAllocCpuPtr = reinterpret_cast<uintptr_t>(alloc->getUnderlyingBuffer());
|
||||
hostAllocCpuPtr = alignDown(hostAllocCpuPtr, NEO::EncodeSurfaceState<GfxFamily>::getSurfaceBaseAddressAlignment());
|
||||
auto allignedPtrOffset = sourcePtr - hostAllocCpuPtr;
|
||||
@@ -2301,7 +2301,7 @@ inline AlignedAllocationData CommandListCoreFamily<gfxCoreFamily>::getAlignedAll
|
||||
template <GFXCORE_FAMILY gfxCoreFamily>
|
||||
inline size_t CommandListCoreFamily<gfxCoreFamily>::getAllocationOffsetForAppendBlitFill(void *ptr, NEO::GraphicsAllocation &gpuAllocation) {
|
||||
uint64_t offset;
|
||||
if (gpuAllocation.getAllocationType() == NEO::AllocationType::EXTERNAL_HOST_PTR) {
|
||||
if (gpuAllocation.getAllocationType() == NEO::AllocationType::externalHostPtr) {
|
||||
offset = castToUint64(ptr) - castToUint64(gpuAllocation.getUnderlyingBuffer()) + gpuAllocation.getAllocationOffset();
|
||||
} else {
|
||||
offset = castToUint64(ptr) - gpuAllocation.getGpuAddress();
|
||||
@@ -2771,7 +2771,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendQueryKernelTimestamps(
|
||||
}
|
||||
|
||||
size_t alignedSize = alignUp<size_t>(sizeof(EventData) * numEvents, MemoryConstants::pageSize64k);
|
||||
NEO::AllocationType allocationType = NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER;
|
||||
NEO::AllocationType allocationType = NEO::AllocationType::gpuTimestampDeviceBuffer;
|
||||
auto devices = device->getNEODevice()->getDeviceBitfield();
|
||||
NEO::AllocationProperties allocationProperties{device->getRootDeviceIndex(),
|
||||
true,
|
||||
@@ -2840,8 +2840,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendQueryKernelTimestamps(
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
launchParams.isBuiltInKernel = true;
|
||||
launchParams.isDestinationAllocationInSystemMemory =
|
||||
(dstAllocationType == NEO::AllocationType::BUFFER_HOST_MEMORY) ||
|
||||
(dstAllocationType == NEO::AllocationType::EXTERNAL_HOST_PTR);
|
||||
(dstAllocationType == NEO::AllocationType::bufferHostMemory) ||
|
||||
(dstAllocationType == NEO::AllocationType::externalHostPtr);
|
||||
auto appendResult = appendLaunchKernel(builtinKernel->toHandle(), dispatchKernelArgs, hSignalEvent, numWaitEvents,
|
||||
phWaitEvents, launchParams, false);
|
||||
if (appendResult != ZE_RESULT_SUCCESS) {
|
||||
@@ -3403,8 +3403,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendWaitOnMemory(void *desc,
|
||||
const auto &rootDeviceEnvironment = this->device->getNEODevice()->getRootDeviceEnvironment();
|
||||
auto allocType = srcAllocationStruct.alloc->getAllocationType();
|
||||
bool isSystemMemoryUsed =
|
||||
(allocType == NEO::AllocationType::BUFFER_HOST_MEMORY) ||
|
||||
(allocType == NEO::AllocationType::EXTERNAL_HOST_PTR);
|
||||
(allocType == NEO::AllocationType::bufferHostMemory) ||
|
||||
(allocType == NEO::AllocationType::externalHostPtr);
|
||||
if (isSystemMemoryUsed) {
|
||||
NEO::MemorySynchronizationCommands<GfxFamily>::addAdditionalSynchronization(*commandContainer.getCommandStream(), gpuAddress, true, rootDeviceEnvironment);
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
|
||||
if (allocation == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (allocation->getAllocationType() == NEO::AllocationType::BUFFER_HOST_MEMORY) {
|
||||
if (allocation->getAllocationType() == NEO::AllocationType::bufferHostMemory) {
|
||||
isKernelUsingSystemAllocation = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,14 +232,14 @@ void CommandListImp::enableInOrderExecution() {
|
||||
|
||||
auto device = this->device->getNEODevice();
|
||||
|
||||
NEO::AllocationProperties allocationProperties{device->getRootDeviceIndex(), MemoryConstants::pageSize64k, NEO::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, device->getDeviceBitfield()};
|
||||
NEO::AllocationProperties allocationProperties{device->getRootDeviceIndex(), MemoryConstants::pageSize64k, NEO::AllocationType::timestampPacketTagBuffer, device->getDeviceBitfield()};
|
||||
|
||||
auto inOrderDependencyCounterAllocation = device->getMemoryManager()->allocateGraphicsMemoryWithProperties(allocationProperties);
|
||||
|
||||
NEO::GraphicsAllocation *hostCounterAllocation = nullptr;
|
||||
|
||||
if (duplicatedInOrderCounterStorageEnabled()) {
|
||||
NEO::AllocationProperties hostAllocationProperties{device->getRootDeviceIndex(), MemoryConstants::pageSize64k, NEO::AllocationType::BUFFER_HOST_MEMORY, device->getDeviceBitfield()};
|
||||
NEO::AllocationProperties hostAllocationProperties{device->getRootDeviceIndex(), MemoryConstants::pageSize64k, NEO::AllocationType::bufferHostMemory, device->getDeviceBitfield()};
|
||||
hostCounterAllocation = device->getMemoryManager()->allocateGraphicsMemoryWithProperties(hostAllocationProperties);
|
||||
|
||||
UNRECOVERABLE_IF(!hostCounterAllocation);
|
||||
|
||||
@@ -268,17 +268,17 @@ void CommandQueueImp::registerCsrClient() {
|
||||
ze_result_t CommandQueueImp::CommandBufferManager::initialize(Device *device, size_t sizeRequested) {
|
||||
size_t alignedSize = alignUp<size_t>(sizeRequested, MemoryConstants::pageSize64k);
|
||||
NEO::AllocationProperties properties{device->getRootDeviceIndex(), true, alignedSize,
|
||||
NEO::AllocationType::COMMAND_BUFFER,
|
||||
NEO::AllocationType::commandBuffer,
|
||||
(device->getNEODevice()->getNumGenericSubDevices() > 1u) /* multiOsContextCapable */,
|
||||
false,
|
||||
device->getNEODevice()->getDeviceBitfield()};
|
||||
|
||||
auto firstBuffer = device->obtainReusableAllocation(alignedSize, NEO::AllocationType::COMMAND_BUFFER);
|
||||
auto firstBuffer = device->obtainReusableAllocation(alignedSize, NEO::AllocationType::commandBuffer);
|
||||
if (!firstBuffer) {
|
||||
firstBuffer = device->getNEODevice()->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties);
|
||||
}
|
||||
|
||||
auto secondBuffer = device->obtainReusableAllocation(alignedSize, NEO::AllocationType::COMMAND_BUFFER);
|
||||
auto secondBuffer = device->obtainReusableAllocation(alignedSize, NEO::AllocationType::commandBuffer);
|
||||
if (!secondBuffer) {
|
||||
secondBuffer = device->getNEODevice()->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties);
|
||||
}
|
||||
@@ -348,8 +348,8 @@ void CommandQueueImp::makeResidentAndMigrate(bool performMigration, const NEO::R
|
||||
alloc->prepareHostPtrForResidency(csr);
|
||||
csr->makeResident(*alloc);
|
||||
if (performMigration &&
|
||||
(alloc->getAllocationType() == NEO::AllocationType::SVM_GPU ||
|
||||
alloc->getAllocationType() == NEO::AllocationType::SVM_CPU)) {
|
||||
(alloc->getAllocationType() == NEO::AllocationType::svmGpu ||
|
||||
alloc->getAllocationType() == NEO::AllocationType::svmCpu)) {
|
||||
auto pageFaultManager = device->getDriverHandle()->getMemoryManager()->getPageFaultManager();
|
||||
pageFaultManager->moveAllocationToGpuDomain(reinterpret_cast<void *>(alloc->getGpuAddress()));
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ ze_result_t ContextImp::allocHostMem(const ze_host_mem_alloc_desc_t *hostDesc,
|
||||
ze_ipc_memory_flags_t flags = {};
|
||||
*ptr = getMemHandlePtr(this->devices.begin()->second,
|
||||
lookupTable.sharedHandleType.fd,
|
||||
NEO::AllocationType::BUFFER_HOST_MEMORY,
|
||||
NEO::AllocationType::bufferHostMemory,
|
||||
flags);
|
||||
if (nullptr == *ptr) {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
@@ -111,7 +111,7 @@ ze_result_t ContextImp::allocHostMem(const ze_host_mem_alloc_desc_t *hostDesc,
|
||||
UNRECOVERABLE_IF(!lookupTable.sharedHandleType.isNTHandle);
|
||||
*ptr = this->driverHandle->importNTHandle(this->devices.begin()->second,
|
||||
lookupTable.sharedHandleType.ntHnadle,
|
||||
NEO::AllocationType::BUFFER_HOST_MEMORY);
|
||||
NEO::AllocationType::bufferHostMemory);
|
||||
if (*ptr == nullptr) {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
@@ -223,7 +223,7 @@ ze_result_t ContextImp::allocDeviceMem(ze_device_handle_t hDevice,
|
||||
ze_ipc_memory_flags_t flags = {};
|
||||
*ptr = getMemHandlePtr(hDevice,
|
||||
lookupTable.sharedHandleType.fd,
|
||||
NEO::AllocationType::BUFFER,
|
||||
NEO::AllocationType::buffer,
|
||||
flags);
|
||||
if (nullptr == *ptr) {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
@@ -232,7 +232,7 @@ ze_result_t ContextImp::allocDeviceMem(ze_device_handle_t hDevice,
|
||||
UNRECOVERABLE_IF(!lookupTable.sharedHandleType.isNTHandle);
|
||||
*ptr = this->driverHandle->importNTHandle(hDevice,
|
||||
lookupTable.sharedHandleType.ntHnadle,
|
||||
NEO::AllocationType::BUFFER);
|
||||
NEO::AllocationType::buffer);
|
||||
if (*ptr == nullptr) {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
@@ -693,11 +693,11 @@ ze_result_t ContextImp::openIpcMemHandle(ze_device_handle_t hDevice,
|
||||
uint64_t handle = ipcData.handle;
|
||||
uint8_t type = ipcData.type;
|
||||
|
||||
NEO::AllocationType allocationType = NEO::AllocationType::UNKNOWN;
|
||||
NEO::AllocationType allocationType = NEO::AllocationType::unknown;
|
||||
if (type == static_cast<uint8_t>(InternalIpcMemoryType::IPC_DEVICE_UNIFIED_MEMORY)) {
|
||||
allocationType = NEO::AllocationType::BUFFER;
|
||||
allocationType = NEO::AllocationType::buffer;
|
||||
} else if (type == static_cast<uint8_t>(InternalIpcMemoryType::IPC_HOST_UNIFIED_MEMORY)) {
|
||||
allocationType = NEO::AllocationType::BUFFER_HOST_MEMORY;
|
||||
allocationType = NEO::AllocationType::bufferHostMemory;
|
||||
} else {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
@@ -1083,7 +1083,7 @@ ze_result_t ContextImp::createPhysicalMem(ze_device_handle_t hDevice,
|
||||
NEO::AllocationProperties physicalDeviceMemoryProperties{neoDevice->getRootDeviceIndex(),
|
||||
true,
|
||||
desc->size,
|
||||
NEO::AllocationType::BUFFER,
|
||||
NEO::AllocationType::buffer,
|
||||
false,
|
||||
false,
|
||||
device->getNEODevice()->getDeviceBitfield()};
|
||||
|
||||
@@ -1261,7 +1261,7 @@ Device *Device::create(DriverHandle *driverHandle, NEO::Device *neoDevice, bool
|
||||
debugSurface = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(
|
||||
{device->getRootDeviceIndex(), true,
|
||||
debugSurfaceSize,
|
||||
NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA,
|
||||
NEO::AllocationType::debugContextSaveArea,
|
||||
false,
|
||||
false,
|
||||
device->getNEODevice()->getDeviceBitfield()});
|
||||
@@ -1465,7 +1465,7 @@ NEO::GraphicsAllocation *DeviceImp::allocateManagedMemoryFromHostPtr(void *buffe
|
||||
}
|
||||
|
||||
allocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(
|
||||
{getRootDeviceIndex(), false, size, NEO::AllocationType::BUFFER_HOST_MEMORY, false, neoDevice->getDeviceBitfield()},
|
||||
{getRootDeviceIndex(), false, size, NEO::AllocationType::bufferHostMemory, false, neoDevice->getDeviceBitfield()},
|
||||
buffer);
|
||||
|
||||
if (allocation == nullptr) {
|
||||
@@ -1485,7 +1485,7 @@ NEO::GraphicsAllocation *DeviceImp::allocateManagedMemoryFromHostPtr(void *buffe
|
||||
|
||||
NEO::GraphicsAllocation *DeviceImp::allocateMemoryFromHostPtr(const void *buffer, size_t size, bool hostCopyAllowed) {
|
||||
NEO::AllocationProperties properties = {getRootDeviceIndex(), false, size,
|
||||
NEO::AllocationType::EXTERNAL_HOST_PTR,
|
||||
NEO::AllocationType::externalHostPtr,
|
||||
false, neoDevice->getDeviceBitfield()};
|
||||
properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = true;
|
||||
auto allocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties,
|
||||
|
||||
@@ -596,7 +596,7 @@ void *DriverHandleImp::importFdHandle(NEO::Device *neoDevice,
|
||||
allocationType,
|
||||
neoDevice->getDeviceBitfield()};
|
||||
unifiedMemoryProperties.subDevicesBitfield = neoDevice->getDeviceBitfield();
|
||||
bool isHostIpcAllocation = (allocationType == NEO::AllocationType::BUFFER_HOST_MEMORY) ? true : false;
|
||||
bool isHostIpcAllocation = (allocationType == NEO::AllocationType::bufferHostMemory) ? true : false;
|
||||
NEO::GraphicsAllocation *alloc =
|
||||
this->getMemoryManager()->createGraphicsAllocationFromSharedHandle(osHandle,
|
||||
unifiedMemoryProperties,
|
||||
@@ -646,7 +646,7 @@ void *DriverHandleImp::importFdHandle(NEO::Device *neoDevice,
|
||||
void *DriverHandleImp::importFdHandles(NEO::Device *neoDevice, ze_ipc_memory_flags_t flags, const std::vector<NEO::osHandle> &handles, void *basePtr, NEO::GraphicsAllocation **pAlloc, NEO::SvmAllocationData &mappedPeerAllocData) {
|
||||
NEO::AllocationProperties unifiedMemoryProperties{neoDevice->getRootDeviceIndex(),
|
||||
MemoryConstants::pageSize,
|
||||
NEO::AllocationType::BUFFER,
|
||||
NEO::AllocationType::buffer,
|
||||
neoDevice->getDeviceBitfield()};
|
||||
unifiedMemoryProperties.subDevicesBitfield = neoDevice->getDeviceBitfield();
|
||||
|
||||
@@ -799,7 +799,7 @@ NEO::GraphicsAllocation *DriverHandleImp::getPeerAllocation(Device *device,
|
||||
peerPtr = this->importFdHandle(device->getNEODevice(),
|
||||
flags,
|
||||
handle,
|
||||
NEO::AllocationType::BUFFER,
|
||||
NEO::AllocationType::buffer,
|
||||
peerMapAddress,
|
||||
&alloc,
|
||||
allocDataInternal);
|
||||
@@ -834,9 +834,9 @@ NEO::GraphicsAllocation *DriverHandleImp::getPeerAllocation(Device *device,
|
||||
void *DriverHandleImp::importNTHandle(ze_device_handle_t hDevice, void *handle, NEO::AllocationType allocationType) {
|
||||
auto neoDevice = Device::fromHandle(hDevice)->getNEODevice();
|
||||
|
||||
bool isHostIpcAllocation = (allocationType == NEO::AllocationType::BUFFER_HOST_MEMORY) ? true : false;
|
||||
bool isHostIpcAllocation = (allocationType == NEO::AllocationType::bufferHostMemory) ? true : false;
|
||||
|
||||
auto alloc = this->getMemoryManager()->createGraphicsAllocationFromNTHandle(handle, neoDevice->getRootDeviceIndex(), NEO::AllocationType::SHARED_BUFFER);
|
||||
auto alloc = this->getMemoryManager()->createGraphicsAllocationFromNTHandle(handle, neoDevice->getRootDeviceIndex(), NEO::AllocationType::sharedBuffer);
|
||||
|
||||
if (alloc == nullptr) {
|
||||
return nullptr;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -110,7 +110,7 @@ NEO::GraphicsAllocation *HostPointerManager::createHostPointerAllocation(uint32_
|
||||
size_t size,
|
||||
const NEO::DeviceBitfield &deviceBitfield) {
|
||||
NEO::AllocationProperties properties = {rootDeviceIndex, false, size,
|
||||
NEO::AllocationType::EXTERNAL_HOST_PTR,
|
||||
NEO::AllocationType::externalHostPtr,
|
||||
false, deviceBitfield};
|
||||
properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = true;
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties,
|
||||
|
||||
@@ -87,14 +87,14 @@ ze_result_t EventPool::initialize(DriverHandle *driver, Context *context, uint32
|
||||
|
||||
initializeSizeParameters(numDevices, deviceHandles, *driverHandleImp, rootDeviceEnvironment);
|
||||
|
||||
NEO::AllocationType allocationType = isEventPoolTimestampFlagSet() ? NEO::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER
|
||||
: NEO::AllocationType::BUFFER_HOST_MEMORY;
|
||||
NEO::AllocationType allocationType = isEventPoolTimestampFlagSet() ? NEO::AllocationType::timestampPacketTagBuffer
|
||||
: NEO::AllocationType::bufferHostMemory;
|
||||
if (this->devices.size() > 1) {
|
||||
this->isDeviceEventPoolAllocation = false;
|
||||
}
|
||||
|
||||
if (this->isDeviceEventPoolAllocation) {
|
||||
allocationType = NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER;
|
||||
allocationType = NEO::AllocationType::gpuTimestampDeviceBuffer;
|
||||
}
|
||||
|
||||
eventPoolAllocations = std::make_unique<NEO::MultiGraphicsAllocation>(maxRootDeviceIndex);
|
||||
@@ -287,9 +287,9 @@ ze_result_t EventPool::openEventPoolIpcHandle(const ze_ipc_event_pool_handle_t &
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
NEO::AllocationType allocationType = NEO::AllocationType::BUFFER_HOST_MEMORY;
|
||||
NEO::AllocationType allocationType = NEO::AllocationType::bufferHostMemory;
|
||||
if (eventPool->isDeviceEventPoolAllocation) {
|
||||
allocationType = NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER;
|
||||
allocationType = NEO::AllocationType::gpuTimestampDeviceBuffer;
|
||||
}
|
||||
|
||||
NEO::AllocationProperties unifiedMemoryProperties{poolData.rootDeviceIndex,
|
||||
|
||||
@@ -81,7 +81,7 @@ ze_result_t ImageCoreFamily<gfxCoreFamily>::initialize(Device *device, const ze_
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
|
||||
}
|
||||
if (lookupTable.sharedHandleType.isDMABUFHandle) {
|
||||
NEO::AllocationProperties properties(device->getRootDeviceIndex(), true, &imgInfo, NEO::AllocationType::SHARED_IMAGE, device->getNEODevice()->getDeviceBitfield());
|
||||
NEO::AllocationProperties properties(device->getRootDeviceIndex(), true, &imgInfo, NEO::AllocationType::sharedImage, device->getNEODevice()->getDeviceBitfield());
|
||||
allocation = device->getNEODevice()->getMemoryManager()->createGraphicsAllocationFromSharedHandle(lookupTable.sharedHandleType.fd, properties, false, false, true, nullptr);
|
||||
device->getNEODevice()->getMemoryManager()->closeSharedHandle(allocation);
|
||||
} else if (lookupTable.sharedHandleType.isNTHandle) {
|
||||
@@ -89,11 +89,11 @@ ze_result_t ImageCoreFamily<gfxCoreFamily>::initialize(Device *device, const ze_
|
||||
if (!verifyResult) {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
allocation = device->getNEODevice()->getMemoryManager()->createGraphicsAllocationFromNTHandle(lookupTable.sharedHandleType.ntHnadle, device->getNEODevice()->getRootDeviceIndex(), NEO::AllocationType::SHARED_IMAGE);
|
||||
allocation = device->getNEODevice()->getMemoryManager()->createGraphicsAllocationFromNTHandle(lookupTable.sharedHandleType.ntHnadle, device->getNEODevice()->getRootDeviceIndex(), NEO::AllocationType::sharedImage);
|
||||
allocation->getDefaultGmm()->queryImageParams(imgInfo);
|
||||
}
|
||||
} else {
|
||||
NEO::AllocationProperties properties(device->getRootDeviceIndex(), true, &imgInfo, NEO::AllocationType::IMAGE, device->getNEODevice()->getDeviceBitfield());
|
||||
NEO::AllocationProperties properties(device->getRootDeviceIndex(), true, &imgInfo, NEO::AllocationType::image, device->getNEODevice()->getDeviceBitfield());
|
||||
|
||||
properties.flags.preferCompressed = isSuitableForCompression(lookupTable, imgInfo);
|
||||
|
||||
|
||||
@@ -899,7 +899,7 @@ NEO::GraphicsAllocation *KernelImp::allocatePrivateMemoryGraphicsAllocation() {
|
||||
|
||||
UNRECOVERABLE_IF(privateSurfaceSize == 0);
|
||||
auto privateMemoryGraphicsAllocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(
|
||||
{neoDevice->getRootDeviceIndex(), privateSurfaceSize, NEO::AllocationType::PRIVATE_SURFACE, neoDevice->getDeviceBitfield()});
|
||||
{neoDevice->getRootDeviceIndex(), privateSurfaceSize, NEO::AllocationType::privateSurface, neoDevice->getDeviceBitfield()});
|
||||
|
||||
UNRECOVERABLE_IF(privateMemoryGraphicsAllocation == nullptr);
|
||||
return privateMemoryGraphicsAllocation;
|
||||
@@ -953,7 +953,7 @@ ze_result_t KernelImp::initialize(const ze_kernel_desc_t *desc) {
|
||||
}
|
||||
UNRECOVERABLE_IF(!this->kernelImmData->getKernelInfo()->heapInfo.pKernelHeap);
|
||||
|
||||
if (isaAllocation->getAllocationType() == NEO::AllocationType::KERNEL_ISA_INTERNAL && this->kernelImmData->getIsaParentAllocation() == nullptr) {
|
||||
if (isaAllocation->getAllocationType() == NEO::AllocationType::kernelIsaInternal && this->kernelImmData->getIsaParentAllocation() == nullptr) {
|
||||
isaAllocation->setTbxWritable(true, std::numeric_limits<uint32_t>::max());
|
||||
isaAllocation->setAubWritable(true, std::numeric_limits<uint32_t>::max());
|
||||
NEO::MemoryTransferHelper::transferMemoryToAllocation(productHelper.isBlitCopyRequiredForLocalMemory(neoDevice->getRootDeviceEnvironment(), *isaAllocation),
|
||||
|
||||
@@ -15,7 +15,7 @@ bool CompressionSelector::preferCompressedAllocation(const AllocationProperties
|
||||
bool preferredCompression = false;
|
||||
int32_t compressionEnabled = debugManager.flags.EnableUsmCompression.get();
|
||||
if (compressionEnabled == 1) {
|
||||
if ((properties.allocationType == AllocationType::SVM_GPU) ||
|
||||
if ((properties.allocationType == AllocationType::svmGpu) ||
|
||||
(properties.flags.isUSMDeviceAllocation)) {
|
||||
preferredCompression = true;
|
||||
}
|
||||
|
||||
@@ -840,7 +840,7 @@ size_t ModuleImp::computeKernelIsaAllocationAlignedSizeWithPadding(size_t isaSiz
|
||||
}
|
||||
|
||||
NEO::GraphicsAllocation *ModuleImp::allocateKernelsIsaMemory(size_t size) {
|
||||
auto allocType = (this->type == ModuleType::Builtin ? NEO::AllocationType::KERNEL_ISA_INTERNAL : NEO::AllocationType::KERNEL_ISA);
|
||||
auto allocType = (this->type == ModuleType::Builtin ? NEO::AllocationType::kernelIsaInternal : NEO::AllocationType::kernelIsa);
|
||||
auto neoDevice = this->device->getNEODevice();
|
||||
return neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({neoDevice->getRootDeviceIndex(),
|
||||
size,
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace L0 {
|
||||
|
||||
NEO::GraphicsAllocation *PrintfHandler::createPrintfBuffer(Device *device) {
|
||||
NEO::AllocationProperties properties(
|
||||
device->getRootDeviceIndex(), PrintfHandler::printfBufferSize, NEO::AllocationType::PRINTF_SURFACE, device->getNEODevice()->getDeviceBitfield());
|
||||
device->getRootDeviceIndex(), PrintfHandler::printfBufferSize, NEO::AllocationType::printfSurface, device->getNEODevice()->getDeviceBitfield());
|
||||
properties.alignment = MemoryConstants::pageSize64k;
|
||||
auto allocation = device->getNEODevice()->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user