diff --git a/level_zero/core/source/cmdlist/cmdlist.cpp b/level_zero/core/source/cmdlist/cmdlist.cpp index 422d98055a..415bcf11e2 100644 --- a/level_zero/core/source/cmdlist/cmdlist.cpp +++ b/level_zero/core/source/cmdlist/cmdlist.cpp @@ -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(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); } diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index fac6695f6d..16d736a8b4 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -913,8 +913,8 @@ ze_result_t CommandListCoreFamily::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::appendLaunchKernel(builtinKernel->toHandle(), kernelArgs, event, numWaitEvents, phWaitEvents, launchParams, relaxedOrderingDispatch); addToMappedEventList(event); @@ -1193,9 +1193,9 @@ ze_result_t CommandListCoreFamily::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::appendLaunchKernelSplit(builtinKernel, dispatchKernelArgs, signalEvent, launchParams); } @@ -1720,8 +1720,8 @@ ze_result_t CommandListCoreFamily::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::appendLaunchKernel(builtinKernel->toHandle(), dispatchKernelArgs, signalEvent, numWaitEvents, phWaitEvents, launchParams, relaxedOrderingDispatch); } @@ -1787,8 +1787,8 @@ ze_result_t CommandListCoreFamily::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::appendLaunchKernel(builtinKernel->toHandle(), dispatchKernelArgs, signalEvent, numWaitEvents, @@ -1978,11 +1978,11 @@ ze_result_t CommandListCoreFamily::appendMemoryFill(void *ptr, builtinKernel->setGroupSize(static_cast(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::getAlignedAll return {0u, 0, nullptr, false}; } alignedPtr = static_cast(alignDown(alloc->getGpuAddress(), NEO::EncodeSurfaceState::getSurfaceBaseAddressAlignment())); - if (alloc->getAllocationType() == NEO::AllocationType::EXTERNAL_HOST_PTR) { + if (alloc->getAllocationType() == NEO::AllocationType::externalHostPtr) { auto hostAllocCpuPtr = reinterpret_cast(alloc->getUnderlyingBuffer()); hostAllocCpuPtr = alignDown(hostAllocCpuPtr, NEO::EncodeSurfaceState::getSurfaceBaseAddressAlignment()); auto allignedPtrOffset = sourcePtr - hostAllocCpuPtr; @@ -2301,7 +2301,7 @@ inline AlignedAllocationData CommandListCoreFamily::getAlignedAll template inline size_t CommandListCoreFamily::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::appendQueryKernelTimestamps( } size_t alignedSize = alignUp(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::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::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::addAdditionalSynchronization(*commandContainer.getCommandStream(), gpuAddress, true, rootDeviceEnvironment); } diff --git a/level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl b/level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl index fa439599e9..2d17e9a70f 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl @@ -208,7 +208,7 @@ ze_result_t CommandListCoreFamily::appendLaunchKernelWithParams(K if (allocation == nullptr) { continue; } - if (allocation->getAllocationType() == NEO::AllocationType::BUFFER_HOST_MEMORY) { + if (allocation->getAllocationType() == NEO::AllocationType::bufferHostMemory) { isKernelUsingSystemAllocation = true; } } diff --git a/level_zero/core/source/cmdlist/cmdlist_imp.cpp b/level_zero/core/source/cmdlist/cmdlist_imp.cpp index c8a1d6073b..fd002bf0fc 100644 --- a/level_zero/core/source/cmdlist/cmdlist_imp.cpp +++ b/level_zero/core/source/cmdlist/cmdlist_imp.cpp @@ -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); diff --git a/level_zero/core/source/cmdqueue/cmdqueue.cpp b/level_zero/core/source/cmdqueue/cmdqueue.cpp index 1e23451824..c7b9e9004a 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue.cpp +++ b/level_zero/core/source/cmdqueue/cmdqueue.cpp @@ -268,17 +268,17 @@ void CommandQueueImp::registerCsrClient() { ze_result_t CommandQueueImp::CommandBufferManager::initialize(Device *device, size_t sizeRequested) { size_t alignedSize = alignUp(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(alloc->getGpuAddress())); } diff --git a/level_zero/core/source/context/context_imp.cpp b/level_zero/core/source/context/context_imp.cpp index 2b80e7561b..ba0ab94ff1 100644 --- a/level_zero/core/source/context/context_imp.cpp +++ b/level_zero/core/source/context/context_imp.cpp @@ -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(InternalIpcMemoryType::IPC_DEVICE_UNIFIED_MEMORY)) { - allocationType = NEO::AllocationType::BUFFER; + allocationType = NEO::AllocationType::buffer; } else if (type == static_cast(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()}; diff --git a/level_zero/core/source/device/device_imp.cpp b/level_zero/core/source/device/device_imp.cpp index d808de0e9d..1516e5d1ce 100644 --- a/level_zero/core/source/device/device_imp.cpp +++ b/level_zero/core/source/device/device_imp.cpp @@ -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, diff --git a/level_zero/core/source/driver/driver_handle_imp.cpp b/level_zero/core/source/driver/driver_handle_imp.cpp index b726c5d944..dd23f3b521 100644 --- a/level_zero/core/source/driver/driver_handle_imp.cpp +++ b/level_zero/core/source/driver/driver_handle_imp.cpp @@ -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 &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; diff --git a/level_zero/core/source/driver/host_pointer_manager.cpp b/level_zero/core/source/driver/host_pointer_manager.cpp index 72f237340f..342cc6a7a6 100644 --- a/level_zero/core/source/driver/host_pointer_manager.cpp +++ b/level_zero/core/source/driver/host_pointer_manager.cpp @@ -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, diff --git a/level_zero/core/source/event/event.cpp b/level_zero/core/source/event/event.cpp index 0b07a98bd3..50d431aab5 100644 --- a/level_zero/core/source/event/event.cpp +++ b/level_zero/core/source/event/event.cpp @@ -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(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, diff --git a/level_zero/core/source/image/image_hw.inl b/level_zero/core/source/image/image_hw.inl index ed6040c7d1..4f840081c9 100644 --- a/level_zero/core/source/image/image_hw.inl +++ b/level_zero/core/source/image/image_hw.inl @@ -81,7 +81,7 @@ ze_result_t ImageCoreFamily::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::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); diff --git a/level_zero/core/source/kernel/kernel_imp.cpp b/level_zero/core/source/kernel/kernel_imp.cpp index 57bd59da3f..41b39e27f9 100644 --- a/level_zero/core/source/kernel/kernel_imp.cpp +++ b/level_zero/core/source/kernel/kernel_imp.cpp @@ -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::max()); isaAllocation->setAubWritable(true, std::numeric_limits::max()); NEO::MemoryTransferHelper::transferMemoryToAllocation(productHelper.isBlitCopyRequiredForLocalMemory(neoDevice->getRootDeviceEnvironment(), *isaAllocation), diff --git a/level_zero/core/source/memory_manager/compression_selector_l0.cpp b/level_zero/core/source/memory_manager/compression_selector_l0.cpp index 6795a6d8be..4ab30a0afc 100644 --- a/level_zero/core/source/memory_manager/compression_selector_l0.cpp +++ b/level_zero/core/source/memory_manager/compression_selector_l0.cpp @@ -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; } diff --git a/level_zero/core/source/module/module_imp.cpp b/level_zero/core/source/module/module_imp.cpp index aab7404b20..51c107a5d6 100644 --- a/level_zero/core/source/module/module_imp.cpp +++ b/level_zero/core/source/module/module_imp.cpp @@ -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, diff --git a/level_zero/core/source/printf_handler/printf_handler.cpp b/level_zero/core/source/printf_handler/printf_handler.cpp index 84175c947b..ec429d1fc0 100644 --- a/level_zero/core/source/printf_handler/printf_handler.cpp +++ b/level_zero/core/source/printf_handler/printf_handler.cpp @@ -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); diff --git a/level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.cpp b/level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.cpp index bda859262d..42b6c16ed2 100644 --- a/level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.cpp +++ b/level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.cpp @@ -195,7 +195,7 @@ void CommandListPrivateHeapsFixture::setUp() { for (uint32_t i = 0; i < storeAllocations; i++) { auto heapAllocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), true, 2 * MemoryConstants::megaByte, - NEO::AllocationType::LINEAR_STREAM, false, false, + NEO::AllocationType::linearStream, false, false, neoDevice->getDeviceBitfield()}); commandListImmediate->csr->getInternalAllocationStorage()->storeAllocation(std::unique_ptr(heapAllocation), REUSABLE_ALLOCATION); } @@ -247,7 +247,7 @@ void ImmediateCmdListSharedHeapsFixture::setUp() { for (uint32_t i = 0; i < storeAllocations; i++) { auto heapAllocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), true, 2 * MemoryConstants::megaByte, - NEO::AllocationType::LINEAR_STREAM, false, false, + NEO::AllocationType::linearStream, false, false, neoDevice->getDeviceBitfield()}); commandListImmediate->csr->getInternalAllocationStorage()->storeAllocation(std::unique_ptr(heapAllocation), REUSABLE_ALLOCATION); } diff --git a/level_zero/core/test/unit_tests/fixtures/memory_ipc_fixture.cpp b/level_zero/core/test/unit_tests/fixtures/memory_ipc_fixture.cpp index aaeba726cd..ea51981b23 100644 --- a/level_zero/core/test/unit_tests/fixtures/memory_ipc_fixture.cpp +++ b/level_zero/core/test/unit_tests/fixtures/memory_ipc_fixture.cpp @@ -318,7 +318,7 @@ NEO::GraphicsAllocation *MemoryManagerOpenIpcMock::allocateGraphicsMemoryWithPro auto gmmHelper = getGmmHelper(0); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); auto alloc = new IpcImplicitScalingMockGraphicsAllocation(properties.rootDeviceIndex, - NEO::AllocationType::BUFFER, + NEO::AllocationType::buffer, ptr, 0x1000, 0u, @@ -338,7 +338,7 @@ NEO::GraphicsAllocation *MemoryManagerOpenIpcMock::createGraphicsAllocationFromS auto gmmHelper = getGmmHelper(0); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); auto alloc = new IpcImplicitScalingMockGraphicsAllocation(properties.rootDeviceIndex, - NEO::AllocationType::BUFFER, + NEO::AllocationType::buffer, ptr, 0x1000, 0u, @@ -357,7 +357,7 @@ NEO::GraphicsAllocation *MemoryManagerOpenIpcMock::createGraphicsAllocationFromM auto gmmHelper = getGmmHelper(0); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); auto alloc = new IpcImplicitScalingMockGraphicsAllocation(properties.rootDeviceIndex, - NEO::AllocationType::BUFFER, + NEO::AllocationType::buffer, ptr, 0x1000, 0u, @@ -373,7 +373,7 @@ NEO::GraphicsAllocation *MemoryManagerOpenIpcMock::createGraphicsAllocationFromN auto gmmHelper = getGmmHelper(0); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); auto alloc = new IpcImplicitScalingMockGraphicsAllocation(0u, - NEO::AllocationType::BUFFER, + NEO::AllocationType::buffer, ptr, 0x1000, 0u, @@ -433,7 +433,7 @@ NEO::GraphicsAllocation *MemoryManagerIpcImplicitScalingMock::allocateGraphicsMe auto gmmHelper = getGmmHelper(0); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); auto alloc = new IpcImplicitScalingMockGraphicsAllocation(0u, - NEO::AllocationType::BUFFER, + NEO::AllocationType::buffer, ptr, 0x1000, 0u, @@ -450,7 +450,7 @@ NEO::GraphicsAllocation *MemoryManagerIpcImplicitScalingMock::allocateGraphicsMe auto gmmHelper = getGmmHelper(0); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); auto alloc = new IpcImplicitScalingMockGraphicsAllocation(0u, - NEO::AllocationType::BUFFER, + NEO::AllocationType::buffer, ptr, 0x1000, 0u, @@ -470,7 +470,7 @@ NEO::GraphicsAllocation *MemoryManagerIpcImplicitScalingMock::createGraphicsAllo auto gmmHelper = getGmmHelper(0); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); auto alloc = new IpcImplicitScalingMockGraphicsAllocation(0u, - NEO::AllocationType::BUFFER, + NEO::AllocationType::buffer, ptr, 0x1000, 0u, @@ -491,7 +491,7 @@ NEO::GraphicsAllocation *MemoryManagerIpcImplicitScalingMock::createGraphicsAllo auto gmmHelper = getGmmHelper(0); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); auto alloc = new IpcImplicitScalingMockGraphicsAllocation(0u, - NEO::AllocationType::BUFFER, + NEO::AllocationType::buffer, ptr, 0x1000, 0u, @@ -510,7 +510,7 @@ NEO::GraphicsAllocation *MemoryManagerIpcImplicitScalingMock::createGraphicsAllo auto gmmHelper = getGmmHelper(0); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); auto alloc = new IpcImplicitScalingMockGraphicsAllocation(0u, - NEO::AllocationType::BUFFER, + NEO::AllocationType::buffer, ptr, 0x1000, 0u, diff --git a/level_zero/core/test/unit_tests/fixtures/memory_ipc_fixture.h b/level_zero/core/test/unit_tests/fixtures/memory_ipc_fixture.h index 2f8b17fa82..c7aa2b9589 100644 --- a/level_zero/core/test/unit_tests/fixtures/memory_ipc_fixture.h +++ b/level_zero/core/test/unit_tests/fixtures/memory_ipc_fixture.h @@ -30,7 +30,7 @@ struct DriverHandleGetFdMock : public L0::DriverHandleImp { const int mockFd = 57; std::pair allocationMap; - NEO::AllocationType allocationTypeRequested = NEO::AllocationType::UNKNOWN; + NEO::AllocationType allocationTypeRequested = NEO::AllocationType::unknown; }; struct ContextFdMock : public L0::ContextImp { @@ -242,16 +242,16 @@ class IpcImplicitScalingMockGraphicsAllocation : public NEO::MemoryAllocation { using MemoryAllocation::usageInfos; IpcImplicitScalingMockGraphicsAllocation() - : NEO::MemoryAllocation(0, AllocationType::UNKNOWN, nullptr, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu) {} + : NEO::MemoryAllocation(0, AllocationType::unknown, nullptr, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu) {} IpcImplicitScalingMockGraphicsAllocation(void *buffer, size_t sizeIn) - : NEO::MemoryAllocation(0, AllocationType::UNKNOWN, buffer, castToUint64(buffer), 0llu, sizeIn, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount) {} + : NEO::MemoryAllocation(0, AllocationType::unknown, buffer, castToUint64(buffer), 0llu, sizeIn, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount) {} IpcImplicitScalingMockGraphicsAllocation(void *buffer, uint64_t gpuAddr, size_t sizeIn) - : NEO::MemoryAllocation(0, AllocationType::UNKNOWN, buffer, gpuAddr, 0llu, sizeIn, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount) {} + : NEO::MemoryAllocation(0, AllocationType::unknown, buffer, gpuAddr, 0llu, sizeIn, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount) {} IpcImplicitScalingMockGraphicsAllocation(uint32_t rootDeviceIndex, void *buffer, size_t sizeIn) - : NEO::MemoryAllocation(rootDeviceIndex, AllocationType::UNKNOWN, buffer, castToUint64(buffer), 0llu, sizeIn, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount) {} + : NEO::MemoryAllocation(rootDeviceIndex, AllocationType::unknown, buffer, castToUint64(buffer), 0llu, sizeIn, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount) {} uint32_t getNumHandles() override { return 2u; diff --git a/level_zero/core/test/unit_tests/fixtures/module_fixture.cpp b/level_zero/core/test/unit_tests/fixtures/module_fixture.cpp index 3badd91d19..fefb5301fc 100644 --- a/level_zero/core/test/unit_tests/fixtures/module_fixture.cpp +++ b/level_zero/core/test/unit_tests/fixtures/module_fixture.cpp @@ -35,7 +35,7 @@ ModuleImmutableDataFixture::MockImmutableData::MockImmutableData(uint32_t perHwT auto ptr = reinterpret_cast(0x1234); isaGraphicsAllocation.reset(new NEO::MockGraphicsAllocation(0, - NEO::AllocationType::KERNEL_ISA, + NEO::AllocationType::kernelIsa, ptr, 0x1000, 0u, @@ -229,7 +229,7 @@ ModuleWithZebinFixture::MockImmutableData::MockImmutableData(L0::Device *device) this->device = device; auto ptr = reinterpret_cast(0x1234); isaGraphicsAllocation.reset(new NEO::MockGraphicsAllocation(0, - NEO::AllocationType::KERNEL_ISA, + NEO::AllocationType::kernelIsa, ptr, 0x1000, 0u, @@ -250,7 +250,7 @@ void ModuleWithZebinFixture::MockModuleWithZebin::addSegments() { auto ptr = reinterpret_cast(0x1234); auto canonizedGpuAddress = castToUint64(ptr); translationUnit->globalVarBuffer = new NEO::MockGraphicsAllocation(0, - NEO::AllocationType::GLOBAL_SURFACE, + NEO::AllocationType::globalSurface, ptr, 0x1000, 0u, @@ -258,7 +258,7 @@ void ModuleWithZebinFixture::MockModuleWithZebin::addSegments() { MemoryManager::maxOsContextCount, canonizedGpuAddress); translationUnit->globalConstBuffer = new NEO::MockGraphicsAllocation(0, - NEO::AllocationType::GLOBAL_SURFACE, + NEO::AllocationType::globalSurface, ptr, 0x1000, 0u, diff --git a/level_zero/core/test/unit_tests/gen9/test_cmdlist_create_gen9.cpp b/level_zero/core/test/unit_tests/gen9/test_cmdlist_create_gen9.cpp index 76dbd61985..a47988a85c 100644 --- a/level_zero/core/test/unit_tests/gen9/test_cmdlist_create_gen9.cpp +++ b/level_zero/core/test/unit_tests/gen9/test_cmdlist_create_gen9.cpp @@ -61,7 +61,7 @@ class CommandListCreateGen9 : public DeviceFixture, public testing::Test { buffer = alignedMalloc(isaSize, 64); } auto allocation = new NEO::GraphicsAllocation(0, - NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::AllocationType::internalHostMemory, buffer, reinterpret_cast(buffer), 0, diff --git a/level_zero/core/test/unit_tests/mocks/mock_cmdlist.cpp b/level_zero/core/test/unit_tests/mocks/mock_cmdlist.cpp index a16ed157fb..b19583c0cd 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_cmdlist.cpp +++ b/level_zero/core/test/unit_tests/mocks/mock_cmdlist.cpp @@ -19,7 +19,7 @@ MockCommandList::MockCommandList(Device *device) : WhiteBox<::L0::CommandListImp size_t batchBufferSize = 65536u; batchBuffer = new uint8_t[batchBufferSize]; mockAllocation = new NEO::GraphicsAllocation(0, - NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::AllocationType::internalHostMemory, &batchBuffer, reinterpret_cast(&batchBuffer), 0, diff --git a/level_zero/core/test/unit_tests/mocks/mock_event.cpp b/level_zero/core/test/unit_tests/mocks/mock_event.cpp index e2257c0107..783b4cdd75 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_event.cpp +++ b/level_zero/core/test/unit_tests/mocks/mock_event.cpp @@ -12,7 +12,7 @@ namespace ult { Mock::Mock() : WhiteBox<::L0::Event>(nullptr, 0, nullptr), mockAllocation(0, - NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::AllocationType::internalHostMemory, &memory, reinterpret_cast(&memory), 0, diff --git a/level_zero/core/test/unit_tests/mocks/mock_event.h b/level_zero/core/test/unit_tests/mocks/mock_event.h index 24233decf7..0c77903c83 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_event.h +++ b/level_zero/core/test/unit_tests/mocks/mock_event.h @@ -112,7 +112,7 @@ class MockEvent : public ::L0::Event { MockEvent() : Event(nullptr, 0, nullptr) { mockAllocation.reset(new NEO::MockGraphicsAllocation(0, - NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, diff --git a/level_zero/core/test/unit_tests/mocks/mock_kernel.cpp b/level_zero/core/test/unit_tests/mocks/mock_kernel.cpp index 21db95f3dc..e1208622e9 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_kernel.cpp +++ b/level_zero/core/test/unit_tests/mocks/mock_kernel.cpp @@ -27,7 +27,7 @@ Mock<::L0::KernelImp>::Mock() : BaseClass() { this->kernelImmData = &immutableData; auto allocation = new NEO::GraphicsAllocation(0, - NEO::AllocationType::KERNEL_ISA, + NEO::AllocationType::kernelIsa, nullptr, 0, 0, diff --git a/level_zero/core/test/unit_tests/os_interface/linux/cmdqueue_linux_tests.cpp b/level_zero/core/test/unit_tests/os_interface/linux/cmdqueue_linux_tests.cpp index 635262eb7a..5579b9eedd 100644 --- a/level_zero/core/test/unit_tests/os_interface/linux/cmdqueue_linux_tests.cpp +++ b/level_zero/core/test/unit_tests/os_interface/linux/cmdqueue_linux_tests.cpp @@ -55,7 +55,7 @@ HWTEST2_F(CommandQueueLinuxTests, givenExecBufferErrorOnXeHpcWhenExecutingComman EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue); Mock kernel; kernel.immutableData.isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::kernelIsa, neoDevice->getDeviceBitfield()})); kernel.immutableData.device = device; auto commandList = std::unique_ptr(CommandList::whiteboxCast(CommandList::create(productFamily, device, NEO::EngineGroupType::renderCompute, 0u, returnValue))); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp index 2e0d53be60..69cf785b64 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp @@ -317,7 +317,7 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenPageFaultCopyCalledThenappendPa auto gmmHelper = device->getNEODevice()->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); NEO::MockGraphicsAllocation mockAllocationSrc(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -325,7 +325,7 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenPageFaultCopyCalledThenappendPa MemoryManager::maxOsContextCount, canonizedGpuAddress); NEO::MockGraphicsAllocation mockAllocationDst(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -345,7 +345,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledWithCopyEngi auto gmmHelper = device->getNEODevice()->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); NEO::MockGraphicsAllocation mockAllocationSrc(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -353,7 +353,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledWithCopyEngi MemoryManager::maxOsContextCount, canonizedGpuAddress); NEO::MockGraphicsAllocation mockAllocationDst(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -372,7 +372,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledThenappendPa auto gmmHelper = device->getNEODevice()->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); NEO::MockGraphicsAllocation mockAllocationSrc(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -380,7 +380,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledThenappendPa MemoryManager::maxOsContextCount, canonizedGpuAddress); NEO::MockGraphicsAllocation mockAllocationDst(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -400,7 +400,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledAndErrorOnMi auto gmmHelper = device->getNEODevice()->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); NEO::MockGraphicsAllocation mockAllocationSrc(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -408,7 +408,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledAndErrorOnMi MemoryManager::maxOsContextCount, canonizedGpuAddress); NEO::MockGraphicsAllocation mockAllocationDst(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -428,7 +428,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledWithCopyEngi auto gmmHelper = device->getNEODevice()->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); NEO::MockGraphicsAllocation mockAllocationSrc(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -436,7 +436,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledWithCopyEngi MemoryManager::maxOsContextCount, canonizedGpuAddress); NEO::MockGraphicsAllocation mockAllocationDst(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -455,7 +455,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledWithCopyEngi auto gmmHelper = device->getNEODevice()->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); NEO::MockGraphicsAllocation mockAllocationSrc(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -463,7 +463,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledWithCopyEngi MemoryManager::maxOsContextCount, canonizedGpuAddress); NEO::MockGraphicsAllocation mockAllocationDst(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -482,7 +482,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhen4GBytePageFaultCopyCalledThenPa auto gmmHelper = device->getNEODevice()->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); NEO::MockGraphicsAllocation mockAllocationSrc(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -490,7 +490,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhen4GBytePageFaultCopyCalledThenPa MemoryManager::maxOsContextCount, canonizedGpuAddress); NEO::MockGraphicsAllocation mockAllocationDst(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -510,7 +510,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhen4GBytePageFaultCopyCalledThenPa auto gmmHelper = device->getNEODevice()->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); NEO::MockGraphicsAllocation mockAllocationSrc(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -518,7 +518,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhen4GBytePageFaultCopyCalledThenPa MemoryManager::maxOsContextCount, canonizedGpuAddress); NEO::MockGraphicsAllocation mockAllocationDst(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -1102,7 +1102,7 @@ HWTEST2_F(CommandListCreate, givenCopyCommandListWhenCopyRegionWithinMaxBlitSize auto gmmHelper = device->getNEODevice()->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); NEO::MockGraphicsAllocation mockAllocationSrc(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -1110,7 +1110,7 @@ HWTEST2_F(CommandListCreate, givenCopyCommandListWhenCopyRegionWithinMaxBlitSize MemoryManager::maxOsContextCount, canonizedGpuAddress); NEO::MockGraphicsAllocation mockAllocationDst(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -1151,7 +1151,7 @@ HWTEST2_F(CommandListCreate, givenCopyCommandListWhenCopyRegionWithinMaxBlitSize auto gmmHelper = device->getNEODevice()->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); NEO::MockGraphicsAllocation mockAllocationSrc(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -1159,7 +1159,7 @@ HWTEST2_F(CommandListCreate, givenCopyCommandListWhenCopyRegionWithinMaxBlitSize MemoryManager::maxOsContextCount, canonizedGpuAddress); NEO::MockGraphicsAllocation mockAllocationDst(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -1199,7 +1199,7 @@ HWTEST2_F(CommandListCreate, givenCopyCommandListWhenCopyRegionGreaterThanMaxBli auto gmmHelper = device->getNEODevice()->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); NEO::MockGraphicsAllocation mockAllocationSrc(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -1207,7 +1207,7 @@ HWTEST2_F(CommandListCreate, givenCopyCommandListWhenCopyRegionGreaterThanMaxBli MemoryManager::maxOsContextCount, canonizedGpuAddress); NEO::MockGraphicsAllocation mockAllocationDst(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -1253,7 +1253,7 @@ class MockCommandListForRegionSize : public WhiteBox<::L0::CommandListCoreFamily Vec3 srcSize = {0, 0, 0}; Vec3 dstSize = {0, 0, 0}; NEO::MockGraphicsAllocation mockAllocationPtr = {0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, reinterpret_cast(0x1234), 1, 0u, @@ -1332,7 +1332,7 @@ HWTEST2_F(CommandListAppendMemoryCopyBlit, whenAppendMemoryCopyBlitIsAppendedAnd auto gmmHelper = device->getNEODevice()->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); NEO::MockGraphicsAllocation mockAllocationSrc(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, @@ -1341,7 +1341,7 @@ HWTEST2_F(CommandListAppendMemoryCopyBlit, whenAppendMemoryCopyBlitIsAppendedAnd canonizedGpuAddress); void *srcPtr = reinterpret_cast(mockAllocationSrc.getGpuAddress()); NEO::MockGraphicsAllocation mockAllocationDst(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp index 5392f77cf8..69f047b20f 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp @@ -1443,7 +1443,7 @@ class MyDeviceMock : public MockDeviceImp { }; HWTEST2_F(CommandListCreate, givenHostPtrAllocAllocWhenInternalMemCreatedThenNewAllocAddedToDealocationContainer, IsAtLeastSkl) { - auto myDevice = std::make_unique>(device->getNEODevice(), execEnv); + auto myDevice = std::make_unique>(device->getNEODevice(), execEnv); myDevice->neoDevice = device->getNEODevice(); auto commandList = std::make_unique>>(); commandList->initialize(myDevice.get(), NEO::EngineGroupType::copy, 0u); @@ -1458,7 +1458,7 @@ HWTEST2_F(CommandListCreate, givenHostPtrAllocAllocWhenInternalMemCreatedThenNew } HWTEST2_F(CommandListCreate, givenHostPtrAllocAllocWhenExternalMemCreatedThenNewAllocAddedToHostPtrMap, IsAtLeastSkl) { - auto myDevice = std::make_unique>(device->getNEODevice(), execEnv); + auto myDevice = std::make_unique>(device->getNEODevice(), execEnv); myDevice->neoDevice = device->getNEODevice(); auto commandList = std::make_unique>>(); commandList->initialize(myDevice.get(), NEO::EngineGroupType::copy, 0u); @@ -1473,7 +1473,7 @@ HWTEST2_F(CommandListCreate, givenHostPtrAllocAllocWhenExternalMemCreatedThenNew } HWTEST2_F(CommandListCreateWithBcs, givenHostPtrAllocAllocAndImmediateCmdListWhenExternalMemCreatedThenNewAllocAddedToInternalAllocationStorage, IsAtLeastSkl) { - auto myDevice = std::make_unique>(device->getNEODevice(), execEnv); + auto myDevice = std::make_unique>(device->getNEODevice(), execEnv); myDevice->neoDevice = device->getNEODevice(); auto commandList = std::make_unique>>(); commandList->initialize(myDevice.get(), NEO::EngineGroupType::copy, 0u); @@ -1494,7 +1494,7 @@ HWTEST2_F(CommandListCreateWithBcs, givenHostPtrAllocAllocAndImmediateCmdListWhe } HWTEST2_F(CommandListCreate, givenGetAlignedAllocationWhenInternalMemWithinDifferentAllocThenReturnNewAlloc, IsAtLeastSkl) { - auto myDevice = std::make_unique>(device->getNEODevice(), execEnv); + auto myDevice = std::make_unique>(device->getNEODevice(), execEnv); myDevice->neoDevice = device->getNEODevice(); auto commandList = std::make_unique>>(); commandList->initialize(myDevice.get(), NEO::EngineGroupType::copy, 0u); @@ -1508,7 +1508,7 @@ HWTEST2_F(CommandListCreate, givenGetAlignedAllocationWhenInternalMemWithinDiffe commandList->commandContainer.getDeallocationContainer().clear(); } HWTEST2_F(CommandListCreate, givenGetAlignedAllocationWhenExternalMemWithinDifferentAllocThenReturnPreviouslyAllocatedMem, IsAtLeastSkl) { - auto myDevice = std::make_unique>(device->getNEODevice(), execEnv); + auto myDevice = std::make_unique>(device->getNEODevice(), execEnv); myDevice->neoDevice = device->getNEODevice(); auto commandList = std::make_unique>>(); commandList->initialize(myDevice.get(), NEO::EngineGroupType::copy, 0u); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp index 9223eecb42..add9c39472 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp @@ -384,10 +384,10 @@ HWTEST_F(CommandListImmediateFlushTaskComputeTests, givenUseCsrImmediateSubmissi NEO::debugManager.flags.EnableFlushTaskSubmission.set(1); size_t size = 0x100000001; - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::internalHostMemory, reinterpret_cast(0x1234), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::internalHostMemory, reinterpret_cast(0x100003456), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); ze_command_queue_desc_t queueDesc = {}; @@ -408,10 +408,10 @@ HWTEST_F(CommandListImmediateFlushTaskComputeTests, givenBindlessModeAndUseCsrIm neoDevice->getDeviceBitfield()); size_t size = 0x100000001; - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::internalHostMemory, reinterpret_cast(0x1234), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::internalHostMemory, reinterpret_cast(0x100003456), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); ze_command_queue_desc_t queueDesc = {}; diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_5.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_5.cpp index 648af9527e..a96ba9524d 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_5.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_5.cpp @@ -90,7 +90,7 @@ HWTEST2_F(AppendQueryKernelTimestamps, givenCommandListWhenAppendQueryKernelTime containsDstPtr = true; } if (residentGfxAlloc->getAllocationType() == - NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER) { + NEO::AllocationType::gpuTimestampDeviceBuffer) { gpuTimeStampAlloc = true; } } diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp index 2e176079e7..32678a44e4 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp @@ -1711,7 +1711,7 @@ HWTEST2_F(InOrderCmdListTests, givenImmediateCmdListWhenDispatchingWithRegularEv auto result = context->allocDeviceMem(device->toHandle(), &deviceDesc, 16384u, 4096u, &alloc); ASSERT_EQ(result, ZE_RESULT_SUCCESS); - NEO::MockGraphicsAllocation mockAllocation(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocation(0, NEO::AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); @@ -1803,7 +1803,7 @@ HWTEST2_F(InOrderCmdListTests, givenNonInOrderCmdListWhenPassingCounterBasedEven auto result = context->allocDeviceMem(device->toHandle(), &deviceDesc, 16384u, 4096u, &alloc); ASSERT_EQ(result, ZE_RESULT_SUCCESS); - NEO::MockGraphicsAllocation mockAllocation(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocation(0, NEO::AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); @@ -2075,11 +2075,11 @@ HWTEST2_F(InOrderCmdListTests, givenDebugFlagSetWhenDispatchingThenEnsureHostAll EXPECT_NE(nullptr, immCmdList2->inOrderExecInfo->getHostCounterAllocation()); EXPECT_NE(&immCmdList2->inOrderExecInfo->getDeviceCounterAllocation(), immCmdList2->inOrderExecInfo->getHostCounterAllocation()); - EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, immCmdList1->inOrderExecInfo->getHostCounterAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::bufferHostMemory, immCmdList1->inOrderExecInfo->getHostCounterAllocation()->getAllocationType()); EXPECT_EQ(immCmdList1->inOrderExecInfo->getBaseHostAddress(), immCmdList1->inOrderExecInfo->getHostCounterAllocation()->getUnderlyingBuffer()); EXPECT_FALSE(immCmdList1->inOrderExecInfo->getHostCounterAllocation()->isAllocatedInLocalMemoryPool()); - EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, immCmdList2->inOrderExecInfo->getHostCounterAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::bufferHostMemory, immCmdList2->inOrderExecInfo->getHostCounterAllocation()->getAllocationType()); EXPECT_EQ(immCmdList2->inOrderExecInfo->getBaseHostAddress(), immCmdList2->inOrderExecInfo->getHostCounterAllocation()->getUnderlyingBuffer()); EXPECT_FALSE(immCmdList2->inOrderExecInfo->getHostCounterAllocation()->isAllocatedInLocalMemoryPool()); @@ -2113,7 +2113,7 @@ HWTEST2_F(InOrderCmdListTests, givenInOrderModeWhenDispatchingThenHandleDependen auto immCmdList = createImmCmdList(); EXPECT_NE(nullptr, immCmdList->inOrderExecInfo.get()); - EXPECT_EQ(AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, immCmdList->inOrderExecInfo->getDeviceCounterAllocation().getAllocationType()); + EXPECT_EQ(AllocationType::timestampPacketTagBuffer, immCmdList->inOrderExecInfo->getDeviceCounterAllocation().getAllocationType()); EXPECT_EQ(0u, immCmdList->inOrderExecInfo->getCounterValue()); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_blit.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_blit.cpp index c3a72c60ae..e5c131c3d7 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_blit.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_blit.cpp @@ -49,7 +49,7 @@ class MockDriverHandle : public L0::DriverHandleImp { bool findAllocationDataForRange(const void *buffer, size_t size, NEO::SvmAllocationData *&allocData) override { - mockAllocation.reset(new NEO::MockGraphicsAllocation(rootDeviceIndex, NEO::AllocationType::INTERNAL_HOST_MEMORY, + mockAllocation.reset(new NEO::MockGraphicsAllocation(rootDeviceIndex, NEO::AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount)); data.gpuAllocations.addAllocation(mockAllocation.get()); @@ -119,7 +119,7 @@ HWTEST2_F(AppendMemoryCopy, auto gpuAllocation = device->getDriverHandle()->findHostPointerAllocation(hostPointer.get(), size, 0); ASSERT_NE(nullptr, gpuAllocation); - EXPECT_EQ(NEO::AllocationType::EXTERNAL_HOST_PTR, gpuAllocation->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::externalHostPtr, gpuAllocation->getAllocationType()); MockCommandListForMemFill commandList; commandList.initialize(device, NEO::EngineGroupType::copy, 0u); @@ -202,10 +202,10 @@ HWTEST2_F(AppendMemoryCopy, givenCopyOnlyCommandListThenDcFlushIsNotAddedAfterBl uint64_t srcOffset = 0x101; uint64_t dstOffset = 0x201; uint64_t copySize = 0x301; - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::internalHostMemory, reinterpret_cast(srcPtr), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::internalHostMemory, reinterpret_cast(dstPtr), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); commandList->appendMemoryCopyBlit(ptrOffset(dstPtr, dstOffset), &mockAllocationDst, 0, ptrOffset(srcPtr, srcOffset), &mockAllocationSrc, 0, copySize); @@ -239,10 +239,10 @@ HWTEST2_F(AppendMemoryCopy, givenCopyCommandListWhenTimestampPassedToMemoryCopyR ze_copy_region_t srcRegion = {4, 4, 4, 2, 2, 2}; ze_copy_region_t dstRegion = {4, 4, 4, 2, 2, 2}; - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); @@ -300,10 +300,10 @@ HWTEST2_F(AppendMemoryCopy, givenCopyCommandListWhenTimestampPassedToImageCopyBl EXPECT_EQ(ZE_RESULT_SUCCESS, result); auto event = std::unique_ptr(L0::Event::create(eventPool.get(), &eventDesc, device)); - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); diff --git a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp index d9cac6e634..f4007d7a31 100644 --- a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp @@ -1113,8 +1113,8 @@ HWTEST2_F(ExecuteCommandListTests, givenExecuteCommandListWhenItReturnsThenConta commandList->close(); void *alloc = alignedMalloc(0x100, 0x100); - NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); - NEO::GraphicsAllocation graphicsAllocation2(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); + NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::buffer, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); + NEO::GraphicsAllocation graphicsAllocation2(0, NEO::AllocationType::buffer, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation1); commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation2); @@ -1212,8 +1212,8 @@ HWTEST2_F(CommandQueueDestroy, givenCommandQueueAndCommandListWithSshAndScratchW commandList->close(); void *alloc = alignedMalloc(0x100, 0x100); - NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); - NEO::GraphicsAllocation graphicsAllocation2(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); + NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::buffer, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); + NEO::GraphicsAllocation graphicsAllocation2(0, NEO::AllocationType::buffer, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation1); commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation2); @@ -1239,8 +1239,8 @@ HWTEST2_F(CommandQueueDestroy, givenCommandQueueAndCommandListWithSshAndPrivateS commandList->close(); void *alloc = alignedMalloc(0x100, 0x100); - NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); - NEO::GraphicsAllocation graphicsAllocation2(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); + NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::buffer, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); + NEO::GraphicsAllocation graphicsAllocation2(0, NEO::AllocationType::buffer, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation1); commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation2); @@ -1314,8 +1314,8 @@ HWTEST2_F(ExecuteCommandListTests, givenFailingSubmitBatchBufferThenResetGraphic commandList->close(); void *alloc = alignedMalloc(0x100, 0x100); - NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); - NEO::GraphicsAllocation graphicsAllocation2(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); + NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::buffer, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); + NEO::GraphicsAllocation graphicsAllocation2(0, NEO::AllocationType::buffer, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); commandList->commandContainer.addToResidencyContainer(&graphicsAllocation1); commandList->commandContainer.addToResidencyContainer(&graphicsAllocation2); static_cast *>(csr)->taskCount = 0; @@ -1345,8 +1345,8 @@ HWTEST2_F(ExecuteCommandListTests, givenFailingSubmitBatchBufferThenResetGraphic commandList->close(); void *alloc = alignedMalloc(0x100, 0x100); - NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); - NEO::GraphicsAllocation graphicsAllocation2(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); + NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::buffer, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); + NEO::GraphicsAllocation graphicsAllocation2(0, NEO::AllocationType::buffer, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); commandList->commandContainer.addToResidencyContainer(&graphicsAllocation1); commandList->commandContainer.addToResidencyContainer(&graphicsAllocation2); static_cast *>(csr)->taskCount = 2; diff --git a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_2.cpp b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_2.cpp index f582b8ea42..8ab1aefd4f 100644 --- a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_2.cpp @@ -716,7 +716,7 @@ TEST_F(CommandQueueInitTests, givenMultipleSubDevicesWhenInitializingThenAllocat uint32_t cmdBufferAllocationsFound = 0; for (auto &allocationProperties : memoryManager->storedAllocationProperties) { - if (allocationProperties.allocationType == NEO::AllocationType::COMMAND_BUFFER) { + if (allocationProperties.allocationType == NEO::AllocationType::commandBuffer) { cmdBufferAllocationsFound++; EXPECT_EQ(expectedBitfield, allocationProperties.subDevicesBitfield.to_ulong()); EXPECT_EQ(1u, allocationProperties.flags.multiOsContextCapable); @@ -875,12 +875,12 @@ HWTEST2_F(CommandQueueScratchTests, givenCommandQueueWhenHandleScratchSpaceThenP NEO::HeapContainer heapContainer; void *surfaceHeap = alignedMalloc(0x1000, 0x1000); - NEO::GraphicsAllocation graphicsAllocationHeap(0, NEO::AllocationType::BUFFER, surfaceHeap, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); + NEO::GraphicsAllocation graphicsAllocationHeap(0, NEO::AllocationType::buffer, surfaceHeap, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); heapContainer.push_back(&graphicsAllocationHeap); bool gsbaStateDirty = false; bool frontEndStateDirty = false; - NEO::GraphicsAllocation graphicsAllocation(1u, NEO::AllocationType::BUFFER, nullptr, 0u, 0u, 0u, MemoryPool::System4KBPages, 0u); + NEO::GraphicsAllocation graphicsAllocation(1u, NEO::AllocationType::buffer, nullptr, 0u, 0u, 0u, MemoryPool::System4KBPages, 0u); auto scratch = static_cast(scratchController.get()); scratch->scratchAllocation = &graphicsAllocation; @@ -934,7 +934,7 @@ HWTEST2_F(CommandQueueScratchTests, givenCommandQueueWhenHandleScratchSpaceAndHe bool gsbaStateDirty = false; bool frontEndStateDirty = false; - NEO::GraphicsAllocation graphicsAllocation(1u, NEO::AllocationType::BUFFER, nullptr, 0u, 0u, 0u, MemoryPool::System4KBPages, 0u); + NEO::GraphicsAllocation graphicsAllocation(1u, NEO::AllocationType::buffer, nullptr, 0u, 0u, 0u, MemoryPool::System4KBPages, 0u); auto scratch = static_cast(scratchController.get()); scratch->scratchAllocation = &graphicsAllocation; diff --git a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_3.cpp b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_3.cpp index 5372e0ee7f..018162f877 100644 --- a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_3.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_3.cpp @@ -959,7 +959,7 @@ HWTEST_F(CommandQueueTest, givenCommandQueueWhenPerformMigrationIsTrueAndAllocat returnValue); ResidencyContainer container; MockGraphicsAllocation mockGA; - mockGA.allocationType = NEO::AllocationType::SVM_GPU; + mockGA.allocationType = NEO::AllocationType::svmGpu; container.push_back(&mockGA); commandQueue->makeResidentAndMigrate(true, container); EXPECT_EQ(mockPageFaultManager->moveAllocationToGpuDomainCalled, 1); @@ -984,7 +984,7 @@ HWTEST_F(CommandQueueTest, givenCommandQueueWhenPerformMigrationIsTrueAndAllocat returnValue); ResidencyContainer container; MockGraphicsAllocation mockGA; - mockGA.allocationType = NEO::AllocationType::SVM_CPU; + mockGA.allocationType = NEO::AllocationType::svmCpu; container.push_back(&mockGA); commandQueue->makeResidentAndMigrate(true, container); EXPECT_EQ(mockPageFaultManager->moveAllocationToGpuDomainCalled, 1); @@ -1009,7 +1009,7 @@ HWTEST_F(CommandQueueTest, givenCommandQueueWhenPerformMigrationIsTrueAndAllocat returnValue); ResidencyContainer container; MockGraphicsAllocation mockGA; - mockGA.allocationType = NEO::AllocationType::TAG_BUFFER; + mockGA.allocationType = NEO::AllocationType::tagBuffer; container.push_back(&mockGA); commandQueue->makeResidentAndMigrate(true, container); EXPECT_EQ(mockPageFaultManager->moveAllocationToGpuDomainCalled, 0); diff --git a/level_zero/core/test/unit_tests/sources/context/test_context_drm.cpp b/level_zero/core/test/unit_tests/sources/context/test_context_drm.cpp index a0fa551b6d..1e9111030f 100644 --- a/level_zero/core/test/unit_tests/sources/context/test_context_drm.cpp +++ b/level_zero/core/test/unit_tests/sources/context/test_context_drm.cpp @@ -54,7 +54,7 @@ TEST_F(GetMemHandlePtrTest, whenCallingGetMemHandlePtrWithValidHandleThenSuccess // Test Successfully returning fd Handle fixtureMemoryManager->ntHandle = false; - EXPECT_NE(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::BUFFER, 0)); + EXPECT_NE(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::buffer, 0)); } TEST_F(GetMemHandlePtrTest, whenCallingGetMemHandlePtrWithInvalidHandleThenNullptrIsReturned) { @@ -66,7 +66,7 @@ TEST_F(GetMemHandlePtrTest, whenCallingGetMemHandlePtrWithInvalidHandleThenNullp // Test Failing returning fd Handle fixtureMemoryManager->ntHandle = false; - EXPECT_EQ(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::BUFFER, 0)); + EXPECT_EQ(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::buffer, 0)); } } // namespace ult diff --git a/level_zero/core/test/unit_tests/sources/context/test_context_drm_or_wddm.cpp b/level_zero/core/test/unit_tests/sources/context/test_context_drm_or_wddm.cpp index 8fdd872abc..f33396ba18 100644 --- a/level_zero/core/test/unit_tests/sources/context/test_context_drm_or_wddm.cpp +++ b/level_zero/core/test/unit_tests/sources/context/test_context_drm_or_wddm.cpp @@ -67,7 +67,7 @@ TEST_F(GetMemHandlePtrTest, whenCallingGetMemHandlePtrWithValidNTHandleThenSucce // Test Successfully returning NT Handle fixtureMemoryManager->ntHandle = true; - EXPECT_NE(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::BUFFER, 0)); + EXPECT_NE(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::buffer, 0)); } TEST_F(GetMemHandlePtrTest, whenCallingGetMemHandlePtrWithInvalidHandleThenNullptrIsReturned) { @@ -79,11 +79,11 @@ TEST_F(GetMemHandlePtrTest, whenCallingGetMemHandlePtrWithInvalidHandleThenNullp // Test Failing returning NT Handle fixtureMemoryManager->ntHandle = true; - EXPECT_EQ(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::BUFFER, 0)); + EXPECT_EQ(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::buffer, 0)); // Test Failing returning fd Handle fixtureMemoryManager->ntHandle = false; - EXPECT_EQ(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::BUFFER, 0)); + EXPECT_EQ(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::buffer, 0)); } TEST_F(GetMemHandlePtrTest, whenCallingGetMemHandlePtrWithDRMDriverTypeWithNonNTHandleThenSuccessIsReturned) { @@ -94,7 +94,7 @@ TEST_F(GetMemHandlePtrTest, whenCallingGetMemHandlePtrWithDRMDriverTypeWithNonNT // Test Successfully returning fd Handle fixtureMemoryManager->ntHandle = false; - EXPECT_NE(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::BUFFER, 0)); + EXPECT_NE(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::buffer, 0)); } TEST_F(GetMemHandlePtrTest, whenCallingGetMemHandlePtrWithWDDMDriverTypeWithNonNTHandleThenNullPtrIsReturned) { @@ -105,7 +105,7 @@ TEST_F(GetMemHandlePtrTest, whenCallingGetMemHandlePtrWithWDDMDriverTypeWithNonN // Test Successfully returning fd Handle fixtureMemoryManager->ntHandle = false; - EXPECT_EQ(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::BUFFER, 0)); + EXPECT_EQ(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::buffer, 0)); } } // namespace ult diff --git a/level_zero/core/test/unit_tests/sources/context/test_context_wddm.cpp b/level_zero/core/test/unit_tests/sources/context/test_context_wddm.cpp index 140984bd46..041131ed8b 100644 --- a/level_zero/core/test/unit_tests/sources/context/test_context_wddm.cpp +++ b/level_zero/core/test/unit_tests/sources/context/test_context_wddm.cpp @@ -54,7 +54,7 @@ TEST_F(GetMemHandlePtrTest, whenCallingGetMemHandlePtrWithValidHandleThenSuccess // Test Successfully returning NT Handle fixtureMemoryManager->ntHandle = true; - EXPECT_NE(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::BUFFER, 0)); + EXPECT_NE(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::buffer, 0)); } TEST_F(GetMemHandlePtrTest, whenCallingGetMemHandlePtrWithInvalidHandleThenNullptrIsReturned) { @@ -66,7 +66,7 @@ TEST_F(GetMemHandlePtrTest, whenCallingGetMemHandlePtrWithInvalidHandleThenNullp // Test Failing returning NT Handle fixtureMemoryManager->ntHandle = true; - EXPECT_EQ(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::BUFFER, 0)); + EXPECT_EQ(nullptr, context->getMemHandlePtr(device, handle, NEO::AllocationType::buffer, 0)); } } // namespace ult diff --git a/level_zero/core/test/unit_tests/sources/debugger/l0_debugger_fixture.h b/level_zero/core/test/unit_tests/sources/debugger/l0_debugger_fixture.h index ba60632869..4ce5f3c5e8 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/l0_debugger_fixture.h +++ b/level_zero/core/test/unit_tests/sources/debugger/l0_debugger_fixture.h @@ -92,7 +92,7 @@ struct L0DebuggerHwFixture : public L0DebuggerFixture { } NEO::GraphicsAllocation *allocateIsaMemory(size_t size, bool internal) { - auto allocType = (internal ? NEO::AllocationType::KERNEL_ISA_INTERNAL : NEO::AllocationType::KERNEL_ISA); + auto allocType = (internal ? NEO::AllocationType::kernelIsaInternal : NEO::AllocationType::kernelIsa); return neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({neoDevice->getRootDeviceIndex(), size, allocType, neoDevice->getDeviceBitfield()}); } diff --git a/level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp b/level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp index 0d24f84577..50ec4d5277 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp @@ -230,7 +230,7 @@ TEST_F(L0DebuggerLinuxTest, whenRegisterElfAndLinkWithAllocationIsCalledThenItRe NEO::DebugData debugData; debugData.vIsa = "01234567890"; debugData.vIsaSize = 10; - MockDrmAllocation isaAllocation(rootDeviceIndex, AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); + MockDrmAllocation isaAllocation(rootDeviceIndex, AllocationType::kernelIsa, MemoryPool::System4KBPages); MockBufferObject bo(rootDeviceIndex, drmMock, 3, 0, 0, 1); isaAllocation.bufferObjects[0] = &bo; device->getL0Debugger()->registerElfAndLinkWithAllocation(&debugData, &isaAllocation); @@ -250,7 +250,7 @@ TEST_F(L0DebuggerLinuxTest, whenRegisterElfAndLinkWithAllocationIsCalledInAlloca NEO::DebugData debugData; debugData.vIsa = "01234567890"; debugData.vIsaSize = 10; - MockDrmAllocation isaAllocation(rootDeviceIndex, AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); + MockDrmAllocation isaAllocation(rootDeviceIndex, AllocationType::kernelIsa, MemoryPool::System4KBPages); device->getL0Debugger()->registerElfAndLinkWithAllocation(&debugData, &isaAllocation); EXPECT_EQ(static_cast(10u), drmMock->registeredDataSize); @@ -260,7 +260,7 @@ HWTEST_F(L0DebuggerLinuxTest, givenFailureToRegisterElfWhenRegisterElfAndLinkWit NEO::DebugData debugData; debugData.vIsa = "01234567890"; debugData.vIsaSize = 10; - MockDrmAllocation isaAllocation(rootDeviceIndex, AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); + MockDrmAllocation isaAllocation(rootDeviceIndex, AllocationType::kernelIsa, MemoryPool::System4KBPages); MockBufferObject bo(rootDeviceIndex, drmMock, 3, 0, 0, 1); isaAllocation.bufferObjects[0] = &bo; @@ -278,11 +278,11 @@ HWTEST_F(L0DebuggerLinuxTest, givenFailureToRegisterElfWhenRegisterElfAndLinkWit } TEST_F(L0DebuggerLinuxTest, givenAllocationsWhenAttachingZebinModuleThenAllAllocationsHaveRegisteredHandles) { - MockDrmAllocation isaAllocation(rootDeviceIndex, AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); + MockDrmAllocation isaAllocation(rootDeviceIndex, AllocationType::kernelIsa, MemoryPool::System4KBPages); MockBufferObject bo(rootDeviceIndex, drmMock, 3, 0, 0, 1); isaAllocation.bufferObjects[0] = &bo; - MockDrmAllocation isaAllocation2(rootDeviceIndex, AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); + MockDrmAllocation isaAllocation2(rootDeviceIndex, AllocationType::kernelIsa, MemoryPool::System4KBPages); MockBufferObject bo2(rootDeviceIndex, drmMock, 3, 0, 0, 1); isaAllocation2.bufferObjects[0] = &bo2; @@ -318,11 +318,11 @@ TEST_F(L0DebuggerLinuxTest, givenAllocationsWhenAttachingZebinModuleThenAllAlloc } TEST_F(L0DebuggerLinuxTest, givenModuleAllocationsWhenAttachingZebinModuleThenBosRequireImmediateBind) { - MockDrmAllocation isaAllocation(rootDeviceIndex, AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); + MockDrmAllocation isaAllocation(rootDeviceIndex, AllocationType::kernelIsa, MemoryPool::System4KBPages); MockBufferObject bo(rootDeviceIndex, drmMock, 3, 0, 0, 1); isaAllocation.bufferObjects[0] = &bo; - MockDrmAllocation isaAllocation2(rootDeviceIndex, AllocationType::CONSTANT_SURFACE, MemoryPool::System4KBPages); + MockDrmAllocation isaAllocation2(rootDeviceIndex, AllocationType::constantSurface, MemoryPool::System4KBPages); MockBufferObject bo2(rootDeviceIndex, drmMock, 3, 0, 0, 1); isaAllocation2.bufferObjects[0] = &bo2; diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_1.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_1.cpp index 1680b35465..c5ff1f7e74 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_1.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_1.cpp @@ -264,9 +264,9 @@ HWTEST_P(L0DebuggerParameterizedTests, givenEnabledDebuggingWhenIsaTypeAllocated ASSERT_NE(nullptr, debugger); size_t kernelIsaSize = 0x1000; - NEO::AllocationType allocTypes[] = {NEO::AllocationType::KERNEL_ISA, - NEO::AllocationType::KERNEL_ISA_INTERNAL, - NEO::AllocationType::DEBUG_MODULE_AREA}; + NEO::AllocationType allocTypes[] = {NEO::AllocationType::kernelIsa, + NEO::AllocationType::kernelIsaInternal, + NEO::AllocationType::debugModuleArea}; for (int i = 0; i < 3; i++) { auto allocation = device->getNEODevice()->getMemoryManager()->allocateGraphicsMemoryWithProperties( @@ -561,10 +561,10 @@ HWTEST2_F(L0DebuggerSimpleTest, givenUseCsrImmediateSubmissionEnabledCommandList auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, true, NEO::EngineGroupType::renderCompute, returnValue); ASSERT_NE(nullptr, commandList); - NEO::GraphicsAllocation srcPtr(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::GraphicsAllocation srcPtr(0, NEO::AllocationType::internalHostMemory, reinterpret_cast(0x1234), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - NEO::GraphicsAllocation dstPtr(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::GraphicsAllocation dstPtr(0, NEO::AllocationType::internalHostMemory, reinterpret_cast(0x2345), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); @@ -584,10 +584,10 @@ HWTEST2_F(L0DebuggerSimpleTest, givenUseCsrImmediateSubmissionDisabledCommandLis auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, true, NEO::EngineGroupType::renderCompute, returnValue); ASSERT_NE(nullptr, commandList); - NEO::GraphicsAllocation srcPtr(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::GraphicsAllocation srcPtr(0, NEO::AllocationType::internalHostMemory, reinterpret_cast(0x1234), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - NEO::GraphicsAllocation dstPtr(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::GraphicsAllocation dstPtr(0, NEO::AllocationType::internalHostMemory, reinterpret_cast(0x2345), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_sba_tracking.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_sba_tracking.cpp index d8efbef7ca..9e0b0ad723 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_sba_tracking.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_sba_tracking.cpp @@ -55,7 +55,7 @@ HWTEST_P(L0DebuggerParameterizedTests, givenL0DebuggerWhenCreatedThenPerContextS ASSERT_NE(nullptr, sbaAllocation); allocations.push_back(sbaAllocation); - EXPECT_EQ(NEO::AllocationType::DEBUG_SBA_TRACKING_BUFFER, sbaAllocation->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::debugSbaTrackingBuffer, sbaAllocation->getAllocationType()); EXPECT_EQ(MemoryPool::System4KBPages, sbaAllocation->getMemoryPool()); } @@ -102,7 +102,7 @@ HWTEST_P(L0DebuggerParameterizedTests, givenL0DebuggerWhenCreatedThenPerContextS ASSERT_NE(nullptr, sbaAllocation); allocations.push_back(sbaAllocation); - EXPECT_EQ(NEO::AllocationType::DEBUG_SBA_TRACKING_BUFFER, sbaAllocation->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::debugSbaTrackingBuffer, sbaAllocation->getAllocationType()); if (sbaAllocation->isAllocatedInLocalMemoryPool()) { EXPECT_EQ(neoDevice->getDeviceBitfield(), sbaAllocation->storageInfo.pageTablesVisibility); } diff --git a/level_zero/core/test/unit_tests/sources/debugger/windows/test_l0_debugger_windows.cpp b/level_zero/core/test/unit_tests/sources/debugger/windows/test_l0_debugger_windows.cpp index f786fc5e6d..5a69a9073c 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/windows/test_l0_debugger_windows.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/windows/test_l0_debugger_windows.cpp @@ -111,10 +111,10 @@ TEST_F(L0DebuggerWindowsTest, givenAllocateGraphicsMemoryWhenAllocationRegistrat EXPECT_LE(3u, wddm->registerAllocationTypeCalled); // At least 1xSBA + 1xMODULE_DEBUG + 1xSTATE_SAVE_AREA during DebuggerL0 init uint32_t registerAllocationTypeCalled = wddm->registerAllocationTypeCalled; - for (auto allocationType : {AllocationType::DEBUG_CONTEXT_SAVE_AREA, - AllocationType::DEBUG_SBA_TRACKING_BUFFER, - AllocationType::DEBUG_MODULE_AREA, - AllocationType::KERNEL_ISA}) { + for (auto allocationType : {AllocationType::debugContextSaveArea, + AllocationType::debugSbaTrackingBuffer, + AllocationType::debugModuleArea, + AllocationType::kernelIsa}) { auto wddmAlloc = static_cast(memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{0u, MemoryConstants::pageSize, allocationType})); EXPECT_EQ(++registerAllocationTypeCalled, wddm->registerAllocationTypeCalled); @@ -132,7 +132,7 @@ TEST_F(L0DebuggerWindowsTest, givenAllocateGraphicsMemoryWhenAllocationRegistrat EXPECT_LE(3u, wddm->registerAllocationTypeCalled); // At least 1xSBA + 1xMODULE_DEBUG + 1xSTATE_SAVE_AREA during DebuggerL0 init uint32_t registerAllocationTypeCalled = wddm->registerAllocationTypeCalled; - auto wddmAlloc = static_cast(memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{0u, MemoryConstants::pageSize, AllocationType::BUFFER})); + auto wddmAlloc = static_cast(memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{0u, MemoryConstants::pageSize, AllocationType::buffer})); EXPECT_EQ(registerAllocationTypeCalled, wddm->registerAllocationTypeCalled); memoryManager->freeGraphicsMemory(wddmAlloc); } diff --git a/level_zero/core/test/unit_tests/sources/device/test_l0_device.cpp b/level_zero/core/test/unit_tests/sources/device/test_l0_device.cpp index 9eb7da2072..ac209ebf3a 100644 --- a/level_zero/core/test/unit_tests/sources/device/test_l0_device.cpp +++ b/level_zero/core/test/unit_tests/sources/device/test_l0_device.cpp @@ -684,7 +684,7 @@ TEST_F(DeviceTest, givenEmptySVmAllocStorageWhenAllocateManagedMemoryFromHostPtr int data; auto allocation = device->allocateManagedMemoryFromHostPtr(&data, sizeof(data), nullptr); EXPECT_NE(nullptr, allocation); - EXPECT_EQ(NEO::AllocationType::BUFFER_HOST_MEMORY, allocation->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::bufferHostMemory, allocation->getAllocationType()); EXPECT_EQ(rootDeviceIndex, allocation->getRootDeviceIndex()); neoDevice->getMemoryManager()->freeGraphicsMemory(allocation); } @@ -698,7 +698,7 @@ TEST_F(DeviceTest, givenEmptySVmAllocStorageWhenAllocateMemoryFromHostPtrThenVal auto allocation = device->allocateMemoryFromHostPtr(data.get(), allocationSize, false); EXPECT_NE(nullptr, allocation); - EXPECT_EQ(NEO::AllocationType::EXTERNAL_HOST_PTR, allocation->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::externalHostPtr, allocation->getAllocationType()); EXPECT_EQ(rootDeviceIndex, allocation->getRootDeviceIndex()); auto alignedPtr = alignDown(data.get(), MemoryConstants::pageSize); @@ -720,11 +720,11 @@ TEST_F(DeviceTest, givenNonEmptyAllocationsListWhenRequestingAllocationSmallerOr auto allocation = device->getDriverHandle()->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getNEODevice()->getRootDeviceIndex(), allocationSize, - NEO::AllocationType::FILL_PATTERN, + NEO::AllocationType::fillPattern, neoDevice->getDeviceBitfield()}); device->storeReusableAllocation(*allocation); EXPECT_FALSE(deviceImp->allocationsForReuse->peekIsEmpty()); - auto obtaindedAllocation = device->obtainReusableAllocation(dataSize, NEO::AllocationType::FILL_PATTERN); + auto obtaindedAllocation = device->obtainReusableAllocation(dataSize, NEO::AllocationType::fillPattern); EXPECT_TRUE(deviceImp->allocationsForReuse->peekIsEmpty()); EXPECT_NE(nullptr, obtaindedAllocation); EXPECT_EQ(allocation, obtaindedAllocation); @@ -740,11 +740,11 @@ TEST_F(DeviceTest, givenNonEmptyAllocationsListWhenRequestingAllocationBiggerInS auto allocation = device->getDriverHandle()->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getNEODevice()->getRootDeviceIndex(), allocationSize, - NEO::AllocationType::FILL_PATTERN, + NEO::AllocationType::fillPattern, neoDevice->getDeviceBitfield()}); device->storeReusableAllocation(*allocation); EXPECT_FALSE(deviceImp->allocationsForReuse->peekIsEmpty()); - auto obtaindedAllocation = device->obtainReusableAllocation(4 * dataSize + 1u, NEO::AllocationType::FILL_PATTERN); + auto obtaindedAllocation = device->obtainReusableAllocation(4 * dataSize + 1u, NEO::AllocationType::fillPattern); EXPECT_EQ(nullptr, obtaindedAllocation); EXPECT_FALSE(deviceImp->allocationsForReuse->peekIsEmpty()); } @@ -758,11 +758,11 @@ TEST_F(DeviceTest, givenNonEmptyAllocationsListAndUnproperAllocationTypeWhenRequ auto allocation = device->getDriverHandle()->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getNEODevice()->getRootDeviceIndex(), allocationSize, - NEO::AllocationType::BUFFER, + NEO::AllocationType::buffer, neoDevice->getDeviceBitfield()}); device->storeReusableAllocation(*allocation); EXPECT_FALSE(deviceImp->allocationsForReuse->peekIsEmpty()); - auto obtaindedAllocation = device->obtainReusableAllocation(4 * dataSize + 1u, NEO::AllocationType::FILL_PATTERN); + auto obtaindedAllocation = device->obtainReusableAllocation(4 * dataSize + 1u, NEO::AllocationType::fillPattern); EXPECT_EQ(nullptr, obtaindedAllocation); EXPECT_FALSE(deviceImp->allocationsForReuse->peekIsEmpty()); } @@ -808,7 +808,7 @@ TEST_F(DeviceHostPointerTest, givenHostPointerNotAcceptedByKernelThenNewAllocati auto allocation = device->allocateMemoryFromHostPtr(buffer, size, true); EXPECT_NE(nullptr, allocation); - EXPECT_EQ(NEO::AllocationType::INTERNAL_HOST_MEMORY, allocation->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::internalHostMemory, allocation->getAllocationType()); EXPECT_EQ(rootDeviceIndex, allocation->getRootDeviceIndex()); EXPECT_NE(allocation->getUnderlyingBuffer(), reinterpret_cast(buffer)); EXPECT_EQ(allocation->getUnderlyingBufferSize(), size); diff --git a/level_zero/core/test/unit_tests/sources/driver/host_pointer_manager_tests.cpp b/level_zero/core/test/unit_tests/sources/driver/host_pointer_manager_tests.cpp index ed7e3af970..1e05ea447f 100644 --- a/level_zero/core/test/unit_tests/sources/driver/host_pointer_manager_tests.cpp +++ b/level_zero/core/test/unit_tests/sources/driver/host_pointer_manager_tests.cpp @@ -85,7 +85,7 @@ TEST_F(HostPointerManagerTest, givenPointerRegisteredWhenSvmAllocationExistsThen size_t usmSize = MemoryConstants::pageSize; void *usmBuffer = hostDriverHandle->getMemoryManager()->allocateSystemMemory(usmSize, usmSize); NEO::GraphicsAllocation *usmAllocation = hostDriverHandle->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), false, usmSize, NEO::AllocationType::BUFFER_HOST_MEMORY, false, neoDevice->getDeviceBitfield()}, + {device->getRootDeviceIndex(), false, usmSize, NEO::AllocationType::bufferHostMemory, false, neoDevice->getDeviceBitfield()}, usmBuffer); ASSERT_NE(nullptr, usmAllocation); @@ -115,7 +115,7 @@ TEST_F(HostPointerManagerTest, givenSvmAllocationExistsWhenGettingExistingAlloca size_t usmSize = MemoryConstants::pageSize; void *usmBuffer = hostDriverHandle->getMemoryManager()->allocateSystemMemory(usmSize, usmSize); NEO::GraphicsAllocation *usmAllocation = hostDriverHandle->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), false, usmSize, NEO::AllocationType::BUFFER_HOST_MEMORY, false, neoDevice->getDeviceBitfield()}, + {device->getRootDeviceIndex(), false, usmSize, NEO::AllocationType::bufferHostMemory, false, neoDevice->getDeviceBitfield()}, usmBuffer); ASSERT_NE(nullptr, usmAllocation); diff --git a/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp b/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp index ae0935f77c..a18e42f6ef 100644 --- a/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp +++ b/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp @@ -225,7 +225,7 @@ HWTEST_F(ImportNTHandle, givenCallToImportNTHandleWithHostBufferMemoryAllocation driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false); uint64_t imageHandle = 0x1; - NEO::AllocationType allocationType = NEO::AllocationType::BUFFER_HOST_MEMORY; + NEO::AllocationType allocationType = NEO::AllocationType::bufferHostMemory; void *ptr = driverHandle->importNTHandle(device->toHandle(), &imageHandle, allocationType); EXPECT_NE(ptr, nullptr); @@ -244,7 +244,7 @@ HWTEST_F(ImportNTHandle, givenCallToImportNTHandleWithBufferMemoryAllocationType driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false); uint64_t imageHandle = 0x1; - NEO::AllocationType allocationType = NEO::AllocationType::BUFFER; + NEO::AllocationType allocationType = NEO::AllocationType::buffer; void *ptr = driverHandle->importNTHandle(device->toHandle(), &imageHandle, allocationType); EXPECT_NE(ptr, nullptr); @@ -318,7 +318,7 @@ HWTEST_F(ImportNTHandle, whenCallingCreateGraphicsAllocationFromMultipleSharedHa AllocationProperties properties = {device->getRootDeviceIndex(), true, MemoryConstants::pageSize, - AllocationType::BUFFER, + AllocationType::buffer, false, device->getNEODevice()->getDeviceBitfield()}; bool requireSpecificBitness{}; diff --git a/level_zero/core/test/unit_tests/sources/event/test_event.cpp b/level_zero/core/test/unit_tests/sources/event/test_event.cpp index b8c99034e2..958d4a7ef7 100644 --- a/level_zero/core/test/unit_tests/sources/event/test_event.cpp +++ b/level_zero/core/test/unit_tests/sources/event/test_event.cpp @@ -319,9 +319,9 @@ TEST_F(EventPoolCreate, GivenDeviceThenEventPoolIsCreated) { auto &l0GfxCoreHelper = device->getNEODevice()->getRootDeviceEnvironment().getHelper(); if (l0GfxCoreHelper.alwaysAllocateEventInLocalMem()) { - EXPECT_EQ(NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, eventPool->getAllocation().getAllocationType()); + EXPECT_EQ(NEO::AllocationType::gpuTimestampDeviceBuffer, eventPool->getAllocation().getAllocationType()); } else { - EXPECT_EQ(NEO::AllocationType::BUFFER_HOST_MEMORY, eventPool->getAllocation().getAllocationType()); + EXPECT_EQ(NEO::AllocationType::bufferHostMemory, eventPool->getAllocation().getAllocationType()); } eventPool->destroy(); } @@ -524,7 +524,7 @@ TEST_F(EventPoolIPCHandleTests, whenGettingIpcHandleForEventPoolWithDeviceAllocT auto allocation = &eventPool->getAllocation(); - EXPECT_EQ(allocation->getAllocationType(), NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER); + EXPECT_EQ(allocation->getAllocationType(), NEO::AllocationType::gpuTimestampDeviceBuffer); ze_ipc_event_pool_handle_t ipcHandle = {}; ze_result_t res = eventPool->getIpcHandle(&ipcHandle); @@ -764,7 +764,7 @@ TEST_F(EventPoolIPCHandleTests, whenOpeningIpcHandleForEventPoolWithDeviceAllocT auto allocation = &ipcEventPool->getAllocation(); - EXPECT_EQ(allocation->getAllocationType(), NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER); + EXPECT_EQ(allocation->getAllocationType(), NEO::AllocationType::gpuTimestampDeviceBuffer); EXPECT_EQ(ipcEventPool->getEventSize(), eventPool->getEventSize()); EXPECT_EQ(numEvents, static_cast(ipcEventPool->getNumEvents())); @@ -1311,7 +1311,7 @@ TEST_F(EventPoolCreate, whenHostVisibleFlagNotSetThenEventAllocationIsOnDevice) EXPECT_EQ(ZE_RESULT_SUCCESS, result); ASSERT_NE(nullptr, eventPool); - EXPECT_EQ(NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, eventPool->getAllocation().getAllocationType()); + EXPECT_EQ(NEO::AllocationType::gpuTimestampDeviceBuffer, eventPool->getAllocation().getAllocationType()); EXPECT_NE(systemMemoryBitfield, memoryManager->recentlyPassedDeviceBitfield); EXPECT_EQ(neoDevice->getDeviceBitfield(), memoryManager->recentlyPassedDeviceBitfield); } @@ -1887,9 +1887,9 @@ TEST_F(TimestampEventCreate, givenTimestampEventThenAllocationsIsDependentIfAllo auto &l0GfxCoreHelper = device->getNEODevice()->getRootDeviceEnvironment().getHelper(); if (l0GfxCoreHelper.alwaysAllocateEventInLocalMem()) { - EXPECT_EQ(NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, allocation->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::gpuTimestampDeviceBuffer, allocation->getAllocationType()); } else { - EXPECT_EQ(NEO::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, allocation->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::timestampPacketTagBuffer, allocation->getAllocationType()); } } @@ -1968,7 +1968,7 @@ TEST_F(TimestampDeviceEventCreate, givenTimestampDeviceEventThenAllocationsIsOfG auto allocation = &eventPool->getAllocation(); ASSERT_NE(nullptr, allocation); - EXPECT_EQ(NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, allocation->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::gpuTimestampDeviceBuffer, allocation->getAllocationType()); } using EventQueryTimestampExpWithRootDeviceAndSubDevices = Test; diff --git a/level_zero/core/test/unit_tests/sources/helper/heap_assigner_l0_tests.cpp b/level_zero/core/test/unit_tests/sources/helper/heap_assigner_l0_tests.cpp index e87cc79dd6..694224bda8 100644 --- a/level_zero/core/test/unit_tests/sources/helper/heap_assigner_l0_tests.cpp +++ b/level_zero/core/test/unit_tests/sources/helper/heap_assigner_l0_tests.cpp @@ -25,17 +25,17 @@ using Platforms = IsAtMostProduct; HWTEST2_F(AlocationHelperTests, givenLinearStreamTypeWhenUseExternalAllocatorForSshAndDshDisabledThenUse32BitIsFalse, Platforms) { HeapAssigner heapAssigner{false}; - EXPECT_FALSE(heapAssigner.use32BitHeap(AllocationType::LINEAR_STREAM)); + EXPECT_FALSE(heapAssigner.use32BitHeap(AllocationType::linearStream)); } HWTEST2_F(AlocationHelperTests, givenLinearStreamTypeWhenUseExternalAllocatorForSshAndDshEnabledThenUse32BitIsTrue, Platforms) { HeapAssigner heapAssigner{true}; - EXPECT_TRUE(heapAssigner.use32BitHeap(AllocationType::LINEAR_STREAM)); + EXPECT_TRUE(heapAssigner.use32BitHeap(AllocationType::linearStream)); } HWTEST2_F(AlocationHelperTests, givenLinearStreamTypeWhenUseIternalAllocatorThenUseHeapExternal, Platforms) { HeapAssigner heapAssigner{true}; - auto heapIndex = heapAssigner.get32BitHeapIndex(AllocationType::LINEAR_STREAM, true, *defaultHwInfo.get(), false); + auto heapIndex = heapAssigner.get32BitHeapIndex(AllocationType::linearStream, true, *defaultHwInfo.get(), false); EXPECT_EQ(heapIndex, NEO::HeapIndex::HEAP_EXTERNAL_DEVICE_MEMORY); } @@ -43,7 +43,7 @@ TEST_F(AlocationHelperTests, givenLinearStreamAllocationWhenSelectingHeapWithUse DebugManagerStateRestore dbgRestorer; debugManager.flags.UseExternalAllocatorForSshAndDsh.set(true); std::unique_ptr mockMemoryManager(new MemoryManagerMock(*device->getNEODevice()->getExecutionEnvironment())); - GraphicsAllocation allocation{0, AllocationType::LINEAR_STREAM, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; + GraphicsAllocation allocation{0, AllocationType::linearStream, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; allocation.set32BitAllocation(false); EXPECT_EQ(MemoryManager::selectExternalHeap(allocation.isAllocatedInLocalMemoryPool()), mockMemoryManager->selectHeap(&allocation, false, false, false)); diff --git a/level_zero/core/test/unit_tests/sources/image/test_image.cpp b/level_zero/core/test/unit_tests/sources/image/test_image.cpp index dfde021537..57b9556e7d 100644 --- a/level_zero/core/test/unit_tests/sources/image/test_image.cpp +++ b/level_zero/core/test/unit_tests/sources/image/test_image.cpp @@ -360,7 +360,7 @@ class MemoryManagerNTHandleMock : public NEO::OsAgnosticMemoryManager { MemoryManagerNTHandleMock(NEO::ExecutionEnvironment &executionEnvironment) : NEO::OsAgnosticMemoryManager(executionEnvironment) {} NEO::GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override { - auto graphicsAllocation = createMemoryAllocation(AllocationType::INTERNAL_HOST_MEMORY, nullptr, reinterpret_cast(1), 1, + auto graphicsAllocation = createMemoryAllocation(AllocationType::internalHostMemory, nullptr, reinterpret_cast(1), 1, 4096u, reinterpret_cast(handle), MemoryPool::SystemCpuInaccessible, rootDeviceIndex, false, false, false); graphicsAllocation->setSharedHandle(static_cast(reinterpret_cast(handle))); @@ -556,7 +556,7 @@ HWTEST2_P(TestImageFormats, givenValidLayoutAndTypeWhenCreateImageCoreFamilyThen imageHW->initialize(device, &zeDesc); - EXPECT_EQ(imageHW->getAllocation()->getAllocationType(), NEO::AllocationType::IMAGE); + EXPECT_EQ(imageHW->getAllocation()->getAllocationType(), NEO::AllocationType::image); auto rss = imageHW->surfaceState; EXPECT_EQ(rss.getSurfaceType(), FamilyType::RENDER_SURFACE_STATE::SURFACE_TYPE_SURFTYPE_2D); EXPECT_EQ(rss.getAuxiliarySurfaceMode(), FamilyType::RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_NONE); diff --git a/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp b/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp index 121631ccba..6422b871ff 100644 --- a/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp +++ b/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp @@ -794,7 +794,7 @@ TEST_F(KernelImmutableDataTests, givenInternalModuleWhenKernelIsCreatedThenIsaIs bool isInternal = true; std::unique_ptr mockKernelImmData = std::make_unique(perHwThreadPrivateMemorySizeRequested); - mockKernelImmData->getIsaGraphicsAllocation()->setAllocationType(AllocationType::KERNEL_ISA_INTERNAL); + mockKernelImmData->getIsaGraphicsAllocation()->setAllocationType(AllocationType::kernelIsaInternal); size_t previouscopyMemoryToAllocationCalledTimes = mockMemoryManager->copyMemoryToAllocationCalledTimes; @@ -869,7 +869,7 @@ TEST_P(KernelIsaCopyingMomentTest, givenInternalModuleWhenKernelIsCreatedThenIsa kernelMock.immutableData.kernelInfo = kernelInfo; kernelMock.immutableData.surfaceStateHeapSize = 64; kernelMock.immutableData.surfaceStateHeapTemplate.reset(new uint8_t[64]); - kernelMock.immutableData.getIsaGraphicsAllocation()->setAllocationType(AllocationType::KERNEL_ISA_INTERNAL); + kernelMock.immutableData.getIsaGraphicsAllocation()->setAllocationType(AllocationType::kernelIsaInternal); kernelInfo->kernelDescriptor.payloadMappings.implicitArgs.systemThreadSurfaceAddress.bindful = 0; moduleMock->translationUnit->programInfo.kernelInfos.push_back(kernelInfo); @@ -1929,7 +1929,7 @@ using KernelIsaTests = Test; TEST_F(KernelIsaTests, givenKernelAllocationInLocalMemoryWhenCreatingWithoutAllowedCpuAccessThenUseBcsForTransfer) { DebugManagerStateRestore restore; debugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::CpuAccessDisallowed)); - debugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(NEO::AllocationType::KERNEL_ISA) - 1)); + debugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(NEO::AllocationType::kernelIsa) - 1)); this->createModuleFromMockBinary(ModuleType::User); auto bcsCsr = device->getNEODevice()->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::regular).commandStreamReceiver; @@ -1946,7 +1946,7 @@ TEST_F(KernelIsaTests, givenKernelAllocationInLocalMemoryWhenCreatingWithoutAllo TEST_F(KernelIsaTests, givenKernelAllocationInLocalMemoryWhenCreatingWithAllowedCpuAccessThenDontUseBcsForTransfer) { DebugManagerStateRestore restore; debugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::CpuAccessAllowed)); - debugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(NEO::AllocationType::KERNEL_ISA) - 1)); + debugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(NEO::AllocationType::kernelIsa) - 1)); this->createModuleFromMockBinary(ModuleType::User); auto bcsCsr = device->getNEODevice()->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::regular).commandStreamReceiver; @@ -1958,7 +1958,7 @@ TEST_F(KernelIsaTests, givenKernelAllocationInLocalMemoryWhenCreatingWithAllowed TEST_F(KernelIsaTests, givenKernelAllocationInLocalMemoryWhenCreatingWithDisallowedCpuAccessAndDisabledBlitterThenFallbackToCpuCopy) { DebugManagerStateRestore restore; debugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::CpuAccessDisallowed)); - debugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(NEO::AllocationType::KERNEL_ISA) - 1)); + debugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(NEO::AllocationType::kernelIsa) - 1)); this->createModuleFromMockBinary(ModuleType::User); device->getNEODevice()->getExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = false; @@ -1972,14 +1972,14 @@ TEST_F(KernelIsaTests, givenKernelInfoWhenInitializingImmutableDataWithInternalI this->createModuleFromMockBinary(ModuleType::Builtin); auto &kernelImmutableData = this->module->kernelImmDatas.back(); - EXPECT_EQ(NEO::AllocationType::KERNEL_ISA_INTERNAL, kernelImmutableData->getIsaGraphicsAllocation()->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::kernelIsaInternal, kernelImmutableData->getIsaGraphicsAllocation()->getAllocationType()); } TEST_F(KernelIsaTests, givenKernelInfoWhenInitializingImmutableDataWithNonInternalIsaThenCorrectAllocationTypeIsUsed) { this->createModuleFromMockBinary(ModuleType::User); auto &kernelImmutableData = this->module->kernelImmDatas.back(); - EXPECT_EQ(NEO::AllocationType::KERNEL_ISA, kernelImmutableData->getIsaGraphicsAllocation()->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::kernelIsa, kernelImmutableData->getIsaGraphicsAllocation()->getAllocationType()); } TEST_F(KernelIsaTests, givenKernelInfoWhenInitializingImmutableDataWithIsaThenPaddingIsAdded) { diff --git a/level_zero/core/test/unit_tests/sources/memory/linux/test_memory_linux.cpp b/level_zero/core/test/unit_tests/sources/memory/linux/test_memory_linux.cpp index 8d4590ebba..67e75b27e6 100644 --- a/level_zero/core/test/unit_tests/sources/memory/linux/test_memory_linux.cpp +++ b/level_zero/core/test/unit_tests/sources/memory/linux/test_memory_linux.cpp @@ -105,7 +105,7 @@ class MemoryManagerIpcImplicitScalingObtainFdMock : public NEO::DrmMemoryManager auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); size_t size = 0x1000; auto alloc = new IpcImplicitScalingObtainFdMockGraphicsAllocation(0u, - NEO::AllocationType::BUFFER, + NEO::AllocationType::buffer, nullptr, ptr, size, @@ -133,7 +133,7 @@ class MemoryManagerIpcImplicitScalingObtainFdMock : public NEO::DrmMemoryManager auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); size_t size = 0x1000; auto alloc = new IpcImplicitScalingObtainFdMockGraphicsAllocation(0u, - NEO::AllocationType::BUFFER, + NEO::AllocationType::buffer, nullptr, ptr, size, @@ -521,7 +521,7 @@ class MemoryManagerIpcObtainFdMock : public NEO::DrmMemoryManager { auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); size_t size = 0x1000; auto alloc = new IpcObtainFdMockGraphicsAllocation(0u, - NEO::AllocationType::BUFFER, + NEO::AllocationType::buffer, nullptr, ptr, size, @@ -548,7 +548,7 @@ class MemoryManagerIpcObtainFdMock : public NEO::DrmMemoryManager { auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); size_t size = 0x1000; auto alloc = new IpcObtainFdMockGraphicsAllocation(0u, - NEO::AllocationType::BUFFER, + NEO::AllocationType::buffer, nullptr, ptr, size, @@ -583,7 +583,7 @@ struct DriverHandleObtaindFdMock : public L0::DriverHandleImp { void *importFdHandle(NEO::Device *neoDevice, ze_ipc_memory_flags_t flags, uint64_t handle, NEO::AllocationType allocationType, void *basePointer, NEO::GraphicsAllocation **pAloc, NEO::SvmAllocationData &mappedPeerAllocData) override { DeviceBitfield deviceBitfield{0x0}; AllocationProperties properties(0, MemoryConstants::pageSize, - AllocationType::BUFFER, + AllocationType::buffer, deviceBitfield); auto alloc = getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); return reinterpret_cast(alloc->getGpuAddress()); diff --git a/level_zero/core/test/unit_tests/sources/memory/test_memory.cpp b/level_zero/core/test/unit_tests/sources/memory/test_memory.cpp index 2c18d98ec5..e970a187a4 100644 --- a/level_zero/core/test/unit_tests/sources/memory/test_memory.cpp +++ b/level_zero/core/test/unit_tests/sources/memory/test_memory.cpp @@ -506,7 +506,7 @@ TEST_F(MemoryExportImportImplicitScalingTest, NEO::GraphicsAllocation *ipcAlloc = nullptr; DriverHandleImp *driverHandleImp = static_cast(context->getDriverHandle()); NEO::SvmAllocationData allocDataInternal(device->getNEODevice()->getRootDeviceIndex()); - void *ipcPtr = driverHandleImp->importFdHandle(device->getNEODevice(), flags, handle, NEO::AllocationType::BUFFER, nullptr, &ipcAlloc, allocDataInternal); + void *ipcPtr = driverHandleImp->importFdHandle(device->getNEODevice(), flags, handle, NEO::AllocationType::buffer, nullptr, &ipcAlloc, allocDataInternal); EXPECT_EQ(ipcPtr, nullptr); result = context->freeMem(ptr); @@ -3160,7 +3160,7 @@ TEST_F(MemoryExportImportTest, givenCallToMemAllocPropertiesWithExtendedExportPropertiesAndNoFdHandleThenErrorIsReturned) { class ExportImportMockGraphicsAllocation : public NEO::MemoryAllocation { public: - ExportImportMockGraphicsAllocation() : NEO::MemoryAllocation(0, AllocationType::BUFFER, nullptr, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu) {} + ExportImportMockGraphicsAllocation() : NEO::MemoryAllocation(0, AllocationType::buffer, nullptr, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu) {} int peekInternalHandle(NEO::MemoryManager *memoryManager, uint64_t &handle) override { return -1; @@ -3183,7 +3183,7 @@ TEST_F(MemoryExportImportTest, givenCallToMemAllocPropertiesWithExtendedExportPropertiesAndNoFdHandleForWin32FormatThenErrorIsReturned) { class ExportImportMockGraphicsAllocation : public NEO::MemoryAllocation { public: - ExportImportMockGraphicsAllocation() : NEO::MemoryAllocation(0, AllocationType::BUFFER, nullptr, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu) {} + ExportImportMockGraphicsAllocation() : NEO::MemoryAllocation(0, AllocationType::buffer, nullptr, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu) {} int peekInternalHandle(NEO::MemoryManager *memoryManager, uint64_t &handle) override { return -1; @@ -5378,7 +5378,7 @@ TEST_F(ImportFdUncachedTests, ze_ipc_memory_flags_t flags = ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED; uint64_t handle = 1; NEO::SvmAllocationData allocDataInternal(device->getNEODevice()->getRootDeviceIndex()); - void *ptr = driverHandle->importFdHandle(device->getNEODevice(), flags, handle, NEO::AllocationType::BUFFER, nullptr, nullptr, allocDataInternal); + void *ptr = driverHandle->importFdHandle(device->getNEODevice(), flags, handle, NEO::AllocationType::buffer, nullptr, nullptr, allocDataInternal); EXPECT_NE(nullptr, ptr); auto allocData = driverHandle->svmAllocsManager->getSVMAlloc(ptr); @@ -5392,7 +5392,7 @@ TEST_F(ImportFdUncachedTests, ze_ipc_memory_flags_t flags = ZE_IPC_MEMORY_FLAG_BIAS_UNCACHED; uint64_t handle = 1; NEO::SvmAllocationData allocDataInternal(device->getNEODevice()->getRootDeviceIndex()); - void *ptr = driverHandle->importFdHandle(device->getNEODevice(), flags, handle, NEO::AllocationType::BUFFER, nullptr, nullptr, allocDataInternal); + void *ptr = driverHandle->importFdHandle(device->getNEODevice(), flags, handle, NEO::AllocationType::buffer, nullptr, nullptr, allocDataInternal); EXPECT_NE(nullptr, ptr); auto allocData = driverHandle->svmAllocsManager->getSVMAlloc(ptr); @@ -5406,7 +5406,7 @@ TEST_F(ImportFdUncachedTests, ze_ipc_memory_flags_t flags = ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED | ZE_IPC_MEMORY_FLAG_BIAS_UNCACHED; uint64_t handle = 1; NEO::SvmAllocationData allocDataInternal(device->getNEODevice()->getRootDeviceIndex()); - void *ptr = driverHandle->importFdHandle(device->getNEODevice(), flags, handle, NEO::AllocationType::BUFFER, nullptr, nullptr, allocDataInternal); + void *ptr = driverHandle->importFdHandle(device->getNEODevice(), flags, handle, NEO::AllocationType::buffer, nullptr, nullptr, allocDataInternal); EXPECT_NE(nullptr, ptr); auto allocData = driverHandle->svmAllocsManager->getSVMAlloc(ptr); @@ -5420,7 +5420,7 @@ TEST_F(ImportFdUncachedTests, ze_ipc_memory_flags_t flags = {}; uint64_t handle = 1; NEO::SvmAllocationData allocDataInternal(device->getNEODevice()->getRootDeviceIndex()); - void *ptr = driverHandle->importFdHandle(device->getNEODevice(), flags, handle, NEO::AllocationType::BUFFER, nullptr, nullptr, allocDataInternal); + void *ptr = driverHandle->importFdHandle(device->getNEODevice(), flags, handle, NEO::AllocationType::buffer, nullptr, nullptr, allocDataInternal); EXPECT_NE(nullptr, ptr); auto allocData = driverHandle->svmAllocsManager->getSVMAlloc(ptr); @@ -5434,7 +5434,7 @@ TEST_F(ImportFdUncachedTests, ze_ipc_memory_flags_t flags = {}; uint64_t handle = 1; NEO::SvmAllocationData allocDataInternal(device->getNEODevice()->getRootDeviceIndex()); - void *ptr = driverHandle->importFdHandle(device->getNEODevice(), flags, handle, NEO::AllocationType::BUFFER_HOST_MEMORY, nullptr, nullptr, allocDataInternal); + void *ptr = driverHandle->importFdHandle(device->getNEODevice(), flags, handle, NEO::AllocationType::bufferHostMemory, nullptr, nullptr, allocDataInternal); EXPECT_NE(nullptr, ptr); auto allocData = driverHandle->svmAllocsManager->getSVMAlloc(ptr); @@ -5449,7 +5449,7 @@ TEST_F(ImportFdUncachedTests, ze_ipc_memory_flags_t flags = {}; uint64_t handle = 1; NEO::SvmAllocationData allocDataInternal(device->getNEODevice()->getRootDeviceIndex()); - void *ptr = driverHandle->importFdHandle(device->getNEODevice(), flags, handle, NEO::AllocationType::BUFFER, nullptr, nullptr, allocDataInternal); + void *ptr = driverHandle->importFdHandle(device->getNEODevice(), flags, handle, NEO::AllocationType::buffer, nullptr, nullptr, allocDataInternal); EXPECT_NE(nullptr, ptr); auto allocData = driverHandle->svmAllocsManager->getSVMAlloc(ptr); @@ -5718,7 +5718,7 @@ TEST_F(MemAllocMultiSubDeviceTestsEnabledImplicitScaling, GivenImplicitScalingDi class ExportImportMockGraphicsAllocation : public NEO::MemoryAllocation { public: - ExportImportMockGraphicsAllocation() : NEO::MemoryAllocation(0, AllocationType::BUFFER, nullptr, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu) {} + ExportImportMockGraphicsAllocation() : NEO::MemoryAllocation(0, AllocationType::buffer, nullptr, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu) {} int peekInternalHandle(NEO::MemoryManager *memoryManager, uint64_t &handle) override { return -1; diff --git a/level_zero/core/test/unit_tests/sources/memory/test_memory_drm.cpp b/level_zero/core/test/unit_tests/sources/memory/test_memory_drm.cpp index 9d44d0e823..f0f6833a54 100644 --- a/level_zero/core/test/unit_tests/sources/memory/test_memory_drm.cpp +++ b/level_zero/core/test/unit_tests/sources/memory/test_memory_drm.cpp @@ -284,7 +284,7 @@ TEST_F(MemoryExportImportTest, size, alignment, &importedPtr); EXPECT_EQ(ZE_RESULT_SUCCESS, result); - EXPECT_EQ(driverHandle->allocationTypeRequested, NEO::AllocationType::BUFFER); + EXPECT_EQ(driverHandle->allocationTypeRequested, NEO::AllocationType::buffer); result = context->freeMem(ptr); EXPECT_EQ(ZE_RESULT_SUCCESS, result); @@ -334,7 +334,7 @@ TEST_F(MemoryExportImportTest, size, alignment, &importedPtr); EXPECT_EQ(ZE_RESULT_SUCCESS, result); - EXPECT_EQ(driverHandle->allocationTypeRequested, NEO::AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(driverHandle->allocationTypeRequested, NEO::AllocationType::bufferHostMemory); result = context->freeMem(ptr); EXPECT_EQ(ZE_RESULT_SUCCESS, result); diff --git a/level_zero/core/test/unit_tests/sources/memory_manager/compression_selector_l0_tests.cpp b/level_zero/core/test/unit_tests/sources/memory_manager/compression_selector_l0_tests.cpp index 804d2e4fd9..bfc541f3e0 100644 --- a/level_zero/core/test/unit_tests/sources/memory_manager/compression_selector_l0_tests.cpp +++ b/level_zero/core/test/unit_tests/sources/memory_manager/compression_selector_l0_tests.cpp @@ -17,7 +17,7 @@ namespace ult { TEST(CompressionSelectorL0Tests, GivenDefaultDebugFlagWhenProvidingUsmAllocationThenExpectCompressionDisabled) { DeviceBitfield deviceBitfield{0x0}; AllocationProperties properties(0, MemoryConstants::pageSize, - AllocationType::BUFFER, + AllocationType::buffer, deviceBitfield); properties.flags.isUSMDeviceAllocation = 1u; @@ -30,7 +30,7 @@ TEST(CompressionSelectorL0Tests, GivenDisabledDebugFlagWhenProvidingUsmAllocatio DeviceBitfield deviceBitfield{0x0}; AllocationProperties properties(0, MemoryConstants::pageSize, - AllocationType::BUFFER, + AllocationType::buffer, deviceBitfield); properties.flags.isUSMDeviceAllocation = 1u; @@ -43,7 +43,7 @@ TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingUsmAllocation DeviceBitfield deviceBitfield{0x0}; AllocationProperties properties(0, MemoryConstants::pageSize, - AllocationType::BUFFER, + AllocationType::buffer, deviceBitfield); properties.flags.isUSMDeviceAllocation = 1u; @@ -56,7 +56,7 @@ TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingSvmGpuAllocat DeviceBitfield deviceBitfield{0x0}; AllocationProperties properties(0, MemoryConstants::pageSize, - AllocationType::SVM_GPU, + AllocationType::svmGpu, deviceBitfield); EXPECT_TRUE(NEO::CompressionSelector::preferCompressedAllocation(properties)); @@ -68,7 +68,7 @@ TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingOtherAllocati DeviceBitfield deviceBitfield{0x0}; AllocationProperties properties(0, MemoryConstants::pageSize, - AllocationType::BUFFER_HOST_MEMORY, + AllocationType::bufferHostMemory, deviceBitfield); EXPECT_FALSE(NEO::CompressionSelector::preferCompressedAllocation(properties)); diff --git a/level_zero/core/test/unit_tests/sources/module/test_module.cpp b/level_zero/core/test/unit_tests/sources/module/test_module.cpp index 82add37a36..5be1b37824 100644 --- a/level_zero/core/test/unit_tests/sources/module/test_module.cpp +++ b/level_zero/core/test/unit_tests/sources/module/test_module.cpp @@ -104,7 +104,7 @@ HWTEST_F(ModuleTest, givenBuiltinModuleTypeWhenCreatingModuleThenCorrectTypeIsSe HWTEST_F(ModuleTest, givenUserModuleWhenCreatedThenCorrectAllocationTypeIsUsedForIsa) { createKernel(); - EXPECT_EQ(NEO::AllocationType::KERNEL_ISA, kernel->getIsaAllocation()->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::kernelIsa, kernel->getIsaAllocation()->getAllocationType()); } template @@ -174,7 +174,7 @@ HWTEST_F(ModuleTest, givenBuiltinModuleWhenCreatedThenCorrectAllocationTypeIsUse this->module.reset(); createModuleFromMockBinary(ModuleType::Builtin); createKernel(); - EXPECT_EQ(NEO::AllocationType::KERNEL_ISA_INTERNAL, kernel->getIsaAllocation()->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::kernelIsaInternal, kernel->getIsaAllocation()->getAllocationType()); } HWTEST_F(ModuleTest, givenBlitterAvailableWhenCopyingPatchedSegmentsThenIsaIsTransferredToAllocationWithBlitter) { @@ -1363,7 +1363,7 @@ TEST_F(ModuleInspectionTests, givenModuleWithUnresolvedSymbolWhenTheOtherModuleD auto kernelImmData = std::make_unique>(device); kernelImmData->isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::kernelIsa, neoDevice->getDeviceBitfield()})); module0->kernelImmDatas.push_back(std::move(kernelImmData)); @@ -1570,7 +1570,7 @@ TEST_F(ModuleDynamicLinkTests, givenModuleWithUnresolvedSymbolWhenTheOtherModule auto kernelImmData = std::make_unique>(device); kernelImmData->isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::kernelIsa, neoDevice->getDeviceBitfield()})); auto isaPtr = kernelImmData->getIsaGraphicsAllocation()->getUnderlyingBuffer(); @@ -1616,7 +1616,7 @@ TEST_F(ModuleDynamicLinkTests, givenModuleWithUnresolvedSymbolWhenTheOtherModule auto kernelImmData = std::make_unique>(device); kernelImmData->isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::kernelIsa, neoDevice->getDeviceBitfield()})); module0->kernelImmDatas.push_back(std::move(kernelImmData)); @@ -1684,7 +1684,7 @@ TEST_F(ModuleDynamicLinkTests, givenMultipleModulesWithUnresolvedSymbolWhenTheEa auto kernelImmData = std::make_unique>(device); kernelImmData->isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::kernelIsa, neoDevice->getDeviceBitfield()})); module0->kernelImmDatas.push_back(std::move(kernelImmData)); @@ -1751,7 +1751,7 @@ TEST_F(ModuleDynamicLinkTests, givenModuleWithInternalRelocationAndUnresolvedExt auto kernelImmData = std::make_unique>(device); kernelImmData->isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::cacheLineSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::cacheLineSize, NEO::AllocationType::kernelIsa, neoDevice->getDeviceBitfield()})); auto isaPtr = kernelImmData->getIsaGraphicsAllocation()->getUnderlyingBuffer(); @@ -1828,7 +1828,7 @@ TEST_F(ModuleDynamicLinkTests, givenMultipleModulesWithUnresolvedSymbolWhenTheEa auto kernelImmData = std::make_unique>(device); kernelImmData->isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::kernelIsa, neoDevice->getDeviceBitfield()})); module0->kernelImmDatas.push_back(std::move(kernelImmData)); @@ -1913,7 +1913,7 @@ TEST_F(ModuleDynamicLinkTests, givenModuleWithUnresolvedSymbolWhenTheOtherModule auto kernelImmData = std::make_unique>(device); kernelImmData->isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::kernelIsa, neoDevice->getDeviceBitfield()})); module0->kernelImmDatas.push_back(std::move(kernelImmData)); @@ -1974,7 +1974,7 @@ TEST_F(ModuleDynamicLinkTests, givenModuleWithUnresolvedSymbolsNotPresentInAnoth auto kernelImmData = std::make_unique>(device); kernelImmData->isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::kernelIsa, neoDevice->getDeviceBitfield()})); module0->kernelImmDatas.push_back(std::move(kernelImmData)); module0->isFunctionSymbolExportEnabled = true; @@ -2030,7 +2030,7 @@ TEST_F(ModuleDynamicLinkTests, givenModuleWithUnresolvedSymbolsNotPresentInAnoth auto kernelImmData = std::make_unique>(device); kernelImmData->isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::kernelIsa, neoDevice->getDeviceBitfield()})); module0->kernelImmDatas.push_back(std::move(kernelImmData)); module0->isFunctionSymbolExportEnabled = false; @@ -2211,7 +2211,7 @@ TEST_F(ModuleFunctionPointerTests, givenModuleWithExportedSymbolThenGetFunctionP auto kernelImmData = std::make_unique>(device); kernelImmData->isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::kernelIsa, neoDevice->getDeviceBitfield()})); module0->kernelImmDatas.push_back(std::move(kernelImmData)); @@ -2246,7 +2246,7 @@ TEST_F(ModuleFunctionPointerTests, givenModuleWithExportedSymbolButNoExportFlags auto kernelImmData = std::make_unique>(device); kernelImmData->isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::kernelIsa, neoDevice->getDeviceBitfield()})); kernelImmData->kernelDescriptor = &kernelDescriptor; @@ -2284,7 +2284,7 @@ TEST_F(ModuleFunctionPointerTests, givenInvalidFunctionNameAndModuleWithExported auto kernelImmData = std::make_unique>(device); kernelImmData->isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::kernelIsa, neoDevice->getDeviceBitfield()})); kernelImmData->kernelDescriptor = &kernelDescriptor; @@ -2318,7 +2318,7 @@ TEST_F(ModuleFunctionPointerTests, givenModuleWithExportedSymbolThenGetFunctionP auto kernelImmData = std::make_unique>(device); kernelImmData->isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::kernelIsa, neoDevice->getDeviceBitfield()})); kernelImmData->kernelDescriptor = &kernelDescriptor; @@ -3133,8 +3133,8 @@ kernels: zebin.data(), zebin.size()); auto retVal = moduleTu.processUnpackedBinary(); EXPECT_EQ(retVal, ZE_RESULT_SUCCESS); - EXPECT_EQ(AllocationType::CONSTANT_SURFACE, moduleTu.globalConstBuffer->getAllocationType()); - EXPECT_EQ(AllocationType::GLOBAL_SURFACE, moduleTu.globalVarBuffer->getAllocationType()); + EXPECT_EQ(AllocationType::constantSurface, moduleTu.globalConstBuffer->getAllocationType()); + EXPECT_EQ(AllocationType::globalSurface, moduleTu.globalVarBuffer->getAllocationType()); auto svmAllocsManager = device->getDriverHandle()->getSvmAllocsManager(); auto globalConstBufferAllocType = svmAllocsManager->getSVMAlloc(reinterpret_cast(moduleTu.globalConstBuffer->getGpuAddress()))->memoryType; @@ -4034,9 +4034,9 @@ TEST_F(ModuleDebugDataTest, GivenDebugDataWithRelocationsWhenCreatingRelocatedDe module->translationUnit = std::make_unique(device); module->translationUnit->globalVarBuffer = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::BUFFER, neoDevice->getDeviceBitfield()}); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::buffer, neoDevice->getDeviceBitfield()}); module->translationUnit->globalConstBuffer = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::BUFFER, neoDevice->getDeviceBitfield()}); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::buffer, neoDevice->getDeviceBitfield()}); uint32_t kernelHeap = 0; auto kernelInfo = new KernelInfo(); @@ -4480,9 +4480,9 @@ TEST_F(ModuleTests, givenModuleWithGlobalAndConstAllocationsWhenGettingModuleAll module->translationUnit = std::make_unique(device); module->translationUnit->globalVarBuffer = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::BUFFER, neoDevice->getDeviceBitfield()}); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::buffer, neoDevice->getDeviceBitfield()}); module->translationUnit->globalConstBuffer = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::BUFFER, neoDevice->getDeviceBitfield()}); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::buffer, neoDevice->getDeviceBitfield()}); uint32_t kernelHeap = 0; auto kernelInfo = new KernelInfo(); diff --git a/level_zero/core/test/unit_tests/sources/printf_handler/test_printf_handler.cpp b/level_zero/core/test/unit_tests/sources/printf_handler/test_printf_handler.cpp index cc646615de..7a1d34215d 100644 --- a/level_zero/core/test/unit_tests/sources/printf_handler/test_printf_handler.cpp +++ b/level_zero/core/test/unit_tests/sources/printf_handler/test_printf_handler.cpp @@ -19,7 +19,7 @@ TEST(PrintfHandler, whenPrintfBufferIscreatedThenCorrectAllocationTypeIsUsed) { MockDeviceImp l0Device(neoDevice, neoDevice->getExecutionEnvironment()); auto allocation = PrintfHandler::createPrintfBuffer(&l0Device); - EXPECT_EQ(NEO::AllocationType::PRINTF_SURFACE, allocation->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::printfSurface, allocation->getAllocationType()); neoDevice->getMemoryManager()->freeGraphicsMemory(allocation); } diff --git a/level_zero/core/test/unit_tests/xe_hpc_core/test_event_xe_hpc_core.cpp b/level_zero/core/test/unit_tests/xe_hpc_core/test_event_xe_hpc_core.cpp index 4fd2ea77ae..db1e28394b 100644 --- a/level_zero/core/test/unit_tests/xe_hpc_core/test_event_xe_hpc_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hpc_core/test_event_xe_hpc_core.cpp @@ -52,7 +52,7 @@ HWTEST2_F(EventPoolIPCHandleHpcCoreTests, whenGettingIpcHandleForEventPoolWithDe auto allocation = &eventPool->getAllocation(); - EXPECT_EQ(allocation->getAllocationType(), NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER); + EXPECT_EQ(allocation->getAllocationType(), NEO::AllocationType::gpuTimestampDeviceBuffer); ze_ipc_event_pool_handle_t ipcHandle = {}; ze_result_t res = eventPool->getIpcHandle(&ipcHandle); diff --git a/level_zero/core/test/unit_tests/xe_hpg_core/dg2/test_module_dg2.cpp b/level_zero/core/test/unit_tests/xe_hpg_core/dg2/test_module_dg2.cpp index 69bf6fa247..7f5ce7d784 100644 --- a/level_zero/core/test/unit_tests/xe_hpg_core/dg2/test_module_dg2.cpp +++ b/level_zero/core/test/unit_tests/xe_hpg_core/dg2/test_module_dg2.cpp @@ -34,7 +34,7 @@ HWTEST2_F(KernelDebugSurfaceDG2Test, givenDebuggerWhenPatchWithImplicitSurfaceCa auto debugSurface = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( {device->getRootDeviceIndex(), true, maxDbgSurfaceSize, - NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA, + NEO::AllocationType::debugContextSaveArea, false, false, device->getNEODevice()->getDeviceBitfield()}); @@ -93,7 +93,7 @@ HWTEST2_F(KernelDebugSurfaceDG2Test, givenNoDebuggerWhenPatchWithImplicitSurface auto debugSurface = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( {device->getRootDeviceIndex(), true, maxDbgSurfaceSize, - NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA, + NEO::AllocationType::debugContextSaveArea, false, false, device->getNEODevice()->getDeviceBitfield()}); diff --git a/level_zero/tools/source/metrics/metric_oa_query_imp.cpp b/level_zero/tools/source/metrics/metric_oa_query_imp.cpp index f43ca0dc53..913cd2f46b 100644 --- a/level_zero/tools/source/metrics/metric_oa_query_imp.cpp +++ b/level_zero/tools/source/metrics/metric_oa_query_imp.cpp @@ -612,7 +612,7 @@ bool OaMetricQueryPoolImp::allocateGpuMemory() { // Allocate gpu memory. NEO::AllocationProperties properties( - metricSource.getDevice().getRootDeviceIndex(), allocationSize, NEO::AllocationType::BUFFER_HOST_MEMORY, metricSource.getDevice().getNEODevice()->getDeviceBitfield()); + metricSource.getDevice().getRootDeviceIndex(), allocationSize, NEO::AllocationType::bufferHostMemory, metricSource.getDevice().getNEODevice()->getDeviceBitfield()); properties.alignment = 64u; pAllocation = metricSource.getDevice().getDriverHandle()->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); diff --git a/opencl/source/command_queue/enqueue_fill_buffer.h b/opencl/source/command_queue/enqueue_fill_buffer.h index df1462b294..86949c800d 100644 --- a/opencl/source/command_queue/enqueue_fill_buffer.h +++ b/opencl/source/command_queue/enqueue_fill_buffer.h @@ -32,12 +32,12 @@ cl_int CommandQueueHw::enqueueFillBuffer( auto commandStreamReceieverOwnership = getGpgpuCommandStreamReceiver().obtainUniqueOwnership(); auto storageWithAllocations = getGpgpuCommandStreamReceiver().getInternalAllocationStorage(); - auto allocationType = AllocationType::FILL_PATTERN; + auto allocationType = AllocationType::fillPattern; auto patternAllocation = storageWithAllocations->obtainReusableAllocation(patternSize, allocationType).release(); commandStreamReceieverOwnership.unlock(); if (!patternAllocation) { - patternAllocation = memoryManager->allocateGraphicsMemoryWithProperties({getDevice().getRootDeviceIndex(), alignUp(patternSize, MemoryConstants::cacheLineSize), AllocationType::FILL_PATTERN, getDevice().getDeviceBitfield()}); + patternAllocation = memoryManager->allocateGraphicsMemoryWithProperties({getDevice().getRootDeviceIndex(), alignUp(patternSize, MemoryConstants::cacheLineSize), AllocationType::fillPattern, getDevice().getDeviceBitfield()}); } if (patternSize == 1) { diff --git a/opencl/source/command_queue/enqueue_svm.h b/opencl/source/command_queue/enqueue_svm.h index 621854deeb..6325295d95 100644 --- a/opencl/source/command_queue/enqueue_svm.h +++ b/opencl/source/command_queue/enqueue_svm.h @@ -78,7 +78,7 @@ cl_int CommandQueueHw::enqueueSVMMap(cl_bool blockingMap, } bool blocking = blockingMap == CL_TRUE; - if (svmData->gpuAllocations.getAllocationType() == AllocationType::SVM_ZERO_COPY) { + if (svmData->gpuAllocations.getAllocationType() == AllocationType::svmZeroCopy) { NullSurface s; Surface *surfaces[] = {&s}; if (context->isProvidingPerformanceHints()) { @@ -156,7 +156,7 @@ cl_int CommandQueueHw::enqueueSVMUnmap(void *svmPtr, return CL_INVALID_VALUE; } - if (svmData->gpuAllocations.getAllocationType() == AllocationType::SVM_ZERO_COPY) { + if (svmData->gpuAllocations.getAllocationType() == AllocationType::svmZeroCopy) { NullSurface s; Surface *surfaces[] = {&s}; return enqueueHandler(surfaces, @@ -492,7 +492,7 @@ cl_int CommandQueueHw::enqueueSVMMemFill(void *svmPtr, auto commandStreamReceieverOwnership = getGpgpuCommandStreamReceiver().obtainUniqueOwnership(); auto storageWithAllocations = getGpgpuCommandStreamReceiver().getInternalAllocationStorage(); - auto allocationType = AllocationType::FILL_PATTERN; + auto allocationType = AllocationType::fillPattern; auto patternAllocation = storageWithAllocations->obtainReusableAllocation(patternSize, allocationType).release(); commandStreamReceieverOwnership.unlock(); diff --git a/opencl/source/kernel/kernel.cpp b/opencl/source/kernel/kernel.cpp index 3262de8b22..bfbca0ced0 100644 --- a/opencl/source/kernel/kernel.cpp +++ b/opencl/source/kernel/kernel.cpp @@ -364,7 +364,7 @@ cl_int Kernel::patchPrivateSurface() { privateSurface = executionEnvironment.memoryManager->allocateGraphicsMemoryWithProperties( {rootDeviceIndex, static_cast(privateSurfaceSize), - AllocationType::PRIVATE_SURFACE, + AllocationType::privateSurface, pClDevice->getDeviceBitfield()}); if (privateSurface == nullptr) { return CL_OUT_OF_RESOURCES; @@ -1986,7 +1986,7 @@ bool Kernel::hasDirectStatelessAccessToSharedBuffer() const { const auto &arg = kernelInfo.kernelDescriptor.payloadMappings.explicitArgs[i]; if (BUFFER_OBJ == kernelArguments.at(i).type && !arg.as().isPureStateful()) { auto buffer = castToObject(getKernelArg(i)); - if (buffer && buffer->getMultiGraphicsAllocation().getAllocationType() == AllocationType::SHARED_BUFFER) { + if (buffer && buffer->getMultiGraphicsAllocation().getAllocationType() == AllocationType::sharedBuffer) { return true; } } @@ -1999,13 +1999,13 @@ bool Kernel::hasDirectStatelessAccessToHostMemory() const { const auto &arg = kernelInfo.kernelDescriptor.payloadMappings.explicitArgs[i]; if (BUFFER_OBJ == kernelArguments.at(i).type && !arg.as().isPureStateful()) { auto buffer = castToObject(getKernelArg(i)); - if (buffer && buffer->getMultiGraphicsAllocation().getAllocationType() == AllocationType::BUFFER_HOST_MEMORY) { + if (buffer && buffer->getMultiGraphicsAllocation().getAllocationType() == AllocationType::bufferHostMemory) { return true; } } if (SVM_ALLOC_OBJ == kernelArguments.at(i).type && !arg.as().isPureStateful()) { auto svmAlloc = reinterpret_cast(getKernelArg(i)); - if (svmAlloc && svmAlloc->getAllocationType() == AllocationType::BUFFER_HOST_MEMORY) { + if (svmAlloc && svmAlloc->getAllocationType() == AllocationType::bufferHostMemory) { return true; } } @@ -2019,7 +2019,7 @@ bool Kernel::hasIndirectStatelessAccessToHostMemory() const { } for (auto gfxAllocation : kernelUnifiedMemoryGfxAllocations) { - if (gfxAllocation->getAllocationType() == AllocationType::BUFFER_HOST_MEMORY) { + if (gfxAllocation->getAllocationType() == AllocationType::bufferHostMemory) { return true; } } @@ -2270,10 +2270,10 @@ int Kernel::setKernelThreadArbitrationPolicy(uint32_t policy) { } bool Kernel::graphicsAllocationTypeUseSystemMemory(AllocationType type) { - return (type == AllocationType::BUFFER_HOST_MEMORY) || - (type == AllocationType::EXTERNAL_HOST_PTR) || - (type == AllocationType::SVM_CPU) || - (type == AllocationType::SVM_ZERO_COPY); + return (type == AllocationType::bufferHostMemory) || + (type == AllocationType::externalHostPtr) || + (type == AllocationType::svmCpu) || + (type == AllocationType::svmZeroCopy); } void Kernel::initializeLocalIdsCache() { diff --git a/opencl/source/mem_obj/buffer.cpp b/opencl/source/mem_obj/buffer.cpp index 0f41037225..20c57ab54e 100644 --- a/opencl/source/mem_obj/buffer.cpp +++ b/opencl/source/mem_obj/buffer.cpp @@ -361,7 +361,7 @@ Buffer *Buffer::create(Context *context, } if (useHostPtr) { - if (allocationInfo.allocationType == AllocationType::BUFFER_HOST_MEMORY) { + if (allocationInfo.allocationType == AllocationType::bufferHostMemory) { if (allocationInfo.alignementSatisfied) { allocationInfo.zeroCopyAllowed = true; allocationInfo.allocateMemory = false; @@ -382,7 +382,7 @@ Buffer *Buffer::create(Context *context, if (svmData) { if ((svmData->memoryType == InternalMemoryType::HOST_UNIFIED_MEMORY) && memoryManager->isLocalMemorySupported(rootDeviceIndex)) { allocationInfo.memory = nullptr; - allocationInfo.allocationType = AllocationType::BUFFER; + allocationInfo.allocationType = AllocationType::buffer; allocationInfo.isHostPtrSVM = false; allocationInfo.zeroCopyAllowed = false; allocationInfo.copyMemoryFromHostPtr = true; @@ -392,7 +392,7 @@ Buffer *Buffer::create(Context *context, allocationInfo.memory = svmData->gpuAllocations.getGraphicsAllocation(rootDeviceIndex); allocationInfo.allocationType = allocationInfo.memory->getAllocationType(); allocationInfo.isHostPtrSVM = true; - allocationInfo.zeroCopyAllowed = allocationInfo.memory->getAllocationType() == AllocationType::SVM_ZERO_COPY; + allocationInfo.zeroCopyAllowed = allocationInfo.memory->getAllocationType() == AllocationType::svmZeroCopy; allocationInfo.copyMemoryFromHostPtr = false; allocationInfo.allocateMemory = false; allocationInfo.mapAllocation = svmData->cpuAllocation; @@ -446,7 +446,7 @@ Buffer *Buffer::create(Context *context, // if allocation failed for CL_MEM_USE_HOST_PTR case retry with non zero copy path if (useHostPtr && !allocationInfo.memory && Buffer::isReadOnlyMemoryPermittedByFlags(memoryProperties)) { - allocationInfo.allocationType = AllocationType::BUFFER_HOST_MEMORY; + allocationInfo.allocationType = AllocationType::bufferHostMemory; allocationInfo.zeroCopyAllowed = false; allocationInfo.copyMemoryFromHostPtr = true; AllocationProperties allocProperties = MemoryPropertiesHelper::getAllocationProperties(rootDeviceIndex, memoryProperties, @@ -470,8 +470,8 @@ Buffer *Buffer::create(Context *context, allocationInfo.copyMemoryFromHostPtr = true; } } - } else if (allocationInfo.allocationType == AllocationType::BUFFER && !compressionEnabled) { - allocationInfo.allocationType = AllocationType::BUFFER_HOST_MEMORY; + } else if (allocationInfo.allocationType == AllocationType::buffer && !compressionEnabled) { + allocationInfo.allocationType = AllocationType::bufferHostMemory; } allocationInfo.memory->setAllocationType(allocationInfo.allocationType); @@ -522,7 +522,7 @@ Buffer *Buffer::create(Context *context, if (!allocationInfo.zeroCopyAllowed && !allocationInfo.isHostPtrSVM) { AllocationProperties properties{rootDeviceIndex, false, // allocateMemory - size, AllocationType::MAP_ALLOCATION, + size, AllocationType::mapAllocation, false, // isMultiStorageAllocation context->getDeviceBitfieldForAllocation(rootDeviceIndex)}; properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = true; @@ -638,15 +638,15 @@ AllocationType Buffer::getGraphicsAllocationTypeAndCompressionPreference(const M bool &compressionEnabled, bool isLocalMemoryEnabled) { if (properties.flags.forceHostMemory) { compressionEnabled = false; - return AllocationType::BUFFER_HOST_MEMORY; + return AllocationType::bufferHostMemory; } if (properties.flags.useHostPtr && !isLocalMemoryEnabled) { compressionEnabled = false; - return AllocationType::BUFFER_HOST_MEMORY; + return AllocationType::bufferHostMemory; } - return AllocationType::BUFFER; + return AllocationType::buffer; } bool Buffer::isReadOnlyMemoryPermittedByFlags(const MemoryProperties &properties) { diff --git a/opencl/source/mem_obj/image.cpp b/opencl/source/mem_obj/image.cpp index 4e5f174b3c..d28db788da 100644 --- a/opencl/source/mem_obj/image.cpp +++ b/opencl/source/mem_obj/image.cpp @@ -241,7 +241,7 @@ Image *Image::create(Context *context, } if (parentBuffer == nullptr) { - allocationInfo.memory->setAllocationType(AllocationType::IMAGE); + allocationInfo.memory->setAllocationType(AllocationType::image); } if (parentImage) { @@ -1195,7 +1195,7 @@ void Image::setAllocationInfoFromHostPtr(CreateMemObj::AllocationInfo &allocatio AllocationProperties properties{rootDeviceIndex, false, // allocateMemory - hostPtrMinSize, AllocationType::MAP_ALLOCATION, + hostPtrMinSize, AllocationType::mapAllocation, false, // isMultiStorageAllocation context->getDeviceBitfieldForAllocation(rootDeviceIndex)}; properties.flags.flushL3RequiredForRead = true; diff --git a/opencl/source/mem_obj/mem_obj.cpp b/opencl/source/mem_obj/mem_obj.cpp index f0a8d7062d..f0ea04ae40 100644 --- a/opencl/source/mem_obj/mem_obj.cpp +++ b/opencl/source/mem_obj/mem_obj.cpp @@ -393,7 +393,7 @@ void *MemObj::getBasePtrForMap(uint32_t rootDeviceIndex) { } AllocationProperties properties{rootDeviceIndex, false, // allocateMemory - getSize(), AllocationType::MAP_ALLOCATION, + getSize(), AllocationType::mapAllocation, false, // isMultiStorageAllocation context->getDeviceBitfieldForAllocation(rootDeviceIndex)}; diff --git a/opencl/source/mem_obj/mem_obj.h b/opencl/source/mem_obj/mem_obj.h index 7c8084950d..f31427de6c 100644 --- a/opencl/source/mem_obj/mem_obj.h +++ b/opencl/source/mem_obj/mem_obj.h @@ -39,7 +39,7 @@ namespace CreateMemObj { struct AllocationInfo { GraphicsAllocation *mapAllocation = nullptr; GraphicsAllocation *memory = nullptr; - AllocationType allocationType = AllocationType::UNKNOWN; + AllocationType allocationType = AllocationType::unknown; bool zeroCopyAllowed = true; bool isHostPtrSVM = false; diff --git a/opencl/source/mem_obj/mem_obj_helper.cpp b/opencl/source/mem_obj/mem_obj_helper.cpp index d83797d222..85c112b09b 100644 --- a/opencl/source/mem_obj/mem_obj_helper.cpp +++ b/opencl/source/mem_obj/mem_obj_helper.cpp @@ -84,7 +84,7 @@ AllocationProperties MemObjHelper::getAllocationPropertiesWithImageInfo( const HardwareInfo &hwInfo, DeviceBitfield subDevicesBitfieldParam, bool deviceOnlyVisibilty) { auto deviceBitfield = MemoryPropertiesHelper::adjustDeviceBitfield(rootDeviceIndex, memoryProperties, subDevicesBitfieldParam); - AllocationProperties allocationProperties{rootDeviceIndex, allocateMemory, &imgInfo, AllocationType::IMAGE, deviceBitfield}; + AllocationProperties allocationProperties{rootDeviceIndex, allocateMemory, &imgInfo, AllocationType::image, deviceBitfield}; MemoryPropertiesHelper::fillPoliciesInProperties(allocationProperties, memoryProperties, hwInfo, deviceOnlyVisibilty); return allocationProperties; } diff --git a/opencl/source/mem_obj/pipe.cpp b/opencl/source/mem_obj/pipe.cpp index a27f1eafba..167bc145d8 100644 --- a/opencl/source/mem_obj/pipe.cpp +++ b/opencl/source/mem_obj/pipe.cpp @@ -64,7 +64,7 @@ Pipe *Pipe::create(Context *context, AllocationProperties allocProperties = MemoryPropertiesHelper::getAllocationProperties(rootDeviceIndex, memoryProperties, true, // allocateMemory - size, AllocationType::PIPE, + size, AllocationType::pipe, false, // isMultiStorageAllocation context->getDevice(0)->getHardwareInfo(), context->getDeviceBitfieldForAllocation(rootDeviceIndex), context->isSingleDeviceContext()); diff --git a/opencl/source/memory_manager/compression_selector_ocl.cpp b/opencl/source/memory_manager/compression_selector_ocl.cpp index 3af6510a81..23ff85da0d 100644 --- a/opencl/source/memory_manager/compression_selector_ocl.cpp +++ b/opencl/source/memory_manager/compression_selector_ocl.cpp @@ -13,10 +13,10 @@ namespace NEO { bool CompressionSelector::preferCompressedAllocation(const AllocationProperties &properties) { switch (properties.allocationType) { - case AllocationType::GLOBAL_SURFACE: - case AllocationType::CONSTANT_SURFACE: - case AllocationType::SVM_GPU: - case AllocationType::PRINTF_SURFACE: { + case AllocationType::globalSurface: + case AllocationType::constantSurface: + case AllocationType::svmGpu: + case AllocationType::printfSurface: { return CompressionSelector::allowStatelessCompression(); } default: diff --git a/opencl/source/memory_manager/migration_controller.cpp b/opencl/source/memory_manager/migration_controller.cpp index f6dd695d56..6b686919db 100644 --- a/opencl/source/memory_manager/migration_controller.cpp +++ b/opencl/source/memory_manager/migration_controller.cpp @@ -59,7 +59,7 @@ void MigrationController::migrateMemory(Context &context, MemoryManager &memoryM } else { auto srcCmdQ = context.getSpecialQueue(sourceRootDeviceIndex); - if (srcMemory->getAllocationType() == AllocationType::IMAGE) { + if (srcMemory->getAllocationType() == AllocationType::image) { auto pImage = static_cast(memObj); size_t origin[3] = {}; size_t region[3] = {}; @@ -80,7 +80,7 @@ void MigrationController::migrateMemory(Context &context, MemoryManager &memoryM } else { auto dstCmdQ = context.getSpecialQueue(targetRootDeviceIndex); - if (dstMemory->getAllocationType() == AllocationType::IMAGE) { + if (dstMemory->getAllocationType() == AllocationType::image) { auto pImage = static_cast(memObj); size_t origin[3] = {}; size_t region[3] = {}; diff --git a/opencl/source/program/printf_handler.cpp b/opencl/source/program/printf_handler.cpp index feee5bfae8..d761637baf 100644 --- a/opencl/source/program/printf_handler.cpp +++ b/opencl/source/program/printf_handler.cpp @@ -49,7 +49,7 @@ void PrintfHandler::prepareDispatch(const MultiDispatchInfo &multiDispatchInfo) } auto rootDeviceIndex = device.getRootDeviceIndex(); kernel = multiDispatchInfo.peekMainKernel(); - printfSurface = device.getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, printfSurfaceSize, AllocationType::PRINTF_SURFACE, device.getDeviceBitfield()}); + printfSurface = device.getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, printfSurfaceSize, AllocationType::printfSurface, device.getDeviceBitfield()}); auto &rootDeviceEnvironment = device.getRootDeviceEnvironment(); const auto &productHelper = device.getProductHelper(); diff --git a/opencl/source/sharings/d3d/d3d_buffer.h b/opencl/source/sharings/d3d/d3d_buffer.h index bb97c19c2e..a858395603 100644 --- a/opencl/source/sharings/d3d/d3d_buffer.h +++ b/opencl/source/sharings/d3d/d3d_buffer.h @@ -43,7 +43,7 @@ class D3DBuffer : public D3DSharing { AllocationProperties properties = {context->getDevice(0)->getRootDeviceIndex(), false, // allocateMemory 0, // size - AllocationType::SHARED_BUFFER, + AllocationType::sharedBuffer, false, // isMultiStorageAllocation context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())}; auto alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(toOsHandle(sharedHandle), properties, true, false, true, nullptr); diff --git a/opencl/source/sharings/d3d/d3d_surface.cpp b/opencl/source/sharings/d3d/d3d_surface.cpp index 8204bcac2d..6c8472f354 100644 --- a/opencl/source/sharings/d3d/d3d_surface.cpp +++ b/opencl/source/sharings/d3d/d3d_surface.cpp @@ -86,7 +86,7 @@ Image *D3DSurface::create(Context *context, cl_dx9_surface_info_khr *surfaceInfo AllocationProperties allocProperties(rootDeviceIndex, false, // allocateMemory 0u, // size - AllocationType::SHARED_IMAGE, + AllocationType::sharedImage, false, // isMultiStorageAllocation context->getDeviceBitfieldForAllocation(rootDeviceIndex)); alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(toOsHandle(surfaceInfo->shared_handle), allocProperties, @@ -108,7 +108,7 @@ Image *D3DSurface::create(Context *context, cl_dx9_surface_info_khr *surfaceInfo memoryProperties, context->getDevice(0)->getHardwareInfo(), context->getDeviceBitfieldForAllocation(rootDeviceIndex), context->isSingleDeviceContext()); - allocProperties.allocationType = AllocationType::SHARED_RESOURCE_COPY; + allocProperties.allocationType = AllocationType::sharedResourceCopy; alloc = context->getMemoryManager()->allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr); diff --git a/opencl/source/sharings/d3d/d3d_texture.cpp b/opencl/source/sharings/d3d/d3d_texture.cpp index 49a8969a75..6dbd651385 100644 --- a/opencl/source/sharings/d3d/d3d_texture.cpp +++ b/opencl/source/sharings/d3d/d3d_texture.cpp @@ -76,7 +76,7 @@ Image *D3DTexture::create2d(Context *context, D3DTexture2d *d3dTexture, cl_ if (textureDesc.MiscFlags & D3DResourceFlags::MISC_SHARED_NTHANDLE) { sharingFcns->getSharedNTHandle(textureStaging, &sharedHandle); if (memoryManager->verifyHandle(toOsHandle(sharedHandle), rootDeviceIndex, true)) { - alloc = memoryManager->createGraphicsAllocationFromNTHandle(sharedHandle, rootDeviceIndex, AllocationType::SHARED_IMAGE); + alloc = memoryManager->createGraphicsAllocationFromNTHandle(sharedHandle, rootDeviceIndex, AllocationType::sharedImage); } else { err.set(CL_INVALID_D3D11_RESOURCE_KHR); return nullptr; @@ -86,7 +86,7 @@ Image *D3DTexture::create2d(Context *context, D3DTexture2d *d3dTexture, cl_ AllocationProperties allocProperties(rootDeviceIndex, false, // allocateMemory 0u, // size - AllocationType::SHARED_IMAGE, + AllocationType::sharedImage, false, // isMultiStorageAllocation context->getDeviceBitfieldForAllocation(rootDeviceIndex)); if (memoryManager->verifyHandle(toOsHandle(sharedHandle), rootDeviceIndex, false)) { @@ -169,7 +169,7 @@ Image *D3DTexture::create3d(Context *context, D3DTexture3d *d3dTexture, cl_ if (textureDesc.MiscFlags & D3DResourceFlags::MISC_SHARED_NTHANDLE) { sharingFcns->getSharedNTHandle(textureStaging, &sharedHandle); if (memoryManager->verifyHandle(toOsHandle(sharedHandle), rootDeviceIndex, true)) { - alloc = memoryManager->createGraphicsAllocationFromNTHandle(sharedHandle, rootDeviceIndex, AllocationType::SHARED_IMAGE); + alloc = memoryManager->createGraphicsAllocationFromNTHandle(sharedHandle, rootDeviceIndex, AllocationType::sharedImage); } else { err.set(CL_INVALID_D3D11_RESOURCE_KHR); return nullptr; @@ -179,7 +179,7 @@ Image *D3DTexture::create3d(Context *context, D3DTexture3d *d3dTexture, cl_ AllocationProperties allocProperties(rootDeviceIndex, false, // allocateMemory 0u, // size - AllocationType::SHARED_IMAGE, + AllocationType::sharedImage, false, // isMultiStorageAllocation context->getDeviceBitfieldForAllocation(rootDeviceIndex)); if (memoryManager->verifyHandle(toOsHandle(sharedHandle), rootDeviceIndex, false)) { diff --git a/opencl/source/sharings/gl/linux/gl_buffer_linux.cpp b/opencl/source/sharings/gl/linux/gl_buffer_linux.cpp index c2ba73a7b3..3241b71a5f 100644 --- a/opencl/source/sharings/gl/linux/gl_buffer_linux.cpp +++ b/opencl/source/sharings/gl/linux/gl_buffer_linux.cpp @@ -148,7 +148,7 @@ GraphicsAllocation *GlBuffer::createGraphicsAllocation(Context *context, unsigne AllocationProperties properties = {context->getDevice(0)->getRootDeviceIndex(), false, // allocateMemory 0u, // size - AllocationType::SHARED_BUFFER, + AllocationType::sharedBuffer, false, // isMultiStorageAllocation context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())}; // couldn't find allocation for reuse - create new diff --git a/opencl/source/sharings/gl/linux/gl_texture_linux.cpp b/opencl/source/sharings/gl/linux/gl_texture_linux.cpp index 4b0495ac32..7f714bfddd 100644 --- a/opencl/source/sharings/gl/linux/gl_texture_linux.cpp +++ b/opencl/source/sharings/gl/linux/gl_texture_linux.cpp @@ -103,7 +103,7 @@ Image *GlTexture::createSharedGlTexture(Context *context, cl_mem_flags flags, cl AllocationProperties allocProperties(context->getDevice(0)->getRootDeviceIndex(), false, // allocateMemory &imgInfo, - AllocationType::SHARED_IMAGE, + AllocationType::sharedImage, context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())); auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(texInfo.globalShareHandle, allocProperties, false, false, false, nullptr); diff --git a/opencl/source/sharings/gl/windows/gl_buffer_windows.cpp b/opencl/source/sharings/gl/windows/gl_buffer_windows.cpp index 3566649cea..5d784aece4 100644 --- a/opencl/source/sharings/gl/windows/gl_buffer_windows.cpp +++ b/opencl/source/sharings/gl/windows/gl_buffer_windows.cpp @@ -148,7 +148,7 @@ GraphicsAllocation *GlBuffer::createGraphicsAllocation(Context *context, unsigne AllocationProperties properties = {context->getDevice(0)->getRootDeviceIndex(), false, // allocateMemory 0u, // size - AllocationType::SHARED_BUFFER, + AllocationType::sharedBuffer, false, // isMultiStorageAllocation context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())}; // couldn't find allocation for reuse - create new diff --git a/opencl/source/sharings/gl/windows/gl_texture_windows.cpp b/opencl/source/sharings/gl/windows/gl_texture_windows.cpp index d194eef8e4..ecef37ac58 100644 --- a/opencl/source/sharings/gl/windows/gl_texture_windows.cpp +++ b/opencl/source/sharings/gl/windows/gl_texture_windows.cpp @@ -56,7 +56,7 @@ Image *GlTexture::createSharedGlTexture(Context *context, cl_mem_flags flags, cl AllocationProperties allocProperties(context->getDevice(0)->getRootDeviceIndex(), false, // allocateMemory 0u, // size - AllocationType::SHARED_IMAGE, + AllocationType::sharedImage, false, // isMultiStorageAllocation context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())); auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(texInfo.globalShareHandle, allocProperties, false, false, true, nullptr); @@ -127,7 +127,7 @@ Image *GlTexture::createSharedGlTexture(Context *context, cl_mem_flags flags, cl GraphicsAllocation *mcsAlloc = nullptr; if (texInfo.globalShareHandleMCS) { - AllocationProperties allocProperties(context->getDevice(0)->getRootDeviceIndex(), 0, AllocationType::MCS, context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())); + AllocationProperties allocProperties(context->getDevice(0)->getRootDeviceIndex(), 0, AllocationType::mcs, context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())); mcsAlloc = memoryManager->createGraphicsAllocationFromSharedHandle(texInfo.globalShareHandleMCS, allocProperties, false, false, true, nullptr); if (texInfo.pGmmResInfoMCS) { DEBUG_BREAK_IF(mcsAlloc->getDefaultGmm() != nullptr); diff --git a/opencl/source/sharings/unified/unified_buffer.cpp b/opencl/source/sharings/unified/unified_buffer.cpp index 7d5d49e4be..17e8361647 100644 --- a/opencl/source/sharings/unified/unified_buffer.cpp +++ b/opencl/source/sharings/unified/unified_buffer.cpp @@ -17,7 +17,7 @@ using namespace NEO; Buffer *UnifiedBuffer::createSharedUnifiedBuffer(Context *context, cl_mem_flags flags, UnifiedSharingMemoryDescription extMem, cl_int *errcodeRet) { ErrorCodeHelper errorCode(errcodeRet, CL_SUCCESS); - auto graphicsAllocation = UnifiedBuffer::createGraphicsAllocation(context, extMem, AllocationType::SHARED_BUFFER); + auto graphicsAllocation = UnifiedBuffer::createGraphicsAllocation(context, extMem, AllocationType::sharedBuffer); if (!graphicsAllocation) { errorCode.set(CL_INVALID_MEM_OBJECT); return nullptr; diff --git a/opencl/source/sharings/unified/unified_image.cpp b/opencl/source/sharings/unified/unified_image.cpp index be13016858..8bfc3e8d88 100644 --- a/opencl/source/sharings/unified/unified_image.cpp +++ b/opencl/source/sharings/unified/unified_image.cpp @@ -31,7 +31,7 @@ Image *UnifiedImage::createSharedUnifiedImage(Context *context, cl_mem_flags fla imgInfo.imgDesc = Image::convertDescriptor(*imageDesc); imgInfo.surfaceFormat = &clSurfaceFormat->surfaceFormat; - GraphicsAllocation *graphicsAllocation = createGraphicsAllocation(context, description, &imgInfo, AllocationType::SHARED_IMAGE); + GraphicsAllocation *graphicsAllocation = createGraphicsAllocation(context, description, &imgInfo, AllocationType::sharedImage); if (!graphicsAllocation) { errorCode.set(CL_INVALID_MEM_OBJECT); return nullptr; diff --git a/opencl/source/sharings/va/va_surface.cpp b/opencl/source/sharings/va/va_surface.cpp index dd8ae6b0d5..02e3646479 100644 --- a/opencl/source/sharings/va/va_surface.cpp +++ b/opencl/source/sharings/va/va_surface.cpp @@ -204,7 +204,7 @@ Image *VASurface::createSharedVaSurface(Context *context, VASharingFunctions *sh AllocationProperties properties(context->getDevice(0)->getRootDeviceIndex(), false, // allocateMemory - &sharedSurfaceInfo.imgInfo, AllocationType::SHARED_IMAGE, + &sharedSurfaceInfo.imgInfo, AllocationType::sharedImage, context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())); auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(sharedSurfaceInfo.sharedHandle, properties, false, false, true, nullptr); diff --git a/opencl/test/unit_test/api/cl_unified_shared_memory_tests.inl b/opencl/test/unit_test/api/cl_unified_shared_memory_tests.inl index c952ceb84f..e8213d8324 100644 --- a/opencl/test/unit_test/api/cl_unified_shared_memory_tests.inl +++ b/opencl/test/unit_test/api/cl_unified_shared_memory_tests.inl @@ -1105,7 +1105,7 @@ TEST(clUnifiedSharedMemoryTests, givenDefaulMemPropertiesWhenClDeviceMemAllocInt auto gpuAllocation = graphicsAllocation->gpuAllocations.getGraphicsAllocation(mockContext.getDevice(0)->getRootDeviceIndex()); EXPECT_EQ(graphicsAllocation->size, allocationSize); EXPECT_EQ(graphicsAllocation->memoryType, InternalMemoryType::DEVICE_UNIFIED_MEMORY); - EXPECT_EQ(AllocationType::BUFFER, gpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::buffer, gpuAllocation->getAllocationType()); EXPECT_EQ(gpuAllocation->getGpuAddress(), castToUint64(unifiedMemoryDeviceAllocation)); EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize64k), gpuAllocation->getUnderlyingBufferSize()); @@ -1128,7 +1128,7 @@ TEST(clUnifiedSharedMemoryTests, givenValidMemPropertiesWhenClDeviceMemAllocInte auto gpuAllocation = graphicsAllocation->gpuAllocations.getGraphicsAllocation(mockContext.getDevice(0)->getRootDeviceIndex()); EXPECT_EQ(graphicsAllocation->size, allocationSize); EXPECT_EQ(graphicsAllocation->memoryType, InternalMemoryType::DEVICE_UNIFIED_MEMORY); - EXPECT_EQ(gpuAllocation->getAllocationType(), AllocationType::WRITE_COMBINED); + EXPECT_EQ(gpuAllocation->getAllocationType(), AllocationType::writeCombined); EXPECT_EQ(gpuAllocation->getGpuAddress(), castToUint64(unifiedMemoryDeviceAllocation)); EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize64k), gpuAllocation->getUnderlyingBufferSize()); @@ -1294,8 +1294,8 @@ TEST_F(MultiRootDeviceClUnifiedSharedMemoryTests, WhenClHostMemAllocIntelIsCalle EXPECT_EQ(graphicsAllocation1->getRootDeviceIndex(), 1u); EXPECT_EQ(graphicsAllocation2->getRootDeviceIndex(), 2u); - EXPECT_EQ(graphicsAllocation1->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); - EXPECT_EQ(graphicsAllocation2->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(graphicsAllocation1->getAllocationType(), AllocationType::bufferHostMemory); + EXPECT_EQ(graphicsAllocation2->getAllocationType(), AllocationType::bufferHostMemory); EXPECT_EQ(graphicsAllocation1->getGpuAddress(), castToUint64(unifiedMemoryHostAllocation)); EXPECT_EQ(graphicsAllocation2->getGpuAddress(), castToUint64(unifiedMemoryHostAllocation)); @@ -1331,8 +1331,8 @@ TEST_F(MultiRootDeviceClUnifiedSharedMemoryTests, WhenClSharedMemAllocIntelIsCal EXPECT_EQ(graphicsAllocation1->getRootDeviceIndex(), 1u); EXPECT_EQ(graphicsAllocation2->getRootDeviceIndex(), 2u); - EXPECT_EQ(graphicsAllocation1->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); - EXPECT_EQ(graphicsAllocation2->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(graphicsAllocation1->getAllocationType(), AllocationType::bufferHostMemory); + EXPECT_EQ(graphicsAllocation2->getAllocationType(), AllocationType::bufferHostMemory); EXPECT_EQ(graphicsAllocation1->getGpuAddress(), castToUint64(unifiedMemorySharedAllocation)); EXPECT_EQ(graphicsAllocation2->getGpuAddress(), castToUint64(unifiedMemorySharedAllocation)); diff --git a/opencl/test/unit_test/aub_tests/command_queue/aub_multicontext_tests_xehp_and_later.cpp b/opencl/test/unit_test/aub_tests/command_queue/aub_multicontext_tests_xehp_and_later.cpp index 93b09d15d4..7709d8e8e6 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/aub_multicontext_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/aub_multicontext_tests_xehp_and_later.cpp @@ -367,7 +367,7 @@ struct StaticWalkerPartitionFourTilesTests : EnqueueWithWalkerPartitionFourTiles const AllocationProperties commandStreamAllocationProperties{rootDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, - AllocationType::COMMAND_BUFFER, + AllocationType::commandBuffer, true, false, rootDevice->getDeviceBitfield()}; diff --git a/opencl/test/unit_test/aub_tests/command_queue/compression_aub_tests_xehp_and_later.cpp b/opencl/test/unit_test/aub_tests/command_queue/compression_aub_tests_xehp_and_later.cpp index 19a35e9e80..8caa88e9e9 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/compression_aub_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/compression_aub_tests_xehp_and_later.cpp @@ -99,7 +99,7 @@ void CompressionXeHPAndLater::givenCompressedBuffersWhenWriting auto notCompressedBuffer = std::unique_ptr(Buffer::create(context, CL_MEM_READ_WRITE, bufferSize, nullptr, retVal)); auto nonCompressedAllocation = notCompressedBuffer->getGraphicsAllocation(device->getRootDeviceIndex()); - nonCompressedAllocation->setAllocationType(AllocationType::BUFFER); + nonCompressedAllocation->setAllocationType(AllocationType::buffer); if (nonCompressedAllocation->getDefaultGmm()) { nonCompressedAllocation->getDefaultGmm()->isCompressionEnabled = false; } diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_buffer_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_buffer_aub_tests.cpp index 24246e5dbb..c6ac2a99a0 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_buffer_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_buffer_aub_tests.cpp @@ -116,7 +116,7 @@ HWTEST_F(AUBReadBuffer, GivenReserveCanonicalGpuAddressWhenReadingBufferThenExpe cl_float srcMemory[] = {1.0f, 2.0f, 3.0f, 4.0f}; cl_float dstMemory[] = {0.0f, 0.0f, 0.0f, 0.0f}; - GraphicsAllocation *srcAllocation = new MockGraphicsAllocation(0, AllocationType::UNKNOWN, + GraphicsAllocation *srcAllocation = new MockGraphicsAllocation(0, AllocationType::unknown, srcMemory, 0xFFFF800400001000, 0xFFFF800400001000, diff --git a/opencl/test/unit_test/aub_tests/command_stream/aub_mi_atomic_tests.cpp b/opencl/test/unit_test/aub_tests/command_stream/aub_mi_atomic_tests.cpp index 1e5807e7d5..be671a6b11 100644 --- a/opencl/test/unit_test/aub_tests/command_stream/aub_mi_atomic_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_stream/aub_mi_atomic_tests.cpp @@ -27,7 +27,7 @@ struct MiAtomicAubFixture : public AUBFixture { AllocationProperties commandBufferProperties = {device->getRootDeviceIndex(), true, MemoryConstants::pageSize, - AllocationType::COMMAND_BUFFER, + AllocationType::commandBuffer, false, device->getDeviceBitfield()}; streamAllocation = memoryManager->allocateGraphicsMemoryWithProperties(commandBufferProperties); @@ -36,7 +36,7 @@ struct MiAtomicAubFixture : public AUBFixture { AllocationProperties deviceBufferProperties = {device->getRootDeviceIndex(), true, MemoryConstants::pageSize, - AllocationType::BUFFER, + AllocationType::buffer, false, device->getDeviceBitfield()}; deviceSurface = memoryManager->allocateGraphicsMemoryWithProperties(deviceBufferProperties); @@ -45,7 +45,7 @@ struct MiAtomicAubFixture : public AUBFixture { AllocationProperties systemBufferProperties = {device->getRootDeviceIndex(), true, MemoryConstants::pageSize, - AllocationType::SVM_CPU, + AllocationType::svmCpu, false, device->getDeviceBitfield()}; systemSurface = memoryManager->allocateGraphicsMemoryWithProperties(systemBufferProperties); diff --git a/opencl/test/unit_test/aub_tests/command_stream/aub_walker_partition_tests_xehp_and_later.cpp b/opencl/test/unit_test/aub_tests/command_stream/aub_walker_partition_tests_xehp_and_later.cpp index 4e72e43b66..1a98837ed9 100644 --- a/opencl/test/unit_test/aub_tests/command_stream/aub_walker_partition_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/aub_tests/command_stream/aub_walker_partition_tests_xehp_and_later.cpp @@ -223,7 +223,7 @@ struct AubWalkerPartitionZeroFixture : public AubWalkerPartitionFixture { debugManager.flags.ExperimentalSetWalkerPartitionCount.set(0); debugManager.flags.ExperimentalSetWalkerPartitionType.set(0); - commandBufferProperties = std::make_unique(device->getRootDeviceIndex(), true, MemoryConstants::pageSize, AllocationType::COMMAND_BUFFER, false, device->getDeviceBitfield()); + commandBufferProperties = std::make_unique(device->getRootDeviceIndex(), true, MemoryConstants::pageSize, AllocationType::commandBuffer, false, device->getDeviceBitfield()); auto memoryManager = this->device->getMemoryManager(); streamAllocation = memoryManager->allocateGraphicsMemoryWithProperties(*commandBufferProperties); helperSurface = memoryManager->allocateGraphicsMemoryWithProperties(*commandBufferProperties); @@ -600,7 +600,7 @@ struct MultiLevelBatchAubFixture : public AUBFixture { auto memoryManager = this->device->getMemoryManager(); - commandBufferProperties = std::make_unique(device->getRootDeviceIndex(), true, MemoryConstants::pageSize, AllocationType::COMMAND_BUFFER, false, device->getDeviceBitfield()); + commandBufferProperties = std::make_unique(device->getRootDeviceIndex(), true, MemoryConstants::pageSize, AllocationType::commandBuffer, false, device->getDeviceBitfield()); streamAllocation = memoryManager->allocateGraphicsMemoryWithProperties(*commandBufferProperties); helperSurface = memoryManager->allocateGraphicsMemoryWithProperties(*commandBufferProperties); memset(helperSurface->getUnderlyingBuffer(), 0, MemoryConstants::pageSize); diff --git a/opencl/test/unit_test/aub_tests/command_stream/mi_math_aub_tests_dg2_and_later.cpp b/opencl/test/unit_test/aub_tests/command_stream/mi_math_aub_tests_dg2_and_later.cpp index 879846fe39..7057b1f7ac 100644 --- a/opencl/test/unit_test/aub_tests/command_stream/mi_math_aub_tests_dg2_and_later.cpp +++ b/opencl/test/unit_test/aub_tests/command_stream/mi_math_aub_tests_dg2_and_later.cpp @@ -33,7 +33,7 @@ struct MiMath : public AUBFixture, public ::testing::Test { void SetUp() override { AUBFixture::setUp(defaultHwInfo.get()); - streamAllocation = this->device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()}); + streamAllocation = this->device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::commandBuffer, device->getDeviceBitfield()}); taskStream = std::make_unique(streamAllocation); } void TearDown() override { diff --git a/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.cpp b/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.cpp index 1eaf28bfb1..f28a1a4b5d 100644 --- a/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.cpp +++ b/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.cpp @@ -18,7 +18,7 @@ GraphicsAllocation *AUBFixture::createHostPtrAllocationFromSvmPtr(void *svmPtr, GraphicsAllocation *allocation = csr->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), false, size}, svmPtr); csr->makeResidentHostPtrAllocation(allocation); csr->getInternalAllocationStorage()->storeAllocation(std::unique_ptr(allocation), TEMPORARY_ALLOCATION); - allocation->setAllocationType(AllocationType::BUFFER); + allocation->setAllocationType(AllocationType::buffer); allocation->setMemObjectsAllocationWithWritableFlags(true); return allocation; } diff --git a/opencl/test/unit_test/aub_tests/fixtures/simple_arg_fixture.h b/opencl/test/unit_test/aub_tests/fixtures/simple_arg_fixture.h index c73f23980f..ea745022cb 100644 --- a/opencl/test/unit_test/aub_tests/fixtures/simple_arg_fixture.h +++ b/opencl/test/unit_test/aub_tests/fixtures/simple_arg_fixture.h @@ -73,7 +73,7 @@ struct SimpleArgFixture : public FixtureFactory::IndirectHeapFixture, outBuffer = AUBCommandStreamFixture::createResidentAllocationAndStoreItInCsr(pDestMemory, sizeUserMemory); ASSERT_NE(nullptr, outBuffer); - outBuffer->setAllocationType(AllocationType::BUFFER); + outBuffer->setAllocationType(AllocationType::buffer); outBuffer->setMemObjectsAllocationWithWritableFlags(true); } diff --git a/opencl/test/unit_test/aub_tests/xe_hpg_core/aub_tests_stateless_compression_in_sba_xe_hpg_core.cpp b/opencl/test/unit_test/aub_tests/xe_hpg_core/aub_tests_stateless_compression_in_sba_xe_hpg_core.cpp index dbe487413f..12d261c851 100644 --- a/opencl/test/unit_test/aub_tests/xe_hpg_core/aub_tests_stateless_compression_in_sba_xe_hpg_core.cpp +++ b/opencl/test/unit_test/aub_tests/xe_hpg_core/aub_tests_stateless_compression_in_sba_xe_hpg_core.cpp @@ -53,7 +53,7 @@ XE_HPG_CORETEST_P(XeHpgCoreStatelessCompressionInSBA, GENERATEONLY_givenCompress auto unCompressedBuffer = std::unique_ptr(Buffer::create(context, CL_MEM_UNCOMPRESSED_HINT_INTEL, bufferSize, nullptr, retVal)); auto unCompressedAllocation = unCompressedBuffer->getGraphicsAllocation(device->getRootDeviceIndex()); - EXPECT_EQ(AllocationType::BUFFER, unCompressedAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::buffer, unCompressedAllocation->getAllocationType()); EXPECT_FALSE(unCompressedAllocation->isCompressionEnabled()); EXPECT_EQ(MemoryPool::LocalMemory, unCompressedAllocation->getMemoryPool()); @@ -157,7 +157,7 @@ XE_HPG_CORETEST_P(XeHpgCoreStatelessCompressionInSBA, givenUncompressibleBufferI auto unCompressedBuffer = std::unique_ptr(Buffer::create(context, CL_MEM_UNCOMPRESSED_HINT_INTEL, bufferSize, nullptr, retVal)); auto unCompressedAllocation = unCompressedBuffer->getGraphicsAllocation(device->getRootDeviceIndex()); - EXPECT_EQ(AllocationType::BUFFER, unCompressedAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::buffer, unCompressedAllocation->getAllocationType()); EXPECT_FALSE(unCompressedAllocation->isCompressionEnabled()); EXPECT_EQ(MemoryPool::LocalMemory, unCompressedAllocation->getMemoryPool()); @@ -169,7 +169,7 @@ XE_HPG_CORETEST_P(XeHpgCoreStatelessCompressionInSBA, givenUncompressibleBufferI auto uncompressibleBufferInHostMemory = std::unique_ptr(Buffer::create(context, CL_MEM_FORCE_HOST_MEMORY_INTEL, bufferSize, nullptr, retVal)); auto uncompressibleAllocationInHostMemory = uncompressibleBufferInHostMemory->getGraphicsAllocation(device->getRootDeviceIndex()); - EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, uncompressibleAllocationInHostMemory->getAllocationType()); + EXPECT_EQ(AllocationType::bufferHostMemory, uncompressibleAllocationInHostMemory->getAllocationType()); EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(uncompressibleAllocationInHostMemory->getMemoryPool())); retVal = pCmdQ->enqueueWriteBuffer(compressedBuffer.get(), CL_FALSE, 0, bufferSize, writePattern, nullptr, 0, nullptr, nullptr); @@ -219,7 +219,7 @@ XE_HPG_CORETEST_P(XeHpgCoreStatelessCompressionInSBA, givenUncompressibleHostMem EXPECT_NE(nullptr, uncompressibleHostMemAllocPtr); auto uncompressibleHostMemAlloc = context->getSVMAllocsManager()->getSVMAllocs()->get(uncompressibleHostMemAllocPtr)->gpuAllocations.getGraphicsAllocation(device->getRootDeviceIndex()); EXPECT_NE(nullptr, uncompressibleHostMemAlloc); - EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, uncompressibleHostMemAlloc->getAllocationType()); + EXPECT_EQ(AllocationType::bufferHostMemory, uncompressibleHostMemAlloc->getAllocationType()); EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(uncompressibleHostMemAlloc->getMemoryPool())); retVal = clEnqueueMemcpyINTEL(pCmdQ, true, compressedDeviceMemAllocPtr, writePattern, bufferSize, 0, nullptr, nullptr); @@ -510,7 +510,7 @@ XE_HPG_CORETEST_F(XeHpgCoreStatelessCompressionInSBAWithBCS, GENERATEONLY_givenC auto unCompressedBuffer = std::unique_ptr(Buffer::create(context.get(), CL_MEM_UNCOMPRESSED_HINT_INTEL, bufferSize, nullptr, retVal)); auto unCompressedAllocation = unCompressedBuffer->getGraphicsAllocation(tileDevices[0]->getRootDeviceIndex()); - EXPECT_EQ(AllocationType::BUFFER, unCompressedAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::buffer, unCompressedAllocation->getAllocationType()); EXPECT_EQ(MemoryPool::LocalMemory, unCompressedAllocation->getMemoryPool()); auto compressedBuffer = std::unique_ptr(Buffer::create(context.get(), CL_MEM_COMPRESSED_HINT_INTEL, bufferSize, nullptr, retVal)); @@ -552,7 +552,7 @@ XE_HPG_CORETEST_F(XeHpgCoreStatelessCompressionInSBAWithBCS, givenUncompressible auto uncompressibleBufferInHostMemory = std::unique_ptr(Buffer::create(context.get(), CL_MEM_FORCE_HOST_MEMORY_INTEL, bufferSize, nullptr, retVal)); auto uncompressibleAllocationInHostMemory = uncompressibleBufferInHostMemory->getGraphicsAllocation(tileDevices[0]->getRootDeviceIndex()); - EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, uncompressibleAllocationInHostMemory->getAllocationType()); + EXPECT_EQ(AllocationType::bufferHostMemory, uncompressibleAllocationInHostMemory->getAllocationType()); EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(uncompressibleAllocationInHostMemory->getMemoryPool())); retVal = commandQueues[0][0]->enqueueWriteBuffer(compressedBuffer.get(), CL_FALSE, 0, bufferSize, writePattern, nullptr, 0, nullptr, nullptr); diff --git a/opencl/test/unit_test/built_ins/built_in_tests.cpp b/opencl/test/unit_test/built_ins/built_in_tests.cpp index c6126d4b6e..4eb5e9e262 100644 --- a/opencl/test/unit_test/built_ins/built_in_tests.cpp +++ b/opencl/test/unit_test/built_ins/built_in_tests.cpp @@ -283,8 +283,8 @@ TEST_F(BuiltInTests, GivenCopyBufferToSystemMemoryBufferWhenDispatchInfoIsCreate MockBuffer &src = *srcPtr; MockBuffer &dst = *dstPtr; - srcPtr->mockGfxAllocation.setAllocationType(AllocationType::BUFFER); - dstPtr->mockGfxAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + srcPtr->mockGfxAllocation.setAllocationType(AllocationType::buffer); + dstPtr->mockGfxAllocation.setAllocationType(AllocationType::bufferHostMemory); BuiltinOpParams builtinOpsParams; @@ -350,8 +350,8 @@ TEST_F(BuiltInTests, GivenCopyBufferToLocalMemoryBufferWhenDispatchInfoIsCreated MockBuffer &src = *srcPtr; MockBuffer &dst = *dstPtr; - srcPtr->mockGfxAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); - dstPtr->mockGfxAllocation.setAllocationType(AllocationType::BUFFER); + srcPtr->mockGfxAllocation.setAllocationType(AllocationType::bufferHostMemory); + dstPtr->mockGfxAllocation.setAllocationType(AllocationType::buffer); BuiltinOpParams builtinOpsParams; @@ -916,8 +916,8 @@ TEST_F(BuiltInTests, givenBigOffsetAndSizeWhenBuilderCopyBufferToSystemBufferRec MockBuffer dstBuffer; dstBuffer.size = static_cast(bigSize); - srcBuffer.mockGfxAllocation.setAllocationType(AllocationType::BUFFER); - dstBuffer.mockGfxAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + srcBuffer.mockGfxAllocation.setAllocationType(AllocationType::buffer); + dstBuffer.mockGfxAllocation.setAllocationType(AllocationType::bufferHostMemory); BuiltinOpParams dc; dc.srcMemObj = &srcBuffer; @@ -956,8 +956,8 @@ TEST_F(BuiltInTests, givenBigOffsetAndSizeWhenBuilderCopyBufferToLocalBufferRect MockBuffer dstBuffer; dstBuffer.size = static_cast(bigSize); - srcBuffer.mockGfxAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); - dstBuffer.mockGfxAllocation.setAllocationType(AllocationType::BUFFER); + srcBuffer.mockGfxAllocation.setAllocationType(AllocationType::bufferHostMemory); + dstBuffer.mockGfxAllocation.setAllocationType(AllocationType::buffer); BuiltinOpParams dc; dc.srcMemObj = &srcBuffer; @@ -996,8 +996,8 @@ TEST_F(BuiltInTests, givenBigOffsetAndSizeWhenBuilderFillSystemBufferStatelessIs MockBuffer dstBuffer; dstBuffer.size = static_cast(bigSize); - srcBuffer.mockGfxAllocation.setAllocationType(AllocationType::BUFFER); - dstBuffer.mockGfxAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + srcBuffer.mockGfxAllocation.setAllocationType(AllocationType::buffer); + dstBuffer.mockGfxAllocation.setAllocationType(AllocationType::bufferHostMemory); BuiltinOpParams dc; dc.srcMemObj = &srcBuffer; @@ -1031,8 +1031,8 @@ TEST_F(BuiltInTests, givenBigOffsetAndSizeWhenBuilderFillLocalBufferStatelessIsU MockBuffer dstBuffer; dstBuffer.size = static_cast(bigSize); - srcBuffer.mockGfxAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); - dstBuffer.mockGfxAllocation.setAllocationType(AllocationType::BUFFER); + srcBuffer.mockGfxAllocation.setAllocationType(AllocationType::bufferHostMemory); + dstBuffer.mockGfxAllocation.setAllocationType(AllocationType::buffer); BuiltinOpParams dc; dc.srcMemObj = &srcBuffer; @@ -1094,7 +1094,7 @@ HWTEST_F(BuiltInTests, givenBigOffsetAndSizeWhenBuilderCopyImageToSystemBufferSt MockBuffer dstBuffer; dstBuffer.size = static_cast(bigSize); - dstBuffer.mockGfxAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + dstBuffer.mockGfxAllocation.setAllocationType(AllocationType::bufferHostMemory); std ::unique_ptr pSrcImage(Image2dHelper<>::create(pContext)); ASSERT_NE(nullptr, pSrcImage.get()); @@ -1132,7 +1132,7 @@ HWTEST_F(BuiltInTests, givenBigOffsetAndSizeWhenBuilderCopyImageToLocalBufferSta MockBuffer dstBuffer; dstBuffer.size = static_cast(bigSize); - dstBuffer.mockGfxAllocation.setAllocationType(AllocationType::BUFFER); + dstBuffer.mockGfxAllocation.setAllocationType(AllocationType::buffer); std ::unique_ptr pSrcImage(Image2dHelper<>::create(pContext)); ASSERT_NE(nullptr, pSrcImage.get()); diff --git a/opencl/test/unit_test/command_queue/blit_enqueue_2_tests.cpp b/opencl/test/unit_test/command_queue/blit_enqueue_2_tests.cpp index 420249f789..ca272b7cc0 100644 --- a/opencl/test/unit_test/command_queue/blit_enqueue_2_tests.cpp +++ b/opencl/test/unit_test/command_queue/blit_enqueue_2_tests.cpp @@ -496,7 +496,7 @@ using BlitCopyTests = BlitEnqueueTests<1>; HWTEST_TEMPLATED_F(BlitCopyTests, givenKernelAllocationInLocalMemoryWhenCreatingWithoutAllowedCpuAccessThenUseBcsForTransfer) { debugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::CpuAccessDisallowed)); - debugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(AllocationType::KERNEL_ISA) - 1)); + debugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(AllocationType::kernelIsa) - 1)); uint32_t kernelHeap = 0; KernelInfo kernelInfo; @@ -518,7 +518,7 @@ HWTEST_TEMPLATED_F(BlitCopyTests, givenKernelAllocationInLocalMemoryWhenCreating HWTEST_TEMPLATED_F(BlitCopyTests, givenKernelAllocationInLocalMemoryWhenCreatingWithAllowedCpuAccessThenDontUseBcsForTransfer) { debugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::CpuAccessAllowed)); - debugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(AllocationType::KERNEL_ISA) - 1)); + debugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(AllocationType::kernelIsa) - 1)); uint32_t kernelHeap = 0; KernelInfo kernelInfo; @@ -536,7 +536,7 @@ HWTEST_TEMPLATED_F(BlitCopyTests, givenKernelAllocationInLocalMemoryWhenCreating HWTEST_TEMPLATED_F(BlitCopyTests, givenKernelAllocationInLocalMemoryWhenCreatingWithDisallowedCpuAccessAndDisabledBlitterThenFallbackToCpuCopy) { debugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::CpuAccessDisallowed)); - debugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(AllocationType::KERNEL_ISA) - 1)); + debugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(AllocationType::kernelIsa) - 1)); device->getExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = false; @@ -583,7 +583,7 @@ HWTEST_TEMPLATED_F(BlitCopyTests, givenLocalMemoryAccessNotAllowedWhenGlobalCons HWTEST_TEMPLATED_F(BlitCopyTests, givenKernelAllocationInLocalMemoryWithoutCpuAccessAllowedWhenSubstituteKernelHeapIsCalledThenUseBcsForTransfer) { debugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::CpuAccessDisallowed)); - debugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(AllocationType::KERNEL_ISA) - 1)); + debugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(AllocationType::kernelIsa) - 1)); device->getExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true; @@ -609,7 +609,7 @@ HWTEST_TEMPLATED_F(BlitCopyTests, givenKernelAllocationInLocalMemoryWithoutCpuAc HWTEST_TEMPLATED_F(BlitCopyTests, givenKernelAllocationInLocalMemoryWithoutCpuAccessAllowedWhenLinkerRequiresPatchingOfInstructionSegmentsThenUseBcsForTransfer) { debugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::CpuAccessDisallowed)); - debugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(AllocationType::KERNEL_ISA) - 1)); + debugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(AllocationType::kernelIsa) - 1)); device->getExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true; diff --git a/opencl/test/unit_test/command_queue/blit_enqueue_fixture.h b/opencl/test/unit_test/command_queue/blit_enqueue_fixture.h index 0b3b23518a..cc9c7d59f2 100644 --- a/opencl/test/unit_test/command_queue/blit_enqueue_fixture.h +++ b/opencl/test/unit_test/command_queue/blit_enqueue_fixture.h @@ -164,7 +164,7 @@ struct BlitEnqueueTests : public ::testing::Test { } void setAllocationType(GraphicsAllocation *graphicsAllocation, bool compressed) { - graphicsAllocation->setAllocationType(AllocationType::BUFFER); + graphicsAllocation->setAllocationType(AllocationType::buffer); if (compressed && !graphicsAllocation->getDefaultGmm()) { auto gmmHelper = device->getRootDeviceEnvironment().getGmmHelper(); diff --git a/opencl/test/unit_test/command_queue/command_queue_tests.cpp b/opencl/test/unit_test/command_queue/command_queue_tests.cpp index 8551246beb..690e1dc699 100644 --- a/opencl/test/unit_test/command_queue/command_queue_tests.cpp +++ b/opencl/test/unit_test/command_queue/command_queue_tests.cpp @@ -506,7 +506,7 @@ TEST_F(CommandQueueCommandStreamTest, givenCommandStreamReceiverWithReusableAllo auto memoryManager = pDevice->getMemoryManager(); size_t requiredSize = alignUp(100 + CSRequirements::minCommandQueueCommandStreamSize + CSRequirements::csOverfetchSize, MemoryConstants::pageSize64k); - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), requiredSize, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), requiredSize, AllocationType::commandBuffer, pDevice->getDeviceBitfield()}); auto &commandStreamReceiver = cmdQ.getGpgpuCommandStreamReceiver(); commandStreamReceiver.getInternalAllocationStorage()->storeAllocation(std::unique_ptr(allocation), REUSABLE_ALLOCATION); @@ -563,7 +563,7 @@ TEST_F(CommandQueueCommandStreamTest, givenCommandQueueWhenGetCSIsCalledThenComm auto commandStreamAllocation = commandStream.getGraphicsAllocation(); ASSERT_NE(nullptr, commandStreamAllocation); - EXPECT_EQ(AllocationType::COMMAND_BUFFER, commandStreamAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::commandBuffer, commandStreamAllocation->getAllocationType()); } struct CommandQueueIndirectHeapTest : public CommandQueueMemoryDevice, @@ -672,9 +672,9 @@ HWTEST_P(CommandQueueIndirectHeapTest, givenCommandStreamReceiverWithReusableAll GraphicsAllocation *allocation = nullptr; auto &commandStreamReceiver = pClDevice->getUltCommandStreamReceiver(); - auto allocationType = AllocationType::LINEAR_STREAM; + auto allocationType = AllocationType::linearStream; if (this->GetParam() == IndirectHeap::Type::INDIRECT_OBJECT && commandStreamReceiver.canUse4GbHeaps) { - allocationType = AllocationType::INTERNAL_HEAP; + allocationType = AllocationType::internalHeap; } allocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), allocationSize, allocationType, pDevice->getDeviceBitfield()}); if (this->GetParam() == IndirectHeap::Type::SURFACE_STATE) { @@ -825,9 +825,9 @@ HWTEST_P(CommandQueueIndirectHeapTest, givenCommandQueueWhenGetIndirectHeapIsCal const auto &indirectHeap = cmdQ.getIndirectHeap(heapType, 100); auto indirectHeapAllocation = indirectHeap.getGraphicsAllocation(); ASSERT_NE(nullptr, indirectHeapAllocation); - auto expectedAllocationType = AllocationType::LINEAR_STREAM; + auto expectedAllocationType = AllocationType::linearStream; if (requireInternalHeap) { - expectedAllocationType = AllocationType::INTERNAL_HEAP; + expectedAllocationType = AllocationType::internalHeap; } EXPECT_EQ(expectedAllocationType, indirectHeapAllocation->getAllocationType()); } diff --git a/opencl/test/unit_test/command_queue/dispatch_walker_tests.cpp b/opencl/test/unit_test/command_queue/dispatch_walker_tests.cpp index 842e2e1dec..dbf0d2ddb8 100644 --- a/opencl/test/unit_test/command_queue/dispatch_walker_tests.cpp +++ b/opencl/test/unit_test/command_queue/dispatch_walker_tests.cpp @@ -824,7 +824,7 @@ HWTEST_F(DispatchWalkerTest, givenThereAreAllocationsForReuseWhenDispatchWalkerI auto &csr = pCmdQ->getGpgpuCommandStreamReceiver(); auto allocation = csr.getMemoryManager()->allocateGraphicsMemoryWithProperties({csr.getRootDeviceIndex(), MemoryConstants::pageSize64k + CSRequirements::csOverfetchSize, - AllocationType::COMMAND_BUFFER, csr.getOsContext().getDeviceBitfield()}); + AllocationType::commandBuffer, csr.getOsContext().getDeviceBitfield()}); csr.getInternalAllocationStorage()->storeAllocation(std::unique_ptr{allocation}, REUSABLE_ALLOCATION); ASSERT_FALSE(csr.getInternalAllocationStorage()->getAllocationsForReuse().peekIsEmpty()); @@ -867,8 +867,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DispatchWalkerTest, GivenMultipleKernelsWhenDispatch using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA; auto memoryManager = this->pDevice->getMemoryManager(); - auto kernelIsaAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::KERNEL_ISA, pDevice->getDeviceBitfield()}); - auto kernelIsaWithSamplerAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::KERNEL_ISA, pDevice->getDeviceBitfield()}); + auto kernelIsaAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::kernelIsa, pDevice->getDeviceBitfield()}); + auto kernelIsaWithSamplerAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::kernelIsa, pDevice->getDeviceBitfield()}); kernelInfo.kernelAllocation = kernelIsaAllocation; kernelInfoWithSampler.kernelAllocation = kernelIsaWithSamplerAllocation; auto gpuAddress1 = kernelIsaAllocation->getGpuAddressToPatch(); diff --git a/opencl/test/unit_test/command_queue/enqueue_command_without_kernel_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_command_without_kernel_tests.cpp index 8aabb0382b..f5618dfb5d 100644 --- a/opencl/test/unit_test/command_queue/enqueue_command_without_kernel_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_command_without_kernel_tests.cpp @@ -419,7 +419,7 @@ HWTEST_F(DispatchFlagsTests, givenMockKernelWhenSettingAdditionalKernelExecInfoT EnqueueProperties enqueueProperties(false, false, false, true, false, false, nullptr); - auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, AllocationType::commandBuffer, device->getDeviceBitfield()})); auto blockedCommandsData = std::make_unique(cmdStream, *mockCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage()); MockKernelWithInternals mockKernelWithInternals(*device.get()); auto pKernel = mockKernelWithInternals.mockKernel; diff --git a/opencl/test/unit_test/command_queue/enqueue_command_without_kernel_tests_dg2_and_later.cpp b/opencl/test/unit_test/command_queue/enqueue_command_without_kernel_tests_dg2_and_later.cpp index 5ec916c005..d5a2e7ef75 100644 --- a/opencl/test/unit_test/command_queue/enqueue_command_without_kernel_tests_dg2_and_later.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_command_without_kernel_tests_dg2_and_later.cpp @@ -39,7 +39,7 @@ HWTEST2_F(DispatchFlagsTests, whenSubmittingKernelWithAdditionalKernelExecInfoTh EnqueueProperties enqueueProperties(false, false, false, true, false, false, nullptr); - auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, AllocationType::commandBuffer, device->getDeviceBitfield()})); auto blockedCommandsData = std::make_unique(cmdStream, *mockCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage()); MockKernelWithInternals mockKernelWithInternals(*device.get()); auto pKernel = mockKernelWithInternals.mockKernel; diff --git a/opencl/test/unit_test/command_queue/enqueue_fill_buffer_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_fill_buffer_tests.cpp index 6b3c050fc8..e9708adb6f 100644 --- a/opencl/test/unit_test/command_queue/enqueue_fill_buffer_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_fill_buffer_tests.cpp @@ -533,7 +533,7 @@ HWTEST_F(EnqueueFillBufferCmdTests, givenEnqueueFillBufferWhenPatternAllocationI GraphicsAllocation *patternAllocation = csr.getAllocationsForReuse().peekHead(); ASSERT_NE(nullptr, patternAllocation); - EXPECT_EQ(AllocationType::FILL_PATTERN, patternAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::fillPattern, patternAllocation->getAllocationType()); } HWTEST_F(EnqueueFillBufferCmdTests, whenFillingBufferThenUseGpuAddressForPatchingOfPatternAllocation) { diff --git a/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp index 83bdd1aee9..969d3594de 100644 --- a/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp @@ -810,7 +810,7 @@ HWTEST_F(EnqueueKernelTest, givenReducedAddressSpaceGraphicsAllocationForHostPtr auto memoryManager = mockCsr->getMemoryManager(); uint32_t hostPtr[10]{}; - AllocationProperties properties{device->getRootDeviceIndex(), false, 1, AllocationType::EXTERNAL_HOST_PTR, false, device->getDeviceBitfield()}; + AllocationProperties properties{device->getRootDeviceIndex(), false, 1, AllocationType::externalHostPtr, false, device->getDeviceBitfield()}; properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = true; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, hostPtr); MockKernelWithInternals mockKernel(*device, context); @@ -834,7 +834,7 @@ HWTEST_F(EnqueueKernelTest, givenReducedAddressSpaceGraphicsAllocationForHostPtr auto memoryManager = mockCsr->getMemoryManager(); uint32_t hostPtr[10]{}; - AllocationProperties properties{device->getRootDeviceIndex(), false, 1, AllocationType::EXTERNAL_HOST_PTR, false, device->getDeviceBitfield()}; + AllocationProperties properties{device->getRootDeviceIndex(), false, 1, AllocationType::externalHostPtr, false, device->getDeviceBitfield()}; properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = false; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, hostPtr); MockKernelWithInternals mockKernel(*device, context); @@ -859,7 +859,7 @@ HWTEST_F(EnqueueKernelTest, givenFullAddressSpaceGraphicsAllocationWhenEnqueueKe auto memoryManager = mockCsr->getMemoryManager(); uint32_t hostPtr[10]{}; - AllocationProperties properties{device->getRootDeviceIndex(), false, 1, AllocationType::EXTERNAL_HOST_PTR, false, device->getDeviceBitfield()}; + AllocationProperties properties{device->getRootDeviceIndex(), false, 1, AllocationType::externalHostPtr, false, device->getDeviceBitfield()}; properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = false; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, hostPtr); MockKernelWithInternals mockKernel(*device, context); diff --git a/opencl/test/unit_test/command_queue/enqueue_read_buffer_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_read_buffer_tests.cpp index 76dc6072f5..2cbc106cfc 100644 --- a/opencl/test/unit_test/command_queue/enqueue_read_buffer_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_read_buffer_tests.cpp @@ -555,7 +555,7 @@ HWTEST_F(EnqueueReadBufferTypeTest, givenCommandQueueWhenEnqueueReadBufferIsCall HWTEST_F(EnqueueReadBufferTypeTest, givenCommandQueueWhenEnqueueReadBufferWithMapAllocationIsCalledThenItDoesntCallNotifyFunction) { auto mockCmdQ = std::make_unique>(context, pClDevice, nullptr); void *ptr = nonZeroCopyBuffer->getCpuAddressForMemoryTransfer(); - GraphicsAllocation mapAllocation{0, AllocationType::UNKNOWN, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; + GraphicsAllocation mapAllocation{0, AllocationType::unknown, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; auto retVal = mockCmdQ->enqueueReadBuffer(srcBuffer.get(), CL_TRUE, 0, diff --git a/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp index d0075f403b..cec2decac7 100644 --- a/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp @@ -895,7 +895,7 @@ HWTEST_F(EnqueueReadImageTest, givenCommandQueueWhenEnqueueReadImageWithMapAlloc size_t region[] = {imageDesc.image_width, imageDesc.image_height, imageDesc.image_array_size}; size_t rowPitch = srcImage->getHostPtrRowPitch(); size_t slicePitch = srcImage->getHostPtrSlicePitch(); - GraphicsAllocation mapAllocation{0, AllocationType::UNKNOWN, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; + GraphicsAllocation mapAllocation{0, AllocationType::unknown, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; EnqueueReadImageHelper<>::enqueueReadImage(mockCmdQ.get(), srcImage.get(), CL_TRUE, origin, region, rowPitch, slicePitch, dstPtr, &mapAllocation); diff --git a/opencl/test/unit_test/command_queue/enqueue_svm_mem_copy_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_svm_mem_copy_tests.cpp index acebc87300..7204ca9782 100644 --- a/opencl/test/unit_test/command_queue/enqueue_svm_mem_copy_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_svm_mem_copy_tests.cpp @@ -491,8 +491,8 @@ HWTEST_F(EnqueueSvmMemCopyTest, givenEnqueueSvmMemcpyWhenSvmZeroCopyThenBuiltinK std::unique_ptr(new MockBuiltinDispatchInfoBuilder(*builtIns, pCmdQ->getClDevice(), &origBuilder))); EXPECT_EQ(&origBuilder, oldBuilder.get()); - srcSvmAlloc->setAllocationType(NEO::AllocationType::SVM_ZERO_COPY); - dstSvmAlloc->setAllocationType(NEO::AllocationType::SVM_ZERO_COPY); + srcSvmAlloc->setAllocationType(NEO::AllocationType::svmZeroCopy); + dstSvmAlloc->setAllocationType(NEO::AllocationType::svmZeroCopy); // call enqueue on mock builder auto retVal = pCmdQ->enqueueSVMMemcpy( @@ -565,8 +565,8 @@ HWTEST_F(EnqueueSvmMemCopyTest, givenEnqueueSvmMemcpyWhenSvmGpuThenBuiltinKernel std::unique_ptr(new MockBuiltinDispatchInfoBuilder(*builtIns, pCmdQ->getClDevice(), &origBuilder))); EXPECT_EQ(&origBuilder, oldBuilder.get()); - srcSvmAlloc->setAllocationType(NEO::AllocationType::SVM_GPU); - dstSvmAlloc->setAllocationType(NEO::AllocationType::SVM_GPU); + srcSvmAlloc->setAllocationType(NEO::AllocationType::svmGpu); + dstSvmAlloc->setAllocationType(NEO::AllocationType::svmGpu); // call enqueue on mock builder auto retVal = pCmdQ->enqueueSVMMemcpy( diff --git a/opencl/test/unit_test/command_queue/enqueue_svm_mem_fill_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_svm_mem_fill_tests.cpp index b0e3bf5280..15f1fc383b 100644 --- a/opencl/test/unit_test/command_queue/enqueue_svm_mem_fill_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_svm_mem_fill_tests.cpp @@ -80,7 +80,7 @@ HWTEST_F(BaseEnqueueSvmMemFillTest, givenEnqueueSVMMemFillWhenUsingFillBufferBui std::unique_ptr(new MockFillBufferBuilder(*builtIns, pCmdQ->getClDevice(), &origBuilder, pattern, patternSize))); size_t patternSize = 0x10u; - auto patternAllocation = static_cast(context->getMemoryManager()->allocateGraphicsMemoryWithProperties({pCmdQ->getDevice().getRootDeviceIndex(), 2 * patternSize, AllocationType::FILL_PATTERN, pCmdQ->getDevice().getDeviceBitfield()})); + auto patternAllocation = static_cast(context->getMemoryManager()->allocateGraphicsMemoryWithProperties({pCmdQ->getDevice().getRootDeviceIndex(), 2 * patternSize, AllocationType::fillPattern, pCmdQ->getDevice().getDeviceBitfield()})); // offset cpuPtr so cpuPtr != gpuAddress (for patching) in order to ensure that setArgSVM will be called using gpu address of the pattern allocation auto origCpuPtr = patternAllocation->cpuPtr; @@ -258,7 +258,7 @@ HWTEST_F(EnqueueSvmMemFillHwTest, givenEnqueueSVMMemFillWhenUsingCopyBufferToSys auto cmdQ = std::make_unique>(context.get(), device.get()); auto svmData = context->getSVMAllocsManager()->getSVMAlloc(svmPtr); svmData->size = static_cast(bigSize); - svmData->gpuAllocations.getGraphicsAllocation(device->getRootDeviceIndex())->setAllocationType(AllocationType::SVM_ZERO_COPY); + svmData->gpuAllocations.getGraphicsAllocation(device->getRootDeviceIndex())->setAllocationType(AllocationType::svmZeroCopy); cmdQ->validateKernelSystemMemory = true; cmdQ->expectedKernelSystemMemory = true; @@ -278,7 +278,7 @@ HWTEST_F(EnqueueSvmMemFillHwTest, givenEnqueueSVMMemFillWhenUsingCopyBufferToSys HWTEST_F(EnqueueSvmMemFillHwTest, givenEnqueueSVMMemFillWhenUsingCopyBufferToLocalBufferStatefulBuilderThenSuccessIsReturned) { auto cmdQ = std::make_unique>(context.get(), device.get()); auto svmData = context->getSVMAllocsManager()->getSVMAlloc(svmPtr); - svmData->gpuAllocations.getGraphicsAllocation(device->getRootDeviceIndex())->setAllocationType(AllocationType::SVM_GPU); + svmData->gpuAllocations.getGraphicsAllocation(device->getRootDeviceIndex())->setAllocationType(AllocationType::svmGpu); cmdQ->validateKernelSystemMemory = true; cmdQ->expectedKernelSystemMemory = false; diff --git a/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp index 0cfd5195e4..c21632ae55 100644 --- a/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp @@ -888,7 +888,7 @@ TEST_F(EnqueueSvmTest, givenEnqueueSVMMemFillWhenPatternAllocationIsObtainedThen GraphicsAllocation *patternAllocation = csr.getAllocationsForReuse().peekHead(); ASSERT_NE(nullptr, patternAllocation); - EXPECT_EQ(AllocationType::FILL_PATTERN, patternAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::fillPattern, patternAllocation->getAllocationType()); } TEST_F(EnqueueSvmTest, GivenSvmAllocationWhenEnqueingKernelThenSuccessIsReturned) { @@ -1792,7 +1792,7 @@ HWTEST_F(CreateHostUnifiedMemoryAllocationTest, auto alignedSize = alignUp(allocationSize, MemoryConstants::pageSize64k); auto memoryManager = context.getMemoryManager(); - auto allocationType = AllocationType::BUFFER_HOST_MEMORY; + auto allocationType = AllocationType::bufferHostMemory; auto maxRootDeviceIndex = numDevices - 1u; RootDeviceIndicesContainer rootDeviceIndices; @@ -1837,7 +1837,7 @@ HWTEST_F(CreateHostUnifiedMemoryAllocationTest, auto alignedSize = alignUp(allocationSize, MemoryConstants::pageSize64k); auto memoryManager = context.getMemoryManager(); - auto allocationType = AllocationType::BUFFER_HOST_MEMORY; + auto allocationType = AllocationType::bufferHostMemory; auto maxRootDeviceIndex = numDevices - 1u; RootDeviceIndicesContainer rootDeviceIndices; diff --git a/opencl/test/unit_test/command_stream/cl_command_stream_receiver_tests.cpp b/opencl/test/unit_test/command_stream/cl_command_stream_receiver_tests.cpp index 04d2c83191..30cd1a8784 100644 --- a/opencl/test/unit_test/command_stream/cl_command_stream_receiver_tests.cpp +++ b/opencl/test/unit_test/command_stream/cl_command_stream_receiver_tests.cpp @@ -58,7 +58,7 @@ HWTEST_F(ClCommandStreamReceiverTests, givenCommandStreamReceiverWhenFenceAlloca EXPECT_TRUE(csr.createGlobalFenceAllocation()); ASSERT_NE(nullptr, csr.globalFenceAllocation); - EXPECT_EQ(AllocationType::GLOBAL_FENCE, csr.globalFenceAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::globalFence, csr.globalFenceAllocation->getAllocationType()); } HWTEST_F(ClCommandStreamReceiverTests, givenCommandStreamReceiverWhenGettingFenceAllocationThenCorrectFenceAllocationIsReturned) { @@ -72,7 +72,7 @@ HWTEST_F(ClCommandStreamReceiverTests, givenCommandStreamReceiverWhenGettingFenc EXPECT_TRUE(csr.createGlobalFenceAllocation()); ASSERT_NE(nullptr, csr.getGlobalFenceAllocation()); - EXPECT_EQ(AllocationType::GLOBAL_FENCE, csr.getGlobalFenceAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::globalFence, csr.getGlobalFenceAllocation()->getAllocationType()); } using CommandStreamReceiverMultiRootDeviceTest = MultiRootDeviceFixture; @@ -86,7 +86,7 @@ TEST_F(CommandStreamReceiverMultiRootDeviceTest, WhenCreatingCommandStreamGraphi EXPECT_EQ(expectedRootDeviceIndex, commandStreamReceiver->getRootDeviceIndex()); // Linear stream / Command buffer - GraphicsAllocation *allocation = mockMemoryManager->allocateGraphicsMemoryWithProperties({expectedRootDeviceIndex, 128u, AllocationType::COMMAND_BUFFER, device1->getDeviceBitfield()}); + GraphicsAllocation *allocation = mockMemoryManager->allocateGraphicsMemoryWithProperties({expectedRootDeviceIndex, 128u, AllocationType::commandBuffer, device1->getDeviceBitfield()}); LinearStream commandStream{allocation}; commandStreamReceiver->ensureCommandBufferAllocation(commandStream, 100u, 0u); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp index 1880a4f169..cc02f53f02 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp @@ -569,7 +569,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCommandStreamReceiverWhenFenc EXPECT_TRUE(csr.isMadeNonResident(csr.globalFenceAllocation)); ASSERT_NE(nullptr, csr.globalFenceAllocation); - EXPECT_EQ(AllocationType::GLOBAL_FENCE, csr.globalFenceAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::globalFence, csr.globalFenceAllocation->getAllocationType()); } HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCommandStreamReceiverWhenFenceAllocationIsRequiredButNotCreatedThenItIsNotMadeResidentDuringFlushSmallTask) { @@ -957,7 +957,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenForced32BitAllocationsModeSto auto newScratchAllocation = commandStreamReceiver->getScratchAllocation(); EXPECT_NE(scratchAllocation, newScratchAllocation); // Allocation changed - std::unique_ptr allocationReusable = commandStreamReceiver->getInternalAllocationStorage()->obtainReusableAllocation(4096, AllocationType::LINEAR_STREAM); + std::unique_ptr allocationReusable = commandStreamReceiver->getInternalAllocationStorage()->obtainReusableAllocation(4096, AllocationType::linearStream); if (allocationReusable.get() != nullptr) { if constexpr (is64bit) { @@ -992,7 +992,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenForced32BitAllocationsModeSto EXPECT_NE(scratchAllocation, newScratchAllocation); // Allocation changed CommandStreamReceiver *csrPtr = reinterpret_cast(commandStreamReceiver); - std::unique_ptr allocationTemporary = commandStreamReceiver->getTemporaryAllocations().detachAllocation(0, nullptr, csrPtr, AllocationType::SCRATCH_SURFACE); + std::unique_ptr allocationTemporary = commandStreamReceiver->getTemporaryAllocations().detachAllocation(0, nullptr, csrPtr, AllocationType::scratchSurface); EXPECT_EQ(scratchAllocation, allocationTemporary.get()); pDevice->getMemoryManager()->freeGraphicsMemory(allocationTemporary.release()); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp index 3a54c7c429..3c1c3d29c1 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp @@ -1925,7 +1925,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenBlockedKernelWhenItIsUnblocke auto kernelInfos = MockKernel::toKernelInfoContainer(pKernel->getKernelInfo(), rootDeviceIndex); MultiDeviceKernel multiDeviceKernel(MockMultiDeviceKernel::toKernelVector(pKernel), kernelInfos); auto event = std::make_unique>(pCmdQ.get(), CL_COMMAND_MARKER, 0, 0); - auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); + auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::commandBuffer, pDevice->getDeviceBitfield()})); IndirectHeap *dsh = nullptr, *ioh = nullptr, *ssh = nullptr; pCmdQ->allocateHeapMemory(IndirectHeap::Type::DYNAMIC_STATE, 4096u, dsh); @@ -1976,7 +1976,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenBlockedKernelWhenInitializeBc auto kernelInfos = MockKernel::toKernelInfoContainer(pKernel->getKernelInfo(), rootDeviceIndex); MultiDeviceKernel multiDeviceKernel(MockMultiDeviceKernel::toKernelVector(pKernel), kernelInfos); auto event = std::make_unique>(pCmdQ.get(), CL_COMMAND_MARKER, 0, 0); - auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); + auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::commandBuffer, pDevice->getDeviceBitfield()})); auto blockedCommandsData = std::make_unique(cmdStream, *pCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage()); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp index 5febe24fdd..3c135f1d5e 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp @@ -984,7 +984,7 @@ HWTEST_F(BcsTests, givenMapAllocationWhenDispatchReadWriteOperationThenSetValidG constexpr size_t mapAllocationSize = MemoryConstants::pageSize * 2; auto mapAllocationPtr = allocateAlignedMemory(mapAllocationSize, MemoryConstants::pageSize); - AllocationProperties properties{csr.getRootDeviceIndex(), false, mapAllocationSize, AllocationType::MAP_ALLOCATION, false, pDevice->getDeviceBitfield()}; + AllocationProperties properties{csr.getRootDeviceIndex(), false, mapAllocationSize, AllocationType::mapAllocation, false, pDevice->getDeviceBitfield()}; GraphicsAllocation *mapAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, mapAllocationPtr.get()); auto mapAllocationOffset = 0x1234; @@ -1106,7 +1106,7 @@ HWTEST_F(BcsTests, givenMapAllocationInBuiltinOpParamsWhenConstructingThenUseItA constexpr size_t mapAllocationSize = MemoryConstants::pageSize * 2; auto mapAllocationPtr = allocateAlignedMemory(mapAllocationSize, MemoryConstants::pageSize); - AllocationProperties properties{csr.getRootDeviceIndex(), false, mapAllocationSize, AllocationType::MAP_ALLOCATION, false, pDevice->getDeviceBitfield()}; + AllocationProperties properties{csr.getRootDeviceIndex(), false, mapAllocationSize, AllocationType::mapAllocation, false, pDevice->getDeviceBitfield()}; GraphicsAllocation *mapAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, reinterpret_cast(mapAllocationPtr.get())); auto mapAllocationOffset = 0x1234; diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_dg2_and_later.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_dg2_and_later.cpp index 260dd55f15..5b8a4ae730 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_dg2_and_later.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_dg2_and_later.cpp @@ -45,7 +45,7 @@ HWTEST2_F(CommandStreamReceiverHwTestDg2AndLater, givenGen12AndLaterWhenRayTraci EXPECT_EQ(sizeof(_3DSTATE_BTD), cmdSize); auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); - AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::SCRATCH_SURFACE, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::scratchSurface, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); commandStreamReceiver.perDssBackedBuffer = allocation; std::unique_ptr buffer(new char[cmdSize]); @@ -80,7 +80,7 @@ HWTEST2_F(CommandStreamReceiverFlushTaskDg2AndLaterTests, givenProgramExtendedPi EXPECT_EQ(expectedCmdSize, cmdSize); auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); - AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::SCRATCH_SURFACE, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::scratchSurface, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); commandStreamReceiver.perDssBackedBuffer = allocation; @@ -153,7 +153,7 @@ HWTEST2_F(CommandStreamReceiverHwTestDg2AndLater, givenGen12AndLaterWhenRayTraci EXPECT_EQ(sizeof(_3DSTATE_BTD), cmdSize); auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); - AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::SCRATCH_SURFACE, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::scratchSurface, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); commandStreamReceiver.perDssBackedBuffer = allocation; std::unique_ptr buffer(new char[cmdSize]); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_xehp_and_later.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_xehp_and_later.cpp index c109ba5925..7c302d3660 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_xehp_and_later.cpp @@ -352,9 +352,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverHwTestXeHPAndLater, givenScrat bool stateBaseAddressDirty = false; void *surfaceHeap = alignedMalloc(0x1000, 0x1000); - NEO::GraphicsAllocation heap1(1u, NEO::AllocationType::BUFFER, surfaceHeap, 0u, 0u, 0u, MemoryPool::System4KBPages, 0u); - NEO::GraphicsAllocation heap2(1u, NEO::AllocationType::BUFFER, surfaceHeap, 0u, 0u, 0u, MemoryPool::System4KBPages, 0u); - NEO::GraphicsAllocation heap3(1u, NEO::AllocationType::BUFFER, surfaceHeap, 0u, 0u, 0u, MemoryPool::System4KBPages, 0u); + NEO::GraphicsAllocation heap1(1u, NEO::AllocationType::buffer, surfaceHeap, 0u, 0u, 0u, MemoryPool::System4KBPages, 0u); + NEO::GraphicsAllocation heap2(1u, NEO::AllocationType::buffer, surfaceHeap, 0u, 0u, 0u, MemoryPool::System4KBPages, 0u); + NEO::GraphicsAllocation heap3(1u, NEO::AllocationType::buffer, surfaceHeap, 0u, 0u, 0u, MemoryPool::System4KBPages, 0u); HeapContainer container; container.push_back(&heap1); @@ -393,7 +393,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverHwTestXeHPAndLater, givenScrat *pDevice->executionEnvironment, *commandStreamReceiver->getInternalAllocationStorage()); - NEO::GraphicsAllocation graphicsAllocation(1u, NEO::AllocationType::BUFFER, nullptr, 0u, 0u, 0u, MemoryPool::System4KBPages, 0u); + NEO::GraphicsAllocation graphicsAllocation(1u, NEO::AllocationType::buffer, nullptr, 0u, 0u, 0u, MemoryPool::System4KBPages, 0u); bool cfeStateDirty = false; @@ -431,7 +431,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverHwTestXeHPAndLater, givenScrat *pDevice->executionEnvironment, *commandStreamReceiver->getInternalAllocationStorage()); - NEO::GraphicsAllocation graphicsAllocation(1u, NEO::AllocationType::BUFFER, nullptr, 0u, 0u, 0u, MemoryPool::System4KBPages, 0u); + NEO::GraphicsAllocation graphicsAllocation(1u, NEO::AllocationType::buffer, nullptr, 0u, 0u, 0u, MemoryPool::System4KBPages, 0u); void *surfaceHeap = alignedMalloc(0x1000, 0x1000); diff --git a/opencl/test/unit_test/command_stream/experimental_command_buffer_tests.cpp b/opencl/test/unit_test/command_stream/experimental_command_buffer_tests.cpp index 7cf56179a9..cb985e7c2d 100644 --- a/opencl/test/unit_test/command_stream/experimental_command_buffer_tests.cpp +++ b/opencl/test/unit_test/command_stream/experimental_command_buffer_tests.cpp @@ -276,9 +276,9 @@ HWTEST_F(MockExperimentalCommandBufferTest, givenEnabledExperimentalCmdBufferWhe // Make two allocations, since CSR will try to reuse it also auto rootDeviceIndex = pDevice->getRootDeviceIndex(); - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({rootDeviceIndex, 3 * MemoryConstants::pageSize64k, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({rootDeviceIndex, 3 * MemoryConstants::pageSize64k, AllocationType::commandBuffer, pDevice->getDeviceBitfield()}); storage->storeAllocation(std::unique_ptr(allocation), REUSABLE_ALLOCATION); - allocation = memoryManager->allocateGraphicsMemoryWithProperties({rootDeviceIndex, 3 * MemoryConstants::pageSize64k, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + allocation = memoryManager->allocateGraphicsMemoryWithProperties({rootDeviceIndex, 3 * MemoryConstants::pageSize64k, AllocationType::commandBuffer, pDevice->getDeviceBitfield()}); storage->storeAllocation(std::unique_ptr(allocation), REUSABLE_ALLOCATION); MockExperimentalCommandBuffer *mockExCmdBuffer = static_cast(commandStreamReceiver.experimentalCmdBuffer.get()); diff --git a/opencl/test/unit_test/d3d_sharing/d3d9_tests.cpp b/opencl/test/unit_test/d3d_sharing/d3d9_tests.cpp index f84121f3b5..e0eb93fc97 100644 --- a/opencl/test/unit_test/d3d_sharing/d3d9_tests.cpp +++ b/opencl/test/unit_test/d3d_sharing/d3d9_tests.cpp @@ -41,7 +41,7 @@ class MockMM : public OsAgnosticMemoryManager { } GraphicsAllocation *allocateGraphicsMemoryForImage(const AllocationData &allocationData) override { auto gmm = std::make_unique(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), *allocationData.imgInfo, StorageInfo{}, false); - AllocationProperties properties(allocationData.rootDeviceIndex, false, nullptr, AllocationType::SHARED_IMAGE, DeviceBitfield{}); + AllocationProperties properties(allocationData.rootDeviceIndex, false, nullptr, AllocationType::sharedImage, DeviceBitfield{}); auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(1, properties, false, false, true, nullptr); alloc->setDefaultGmm(forceGmm); gmmOwnershipPassed = true; @@ -256,7 +256,7 @@ TEST_F(D3D9Tests, givenD3DHandleWhenCreatingSharedSurfaceThenAllocationTypeImage ASSERT_NE(nullptr, sharedImg.get()); auto graphicsAllocation = sharedImg->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex()); ASSERT_NE(nullptr, graphicsAllocation); - EXPECT_EQ(AllocationType::SHARED_IMAGE, graphicsAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::sharedImage, graphicsAllocation->getAllocationType()); EXPECT_EQ(1u, mockSharingFcns->getTexture2dDescCalled); } diff --git a/opencl/test/unit_test/d3d_sharing/d3d_tests_part2.cpp b/opencl/test/unit_test/d3d_sharing/d3d_tests_part2.cpp index 88aa24a02a..7dea60b825 100644 --- a/opencl/test/unit_test/d3d_sharing/d3d_tests_part2.cpp +++ b/opencl/test/unit_test/d3d_sharing/d3d_tests_part2.cpp @@ -503,7 +503,7 @@ TYPED_TEST_P(D3DTests, givenD3DTexture2dWhenOclImageIsCreatedThenSharedImageAllo auto image = std::unique_ptr(D3DTexture::create2d(this->context, reinterpret_cast(&this->dummyD3DTexture), CL_MEM_READ_WRITE, 7, nullptr)); ASSERT_NE(nullptr, image.get()); ASSERT_NE(nullptr, image->getGraphicsAllocation(this->rootDeviceIndex)); - EXPECT_EQ(AllocationType::SHARED_IMAGE, image->getGraphicsAllocation(this->rootDeviceIndex)->getAllocationType()); + EXPECT_EQ(AllocationType::sharedImage, image->getGraphicsAllocation(this->rootDeviceIndex)->getAllocationType()); EXPECT_EQ(1u, this->mockSharingFcns->getTexture2dDescCalled); } @@ -520,7 +520,7 @@ TYPED_TEST_P(D3DTests, givenD3DTexture3dWhenOclImageIsCreatedThenSharedImageAllo auto image = std::unique_ptr(D3DTexture::create3d(this->context, reinterpret_cast(&this->dummyD3DTexture), CL_MEM_READ_WRITE, 1, nullptr)); ASSERT_NE(nullptr, image.get()); ASSERT_NE(nullptr, image->getGraphicsAllocation(this->rootDeviceIndex)); - EXPECT_EQ(AllocationType::SHARED_IMAGE, image->getGraphicsAllocation(this->rootDeviceIndex)->getAllocationType()); + EXPECT_EQ(AllocationType::sharedImage, image->getGraphicsAllocation(this->rootDeviceIndex)->getAllocationType()); EXPECT_EQ(1u, this->mockSharingFcns->createTexture3dCalled); EXPECT_EQ(1u, this->mockSharingFcns->getTexture3dDescCalled); diff --git a/opencl/test/unit_test/event/event_builder_tests.cpp b/opencl/test/unit_test/event/event_builder_tests.cpp index 43777972bd..240cb28599 100644 --- a/opencl/test/unit_test/event/event_builder_tests.cpp +++ b/opencl/test/unit_test/event/event_builder_tests.cpp @@ -92,7 +92,7 @@ TEST(EventBuilder, givenVirtualEventWithCommandThenFinalizeAddChild) { cmdQ.allocateHeapMemory(IndirectHeap::Type::DYNAMIC_STATE, 1, ih1); cmdQ.allocateHeapMemory(IndirectHeap::Type::INDIRECT_OBJECT, 1, ih2); cmdQ.allocateHeapMemory(IndirectHeap::Type::SURFACE_STATE, 1, ih3); - auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::commandBuffer, device->getDeviceBitfield()})); std::vector surfaces; auto kernelOperation = std::make_unique(cmdStream, *device->getDefaultEngine().commandStreamReceiver->getInternalAllocationStorage()); @@ -142,7 +142,7 @@ TEST(EventBuilder, givenVirtualEventWithSubmittedCommandAsParentThenFinalizeNotA cmdQ.allocateHeapMemory(IndirectHeap::Type::DYNAMIC_STATE, 1, ih1); cmdQ.allocateHeapMemory(IndirectHeap::Type::INDIRECT_OBJECT, 1, ih2); cmdQ.allocateHeapMemory(IndirectHeap::Type::SURFACE_STATE, 1, ih3); - auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, AllocationType::commandBuffer, device->getDeviceBitfield()})); std::vector surfaces; auto kernelOperation = std::make_unique(cmdStream, *device->getDefaultEngine().commandStreamReceiver->getInternalAllocationStorage()); diff --git a/opencl/test/unit_test/event/event_tests.cpp b/opencl/test/unit_test/event/event_tests.cpp index f11d8d460a..60e849e18b 100644 --- a/opencl/test/unit_test/event/event_tests.cpp +++ b/opencl/test/unit_test/event/event_tests.cpp @@ -462,7 +462,7 @@ TEST_F(InternalsEventTest, GivenSubmitCommandFalseWhenSubmittingCommandsThenRefA MockCommandQueue cmdQ(mockContext, pClDevice, nullptr, false); MockEvent event(&cmdQ, CL_COMMAND_NDRANGE_KERNEL, 0, 0); - auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), true, 4096, AllocationType::COMMAND_BUFFER, false, pDevice->getDeviceBitfield()})); + auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), true, 4096, AllocationType::commandBuffer, false, pDevice->getDeviceBitfield()})); IndirectHeap *dsh = nullptr, *ioh = nullptr, *ssh = nullptr; cmdQ.allocateHeapMemory(IndirectHeap::Type::DYNAMIC_STATE, 4096u, dsh); cmdQ.allocateHeapMemory(IndirectHeap::Type::INDIRECT_OBJECT, 4096u, ioh); @@ -514,7 +514,7 @@ TEST_F(InternalsEventTest, GivenSubmitCommandTrueWhenSubmittingCommandsThenRefAp MockCommandQueue cmdQ(mockContext, pClDevice, nullptr, false); MockEvent event(&cmdQ, CL_COMMAND_NDRANGE_KERNEL, 0, 0); - auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); + auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::commandBuffer, pDevice->getDeviceBitfield()})); IndirectHeap *dsh = nullptr, *ioh = nullptr, *ssh = nullptr; cmdQ.allocateHeapMemory(IndirectHeap::Type::DYNAMIC_STATE, 4096u, dsh); cmdQ.allocateHeapMemory(IndirectHeap::Type::INDIRECT_OBJECT, 4096u, ioh); @@ -549,7 +549,7 @@ TEST_F(InternalsEventTest, givenBlockedKernelWithPrintfWhenSubmittedThenPrintOut testing::internal::CaptureStdout(); MockEvent event(&mockCmdQueue, CL_COMMAND_NDRANGE_KERNEL, 0, 0); - auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); + auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::commandBuffer, pDevice->getDeviceBitfield()})); IndirectHeap *dsh = nullptr, *ioh = nullptr, *ssh = nullptr; mockCmdQueue.allocateHeapMemory(IndirectHeap::Type::DYNAMIC_STATE, 4096u, dsh); mockCmdQueue.allocateHeapMemory(IndirectHeap::Type::INDIRECT_OBJECT, 4096u, ioh); @@ -601,7 +601,7 @@ TEST_F(InternalsEventTest, givenGpuHangOnCmdQueueWaitFunctionAndBlockedKernelWit testing::internal::CaptureStdout(); MockEvent event(&mockCmdQueue, CL_COMMAND_NDRANGE_KERNEL, 0, 0); - auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); + auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::commandBuffer, pDevice->getDeviceBitfield()})); IndirectHeap *dsh = nullptr, *ioh = nullptr, *ssh = nullptr; mockCmdQueue.allocateHeapMemory(IndirectHeap::Type::DYNAMIC_STATE, 4096u, dsh); mockCmdQueue.allocateHeapMemory(IndirectHeap::Type::INDIRECT_OBJECT, 4096u, ioh); @@ -650,7 +650,7 @@ TEST_F(InternalsEventTest, givenGpuHangOnPrintingEnqueueOutputAndBlockedKernelWi testing::internal::CaptureStdout(); MockEvent event(&mockCmdQueue, CL_COMMAND_NDRANGE_KERNEL, 0, 0); - auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); + auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::commandBuffer, pDevice->getDeviceBitfield()})); IndirectHeap *dsh = nullptr, *ioh = nullptr, *ssh = nullptr; mockCmdQueue.allocateHeapMemory(IndirectHeap::Type::DYNAMIC_STATE, 4096u, dsh); mockCmdQueue.allocateHeapMemory(IndirectHeap::Type::INDIRECT_OBJECT, 4096u, ioh); @@ -1196,7 +1196,7 @@ HWTEST_F(EventTest, givenVirtualEventWhenCommandSubmittedThenLockCsrOccurs) { pCmdQ->allocateHeapMemory(IndirectHeap::Type::DYNAMIC_STATE, 1, ih1); pCmdQ->allocateHeapMemory(IndirectHeap::Type::INDIRECT_OBJECT, 1, ih2); pCmdQ->allocateHeapMemory(IndirectHeap::Type::SURFACE_STATE, 1, ih3); - auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); + auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::commandBuffer, pDevice->getDeviceBitfield()})); std::vector surfaces; auto kernelOperation = std::make_unique(cmdStream, *pDevice->getDefaultEngine().commandStreamReceiver->getInternalAllocationStorage()); @@ -1760,7 +1760,7 @@ HWTEST_F(InternalsEventTest, givenAbortedCommandWhenSubmitCalledThenDontUpdateFl MockKernelWithInternals mockKernelWithInternals(*pClDevice); auto pKernel = mockKernelWithInternals.mockKernel; - auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); + auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::commandBuffer, pDevice->getDeviceBitfield()})); IndirectHeap *dsh = nullptr, *ioh = nullptr, *ssh = nullptr; pCmdQ->allocateHeapMemory(IndirectHeap::Type::DYNAMIC_STATE, 4096u, dsh); pCmdQ->allocateHeapMemory(IndirectHeap::Type::INDIRECT_OBJECT, 4096u, ioh); diff --git a/opencl/test/unit_test/fixtures/d3d_test_fixture.h b/opencl/test/unit_test/fixtures/d3d_test_fixture.h index 1b406734d2..9c4a78eb49 100644 --- a/opencl/test/unit_test/fixtures/d3d_test_fixture.h +++ b/opencl/test/unit_test/fixtures/d3d_test_fixture.h @@ -63,7 +63,7 @@ class D3DTests : public PlatformFixture, public ::testing::Test { if (failAlloc) { return nullptr; } - AllocationProperties properties(rootDeviceIndex, true, 0, AllocationType::INTERNAL_HOST_MEMORY, false, false, 0); + AllocationProperties properties(rootDeviceIndex, true, 0, AllocationType::internalHostMemory, false, false, 0); auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(toOsHandle(handle), properties, false, false, true, nullptr); alloc->setDefaultGmm(forceGmm); gmmOwnershipPassed = true; diff --git a/opencl/test/unit_test/gen12lp/buffer_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/buffer_tests_gen12lp.inl index f3c5394085..b47ee3115c 100644 --- a/opencl/test/unit_test/gen12lp/buffer_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/buffer_tests_gen12lp.inl @@ -75,7 +75,7 @@ GEN12LPTEST_F(BufferTestsTgllp, givenConstantSurfaceWhenProgrammingSurfaceStateT nullptr, retVal)); ASSERT_EQ(CL_SUCCESS, retVal); - buffer->getGraphicsAllocation(0)->setAllocationType(AllocationType::CONSTANT_SURFACE); + buffer->getGraphicsAllocation(0)->setAllocationType(AllocationType::constantSurface); typename FamilyType::RENDER_SURFACE_STATE surfaceState = {}; buffer->setArgStateful(&surfaceState, false, false, false, false, context->getDevice(0)->getDevice(), false, false); diff --git a/opencl/test/unit_test/gen12lp/gfx_core_helper_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/gfx_core_helper_tests_gen12lp.inl index e391f92937..2a2bd94330 100644 --- a/opencl/test/unit_test/gen12lp/gfx_core_helper_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/gfx_core_helper_tests_gen12lp.inl @@ -300,7 +300,7 @@ GEN12LPTEST_F(GfxCoreHelperTestsGen12LpBuffer, givenBufferThenCheckResourceCompa buffer.reset(Buffer::create(context.get(), 0, MemoryConstants::cacheLineSize, nullptr, retVal)); - buffer->getGraphicsAllocation(rootDeviceIndex)->setAllocationType(AllocationType::BUFFER); + buffer->getGraphicsAllocation(rootDeviceIndex)->setAllocationType(AllocationType::buffer); EXPECT_TRUE(gfxCoreHelper.checkResourceCompatibility(*buffer->getGraphicsAllocation(rootDeviceIndex))); } @@ -397,16 +397,16 @@ GEN12LPTEST_F(GfxCoreHelperTestGen12Lp, givenAllocationTypeWithCpuAccessRequired debugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::CpuAccessDisallowed)); const AllocationType allocationTypesToUseSystemMemory[] = { - AllocationType::COMMAND_BUFFER, - AllocationType::CONSTANT_SURFACE, - AllocationType::GLOBAL_SURFACE, - AllocationType::INTERNAL_HEAP, - AllocationType::LINEAR_STREAM, - AllocationType::PIPE, - AllocationType::PRINTF_SURFACE, - AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, - AllocationType::RING_BUFFER, - AllocationType::SEMAPHORE_BUFFER}; + AllocationType::commandBuffer, + AllocationType::constantSurface, + AllocationType::globalSurface, + AllocationType::internalHeap, + AllocationType::linearStream, + AllocationType::pipe, + AllocationType::printfSurface, + AllocationType::timestampPacketTagBuffer, + AllocationType::ringBuffer, + AllocationType::semaphoreBuffer}; MockMemoryManager mockMemoryManager; for (auto allocationType : allocationTypesToUseSystemMemory) { @@ -419,7 +419,7 @@ GEN12LPTEST_F(GfxCoreHelperTestGen12Lp, givenAllocationTypeWithCpuAccessRequired } AllocationData allocData{}; - AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::buffer, false, mockDeviceBitfield); mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.requiresCpuAccess); EXPECT_FALSE(allocData.flags.useSystemMemory); diff --git a/opencl/test/unit_test/gen12lp/tgllp/buffer_tests_tgllp.cpp b/opencl/test/unit_test/gen12lp/tgllp/buffer_tests_tgllp.cpp index 3af58ee1f9..58bed872d0 100644 --- a/opencl/test/unit_test/gen12lp/tgllp/buffer_tests_tgllp.cpp +++ b/opencl/test/unit_test/gen12lp/tgllp/buffer_tests_tgllp.cpp @@ -70,7 +70,7 @@ GEN12LPTEST_F(BufferTestsTgllp, givenConstantSurfaceWhenProgrammingSurfaceStateT nullptr, retVal)); ASSERT_EQ(CL_SUCCESS, retVal); - buffer->getGraphicsAllocation(0)->setAllocationType(AllocationType::CONSTANT_SURFACE); + buffer->getGraphicsAllocation(0)->setAllocationType(AllocationType::constantSurface); typename FamilyType::RENDER_SURFACE_STATE surfaceState = {}; buffer->setArgStateful(&surfaceState, false, false, false, false, context->getDevice(0)->getDevice(), false, 1u); diff --git a/opencl/test/unit_test/gtpin/gtpin_tests.cpp b/opencl/test/unit_test/gtpin/gtpin_tests.cpp index b3a4357ef4..80b16e9894 100644 --- a/opencl/test/unit_test/gtpin/gtpin_tests.cpp +++ b/opencl/test/unit_test/gtpin/gtpin_tests.cpp @@ -2123,7 +2123,7 @@ HWTEST_F(GTPinTests, givenGtPinInitializedWhenSubmittingKernelCommandThenFlushed mockCmdQ->allocateHeapMemory(IndirectHeap::Type::SURFACE_STATE, 128, ih3); PreemptionMode preemptionMode = pDevice->getPreemptionMode(); - auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 128, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); + auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 128, AllocationType::commandBuffer, pDevice->getDeviceBitfield()})); std::vector surfaces; auto kernelOperation = std::make_unique(cmdStream, *mockCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage()); @@ -2229,11 +2229,11 @@ TEST_F(GTPinTestsWithLocalMemory, givenGtPinCanUseSharedAllocationWhenGtPinBuffe auto cpuAllocation = allocData->cpuAllocation; ASSERT_NE(nullptr, cpuAllocation); - EXPECT_NE(AllocationType::UNIFIED_SHARED_MEMORY, cpuAllocation->getAllocationType()); + EXPECT_NE(AllocationType::unifiedSharedMemory, cpuAllocation->getAllocationType()); auto gpuAllocation = allocData->gpuAllocations.getGraphicsAllocation(pDevice->getRootDeviceIndex()); ASSERT_NE(nullptr, gpuAllocation); - EXPECT_NE(AllocationType::UNIFIED_SHARED_MEMORY, gpuAllocation->getAllocationType()); + EXPECT_NE(AllocationType::unifiedSharedMemory, gpuAllocation->getAllocationType()); uint8_t *address = nullptr; status = gtpinMapBuffer(gtPinContext, resource, &address); @@ -2270,7 +2270,7 @@ TEST_F(GTPinTestsWithLocalMemory, givenGtPinCanUseSharedAllocationWhenGtPinBuffe auto gpuAllocation = allocData->gpuAllocations.getGraphicsAllocation(pDevice->getRootDeviceIndex()); ASSERT_NE(nullptr, gpuAllocation); - EXPECT_NE(AllocationType::UNIFIED_SHARED_MEMORY, gpuAllocation->getAllocationType()); + EXPECT_NE(AllocationType::unifiedSharedMemory, gpuAllocation->getAllocationType()); uint8_t *address = nullptr; status = gtpinMapBuffer(gtPinContext, resource, &address); diff --git a/opencl/test/unit_test/helpers/api_specific_config_ocl_tests.cpp b/opencl/test/unit_test/helpers/api_specific_config_ocl_tests.cpp index 6cb4a48383..7856b3a639 100644 --- a/opencl/test/unit_test/helpers/api_specific_config_ocl_tests.cpp +++ b/opencl/test/unit_test/helpers/api_specific_config_ocl_tests.cpp @@ -62,7 +62,7 @@ TEST(ApiSpecificConfigOclTests, givenEnableStatelessCompressionWhenProvidingSvmG DeviceBitfield deviceBitfield{0x0}; AllocationProperties properties(0, MemoryConstants::pageSize, - AllocationType::SVM_GPU, + AllocationType::svmGpu, deviceBitfield); EXPECT_TRUE(NEO::CompressionSelector::preferCompressedAllocation(properties)); @@ -75,7 +75,7 @@ TEST(ApiSpecificConfigOclTests, givenEnableStatelessCompressionWhenProvidingPrin DeviceBitfield deviceBitfield{0x0}; AllocationProperties properties(0, MemoryConstants::pageSize, - AllocationType::PRINTF_SURFACE, + AllocationType::printfSurface, deviceBitfield); EXPECT_TRUE(NEO::CompressionSelector::preferCompressedAllocation(properties)); diff --git a/opencl/test/unit_test/helpers/cl_memory_properties_helpers_tests.cpp b/opencl/test/unit_test/helpers/cl_memory_properties_helpers_tests.cpp index a24247508d..12c2374e88 100644 --- a/opencl/test/unit_test/helpers/cl_memory_properties_helpers_tests.cpp +++ b/opencl/test/unit_test/helpers/cl_memory_properties_helpers_tests.cpp @@ -34,7 +34,7 @@ TEST(MemoryProperties, givenResource48BitMemoryPropertySetWhenGetAllocationPrope HardwareInfo hwInfo(*defaultHwInfo); - auto allocationProperties = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, true, 0, AllocationType::BUFFER, + auto allocationProperties = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, true, 0, AllocationType::buffer, false, hwInfo, deviceBitfield, false); EXPECT_EQ(1u, allocationProperties.flags.resource48Bit); @@ -367,7 +367,7 @@ TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsIntelWhenParsingMemoryPrope } TEST_F(MemoryPropertiesHelperTests, givenDifferentParametersWhenCallingFillCachePolicyInPropertiesThenFlushL3FlagsAreCorrectlySet) { - AllocationProperties allocationProperties{mockRootDeviceIndex, 0, AllocationType::BUFFER, mockDeviceBitfield}; + AllocationProperties allocationProperties{mockRootDeviceIndex, 0, AllocationType::buffer, mockDeviceBitfield}; for (auto uncached : ::testing::Bool()) { for (auto readOnly : ::testing::Bool()) { @@ -550,7 +550,7 @@ TEST_F(MemoryPropertiesHelperTests, givenUsmInitialPlacementSetWhenCallingHasIni } TEST_F(MemoryPropertiesHelperTests, WhenCallingSetInitialPlacementThenCorrectValueIsSetInAllocationProperties) { - AllocationProperties allocationProperties{mockRootDeviceIndex, 0, AllocationType::UNIFIED_SHARED_MEMORY, mockDeviceBitfield}; + AllocationProperties allocationProperties{mockRootDeviceIndex, 0, AllocationType::unifiedSharedMemory, mockDeviceBitfield}; for (auto initialPlacement : {GraphicsAllocation::UsmInitialPlacement::CPU, GraphicsAllocation::UsmInitialPlacement::GPU}) { MemoryPropertiesHelper::setUSMInitialPlacement(allocationProperties, initialPlacement); diff --git a/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp b/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp index 01e62b4797..454496c5d4 100644 --- a/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp @@ -229,7 +229,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, givenIndirectHeapNotAllocatedF HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, givenIndirectHeapAllocatedFromInternalPoolWhenSendCrossThreadDataIsCalledThenHeapBaseOffsetIsReturned) { using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - auto internalAllocation = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP, pDevice->getDeviceBitfield())); + auto internalAllocation = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, AllocationType::internalHeap, pDevice->getDeviceBitfield())); IndirectHeap indirectHeap(internalAllocation, true); auto expectedOffset = internalAllocation->getGpuAddressToPatch(); @@ -676,12 +676,12 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, WhenGettingBindingTableStateTh // setup global memory char globalBuffer[16]; - GraphicsAllocation gfxGlobalAlloc(0, AllocationType::UNKNOWN, globalBuffer, castToUint64(globalBuffer), 0llu, sizeof(globalBuffer), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); + GraphicsAllocation gfxGlobalAlloc(0, AllocationType::unknown, globalBuffer, castToUint64(globalBuffer), 0llu, sizeof(globalBuffer), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); program.setGlobalSurface(&gfxGlobalAlloc); // setup constant memory char constBuffer[16]; - GraphicsAllocation gfxConstAlloc(0, AllocationType::UNKNOWN, constBuffer, castToUint64(constBuffer), 0llu, sizeof(constBuffer), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); + GraphicsAllocation gfxConstAlloc(0, AllocationType::unknown, constBuffer, castToUint64(constBuffer), 0llu, sizeof(constBuffer), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); program.setConstantSurface(&gfxConstAlloc); // create kernel @@ -1312,7 +1312,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, HardwareCommandsTestXeHpAndLater, givenIndirectHeap HWCMDTEST_F(IGFX_XE_HP_CORE, HardwareCommandsTestXeHpAndLater, givenIndirectHeapAllocatedFromInternalPoolWhenSendCrossThreadDataIsCalledThenHeapBaseOffsetIsReturned) { using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - auto internalAllocation = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP, pDevice->getDeviceBitfield())); + auto internalAllocation = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, AllocationType::internalHeap, pDevice->getDeviceBitfield())); IndirectHeap indirectHeap(internalAllocation, true); auto expectedOffset = is64bit ? internalAllocation->getGpuAddressToPatch() : 0u; diff --git a/opencl/test/unit_test/helpers/heap_assigner_ocl_tests.cpp b/opencl/test/unit_test/helpers/heap_assigner_ocl_tests.cpp index 416813e4c9..abf835b0ae 100644 --- a/opencl/test/unit_test/helpers/heap_assigner_ocl_tests.cpp +++ b/opencl/test/unit_test/helpers/heap_assigner_ocl_tests.cpp @@ -18,7 +18,7 @@ using AlocationHelperTests = Test; HWTEST_F(AlocationHelperTests, givenLinearStreamTypeWhenUseExternalAllocatorForSshAndDshDisabledThenUse32BitIsFalse) { HeapAssigner heapAssigner{false}; - EXPECT_FALSE(heapAssigner.use32BitHeap(AllocationType::LINEAR_STREAM)); + EXPECT_FALSE(heapAssigner.use32BitHeap(AllocationType::linearStream)); } } // namespace NEO \ No newline at end of file diff --git a/opencl/test/unit_test/helpers/task_information_tests.cpp b/opencl/test/unit_test/helpers/task_information_tests.cpp index a54337536d..6b99c7304d 100644 --- a/opencl/test/unit_test/helpers/task_information_tests.cpp +++ b/opencl/test/unit_test/helpers/task_information_tests.cpp @@ -166,7 +166,7 @@ TEST(CommandTest, givenWaitlistRequestWhenCommandComputeKernelIsCreatedThenMakeL cmdQ.allocateHeapMemory(IndirectHeap::Type::DYNAMIC_STATE, 1, ih1); cmdQ.allocateHeapMemory(IndirectHeap::Type::INDIRECT_OBJECT, 1, ih2); cmdQ.allocateHeapMemory(IndirectHeap::Type::SURFACE_STATE, 1, ih3); - auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::commandBuffer, device->getDeviceBitfield()})); std::vector surfaces; auto kernelOperation = std::make_unique(cmdStream, *device->getDefaultEngine().commandStreamReceiver->getInternalAllocationStorage()); @@ -201,7 +201,7 @@ TEST(KernelOperationDestruction, givenKernelOperationWhenItIsDestructedThenAllAl cmdQ.allocateHeapMemory(IndirectHeap::Type::DYNAMIC_STATE, 1, ih1); cmdQ.allocateHeapMemory(IndirectHeap::Type::INDIRECT_OBJECT, 1, ih2); cmdQ.allocateHeapMemory(IndirectHeap::Type::SURFACE_STATE, 1, ih3); - auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::commandBuffer, device->getDeviceBitfield()})); auto &heapAllocation1 = *ih1->getGraphicsAllocation(); auto &heapAllocation2 = *ih2->getGraphicsAllocation(); @@ -279,7 +279,7 @@ HWTEST_F(DispatchFlagsTests, givenCommandComputeKernelWhenSubmitThenPassCorrectD mockCmdQ->allocateHeapMemory(IndirectHeap::Type::SURFACE_STATE, 1, ih3); PreemptionMode preemptionMode = device->getPreemptionMode(); - auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::commandBuffer, device->getDeviceBitfield()})); std::vector surfaces; auto kernelOperation = std::make_unique(cmdStream, *mockCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage()); @@ -322,7 +322,7 @@ HWTEST_F(DispatchFlagsTests, givenClCommandCopyImageWhenSubmitThenFlushTextureCa mockCmdQ->allocateHeapMemory(IndirectHeap::Type::SURFACE_STATE, 1, ih3); PreemptionMode preemptionMode = device->getPreemptionMode(); - auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::commandBuffer, device->getDeviceBitfield()})); std::vector surfaces; auto kernelOperation = std::make_unique(cmdStream, *mockCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage()); @@ -369,7 +369,7 @@ HWTEST_F(DispatchFlagsTests, givenCommandWithoutKernelWhenSubmitThenPassCorrectD mockCmdQ->allocateHeapMemory(IndirectHeap::Type::INDIRECT_OBJECT, 1, ih2); mockCmdQ->allocateHeapMemory(IndirectHeap::Type::SURFACE_STATE, 1, ih3); - auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::commandBuffer, device->getDeviceBitfield()})); auto kernelOperation = std::make_unique(cmdStream, *mockCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage()); kernelOperation->setHeaps(ih1, ih2, ih3); std::unique_ptr command(new CommandWithoutKernel(*mockCmdQ, kernelOperation)); @@ -406,7 +406,7 @@ HWTEST_F(DispatchFlagsTests, givenCommandComputeKernelWhenSubmitThenPassCorrectD mockCmdQ->dispatchHints = 1234; PreemptionMode preemptionMode = device->getPreemptionMode(); - auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::commandBuffer, device->getDeviceBitfield()})); std::vector surfaces; auto kernelOperation = std::make_unique(cmdStream, *mockCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage()); diff --git a/opencl/test/unit_test/helpers/test_preamble_xehp_and_later.cpp b/opencl/test/unit_test/helpers/test_preamble_xehp_and_later.cpp index 214d34c07d..1be92e7e29 100644 --- a/opencl/test/unit_test/helpers/test_preamble_xehp_and_later.cpp +++ b/opencl/test/unit_test/helpers/test_preamble_xehp_and_later.cpp @@ -449,7 +449,7 @@ using RenderSurfaceStateXeHPAndLaterTests = XeHpCommandStreamReceiverFlushTaskTe HWCMDTEST_F(IGFX_XE_HP_CORE, RenderSurfaceStateXeHPAndLaterTests, givenSpecificProductFamilyWhenAppendingRssThenProgramGpuCoherency) { auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); size_t allocationSize = MemoryConstants::pageSize; - AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, AllocationType::buffer, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); auto rssCmd = FamilyType::cmdInitRenderSurfaceState; diff --git a/opencl/test/unit_test/kernel/kernel_arg_buffer_tests.cpp b/opencl/test/unit_test/kernel/kernel_arg_buffer_tests.cpp index b450f69138..8022993490 100644 --- a/opencl/test/unit_test/kernel/kernel_arg_buffer_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_arg_buffer_tests.cpp @@ -206,7 +206,7 @@ TEST_F(KernelArgBufferTest, given32BitDeviceWhenArgPassedIsNullThenOnly4BytesAre TEST_F(KernelArgBufferTest, givenBufferWhenHasDirectStatelessAccessToHostMemoryIsCalledThenReturnFalse) { MockBuffer buffer; - buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::BUFFER); + buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::buffer); auto val = (cl_mem)&buffer; auto pVal = &val; @@ -223,7 +223,7 @@ TEST_F(KernelArgBufferTest, givenBufferWhenHasDirectStatelessAccessToHostMemoryI TEST_F(KernelArgBufferTest, givenSharedBufferWhenHasDirectStatelessAccessToSharedBufferIsCalledThenReturnCorrectValue) { MockBuffer buffer; - buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::SHARED_BUFFER); + buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::sharedBuffer); auto val = (cl_mem)&buffer; auto pVal = &val; @@ -240,7 +240,7 @@ TEST_F(KernelArgBufferTest, givenSharedBufferWhenHasDirectStatelessAccessToShare TEST_F(KernelArgBufferTest, givenBufferInHostMemoryWhenHasDirectStatelessAccessToHostMemoryIsCalledThenReturnCorrectValue) { MockBuffer buffer; - buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::bufferHostMemory); auto val = (cl_mem)&buffer; auto pVal = &val; @@ -264,7 +264,7 @@ TEST_F(KernelArgBufferTest, givenGfxAllocationWhenHasDirectStatelessAccessToHost char data[128]; void *ptr = &data; MockGraphicsAllocation gfxAllocation(ptr, 128); - gfxAllocation.setAllocationType(AllocationType::BUFFER); + gfxAllocation.setAllocationType(AllocationType::buffer); for (auto pureStatefulBufferAccess : {false, true}) { pKernelInfo->setBufferStateful(0, pureStatefulBufferAccess); @@ -285,7 +285,7 @@ TEST_F(KernelArgBufferTest, givenGfxAllocationInHostMemoryWhenHasDirectStateless char data[128]; void *ptr = &data; MockGraphicsAllocation gfxAllocation(ptr, 128); - gfxAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + gfxAllocation.setAllocationType(AllocationType::bufferHostMemory); for (auto pureStatefulBufferAccess : {false, true}) { pKernelInfo->setBufferStateful(0, pureStatefulBufferAccess); @@ -324,15 +324,15 @@ TEST_F(KernelArgBufferTest, givenKernelWithIndirectStatelessAccessWhenHasIndirec MockKernel kernelWithNoIndirectHostAllocations(pProgram, kernelInfo, *pClDevice); EXPECT_FALSE(kernelWithNoIndirectHostAllocations.hasIndirectStatelessAccessToHostMemory()); - const auto allocationTypes = {AllocationType::BUFFER, - AllocationType::BUFFER_HOST_MEMORY}; + const auto allocationTypes = {AllocationType::buffer, + AllocationType::bufferHostMemory}; MockKernel kernelWithIndirectUnifiedMemoryAllocation(pProgram, kernelInfo, *pClDevice); MockGraphicsAllocation gfxAllocation; for (const auto type : allocationTypes) { gfxAllocation.setAllocationType(type); kernelWithIndirectUnifiedMemoryAllocation.setUnifiedMemoryExecInfo(&gfxAllocation); - if (type == AllocationType::BUFFER_HOST_MEMORY) { + if (type == AllocationType::bufferHostMemory) { EXPECT_TRUE(kernelWithIndirectUnifiedMemoryAllocation.hasIndirectStatelessAccessToHostMemory()); } else { EXPECT_FALSE(kernelWithIndirectUnifiedMemoryAllocation.hasIndirectStatelessAccessToHostMemory()); @@ -383,7 +383,7 @@ TEST_F(KernelArgBufferTest, givenSetArgBufferOnKernelWithDirectStatelessAccessTo debugManager.flags.EnableStatelessCompression.set(1); MockBuffer buffer; - buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::SHARED_BUFFER); + buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::sharedBuffer); auto val = (cl_mem)&buffer; auto pVal = &val; @@ -405,7 +405,7 @@ TEST_F(KernelArgBufferTest, givenSetArgBufferOnKernelWithDirectStatelessAccessTo debugManager.flags.EnableStatelessCompression.set(1); MockBuffer buffer; - buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::bufferHostMemory); auto val = (cl_mem)&buffer; auto pVal = &val; @@ -455,7 +455,7 @@ TEST_F(KernelArgBufferTest, givenSetArgSvmAllocOnKernelWithDirectStatelessAccess char data[128]; void *ptr = &data; MockGraphicsAllocation gfxAllocation(ptr, 128); - gfxAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + gfxAllocation.setAllocationType(AllocationType::bufferHostMemory); auto retVal = pKernel->setArgSvmAlloc(0, ptr, &gfxAllocation, 0u); EXPECT_EQ(CL_SUCCESS, retVal); @@ -501,7 +501,7 @@ TEST_F(KernelArgBufferTest, givenSetUnifiedMemoryExecInfoOnKernelWithNoIndirectS pKernelInfo->kernelDescriptor.kernelAttributes.hasIndirectStatelessAccess = false; MockGraphicsAllocation gfxAllocation; - gfxAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + gfxAllocation.setAllocationType(AllocationType::bufferHostMemory); pKernel->setUnifiedMemoryExecInfo(&gfxAllocation); @@ -520,8 +520,8 @@ TEST_F(KernelArgBufferTest, givenSetUnifiedMemoryExecInfoOnKernelWithIndirectSta pKernelInfo->kernelDescriptor.kernelAttributes.hasIndirectStatelessAccess = true; - const auto allocationTypes = {AllocationType::BUFFER, - AllocationType::BUFFER_HOST_MEMORY}; + const auto allocationTypes = {AllocationType::buffer, + AllocationType::bufferHostMemory}; MockGraphicsAllocation gfxAllocation; @@ -530,7 +530,7 @@ TEST_F(KernelArgBufferTest, givenSetUnifiedMemoryExecInfoOnKernelWithIndirectSta pKernel->setUnifiedMemoryExecInfo(&gfxAllocation); - if (type == AllocationType::BUFFER_HOST_MEMORY) { + if (type == AllocationType::bufferHostMemory) { EXPECT_TRUE(pKernel->hasIndirectStatelessAccessToHostMemory()); } else { EXPECT_FALSE(pKernel->hasIndirectStatelessAccessToHostMemory()); @@ -540,7 +540,7 @@ TEST_F(KernelArgBufferTest, givenSetUnifiedMemoryExecInfoOnKernelWithIndirectSta pKernel->updateAuxTranslationRequired(); - if (type == AllocationType::BUFFER_HOST_MEMORY) { + if (type == AllocationType::bufferHostMemory) { EXPECT_TRUE(pKernel->isAuxTranslationRequired()); } else { EXPECT_FALSE(pKernel->isAuxTranslationRequired()); @@ -557,10 +557,10 @@ TEST_F(KernelArgBufferTest, givenSetUnifiedMemoryExecInfoOnKernelWithIndirectSta pKernelInfo->kernelDescriptor.kernelAttributes.hasIndirectStatelessAccess = true; - constexpr std::array allocationTypes = {{{AllocationType::BUFFER, false}, - {AllocationType::BUFFER, true}, - {AllocationType::BUFFER_HOST_MEMORY, false}, - {AllocationType::SVM_GPU, true}}}; + constexpr std::array allocationTypes = {{{AllocationType::buffer, false}, + {AllocationType::buffer, true}, + {AllocationType::bufferHostMemory, false}, + {AllocationType::svmGpu, true}}}; GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = false; @@ -599,10 +599,10 @@ TEST_F(KernelArgBufferTest, givenSVMAllocsManagerWithCompressedSVMAllocationsWhe DebugManagerStateRestore debugRestorer; debugManager.flags.EnableStatelessCompression.set(1); - constexpr std::array allocationTypes = {{{AllocationType::BUFFER, false}, - {AllocationType::BUFFER, true}, - {AllocationType::BUFFER_HOST_MEMORY, false}, - {AllocationType::SVM_GPU, true}}}; + constexpr std::array allocationTypes = {{{AllocationType::buffer, false}, + {AllocationType::buffer, true}, + {AllocationType::bufferHostMemory, false}, + {AllocationType::svmGpu, true}}}; GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = false; @@ -691,7 +691,7 @@ HWTEST_F(KernelArgBufferTestBindless, givenBindlessBuffersWhenPatchBindlessOffse TEST_F(KernelArgBufferTest, givenBufferAsHostMemoryWhenSettingKernelArgThenKernelUsesSystemMemory) { MockBuffer buffer; - buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::bufferHostMemory); auto memVal = (cl_mem)&buffer; auto val = &memVal; @@ -706,7 +706,7 @@ TEST_F(KernelArgBufferTest, givenBufferAsHostMemoryWhenSettingKernelArgThenKerne TEST_F(KernelArgBufferTest, givenBufferAsDeviceMemoryWhenSettingKernelArgThenKernelNotUsesSystemMemory) { MockBuffer buffer; - buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::BUFFER); + buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::buffer); auto memVal = (cl_mem)&buffer; auto val = &memVal; @@ -721,7 +721,7 @@ TEST_F(KernelArgBufferTest, givenBufferAsDeviceMemoryWhenSettingKernelArgThenKer TEST_F(KernelArgBufferTest, givenBufferAsDeviceMemoryAndKernelIsAlreadySetToUseSystemWhenSettingKernelArgThenKernelUsesSystemMemory) { MockBuffer buffer; - buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::BUFFER); + buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::buffer); auto memVal = (cl_mem)&buffer; auto val = &memVal; diff --git a/opencl/test/unit_test/kernel/kernel_arg_svm_tests.cpp b/opencl/test/unit_test/kernel/kernel_arg_svm_tests.cpp index 384f011b96..1c7b197771 100644 --- a/opencl/test/unit_test/kernel/kernel_arg_svm_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_arg_svm_tests.cpp @@ -528,7 +528,7 @@ TEST_F(KernelArgSvmTest, GivenZeroCopySvmPtrWhenSettingKernelArgThenKernelUsesSy auto svmData = pContext->getSVMAllocsManager()->getSVMAlloc(alloc); auto gpuAllocation = svmData->gpuAllocations.getGraphicsAllocation(*pContext->getRootDeviceIndices().begin()); - gpuAllocation->setAllocationType(NEO::AllocationType::SVM_ZERO_COPY); + gpuAllocation->setAllocationType(NEO::AllocationType::svmZeroCopy); EXPECT_FALSE(pKernel->isAnyKernelArgumentUsingSystemMemory()); @@ -554,7 +554,7 @@ TEST_F(KernelArgSvmTest, GivenGpuSvmPtrWhenSettingKernelArgThenKernelNotUsesSyst auto svmData = pContext->getSVMAllocsManager()->getSVMAlloc(alloc); auto gpuAllocation = svmData->gpuAllocations.getGraphicsAllocation(*pContext->getRootDeviceIndices().begin()); - gpuAllocation->setAllocationType(NEO::AllocationType::SVM_GPU); + gpuAllocation->setAllocationType(NEO::AllocationType::svmGpu); EXPECT_FALSE(pKernel->isAnyKernelArgumentUsingSystemMemory()); @@ -580,7 +580,7 @@ TEST_F(KernelArgSvmTest, GivenGpuSvmPtrAndKernelIsAlreadySetToUseSystemWhenSetti auto svmData = pContext->getSVMAllocsManager()->getSVMAlloc(alloc); auto gpuAllocation = svmData->gpuAllocations.getGraphicsAllocation(*pContext->getRootDeviceIndices().begin()); - gpuAllocation->setAllocationType(NEO::AllocationType::SVM_GPU); + gpuAllocation->setAllocationType(NEO::AllocationType::svmGpu); EXPECT_FALSE(pKernel->isAnyKernelArgumentUsingSystemMemory()); pKernel->anyKernelArgumentUsingSystemMemory = true; diff --git a/opencl/test/unit_test/kernel/kernel_tests.cpp b/opencl/test/unit_test/kernel/kernel_tests.cpp index 99e3a0435a..f2282181ea 100644 --- a/opencl/test/unit_test/kernel/kernel_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_tests.cpp @@ -842,7 +842,7 @@ TEST_F(KernelGlobalSurfaceTest, givenBuiltInKernelWhenKernelIsCreatedThenGlobalS char buffer[16]; - GraphicsAllocation gfxAlloc(0, AllocationType::UNKNOWN, buffer, (uint64_t)buffer - 8u, 8, static_cast(1u), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); + GraphicsAllocation gfxAlloc(0, AllocationType::unknown, buffer, (uint64_t)buffer - 8u, 8, static_cast(1u), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); uint64_t bufferAddress = (uint64_t)gfxAlloc.getUnderlyingBuffer(); // create kernel @@ -870,7 +870,7 @@ TEST_F(KernelGlobalSurfaceTest, givenNDRangeKernelWhenKernelIsCreatedThenGlobalS char buffer[16]; auto gmmHelper = pDevice->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(buffer)); - GraphicsAllocation gfxAlloc(0, AllocationType::UNKNOWN, buffer, (uint64_t)buffer - 8u, 8, MemoryPool::MemoryNull, 0u, canonizedGpuAddress); + GraphicsAllocation gfxAlloc(0, AllocationType::unknown, buffer, (uint64_t)buffer - 8u, 8, MemoryPool::MemoryNull, 0u, canonizedGpuAddress); uint64_t bufferAddress = gfxAlloc.getGpuAddress(); // create kernel @@ -963,7 +963,7 @@ TEST_F(KernelConstantSurfaceTest, givenBuiltInKernelWhenKernelIsCreatedThenConst char buffer[16]; - GraphicsAllocation gfxAlloc(0, AllocationType::UNKNOWN, buffer, (uint64_t)buffer - 8u, 8, static_cast(1u), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); + GraphicsAllocation gfxAlloc(0, AllocationType::unknown, buffer, (uint64_t)buffer - 8u, 8, static_cast(1u), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); uint64_t bufferAddress = (uint64_t)gfxAlloc.getUnderlyingBuffer(); // create kernel @@ -990,7 +990,7 @@ TEST_F(KernelConstantSurfaceTest, givenNDRangeKernelWhenKernelIsCreatedThenConst char buffer[16]; auto gmmHelper = pDevice->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(buffer)); - GraphicsAllocation gfxAlloc(0, AllocationType::UNKNOWN, buffer, (uint64_t)buffer - 8u, 8, MemoryPool::MemoryNull, 0u, canonizedGpuAddress); + GraphicsAllocation gfxAlloc(0, AllocationType::unknown, buffer, (uint64_t)buffer - 8u, 8, MemoryPool::MemoryNull, 0u, canonizedGpuAddress); uint64_t bufferAddress = gfxAlloc.getGpuAddress(); // create kernel @@ -3272,7 +3272,7 @@ HWTEST2_F(KernelConstantSurfaceTest, givenKernelWithConstantSurfaceWhenKernelIsC char buffer[MemoryConstants::pageSize64k]; auto gmmHelper = pDevice->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(buffer)); - GraphicsAllocation gfxAlloc(0, AllocationType::CONSTANT_SURFACE, buffer, MemoryConstants::pageSize64k, + GraphicsAllocation gfxAlloc(0, AllocationType::constantSurface, buffer, MemoryConstants::pageSize64k, static_cast(8), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, canonizedGpuAddress); MockContext context(pClDevice); @@ -3434,13 +3434,13 @@ TEST_F(KernelImplicitArgsTest, givenKernelWithoutImplicitArgsWhenSettingKernelPa TEST_F(KernelTests, GivenCorrectAllocationTypeThenFunctionCheckingSystemMemoryReturnsTrue) { std::vector systemMemoryAllocationType = { - NEO::AllocationType::BUFFER_HOST_MEMORY, - NEO::AllocationType::EXTERNAL_HOST_PTR, - NEO::AllocationType::SVM_CPU, - NEO::AllocationType::SVM_ZERO_COPY}; + NEO::AllocationType::bufferHostMemory, + NEO::AllocationType::externalHostPtr, + NEO::AllocationType::svmCpu, + NEO::AllocationType::svmZeroCopy}; - for (uint32_t allocationTypeIndex = static_cast(NEO::AllocationType::UNKNOWN); - allocationTypeIndex < static_cast(NEO::AllocationType::COUNT); + for (uint32_t allocationTypeIndex = static_cast(NEO::AllocationType::unknown); + allocationTypeIndex < static_cast(NEO::AllocationType::count); allocationTypeIndex++) { auto currentAllocationType = static_cast(allocationTypeIndex); bool ret = Kernel::graphicsAllocationTypeUseSystemMemory(currentAllocationType); diff --git a/opencl/test/unit_test/mem_obj/buffer_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_tests.cpp index c8b79a88bd..e386a40c5d 100644 --- a/opencl/test/unit_test/mem_obj/buffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_tests.cpp @@ -377,9 +377,9 @@ TEST(Buffer, givenNullptrPassedToBufferCreateWhenNoSharedContextOrCompressedBuff ASSERT_NE(nullptr, buffer.get()); if (MemoryPoolHelper::isSystemMemoryPool(buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getMemoryPool())) { - EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType()); + EXPECT_EQ(AllocationType::bufferHostMemory, buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType()); } else { - EXPECT_EQ(AllocationType::BUFFER, buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType()); + EXPECT_EQ(AllocationType::buffer, buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType()); } } @@ -400,7 +400,7 @@ TEST(Buffer, givenHostPtrPassedToBufferCreateWhenMemUseHostPtrFlagisSetAndBuffer auto mapAllocation = buffer->getMapAllocation(device->getRootDeviceIndex()); EXPECT_NE(nullptr, mapAllocation); EXPECT_EQ(offsetedPtr, mapAllocation->getUnderlyingBuffer()); - EXPECT_EQ(AllocationType::MAP_ALLOCATION, mapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::mapAllocation, mapAllocation->getAllocationType()); alignedFree(ptr); } @@ -416,7 +416,7 @@ TEST(Buffer, givenAlignedHostPtrPassedToBufferCreateWhenNoSharedContextOrCompres std::unique_ptr buffer(Buffer::create(&ctx, flags, MemoryConstants::pageSize, hostPtr, retVal)); ASSERT_NE(nullptr, buffer.get()); - EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, buffer->getMultiGraphicsAllocation().getAllocationType()); + EXPECT_EQ(AllocationType::bufferHostMemory, buffer->getMultiGraphicsAllocation().getAllocationType()); } TEST(Buffer, givenAllocHostPtrFlagPassedToBufferCreateWhenNoSharedContextOrCompressedBuffersThenBuffersAllocationTypeIsBufferHostMemory) { @@ -429,7 +429,7 @@ TEST(Buffer, givenAllocHostPtrFlagPassedToBufferCreateWhenNoSharedContextOrCompr std::unique_ptr buffer(Buffer::create(&ctx, flags, MemoryConstants::pageSize, nullptr, retVal)); ASSERT_NE(nullptr, buffer.get()); - EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, buffer->getMultiGraphicsAllocation().getAllocationType()); + EXPECT_EQ(AllocationType::bufferHostMemory, buffer->getMultiGraphicsAllocation().getAllocationType()); } TEST(Buffer, givenCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferCompressedTypeIsReturnedIn64Bit) { @@ -442,7 +442,7 @@ TEST(Buffer, givenCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferC auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, compressionEnabled, false); EXPECT_TRUE(compressionEnabled); - EXPECT_EQ(AllocationType::BUFFER, type); + EXPECT_EQ(AllocationType::buffer, type); } TEST(Buffer, givenCompressedBuffersDisabledLocalMemoryEnabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturnedIn64Bit) { @@ -455,7 +455,7 @@ TEST(Buffer, givenCompressedBuffersDisabledLocalMemoryEnabledWhenAllocationTypeI auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, compressionEnabled, true); EXPECT_FALSE(compressionEnabled); - EXPECT_EQ(AllocationType::BUFFER, type); + EXPECT_EQ(AllocationType::buffer, type); } TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) { @@ -469,7 +469,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledWhenAllocationTypeIsQuerie auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, compressionEnabled, false); EXPECT_FALSE(compressionEnabled); - EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, type); + EXPECT_EQ(AllocationType::bufferHostMemory, type); } TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) { @@ -483,7 +483,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledWhenAllocationTypeIsQueried auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, compressionEnabled, true); EXPECT_FALSE(compressionEnabled); - EXPECT_EQ(AllocationType::BUFFER, type); + EXPECT_EQ(AllocationType::buffer, type); } TEST(Buffer, givenAllocHostPtrFlagWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) { @@ -497,7 +497,7 @@ TEST(Buffer, givenAllocHostPtrFlagWhenAllocationTypeIsQueriedThenBufferTypeIsRet auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, compressionEnabled, false); EXPECT_FALSE(compressionEnabled); - EXPECT_EQ(AllocationType::BUFFER, type); + EXPECT_EQ(AllocationType::buffer, type); } TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledAndCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferMemoryTypeIsReturned) { @@ -511,7 +511,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledAndCompressedBuffersEnable auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, compressionEnabled, false); EXPECT_FALSE(compressionEnabled); - EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, type); + EXPECT_EQ(AllocationType::bufferHostMemory, type); } TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledAndCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferMemoryTypeIsReturned) { @@ -525,7 +525,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledAndCompressedBuffersEnabled auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, compressionEnabled, true); EXPECT_TRUE(compressionEnabled); - EXPECT_EQ(AllocationType::BUFFER, type); + EXPECT_EQ(AllocationType::buffer, type); } TEST(Buffer, givenUseHostPointerFlagAndForceSharedPhysicalStorageWhenLocalMemoryIsEnabledThenBufferHostMemoryTypeIsReturned) { @@ -539,7 +539,7 @@ TEST(Buffer, givenUseHostPointerFlagAndForceSharedPhysicalStorageWhenLocalMemory auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, compressionEnabled, true); EXPECT_FALSE(compressionEnabled); - EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, type); + EXPECT_EQ(AllocationType::bufferHostMemory, type); } TEST(Buffer, givenAllocHostPtrFlagAndCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferCompressedTypeIsReturned) { @@ -553,7 +553,7 @@ TEST(Buffer, givenAllocHostPtrFlagAndCompressedBuffersEnabledWhenAllocationTypeI auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, compressionEnabled, false); EXPECT_TRUE(compressionEnabled); - EXPECT_EQ(AllocationType::BUFFER, type); + EXPECT_EQ(AllocationType::buffer, type); } TEST(Buffer, givenZeroFlagsNoSharedContextAndCompressedBuffersDisabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) { @@ -566,7 +566,7 @@ TEST(Buffer, givenZeroFlagsNoSharedContextAndCompressedBuffersDisabledWhenAlloca auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, compressionEnabled, false); EXPECT_FALSE(compressionEnabled); - EXPECT_EQ(AllocationType::BUFFER, type); + EXPECT_EQ(AllocationType::buffer, type); } TEST(Buffer, givenClMemCopyHostPointerPassedToBufferCreateWhenAllocationIsNotInSystemMemoryPoolAndCopyOnCpuDisabledThenAllocationIsWrittenByEnqueueWriteBuffer) { @@ -662,7 +662,7 @@ TEST_F(CompressedBuffersTests, givenBufferCompressedAllocationAndZeroCopyHostPtr auto allocation = buffer->getGraphicsAllocation(device->getRootDeviceIndex()); EXPECT_EQ(cacheAlignedHostPtr, allocation->getUnderlyingBuffer()); EXPECT_TRUE(buffer->isMemObjZeroCopy()); - EXPECT_EQ(allocation->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(allocation->getAllocationType(), AllocationType::bufferHostMemory); uint32_t pattern[2] = {0, 0}; pattern[0] = 0xdeadbeef; @@ -681,7 +681,7 @@ TEST_F(CompressedBuffersTests, givenBufferCompressedAllocationAndZeroCopyHostPtr allocation = buffer->getGraphicsAllocation(device->getRootDeviceIndex()); EXPECT_EQ(cacheAlignedHostPtr, allocation->getUnderlyingBuffer()); EXPECT_TRUE(buffer->isMemObjZeroCopy()); - EXPECT_EQ(allocation->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(allocation->getAllocationType(), AllocationType::bufferHostMemory); EXPECT_EQ(0, memcmp(allocation->getUnderlyingBuffer(), &pattern[0], sizeof(pattern))); @@ -690,7 +690,7 @@ TEST_F(CompressedBuffersTests, givenBufferCompressedAllocationAndZeroCopyHostPtr TEST_F(CompressedBuffersTests, givenAllocationCreatedWithForceSharedPhysicalMemoryWhenItIsCreatedThenItIsZeroCopy) { buffer.reset(Buffer::create(context.get(), CL_MEM_FORCE_HOST_MEMORY_INTEL, 1u, nullptr, retVal)); - EXPECT_EQ(buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType(), AllocationType::bufferHostMemory); EXPECT_TRUE(buffer->isMemObjZeroCopy()); EXPECT_EQ(1u, buffer->getSize()); } @@ -698,7 +698,7 @@ TEST_F(CompressedBuffersTests, givenAllocationCreatedWithForceSharedPhysicalMemo TEST_F(CompressedBuffersTests, givenCompressedBuffersAndAllocationCreatedWithForceSharedPhysicalMemoryWhenItIsCreatedThenItIsZeroCopy) { hwInfo->capabilityTable.ftrRenderCompressedBuffers = true; buffer.reset(Buffer::create(context.get(), CL_MEM_FORCE_HOST_MEMORY_INTEL, 1u, nullptr, retVal)); - EXPECT_EQ(buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType(), AllocationType::bufferHostMemory); EXPECT_TRUE(buffer->isMemObjZeroCopy()); EXPECT_EQ(1u, buffer->getSize()); } @@ -710,9 +710,9 @@ TEST_F(CompressedBuffersTests, givenBufferNotCompressedAllocationAndNoHostPtrWhe auto allocation = buffer->getGraphicsAllocation(device->getRootDeviceIndex()); EXPECT_TRUE(buffer->isMemObjZeroCopy()); if (MemoryPoolHelper::isSystemMemoryPool(allocation->getMemoryPool())) { - EXPECT_EQ(allocation->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(allocation->getAllocationType(), AllocationType::bufferHostMemory); } else { - EXPECT_EQ(allocation->getAllocationType(), AllocationType::BUFFER); + EXPECT_EQ(allocation->getAllocationType(), AllocationType::buffer); } auto memoryManager = static_cast(device->getExecutionEnvironment()->memoryManager.get()); @@ -723,11 +723,11 @@ TEST_F(CompressedBuffersTests, givenBufferNotCompressedAllocationAndNoHostPtrWhe auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper(); if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize)) { EXPECT_FALSE(buffer->isMemObjZeroCopy()); - EXPECT_EQ(allocation->getAllocationType(), AllocationType::BUFFER); + EXPECT_EQ(allocation->getAllocationType(), AllocationType::buffer); EXPECT_EQ(!memoryManager->allocate32BitGraphicsMemoryImplCalled, allocation->isCompressionEnabled()); } else { EXPECT_TRUE(buffer->isMemObjZeroCopy()); - EXPECT_EQ(allocation->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(allocation->getAllocationType(), AllocationType::bufferHostMemory); } } @@ -743,10 +743,10 @@ TEST_F(CompressedBuffersTests, givenDebugVariableSetWhenHwFlagIsNotSetThenSelect auto graphicsAllocation = buffer->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex()); auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper(); if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize)) { - EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::BUFFER); + EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::buffer); EXPECT_EQ(!memoryManager->allocate32BitGraphicsMemoryImplCalled, graphicsAllocation->isCompressionEnabled()); } else { - EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::bufferHostMemory); } debugManager.flags.RenderCompressedBuffersEnabled.set(0); @@ -809,7 +809,7 @@ TEST_F(CompressedBuffersCopyHostMemoryTests, givenCompressedBufferWhenCopyFromHo EXPECT_EQ(bufferSize, mockCmdQ->writeBufferSize); EXPECT_EQ(hostPtr, mockCmdQ->writeBufferPtr); } else { - EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::bufferHostMemory); EXPECT_EQ(0u, mockCmdQ->writeBufferCounter); EXPECT_FALSE(mockCmdQ->writeBufferBlocking); EXPECT_EQ(0u, mockCmdQ->writeBufferOffset); @@ -969,9 +969,9 @@ TEST_P(NoHostPtr, WhenGettingAllocationTypeThenCorrectBufferTypeIsReturned) { auto allocation = buffer->getGraphicsAllocation(pClDevice->getRootDeviceIndex()); if (MemoryPoolHelper::isSystemMemoryPool(allocation->getMemoryPool())) { - EXPECT_EQ(allocation->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(allocation->getAllocationType(), AllocationType::bufferHostMemory); } else { - EXPECT_EQ(allocation->getAllocationType(), AllocationType::BUFFER); + EXPECT_EQ(allocation->getAllocationType(), AllocationType::buffer); } auto isBufferWritable = !(flags & (CL_MEM_READ_ONLY | CL_MEM_HOST_READ_ONLY | CL_MEM_HOST_NO_ACCESS)); @@ -1214,7 +1214,7 @@ TEST_P(ValidHostPtr, GivenUsmHostPtrWhenCreatingBufferThenBufferIsCreatedCorrect auto svmData = context->getSVMAllocsManager()->getSVMAlloc(ptr); ASSERT_NE(nullptr, svmData); - EXPECT_EQ(AllocationType::BUFFER, buffer->getGraphicsAllocation(pDevice->getRootDeviceIndex())->getAllocationType()); + EXPECT_EQ(AllocationType::buffer, buffer->getGraphicsAllocation(pDevice->getRootDeviceIndex())->getAllocationType()); auto mapAllocation = buffer->getMapAllocation(pDevice->getRootDeviceIndex()); ASSERT_NE(nullptr, mapAllocation); diff --git a/opencl/test/unit_test/mem_obj/create_image_in_local_memory_tests.cpp b/opencl/test/unit_test/mem_obj/create_image_in_local_memory_tests.cpp index 5ad10c2567..d12044293e 100644 --- a/opencl/test/unit_test/mem_obj/create_image_in_local_memory_tests.cpp +++ b/opencl/test/unit_test/mem_obj/create_image_in_local_memory_tests.cpp @@ -81,7 +81,7 @@ TEST_F(ImageInLocalMemoryTest, givenImageWithoutHostPtrWhenLocalMemoryIsEnabledT ASSERT_NE(nullptr, imgGfxAlloc); EXPECT_EQ(MemoryPool::LocalMemory, imgGfxAlloc->getMemoryPool()); EXPECT_LE(imageDesc.image_width * surfaceFormat->surfaceFormat.imageElementSizeInBytes, imgGfxAlloc->getUnderlyingBufferSize()); - EXPECT_EQ(AllocationType::IMAGE, imgGfxAlloc->getAllocationType()); + EXPECT_EQ(AllocationType::image, imgGfxAlloc->getAllocationType()); EXPECT_EQ(0u, imgGfxAlloc->getDefaultGmm()->resourceParams.Flags.Info.NonLocalOnly); auto gmmHelper = context->getDevice(0)->getGmmHelper(); diff --git a/opencl/test/unit_test/mem_obj/image2d_from_buffer_tests.cpp b/opencl/test/unit_test/mem_obj/image2d_from_buffer_tests.cpp index 30b98c6b02..a0e25bd770 100644 --- a/opencl/test/unit_test/mem_obj/image2d_from_buffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image2d_from_buffer_tests.cpp @@ -327,7 +327,7 @@ TEST_F(Image2dFromBufferTest, givenBufferWhenImageFromBufferThenIsImageFromBuffe EXPECT_TRUE(imageFromBuffer->isImageFromBuffer()); auto graphicsAllocation = imageFromBuffer->getGraphicsAllocation(context.getDevice(0)->getRootDeviceIndex()); - EXPECT_TRUE(AllocationType::BUFFER_HOST_MEMORY == graphicsAllocation->getAllocationType()); + EXPECT_TRUE(AllocationType::bufferHostMemory == graphicsAllocation->getAllocationType()); buffer->release(); imageDesc.mem_object = memObj; diff --git a/opencl/test/unit_test/mem_obj/image_release_mapped_ptr_tests.cpp b/opencl/test/unit_test/mem_obj/image_release_mapped_ptr_tests.cpp index a7b6550029..5abf5018d8 100644 --- a/opencl/test/unit_test/mem_obj/image_release_mapped_ptr_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_release_mapped_ptr_tests.cpp @@ -70,7 +70,7 @@ HWTEST_F(ImageUnmapTest, givenImageWhenUnmapMemObjIsCalledThenEnqueueNonBlocking cl_map_flags mapFlags = CL_MAP_WRITE; image->addMappedPtr(ptr, 1, mapFlags, region, origin, 0, nullptr); - AllocationProperties properties{0, false, MemoryConstants::cacheLineSize, AllocationType::MAP_ALLOCATION, false, device->getDeviceBitfield()}; + AllocationProperties properties{0, false, MemoryConstants::cacheLineSize, AllocationType::mapAllocation, false, device->getDeviceBitfield()}; auto allocation = device->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties, ptr); image->setMapAllocation(allocation); diff --git a/opencl/test/unit_test/mem_obj/image_tests.cpp b/opencl/test/unit_test/mem_obj/image_tests.cpp index 1ea06e9870..5097d1e5f1 100644 --- a/opencl/test/unit_test/mem_obj/image_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_tests.cpp @@ -633,7 +633,7 @@ TEST_P(CreateImageNoHostPtr, whenImageIsCreatedThenItHasProperAccessAndCacheProp ASSERT_NE(nullptr, image); auto allocation = image->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex()); - EXPECT_TRUE(allocation->getAllocationType() == AllocationType::IMAGE); + EXPECT_TRUE(allocation->getAllocationType() == AllocationType::image); auto isImageWritable = !(flags & (CL_MEM_READ_ONLY | CL_MEM_HOST_READ_ONLY | CL_MEM_HOST_NO_ACCESS)); EXPECT_EQ(isImageWritable, allocation->isMemObjectsAllocationWithWritableFlags()); diff --git a/opencl/test/unit_test/mem_obj/mem_obj_destruction_tests.cpp b/opencl/test/unit_test/mem_obj/mem_obj_destruction_tests.cpp index 3962340c8b..c7f2f9e9ab 100644 --- a/opencl/test/unit_test/mem_obj/mem_obj_destruction_tests.cpp +++ b/opencl/test/unit_test/mem_obj/mem_obj_destruction_tests.cpp @@ -385,7 +385,7 @@ HWTEST_P(MemObjSyncDestructionTest, givenMemObjWithMapAllocationWhenAsyncDestruc AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize, - AllocationType::MAP_ALLOCATION, + AllocationType::mapAllocation, false, context->getDeviceBitfieldForAllocation(device->getRootDeviceIndex())}; mapAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, nullptr); @@ -426,7 +426,7 @@ HWTEST_P(MemObjSyncDestructionTest, givenMemObjWithMapAllocationWhenAsyncDestruc AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize, - AllocationType::MAP_ALLOCATION, + AllocationType::mapAllocation, false, context->getDeviceBitfieldForAllocation(device->getRootDeviceIndex())}; mapAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, nullptr); @@ -457,7 +457,7 @@ HWTEST_P(MemObjAsyncDestructionTest, givenMemObjWithMapAllocationWithoutMemUseHo AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize, - AllocationType::MAP_ALLOCATION, + AllocationType::mapAllocation, false, context->getDeviceBitfieldForAllocation(device->getRootDeviceIndex())}; mapAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, nullptr); @@ -497,7 +497,7 @@ HWTEST_P(MemObjAsyncDestructionTest, givenMemObjWithMapAllocationWithMemUseHostP AllocationProperties properties{device->getRootDeviceIndex(), false, MemoryConstants::pageSize, - AllocationType::MAP_ALLOCATION, + AllocationType::mapAllocation, false, context->getDeviceBitfieldForAllocation(device->getRootDeviceIndex())}; mapAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, hostPtr); diff --git a/opencl/test/unit_test/mem_obj/windows/buffer_windows_tests.cpp b/opencl/test/unit_test/mem_obj/windows/buffer_windows_tests.cpp index 3bcd14e0be..9f664270fc 100644 --- a/opencl/test/unit_test/mem_obj/windows/buffer_windows_tests.cpp +++ b/opencl/test/unit_test/mem_obj/windows/buffer_windows_tests.cpp @@ -136,7 +136,7 @@ TEST_F(ValidExportHostPtr, givenPropertiesWithNtHandleWhenValidateInputAndCreate EXPECT_EQ(retVal, CL_SUCCESS); EXPECT_EQ(static_cast(pClExecutionEnvironment->memoryManager.get())->capturedSharedHandle, properties[1]); - EXPECT_EQ(static_cast(buffer)->getGraphicsAllocation(0u)->getAllocationType(), NEO::AllocationType::SHARED_BUFFER); + EXPECT_EQ(static_cast(buffer)->getGraphicsAllocation(0u)->getAllocationType(), NEO::AllocationType::sharedBuffer); EXPECT_NE(buffer, nullptr); clReleaseMemObject(buffer); diff --git a/opencl/test/unit_test/memory_manager/cl_memory_manager_allocate_in_preferred_pool_tests.cpp b/opencl/test/unit_test/memory_manager/cl_memory_manager_allocate_in_preferred_pool_tests.cpp index 444071fd22..7ca745f375 100644 --- a/opencl/test/unit_test/memory_manager/cl_memory_manager_allocate_in_preferred_pool_tests.cpp +++ b/opencl/test/unit_test/memory_manager/cl_memory_manager_allocate_in_preferred_pool_tests.cpp @@ -40,7 +40,7 @@ TEST(MemoryManagerTest, givenEnabledLocalMemoryWhenAllocatingSharedResourceCopyT auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]); AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(mockRootDeviceIndex, imgInfo, true, memoryProperties, localPlatformDevice, mockDeviceBitfield, true); - allocProperties.allocationType = AllocationType::SHARED_RESOURCE_COPY; + allocProperties.allocationType = AllocationType::sharedResourceCopy; auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr); ASSERT_NE(nullptr, allocation); diff --git a/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp b/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp index 32e7400fd2..fc66a13f33 100644 --- a/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp @@ -60,7 +60,7 @@ TEST_F(MultiDeviceSVMMemoryAllocatorTest, givenMultipleDevicesWhenCreatingSVMAll for (auto &rootDeviceIndex : context->getRootDeviceIndices()) { auto svmAllocation = svmManager->getSVMAlloc(ptr)->gpuAllocations.getGraphicsAllocation(rootDeviceIndex); EXPECT_NE(nullptr, svmAllocation); - EXPECT_EQ(AllocationType::SVM_ZERO_COPY, svmAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::svmZeroCopy, svmAllocation->getAllocationType()); EXPECT_FALSE(svmAllocation->isCoherent()); } @@ -90,7 +90,7 @@ TEST_F(SVMMemoryAllocatorTest, whenSVMAllocationIsFreedThenCannotBeGotAgain) { TEST_F(SVMMemoryAllocatorTest, givenSvmManagerWhenOperatedOnThenCorrectAllocationIsInsertedReturnedAndRemoved) { int data; size_t size = sizeof(data); - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, size, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, size, AllocationType::bufferHostMemory, mockDeviceBitfield}); NEO::SvmAllocationData svmData(mockRootDeviceIndex); svmData.gpuAllocations.addAllocation(allocation); @@ -223,7 +223,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, whenDeviceAllocationIsCreatedThenItIsStoredW EXPECT_EQ(gpuAllocation->getMemoryPool(), MemoryPool::LocalMemory); EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize64k), gpuAllocation->getUnderlyingBufferSize()); - EXPECT_EQ(AllocationType::WRITE_COMBINED, gpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::writeCombined, gpuAllocation->getAllocationType()); svmManager->freeSVMAlloc(ptr); } @@ -248,7 +248,7 @@ TEST_F(SVMMemoryAllocatorTest, givenNoWriteCombinedFlagwhenDeviceAllocationIsCre EXPECT_EQ(allocationSize, allocation->size); EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize64k), gpuAllocation->getUnderlyingBufferSize()); - EXPECT_EQ(AllocationType::BUFFER, gpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::buffer, gpuAllocation->getAllocationType()); svmManager->freeSVMAlloc(ptr); } @@ -266,7 +266,7 @@ TEST_F(SVMMemoryAllocatorTest, whenHostAllocationIsCreatedThenItIsStoredWithProp EXPECT_EQ(allocationSize, allocation->size); EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize64k), gpuAllocation->getUnderlyingBufferSize()); - EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, gpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::bufferHostMemory, gpuAllocation->getAllocationType()); EXPECT_NE(gpuAllocation->getMemoryPool(), MemoryPool::LocalMemory); EXPECT_NE(nullptr, gpuAllocation->getUnderlyingBuffer()); svmManager->freeSVMAlloc(ptr); @@ -301,7 +301,7 @@ TEST_F(SVMMemoryAllocatorTest, whenSharedAllocationIsCreatedThenItIsStoredWithPr EXPECT_EQ(allocationSize, allocation->size); EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize64k), gpuAllocation->getUnderlyingBufferSize()); - EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, gpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::bufferHostMemory, gpuAllocation->getAllocationType()); EXPECT_NE(gpuAllocation->getMemoryPool(), MemoryPool::LocalMemory); EXPECT_NE(nullptr, gpuAllocation->getUnderlyingBuffer()); svmManager->freeSVMAlloc(ptr); @@ -331,8 +331,8 @@ TEST_F(SVMLocalMemoryAllocatorTest, whenSharedAllocationIsCreatedWithDebugFlagSe EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize64k), gpuAllocation->getUnderlyingBufferSize()); EXPECT_EQ(alignUp(allocationSize, alignment), allocation->cpuAllocation->getUnderlyingBufferSize()); - EXPECT_EQ(AllocationType::SVM_GPU, gpuAllocation->getAllocationType()); - EXPECT_EQ(AllocationType::SVM_CPU, allocation->cpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::svmGpu, gpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::svmCpu, allocation->cpuAllocation->getAllocationType()); EXPECT_EQ(gpuAllocation->getMemoryPool(), MemoryPool::LocalMemory); EXPECT_NE(allocation->cpuAllocation->getMemoryPool(), MemoryPool::LocalMemory); @@ -361,8 +361,8 @@ TEST_F(SVMLocalMemoryAllocatorTest, whenSharedAllocationIsCreatedWithLocalMemory EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize64k), gpuAllocation->getUnderlyingBufferSize()); EXPECT_EQ(alignUp(allocationSize, alignment), allocation->cpuAllocation->getUnderlyingBufferSize()); - EXPECT_EQ(AllocationType::SVM_GPU, gpuAllocation->getAllocationType()); - EXPECT_EQ(AllocationType::SVM_CPU, allocation->cpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::svmGpu, gpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::svmCpu, allocation->cpuAllocation->getAllocationType()); EXPECT_EQ(gpuAllocation->getMemoryPool(), MemoryPool::LocalMemory); EXPECT_NE(allocation->cpuAllocation->getMemoryPool(), MemoryPool::LocalMemory); @@ -390,7 +390,7 @@ TEST_F(SVMMemoryAllocatorTest, givenSharedAllocationsDebugFlagWhenDeviceMemoryIs EXPECT_EQ(allocationSize, allocation->size); EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize64k), gpuAllocation->getUnderlyingBufferSize()); - EXPECT_EQ(AllocationType::BUFFER, gpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::buffer, gpuAllocation->getAllocationType()); svmManager->freeSVMAlloc(ptr); } diff --git a/opencl/test/unit_test/mt_tests/os_interface/linux/drm_memory_manager_mt_tests.cpp b/opencl/test/unit_test/mt_tests/os_interface/linux/drm_memory_manager_mt_tests.cpp index f2d982cb34..dded6864e6 100644 --- a/opencl/test/unit_test/mt_tests/os_interface/linux/drm_memory_manager_mt_tests.cpp +++ b/opencl/test/unit_test/mt_tests/os_interface/linux/drm_memory_manager_mt_tests.cpp @@ -54,7 +54,7 @@ TEST(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSharedAllocationIsCreatedFro auto createFunction = [&]() { size_t indexFree = index++; - AllocationProperties properties(0, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(0, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, {}); createdAllocations[indexFree] = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); EXPECT_NE(nullptr, createdAllocations[indexFree]); EXPECT_GE(1u, memoryManager->peekSharedBosSize()); @@ -125,7 +125,7 @@ TEST(DrmMemoryManagerTest, givenMultipleThreadsWhenSharedAllocationIsCreatedThen auto createFunction = [&]() { size_t indexFree = index++; - AllocationProperties properties(0, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(0, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, {}); createdAllocations[indexFree] = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); EXPECT_NE(nullptr, createdAllocations[indexFree]); diff --git a/opencl/test/unit_test/os_interface/linux/cl_drm_memory_manager_tests.cpp b/opencl/test/unit_test/os_interface/linux/cl_drm_memory_manager_tests.cpp index 102a8adec6..f3c923e7e0 100644 --- a/opencl/test/unit_test/os_interface/linux/cl_drm_memory_manager_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/cl_drm_memory_manager_tests.cpp @@ -767,12 +767,12 @@ TEST_F(ClDrmMemoryManagerTest, givenOsHandleWithNonTiledObjectWhenCreateFromShar imgInfo.surfaceFormat = &gmmSurfaceFormat->surfaceFormat; imgInfo.plane = GMM_PLANE_Y; - AllocationProperties properties(rootDeviceIndex, false, &imgInfo, AllocationType::SHARED_IMAGE, context.getDevice(0)->getDeviceBitfield()); + AllocationProperties properties(rootDeviceIndex, false, &imgInfo, AllocationType::sharedImage, context.getDevice(0)->getDeviceBitfield()); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); ASSERT_NE(nullptr, graphicsAllocation); EXPECT_EQ(boHandle, mock->getTilingHandleIn); - EXPECT_EQ(AllocationType::SHARED_IMAGE, graphicsAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::sharedImage, graphicsAllocation->getAllocationType()); auto gmm = graphicsAllocation->getDefaultGmm(); ASSERT_NE(nullptr, gmm); @@ -810,12 +810,12 @@ TEST_F(ClDrmMemoryManagerTest, givenOsHandleWithTileYObjectWhenCreateFromSharedH imgInfo.surfaceFormat = &gmmSurfaceFormat->surfaceFormat; imgInfo.plane = GMM_PLANE_Y; - AllocationProperties properties(rootDeviceIndex, false, &imgInfo, AllocationType::SHARED_IMAGE, context.getDevice(0)->getDeviceBitfield()); + AllocationProperties properties(rootDeviceIndex, false, &imgInfo, AllocationType::sharedImage, context.getDevice(0)->getDeviceBitfield()); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); ASSERT_NE(nullptr, graphicsAllocation); EXPECT_EQ(boHandle, mock->getTilingHandleIn); - EXPECT_EQ(AllocationType::SHARED_IMAGE, graphicsAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::sharedImage, graphicsAllocation->getAllocationType()); auto gmm = graphicsAllocation->getDefaultGmm(); ASSERT_NE(nullptr, gmm); @@ -852,12 +852,12 @@ TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenCreateFromSharedHandleFa imgInfo.surfaceFormat = &gmmSurfaceFormat->surfaceFormat; imgInfo.plane = GMM_PLANE_Y; - AllocationProperties properties(rootDeviceIndex, false, &imgInfo, AllocationType::SHARED_IMAGE, context.getDevice(0)->getDeviceBitfield()); + AllocationProperties properties(rootDeviceIndex, false, &imgInfo, AllocationType::sharedImage, context.getDevice(0)->getDeviceBitfield()); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); ASSERT_NE(nullptr, graphicsAllocation); EXPECT_EQ(boHandle, mock->getTilingHandleIn); - EXPECT_EQ(AllocationType::SHARED_IMAGE, graphicsAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::sharedImage, graphicsAllocation->getAllocationType()); auto gmm = graphicsAllocation->getDefaultGmm(); ASSERT_NE(nullptr, gmm); diff --git a/opencl/test/unit_test/os_interface/linux/cl_mem_cache_clos_tests_xe_hpc.cpp b/opencl/test/unit_test/os_interface/linux/cl_mem_cache_clos_tests_xe_hpc.cpp index 32e189dce4..3e481a280c 100644 --- a/opencl/test/unit_test/os_interface/linux/cl_mem_cache_clos_tests_xe_hpc.cpp +++ b/opencl/test/unit_test/os_interface/linux/cl_mem_cache_clos_tests_xe_hpc.cpp @@ -119,7 +119,7 @@ using UnifiedMemoryWithClMemCacheClosTests = BuffersWithClMemCacheClosTests; XE_HPC_CORETEST_F(UnifiedMemoryWithClMemCacheClosTests, givenDrmUnifiedSharedMemoryWhenItIsCreatedWithCacheClosSpecifiedInMemoryPropertiesThenSetCacheRegionInBufferObjects) { AllocationProperties gpuProperties{0u, MemoryConstants::pageSize64k, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, 1u}; gpuProperties.cacheRegion = 1; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(gpuProperties); @@ -138,7 +138,7 @@ XE_HPC_CORETEST_F(UnifiedMemoryWithClMemCacheClosTests, givenDrmUnifiedSharedMem XE_HPC_CORETEST_F(UnifiedMemoryWithClMemCacheClosTests, givenDrmUnifiedSharedMemoryWhenItIsCreatedWithIncorrectCacheClosSpecifiedInMemoryPropertiesThenReturnNull) { AllocationProperties gpuProperties{0u, MemoryConstants::pageSize64k, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, 1u}; gpuProperties.cacheRegion = 0xFFFF; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(gpuProperties); diff --git a/opencl/test/unit_test/os_interface/windows/cl_wddm_memory_manager_tests.cpp b/opencl/test/unit_test/os_interface/windows/cl_wddm_memory_manager_tests.cpp index 1790ced947..1c0cf9802e 100644 --- a/opencl/test/unit_test/os_interface/windows/cl_wddm_memory_manager_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/cl_wddm_memory_manager_tests.cpp @@ -512,7 +512,7 @@ TEST_F(PlatformWithFourDevicesTest, whenCreateColoredAllocationAndWddmReturnsCan platform()->peekExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo()->featureTable.flags.ftrMultiTileArch = true; GraphicsAllocation *allocation = nullptr; - EXPECT_NO_THROW(allocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, true, 4 * MemoryConstants::pageSize64k, AllocationType::BUFFER, true, mockDeviceBitfield})); + EXPECT_NO_THROW(allocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, true, 4 * MemoryConstants::pageSize64k, AllocationType::buffer, true, mockDeviceBitfield})); EXPECT_NE(nullptr, allocation); memoryManager.freeGraphicsMemory(allocation); @@ -533,7 +533,7 @@ TEST_F(PlatformWithFourDevicesTest, givenDifferentAllocationSizesWhenColourAlloc // We are allocating memory from 4 to 12 pages and want to check if remainders (1, 2 or 3 pages in case of 4 devices) are spread equally. for (int additionalSize = 0; additionalSize <= 8; additionalSize++) { - auto allocation = static_cast(memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, true, (4 + additionalSize) * MemoryConstants::pageSize64k, AllocationType::BUFFER, true, 0b1111})); + auto allocation = static_cast(memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, true, (4 + additionalSize) * MemoryConstants::pageSize64k, AllocationType::buffer, true, 0b1111})); auto handles = allocation->getNumGmms(); EXPECT_EQ(4u, handles); @@ -572,7 +572,7 @@ TEST_F(PlatformWithFourDevicesTest, givenDifferentAllocationSizesWhenColourAlloc TEST_F(PlatformWithFourDevicesTest, whenCreateScratchSpaceInSingleTileQueueThenTheAllocationHasOneHandle) { MemoryManagerCreate memoryManager(true, true, *platform()->peekExecutionEnvironment()); - AllocationProperties properties{mockRootDeviceIndex, true, 1u, AllocationType::SCRATCH_SURFACE, false, false, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, true, 1u, AllocationType::scratchSurface, false, false, mockDeviceBitfield}; auto allocation = static_cast(memoryManager.allocateGraphicsMemoryWithProperties(properties)); EXPECT_EQ(1u, allocation->getNumGmms()); memoryManager.freeGraphicsMemory(allocation); diff --git a/opencl/test/unit_test/program/kernel_info_tests.cpp b/opencl/test/unit_test/program/kernel_info_tests.cpp index edbe656a4c..7f6cd6b524 100644 --- a/opencl/test/unit_test/program/kernel_info_tests.cpp +++ b/opencl/test/unit_test/program/kernel_info_tests.cpp @@ -63,7 +63,7 @@ TEST(KernelInfoTest, givenKernelInfoWhenCreatingKernelAllocationWithInternalIsaF auto retVal = kernelInfo.createKernelAllocation(*device, false); EXPECT_TRUE(retVal); auto allocation = kernelInfo.kernelAllocation; - EXPECT_EQ(AllocationType::KERNEL_ISA, allocation->getAllocationType()); + EXPECT_EQ(AllocationType::kernelIsa, allocation->getAllocationType()); device->getMemoryManager()->checkGpuUsageAndDestroyGraphicsAllocations(allocation); } @@ -79,7 +79,7 @@ TEST(KernelInfoTest, givenKernelInfoWhenCreatingKernelAllocationWithInternalIsaT auto retVal = kernelInfo.createKernelAllocation(*device, true); EXPECT_TRUE(retVal); auto allocation = kernelInfo.kernelAllocation; - EXPECT_EQ(AllocationType::KERNEL_ISA_INTERNAL, allocation->getAllocationType()); + EXPECT_EQ(AllocationType::kernelIsaInternal, allocation->getAllocationType()); device->getMemoryManager()->checkGpuUsageAndDestroyGraphicsAllocations(allocation); } diff --git a/opencl/test/unit_test/program/program_tests.cpp b/opencl/test/unit_test/program/program_tests.cpp index 8a078722a3..a49e3546d5 100644 --- a/opencl/test/unit_test/program/program_tests.cpp +++ b/opencl/test/unit_test/program/program_tests.cpp @@ -2178,9 +2178,9 @@ TEST_F(ProgramTests, givenExistingConstantSurfacesWhenProcessGenBinaryThenCleanu program->buildInfos.resize(2); program->buildInfos[0].constantSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::cacheLineSize, - AllocationType::CONSTANT_SURFACE, pDevice->getDeviceBitfield()}); + AllocationType::constantSurface, pDevice->getDeviceBitfield()}); program->buildInfos[1].constantSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::cacheLineSize, - AllocationType::CONSTANT_SURFACE, pDevice->getDeviceBitfield()}); + AllocationType::constantSurface, pDevice->getDeviceBitfield()}); program->buildInfos[rootDeviceIndex].unpackedDeviceBinary = makeCopy(patchtokensProgram.storage.data(), patchtokensProgram.storage.size()); program->buildInfos[rootDeviceIndex].unpackedDeviceBinarySize = patchtokensProgram.storage.size(); @@ -2204,9 +2204,9 @@ TEST_F(ProgramTests, givenExistingGlobalSurfacesWhenProcessGenBinaryThenCleanupT program->buildInfos.resize(2); program->buildInfos[0].globalSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::cacheLineSize, - AllocationType::GLOBAL_SURFACE, pDevice->getDeviceBitfield()}); + AllocationType::globalSurface, pDevice->getDeviceBitfield()}); program->buildInfos[1].globalSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::cacheLineSize, - AllocationType::GLOBAL_SURFACE, pDevice->getDeviceBitfield()}); + AllocationType::globalSurface, pDevice->getDeviceBitfield()}); program->buildInfos[rootDeviceIndex].unpackedDeviceBinary = makeCopy(patchtokensProgram.storage.data(), patchtokensProgram.storage.size()); program->buildInfos[rootDeviceIndex].unpackedDeviceBinarySize = patchtokensProgram.storage.size(); diff --git a/opencl/test/unit_test/sharings/gl/windows/gl_create_from_texture_tests.cpp b/opencl/test/unit_test/sharings/gl/windows/gl_create_from_texture_tests.cpp index 956c8ce1af..22994830e0 100644 --- a/opencl/test/unit_test/sharings/gl/windows/gl_create_from_texture_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/windows/gl_create_from_texture_tests.cpp @@ -344,6 +344,6 @@ TEST_F(CreateFromGlTextureTests, GivenGlTextureWhenCreateIsCalledThenAllocationT auto graphicsAllocation = glImage->getGraphicsAllocation(clContext.getDevice(0)->getRootDeviceIndex()); ASSERT_NE(nullptr, graphicsAllocation); - EXPECT_EQ(AllocationType::SHARED_IMAGE, graphicsAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::sharedImage, graphicsAllocation->getAllocationType()); } } // namespace NEO diff --git a/opencl/test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp b/opencl/test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp index 76dfe1f8bb..ffddf1cf62 100644 --- a/opencl/test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp @@ -1299,7 +1299,7 @@ TEST_F(GlSharingTests, whenGetGlContextHandleIsCalledThenProperHandleIsReturned) TEST_F(GlSharingTests, givenClGLBufferWhenCreatedThenSharedBufferAllocatoinTypeIsSet) { std::unique_ptr buffer(GlBuffer::createSharedGlBuffer(&context, CL_MEM_READ_WRITE, bufferId, nullptr)); ASSERT_NE(nullptr, buffer->getGraphicsAllocation(rootDeviceIndex)); - EXPECT_EQ(AllocationType::SHARED_BUFFER, buffer->getGraphicsAllocation(rootDeviceIndex)->getAllocationType()); + EXPECT_EQ(AllocationType::sharedBuffer, buffer->getGraphicsAllocation(rootDeviceIndex)->getAllocationType()); } using clGetSupportedGLTextureFormatsINTELTests = GlSharingTests; diff --git a/opencl/test/unit_test/sharings/unified/unified_sharing_fixtures.h b/opencl/test/unit_test/sharings/unified/unified_sharing_fixtures.h index fd63953991..f75d212267 100644 --- a/opencl/test/unit_test/sharings/unified/unified_sharing_fixtures.h +++ b/opencl/test/unit_test/sharings/unified/unified_sharing_fixtures.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 Intel Corporation + * Copyright (C) 2019-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -65,7 +65,7 @@ struct UnifiedSharingMockMemoryManager : MockMemoryManager { return nullptr; } - auto graphicsAllocation = createMemoryAllocation(AllocationType::INTERNAL_HOST_MEMORY, nullptr, reinterpret_cast(1), 1, + auto graphicsAllocation = createMemoryAllocation(AllocationType::internalHostMemory, nullptr, reinterpret_cast(1), 1, 4096u, reinterpret_cast(handle), MemoryPool::SystemCpuInaccessible, rootDeviceIndex, false, false, false); graphicsAllocation->setSharedHandle(static_cast(reinterpret_cast(handle))); diff --git a/opencl/test/unit_test/sharings/unified/unified_sharing_image_tests.cpp b/opencl/test/unit_test/sharings/unified/unified_sharing_image_tests.cpp index d5897e6872..96ad897aab 100644 --- a/opencl/test/unit_test/sharings/unified/unified_sharing_image_tests.cpp +++ b/opencl/test/unit_test/sharings/unified/unified_sharing_image_tests.cpp @@ -111,7 +111,7 @@ class MockProductHelper : public ProductHelperHw { struct MemoryManagerReturningCompressedAllocations : UnifiedSharingMockMemoryManager { GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override { - auto allocation = UnifiedSharingMockMemoryManager::createGraphicsAllocationFromNTHandle(handle, rootDeviceIndex, AllocationType::SHARED_IMAGE); + auto allocation = UnifiedSharingMockMemoryManager::createGraphicsAllocationFromNTHandle(handle, rootDeviceIndex, AllocationType::sharedImage); auto gmm = allocation->getDefaultGmm(); auto mockGmmResourceInfo = std::make_unique(gmm->gmmResourceInfo->peekGmmResourceInfo()); diff --git a/opencl/test/unit_test/sharings/unified/unified_sharing_tests.cpp b/opencl/test/unit_test/sharings/unified/unified_sharing_tests.cpp index 7f54e62068..b8d27de3c0 100644 --- a/opencl/test/unit_test/sharings/unified/unified_sharing_tests.cpp +++ b/opencl/test/unit_test/sharings/unified/unified_sharing_tests.cpp @@ -200,7 +200,7 @@ TEST_F(UnifiedSharingCreateAllocationTests, givenWindowsNtHandleWhenCreateGraphi UnifiedSharingMemoryDescription desc{}; desc.handle = reinterpret_cast(0x1234); desc.type = UnifiedSharingHandleType::Win32Nt; - AllocationType allocationType = AllocationType::SHARED_IMAGE; + AllocationType allocationType = AllocationType::sharedImage; MockSharingHandler::createGraphicsAllocation(this->context.get(), desc, allocationType); EXPECT_TRUE(memoryManager->createFromNTHandleCalled); @@ -212,7 +212,7 @@ TEST_F(UnifiedSharingCreateAllocationTests, givenWindowsSharedHandleWhenCreateGr UnifiedSharingMemoryDescription desc{}; desc.handle = reinterpret_cast(0x1234); desc.type = UnifiedSharingHandleType::Win32Shared; - AllocationType allocationType = AllocationType::SHARED_IMAGE; + AllocationType allocationType = AllocationType::sharedImage; MockSharingHandler::createGraphicsAllocation(this->context.get(), desc, allocationType); EXPECT_FALSE(memoryManager->createFromNTHandleCalled); @@ -226,7 +226,7 @@ TEST_F(UnifiedSharingCreateAllocationTests, givenLinuxSharedHandleWhenCreateGrap UnifiedSharingMemoryDescription desc{}; desc.handle = reinterpret_cast(0x1234); desc.type = UnifiedSharingHandleType::LinuxFd; - AllocationType allocationType = AllocationType::SHARED_IMAGE; + AllocationType allocationType = AllocationType::sharedImage; MockSharingHandler::createGraphicsAllocation(this->context.get(), desc, allocationType); EXPECT_FALSE(memoryManager->createFromNTHandleCalled); diff --git a/opencl/test/unit_test/xe_hpc_core/gfx_core_helper_tests_xe_hpc_core.cpp b/opencl/test/unit_test/xe_hpc_core/gfx_core_helper_tests_xe_hpc_core.cpp index c2d3749db1..bf11a2649a 100644 --- a/opencl/test/unit_test/xe_hpc_core/gfx_core_helper_tests_xe_hpc_core.cpp +++ b/opencl/test/unit_test/xe_hpc_core/gfx_core_helper_tests_xe_hpc_core.cpp @@ -48,7 +48,7 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenGfxCoreHelperwhenAskingForDc XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenCommandBufferAllocationTypeWhenGetAllocationDataIsCalledThenLocalMemoryIsRequested) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::COMMAND_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::commandBuffer, false, mockDeviceBitfield); MockMemoryManager mockMemoryManager; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); @@ -76,9 +76,9 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenSingleTileBdA0CsrWhenAllocat auto &heap = commandStreamReceiver->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, MemoryConstants::pageSize64k); auto heapAllocation = heap.getGraphicsAllocation(); if (commandStreamReceiver->canUse4GbHeaps) { - EXPECT_EQ(AllocationType::INTERNAL_HEAP, heapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::internalHeap, heapAllocation->getAllocationType()); } else { - EXPECT_EQ(AllocationType::LINEAR_STREAM, heapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::linearStream, heapAllocation->getAllocationType()); } auto &productHelper = clDevice->getProductHelper(); if (productHelper.isTilePlacementResourceWaRequired(*hwInfo)) { @@ -87,7 +87,7 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenSingleTileBdA0CsrWhenAllocat commandStreamReceiver->ensureCommandBufferAllocation(heap, heap.getAvailableSpace() + 1, 0u); auto commandBufferAllocation = heap.getGraphicsAllocation(); - EXPECT_EQ(AllocationType::COMMAND_BUFFER, commandBufferAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::commandBuffer, commandBufferAllocation->getAllocationType()); EXPECT_NE(heapAllocation, commandBufferAllocation); EXPECT_EQ(commandBufferAllocation->getMemoryPool(), MemoryPool::LocalMemory); } @@ -644,7 +644,7 @@ XE_HPC_CORETEST_F(ProductHelperTestXeHpcCore, givenDefaultProductHelperHwWhenGet auto &productHelper = getHelper(); MockGraphicsAllocation allocation; allocation.overrideMemoryPool(MemoryPool::LocalMemory); - allocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + allocation.setAllocationType(AllocationType::bufferHostMemory); EXPECT_FALSE(productHelper.isBlitCopyRequiredForLocalMemory(pDevice->getRootDeviceEnvironment(), allocation)); } @@ -752,7 +752,7 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenBdA0WhenAllocatingOnNonTileZ constexpr DeviceBitfield tile0Mask = 1; constexpr DeviceBitfield allTilesMask = 0b1111; - const AllocationProperties allocProperties(0, 1, AllocationType::UNKNOWN, allTilesMask); + const AllocationProperties allocProperties(0, 1, AllocationType::unknown, allTilesMask); for (int32_t debugFlag : {-1, 0, 1}) { debugManager.flags.ForceTile0PlacementForTile1ResourcesWaActive.set(debugFlag); @@ -789,8 +789,8 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenCommandBufferAllocationWhenS constexpr DeviceBitfield singleTileBitfield = 0b0100; constexpr DeviceBitfield allTilesBitfield = 0b1111; - const AllocationProperties singleTileAllocProperties(0, 1, AllocationType::COMMAND_BUFFER, singleTileBitfield); - const AllocationProperties allTilesAllocProperties(0, 1, AllocationType::COMMAND_BUFFER, allTilesBitfield); + const AllocationProperties singleTileAllocProperties(0, 1, AllocationType::commandBuffer, singleTileBitfield); + const AllocationProperties allTilesAllocProperties(0, 1, AllocationType::commandBuffer, allTilesBitfield); AllocationData allocData; allocData.flags.useSystemMemory = false; diff --git a/opencl/test/unit_test/xe_hpc_core/test_cmds_programming_xe_hpc_core.cpp b/opencl/test/unit_test/xe_hpc_core/test_cmds_programming_xe_hpc_core.cpp index 90c349e045..f81711aed8 100644 --- a/opencl/test/unit_test/xe_hpc_core/test_cmds_programming_xe_hpc_core.cpp +++ b/opencl/test/unit_test/xe_hpc_core/test_cmds_programming_xe_hpc_core.cpp @@ -51,7 +51,7 @@ XE_HPC_CORETEST_F(CmdsProgrammingTestsXeHpcCore, givenL3ToL1DebugFlagWhenStatele XE_HPC_CORETEST_F(CmdsProgrammingTestsXeHpcCore, whenAppendingRssThenProgramWtL1CachePolicy) { auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); size_t allocationSize = MemoryConstants::pageSize; - AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, AllocationType::buffer, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); auto rssCmd = FamilyType::cmdInitRenderSurfaceState; diff --git a/opencl/test/unit_test/xe_hpc_core/xe_hpc_core_test_ocl_fixtures.cpp b/opencl/test/unit_test/xe_hpc_core/xe_hpc_core_test_ocl_fixtures.cpp index 4cae0fc74f..f916b6c2d4 100644 --- a/opencl/test/unit_test/xe_hpc_core/xe_hpc_core_test_ocl_fixtures.cpp +++ b/opencl/test/unit_test/xe_hpc_core/xe_hpc_core_test_ocl_fixtures.cpp @@ -40,15 +40,15 @@ void ClGfxCoreHelperXeHpcCoreFixture::checkIfSingleTileCsrWhenAllocatingCsrSpeci auto &heap = commandStreamReceiver->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, MemoryConstants::pageSize64k); auto heapAllocation = heap.getGraphicsAllocation(); if (commandStreamReceiver->canUse4GbHeaps) { - EXPECT_EQ(AllocationType::INTERNAL_HEAP, heapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::internalHeap, heapAllocation->getAllocationType()); } else { - EXPECT_EQ(AllocationType::LINEAR_STREAM, heapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::linearStream, heapAllocation->getAllocationType()); } EXPECT_EQ(singleTileMask, heapAllocation->storageInfo.memoryBanks); commandStreamReceiver->ensureCommandBufferAllocation(heap, heap.getAvailableSpace() + 1, 0u); auto commandBufferAllocation = heap.getGraphicsAllocation(); - EXPECT_EQ(AllocationType::COMMAND_BUFFER, commandBufferAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::commandBuffer, commandBufferAllocation->getAllocationType()); EXPECT_NE(heapAllocation, commandBufferAllocation); EXPECT_EQ(commandBufferAllocation->getMemoryPool(), MemoryPool::LocalMemory); } @@ -69,15 +69,15 @@ void ClGfxCoreHelperXeHpcCoreFixture::checkIfMultiTileCsrWhenAllocatingCsrSpecif auto &heap = commandStreamReceiver->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, MemoryConstants::pageSize64k); auto heapAllocation = heap.getGraphicsAllocation(); if (commandStreamReceiver->canUse4GbHeaps) { - EXPECT_EQ(AllocationType::INTERNAL_HEAP, heapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::internalHeap, heapAllocation->getAllocationType()); } else { - EXPECT_EQ(AllocationType::LINEAR_STREAM, heapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::linearStream, heapAllocation->getAllocationType()); } EXPECT_EQ(tile0Mask, heapAllocation->storageInfo.memoryBanks); commandStreamReceiver->ensureCommandBufferAllocation(heap, heap.getAvailableSpace() + 1, 0u); auto commandBufferAllocation = heap.getGraphicsAllocation(); - EXPECT_EQ(AllocationType::COMMAND_BUFFER, commandBufferAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::commandBuffer, commandBufferAllocation->getAllocationType()); EXPECT_NE(heapAllocation, commandBufferAllocation); EXPECT_EQ(commandBufferAllocation->getMemoryPool(), MemoryPool::LocalMemory); } diff --git a/opencl/test/unit_test/xe_hpg_core/dg2/test_cmds_programming_dg2.cpp b/opencl/test/unit_test/xe_hpg_core/dg2/test_cmds_programming_dg2.cpp index 2dc861f5f0..cd962f3d78 100644 --- a/opencl/test/unit_test/xe_hpg_core/dg2/test_cmds_programming_dg2.cpp +++ b/opencl/test/unit_test/xe_hpg_core/dg2/test_cmds_programming_dg2.cpp @@ -70,7 +70,7 @@ DG2TEST_F(CmdsProgrammingTestsDg2, givenL3ToL1DebugFlagAndDebuggerInitializedWhe DG2TEST_F(CmdsProgrammingTestsDg2, whenAppendingRssThenProgramWBL1CachePolicyUnlessDebuggerIsActive) { auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); size_t allocationSize = MemoryConstants::pageSize; - AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, AllocationType::buffer, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); auto rssCmd = FamilyType::cmdInitRenderSurfaceState; diff --git a/opencl/test/unit_test/xe_hpg_core/test_cmds_programming_xe_hpg_core.cpp b/opencl/test/unit_test/xe_hpg_core/test_cmds_programming_xe_hpg_core.cpp index d7a3094b1f..514659827a 100644 --- a/opencl/test/unit_test/xe_hpg_core/test_cmds_programming_xe_hpg_core.cpp +++ b/opencl/test/unit_test/xe_hpg_core/test_cmds_programming_xe_hpg_core.cpp @@ -54,7 +54,7 @@ XE_HPG_CORETEST_F(CmdsProgrammingTestsXeHpgCore, givenL3ToL1DebugFlagWhenStatele XE_HPG_CORETEST_F(CmdsProgrammingTestsXeHpgCore, whenAppendingRssThenProgramWBPL1CachePolicy) { auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); size_t allocationSize = MemoryConstants::pageSize; - AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, AllocationType::buffer, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); auto rssCmd = FamilyType::cmdInitRenderSurfaceState; diff --git a/shared/source/assert_handler/assert_handler.cpp b/shared/source/assert_handler/assert_handler.cpp index a351f43e32..9d7f0d29c1 100644 --- a/shared/source/assert_handler/assert_handler.cpp +++ b/shared/source/assert_handler/assert_handler.cpp @@ -16,7 +16,7 @@ namespace NEO { AssertHandler::AssertHandler(Device *device) : device(device) { auto rootDeviceIndex = device->getRootDeviceIndex(); - assertBuffer = device->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, assertBufferSize, AllocationType::ASSERT_BUFFER, device->getDeviceBitfield()}); + assertBuffer = device->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, assertBufferSize, AllocationType::assertBuffer, device->getDeviceBitfield()}); AssertBufferHeader initialHeader = {}; initialHeader.size = assertBufferSize; diff --git a/shared/source/aub/aub_helper.h b/shared/source/aub/aub_helper.h index 0aabf61153..22b2e5ab16 100644 --- a/shared/source/aub/aub_helper.h +++ b/shared/source/aub/aub_helper.h @@ -18,24 +18,24 @@ class AubHelper : public NonCopyableOrMovableClass { public: static bool isOneTimeAubWritableAllocationType(const AllocationType &type) { switch (type) { - case AllocationType::PIPE: - case AllocationType::CONSTANT_SURFACE: - case AllocationType::GLOBAL_SURFACE: - case AllocationType::KERNEL_ISA: - case AllocationType::KERNEL_ISA_INTERNAL: - case AllocationType::PRIVATE_SURFACE: - case AllocationType::SCRATCH_SURFACE: - case AllocationType::WORK_PARTITION_SURFACE: - case AllocationType::BUFFER: - case AllocationType::BUFFER_HOST_MEMORY: - case AllocationType::IMAGE: - case AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: - case AllocationType::EXTERNAL_HOST_PTR: - case AllocationType::MAP_ALLOCATION: - case AllocationType::SVM_GPU: - case AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: - case AllocationType::ASSERT_BUFFER: - case AllocationType::TAG_BUFFER: + case AllocationType::pipe: + case AllocationType::constantSurface: + case AllocationType::globalSurface: + case AllocationType::kernelIsa: + case AllocationType::kernelIsaInternal: + case AllocationType::privateSurface: + case AllocationType::scratchSurface: + case AllocationType::workPartitionSurface: + case AllocationType::buffer: + case AllocationType::bufferHostMemory: + case AllocationType::image: + case AllocationType::timestampPacketTagBuffer: + case AllocationType::externalHostPtr: + case AllocationType::mapAllocation: + case AllocationType::svmGpu: + case AllocationType::gpuTimestampDeviceBuffer: + case AllocationType::assertBuffer: + case AllocationType::tagBuffer: return true; default: return false; diff --git a/shared/source/aub_mem_dump/aub_alloc_dump.h b/shared/source/aub_mem_dump/aub_alloc_dump.h index d6e27191a2..1b88bd5f1f 100644 --- a/shared/source/aub_mem_dump/aub_alloc_dump.h +++ b/shared/source/aub_mem_dump/aub_alloc_dump.h @@ -33,16 +33,16 @@ enum DumpFormat { }; inline bool isWritableBuffer(GraphicsAllocation &gfxAllocation) { - return (gfxAllocation.getAllocationType() == AllocationType::BUFFER || - gfxAllocation.getAllocationType() == AllocationType::BUFFER_HOST_MEMORY || - gfxAllocation.getAllocationType() == AllocationType::EXTERNAL_HOST_PTR || - gfxAllocation.getAllocationType() == AllocationType::MAP_ALLOCATION || - gfxAllocation.getAllocationType() == AllocationType::SVM_GPU) && + return (gfxAllocation.getAllocationType() == AllocationType::buffer || + gfxAllocation.getAllocationType() == AllocationType::bufferHostMemory || + gfxAllocation.getAllocationType() == AllocationType::externalHostPtr || + gfxAllocation.getAllocationType() == AllocationType::mapAllocation || + gfxAllocation.getAllocationType() == AllocationType::svmGpu) && gfxAllocation.isMemObjectsAllocationWithWritableFlags(); } inline bool isWritableImage(GraphicsAllocation &gfxAllocation) { - return (gfxAllocation.getAllocationType() == AllocationType::IMAGE) && + return (gfxAllocation.getAllocationType() == AllocationType::image) && gfxAllocation.isMemObjectsAllocationWithWritableFlags(); } diff --git a/shared/source/built_ins/built_ins.cpp b/shared/source/built_ins/built_ins.cpp index 0bb329cf8a..6cb549d637 100644 --- a/shared/source/built_ins/built_ins.cpp +++ b/shared/source/built_ins/built_ins.cpp @@ -44,7 +44,7 @@ const SipKernel &BuiltIns::getSipKernel(SipKernelType type, Device &device) { UNRECOVERABLE_IF(ret != TranslationOutput::ErrorCode::Success); UNRECOVERABLE_IF(sipBinary.size() == 0); - const auto allocType = AllocationType::KERNEL_ISA_INTERNAL; + const auto allocType = AllocationType::kernelIsaInternal; AllocationProperties properties = {device.getRootDeviceIndex(), sipBinary.size(), allocType, device.getDeviceBitfield()}; properties.flags.use32BitFrontWindow = false; @@ -84,7 +84,7 @@ const SipKernel &BuiltIns::getSipKernel(Device &device, OsContext *context) { auto binary = std::make_unique(binarySize); memcpy_s(binary.get(), binarySize * sizeof(uint32_t), bindlessSip.getBinary().data(), bindlessSip.getBinary().size()); - const auto allocType = AllocationType::KERNEL_ISA_INTERNAL; + const auto allocType = AllocationType::kernelIsaInternal; AllocationProperties properties = {device.getRootDeviceIndex(), bindlessSip.getBinary().size(), allocType, device.getDeviceBitfield()}; properties.flags.use32BitFrontWindow = false; diff --git a/shared/source/built_ins/sip.cpp b/shared/source/built_ins/sip.cpp index 4823198d27..b5541565d0 100644 --- a/shared/source/built_ins/sip.cpp +++ b/shared/source/built_ins/sip.cpp @@ -145,7 +145,7 @@ bool SipKernel::initRawBinaryFromFileKernel(SipKernelType type, Device &device, void *alignedBuffer = alignedMalloc(bytesRead, MemoryConstants::pageSize); memcpy_s(alignedBuffer, bytesRead, fileData.data(), bytesRead); - const auto allocType = AllocationType::KERNEL_ISA_INTERNAL; + const auto allocType = AllocationType::kernelIsaInternal; AllocationProperties properties = {rootDeviceIndex, bytesRead, allocType, device.getDeviceBitfield()}; properties.flags.use32BitFrontWindow = false; @@ -209,7 +209,7 @@ bool SipKernel::initHexadecimalArraySipKernel(SipKernelType type, Device &device auto &gfxCoreHelper = device.getGfxCoreHelper(); gfxCoreHelper.setSipKernelData(sipKernelBinary, kernelBinarySize); - const auto allocType = AllocationType::KERNEL_ISA_INTERNAL; + const auto allocType = AllocationType::kernelIsaInternal; AllocationProperties properties = {rootDeviceIndex, kernelBinarySize, allocType, device.getDeviceBitfield()}; properties.flags.use32BitFrontWindow = false; diff --git a/shared/source/command_container/cmdcontainer.cpp b/shared/source/command_container/cmdcontainer.cpp index c3456d335c..b2c36822c2 100644 --- a/shared/source/command_container/cmdcontainer.cpp +++ b/shared/source/command_container/cmdcontainer.cpp @@ -41,7 +41,7 @@ CommandContainer::~CommandContainer() { } } for (auto deallocation : deallocationContainer) { - if (((deallocation->getAllocationType() == AllocationType::INTERNAL_HEAP) || (deallocation->getAllocationType() == AllocationType::LINEAR_STREAM))) { + if (((deallocation->getAllocationType() == AllocationType::internalHeap) || (deallocation->getAllocationType() == AllocationType::linearStream))) { getHeapHelper()->storeHeapAllocation(deallocation); } } @@ -317,7 +317,7 @@ GraphicsAllocation *CommandContainer::obtainNextCommandBufferAllocation(bool for GraphicsAllocation *cmdBufferAllocation = nullptr; if (this->reusableAllocationList) { size_t alignedSize = getAlignedCmdBufferSize(); - cmdBufferAllocation = this->reusableAllocationList->detachAllocation(alignedSize, nullptr, forceHostMemory, nullptr, AllocationType::COMMAND_BUFFER).release(); + cmdBufferAllocation = this->reusableAllocationList->detachAllocation(alignedSize, nullptr, forceHostMemory, nullptr, AllocationType::commandBuffer).release(); } if (!cmdBufferAllocation) { cmdBufferAllocation = this->allocateCommandBuffer(forceHostMemory); @@ -453,9 +453,9 @@ GraphicsAllocation *CommandContainer::reuseExistingCmdBuffer() { GraphicsAllocation *CommandContainer::reuseExistingCmdBuffer(bool forceHostMemory) { forceHostMemory &= this->useSecondaryCommandStream; size_t alignedSize = getAlignedCmdBufferSize(); - auto cmdBufferAllocation = this->immediateReusableAllocationList->detachAllocation(alignedSize, nullptr, forceHostMemory, this->immediateCmdListCsr, AllocationType::COMMAND_BUFFER).release(); + auto cmdBufferAllocation = this->immediateReusableAllocationList->detachAllocation(alignedSize, nullptr, forceHostMemory, this->immediateCmdListCsr, AllocationType::commandBuffer).release(); if (!cmdBufferAllocation) { - this->reusableAllocationList->detachAllocation(alignedSize, nullptr, forceHostMemory, this->immediateCmdListCsr, AllocationType::COMMAND_BUFFER).release(); + this->reusableAllocationList->detachAllocation(alignedSize, nullptr, forceHostMemory, this->immediateCmdListCsr, AllocationType::commandBuffer).release(); } if (cmdBufferAllocation) { @@ -487,7 +487,7 @@ GraphicsAllocation *CommandContainer::allocateCommandBuffer(bool forceHostMemory AllocationProperties properties{device->getRootDeviceIndex(), true /* allocateMemory*/, alignedSize, - AllocationType::COMMAND_BUFFER, + AllocationType::commandBuffer, (device->getNumGenericSubDevices() > 1u) /* multiOsContextCapable */, false, device->getDeviceBitfield()}; @@ -554,7 +554,7 @@ void CommandContainer::storeAllocationAndFlushTagUpdate(GraphicsAllocation *allo auto osContextId = this->immediateCmdListCsr->getOsContext().getContextId(); allocation->updateTaskCount(taskCount, osContextId); allocation->updateResidencyTaskCount(taskCount, osContextId); - if (allocation->getAllocationType() == AllocationType::COMMAND_BUFFER) { + if (allocation->getAllocationType() == AllocationType::commandBuffer) { this->immediateReusableAllocationList->pushTailOne(*allocation); } else { getHeapHelper()->storeHeapAllocation(allocation); diff --git a/shared/source/command_container/command_encoder_xehp_and_later.inl b/shared/source/command_container/command_encoder_xehp_and_later.inl index 3601434419..eb4e765bd8 100644 --- a/shared/source/command_container/command_encoder_xehp_and_later.inl +++ b/shared/source/command_container/command_encoder_xehp_and_later.inl @@ -728,7 +728,7 @@ void EncodeSurfaceState::encodeExtraBufferParams(EncodeSurfaceStateArgs uint32_t compressionFormat = 0; bool setConstCachePolicy = false; - if (args.allocation && args.allocation->getAllocationType() == AllocationType::CONSTANT_SURFACE) { + if (args.allocation && args.allocation->getAllocationType() == AllocationType::constantSurface) { setConstCachePolicy = true; } diff --git a/shared/source/command_stream/aub_command_stream_receiver_hw_base.inl b/shared/source/command_stream/aub_command_stream_receiver_hw_base.inl index 3640c4336c..75557acd80 100644 --- a/shared/source/command_stream/aub_command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/aub_command_stream_receiver_hw_base.inl @@ -705,7 +705,7 @@ bool AUBCommandStreamReceiverHw::writeMemory(GraphicsAllocation &gfxA template bool AUBCommandStreamReceiverHw::writeMemory(AllocationView &allocationView) { - GraphicsAllocation gfxAllocation(this->rootDeviceIndex, AllocationType::UNKNOWN, reinterpret_cast(allocationView.first), allocationView.first, 0llu, allocationView.second, MemoryPool::MemoryNull, 0u); + GraphicsAllocation gfxAllocation(this->rootDeviceIndex, AllocationType::unknown, reinterpret_cast(allocationView.first), allocationView.first, 0llu, allocationView.second, MemoryPool::MemoryNull, 0u); return writeMemory(gfxAllocation); } diff --git a/shared/source/command_stream/command_stream_receiver.cpp b/shared/source/command_stream/command_stream_receiver.cpp index 97a85271e3..b45e3791b8 100644 --- a/shared/source/command_stream/command_stream_receiver.cpp +++ b/shared/source/command_stream/command_stream_receiver.cpp @@ -249,7 +249,7 @@ void CommandStreamReceiver::ensureCommandBufferAllocation(LinearStream &commandS } const auto allocationSize = alignUp(minimumRequiredSize + additionalAllocationSize, alignment); - constexpr static auto allocationType = AllocationType::COMMAND_BUFFER; + constexpr static auto allocationType = AllocationType::commandBuffer; auto allocation = this->getInternalAllocationStorage()->obtainReusableAllocation(allocationSize, allocationType).release(); if (allocation == nullptr) { const AllocationProperties commandStreamAllocationProperties{rootDeviceIndex, true, allocationSize, allocationType, @@ -277,11 +277,11 @@ void CommandStreamReceiver::preallocateAllocation(AllocationType type, size_t si } void CommandStreamReceiver::preallocateCommandBuffer() { - preallocateAllocation(AllocationType::COMMAND_BUFFER, MemoryConstants::pageSize64k); + preallocateAllocation(AllocationType::commandBuffer, MemoryConstants::pageSize64k); } void CommandStreamReceiver::preallocateInternalHeap() { - preallocateAllocation(AllocationType::INTERNAL_HEAP, MemoryConstants::pageSize64k); + preallocateAllocation(AllocationType::internalHeap, MemoryConstants::pageSize64k); } void CommandStreamReceiver::fillReusableAllocationsList() { @@ -539,7 +539,7 @@ MultiGraphicsAllocation &CommandStreamReceiver::createTagsMultiAllocation() { auto maxRootDeviceIndex = static_cast(this->executionEnvironment.rootDeviceEnvironments.size() - 1); auto allocations = new MultiGraphicsAllocation(maxRootDeviceIndex); - AllocationProperties unifiedMemoryProperties{rootDeviceIndex, MemoryConstants::pageSize, AllocationType::TAG_BUFFER, systemMemoryBitfield}; + AllocationProperties unifiedMemoryProperties{rootDeviceIndex, MemoryConstants::pageSize, AllocationType::tagBuffer, systemMemoryBitfield}; this->getMemoryManager()->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, unifiedMemoryProperties, *allocations); return *allocations; @@ -552,7 +552,7 @@ bool CommandStreamReceiver::ensureTagAllocationForRootDeviceIndex(uint32_t rootD if (tagsMultiAllocation->getGraphicsAllocation(rootDeviceIndex)) { return true; } - AllocationProperties allocationProperties{rootDeviceIndex, MemoryConstants::pageSize, AllocationType::TAG_BUFFER, systemMemoryBitfield}; + AllocationProperties allocationProperties{rootDeviceIndex, MemoryConstants::pageSize, AllocationType::tagBuffer, systemMemoryBitfield}; allocationProperties.flags.allocateMemory = false; auto graphicsAllocation = this->getMemoryManager()->createGraphicsAllocationFromExistingStorage(allocationProperties, tagAllocation->getUnderlyingBuffer(), *tagsMultiAllocation); if (!graphicsAllocation) { @@ -643,7 +643,7 @@ void CommandStreamReceiver::startControllingDirectSubmissions() { GraphicsAllocation *CommandStreamReceiver::allocateDebugSurface(size_t size) { UNRECOVERABLE_IF(debugSurface != nullptr); - debugSurface = getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, size, AllocationType::DEBUG_CONTEXT_SAVE_AREA, getOsContext().getDeviceBitfield()}); + debugSurface = getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, size, AllocationType::debugContextSaveArea, getOsContext().getDeviceBitfield()}); return debugSurface; } @@ -693,9 +693,9 @@ void CommandStreamReceiver::allocateHeapMemory(IndirectHeap::Type heapType, minRequiredSize += reservedSize; finalHeapSize = alignUp(std::max(finalHeapSize, minRequiredSize), MemoryConstants::pageSize); - auto allocationType = AllocationType::LINEAR_STREAM; + auto allocationType = AllocationType::linearStream; if (requireInternalHeap) { - allocationType = AllocationType::INTERNAL_HEAP; + allocationType = AllocationType::internalHeap; } auto heapMemory = internalAllocationStorage->obtainReusableAllocation(finalHeapSize, allocationType).release(); @@ -829,7 +829,7 @@ bool CommandStreamReceiver::createWorkPartitionAllocation(const Device &device) } UNRECOVERABLE_IF(device.getNumGenericSubDevices() < 2); - AllocationProperties properties{this->rootDeviceIndex, true, 4096u, AllocationType::WORK_PARTITION_SURFACE, true, false, deviceBitfield}; + AllocationProperties properties{this->rootDeviceIndex, true, 4096u, AllocationType::workPartitionSurface, true, false, deviceBitfield}; this->workPartitionAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); if (this->workPartitionAllocation == nullptr) { return false; @@ -862,7 +862,7 @@ bool CommandStreamReceiver::createGlobalFenceAllocation() { } DEBUG_BREAK_IF(this->globalFenceAllocation != nullptr); - this->globalFenceAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize, AllocationType::GLOBAL_FENCE, osContext->getDeviceBitfield()}); + this->globalFenceAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize, AllocationType::globalFence, osContext->getDeviceBitfield()}); return this->globalFenceAllocation != nullptr; } @@ -873,7 +873,7 @@ bool CommandStreamReceiver::createPreemptionAllocation() { if (debugManager.flags.OverrideCsrAllocationSize.get() > 0) { preemptionSurfaceSize = debugManager.flags.OverrideCsrAllocationSize.get(); } - AllocationProperties properties{rootDeviceIndex, true, preemptionSurfaceSize, AllocationType::PREEMPTION, isMultiOsContextCapable(), false, deviceBitfield}; + AllocationProperties properties{rootDeviceIndex, true, preemptionSurfaceSize, AllocationType::preemption, isMultiOsContextCapable(), false, deviceBitfield}; properties.flags.uncacheable = hwInfo->workaroundTable.flags.waCSRUncachable; properties.alignment = gfxCoreHelper.getPreemptionAllocationAlignment(); this->preemptionAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); @@ -892,13 +892,13 @@ AllocationsList &CommandStreamReceiver::getDeferredAllocations() { return intern bool CommandStreamReceiver::createAllocationForHostSurface(HostPtrSurface &surface, bool requiresL3Flush) { std::unique_lock lock = this->obtainHostPtrSurfaceCreationLock(); - auto allocation = internalAllocationStorage->obtainTemporaryAllocationWithPtr(surface.getSurfaceSize(), surface.getMemoryPointer(), AllocationType::EXTERNAL_HOST_PTR); + auto allocation = internalAllocationStorage->obtainTemporaryAllocationWithPtr(surface.getSurfaceSize(), surface.getMemoryPointer(), AllocationType::externalHostPtr); if (allocation == nullptr) { auto memoryManager = getMemoryManager(); AllocationProperties properties{rootDeviceIndex, false, // allocateMemory - surface.getSurfaceSize(), AllocationType::EXTERNAL_HOST_PTR, + surface.getSurfaceSize(), AllocationType::externalHostPtr, false, // isMultiStorageAllocation osContext->getDeviceBitfield()}; properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = requiresL3Flush; @@ -1053,7 +1053,7 @@ bool CommandStreamReceiver::createPerDssBackedBuffer(Device &device) { UNRECOVERABLE_IF(perDssBackedBuffer != nullptr); auto size = RayTracingHelper::getTotalMemoryBackedFifoSize(device); - perDssBackedBuffer = getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, size, AllocationType::BUFFER, device.getDeviceBitfield()}); + perDssBackedBuffer = getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, size, AllocationType::buffer, device.getDeviceBitfield()}); return perDssBackedBuffer != nullptr; } @@ -1109,7 +1109,7 @@ void CommandStreamReceiver::createGlobalStatelessHeap() { auto lock = obtainUniqueOwnership(); if (this->globalStatelessHeapAllocation == nullptr) { constexpr size_t heapSize = 16 * MemoryConstants::kiloByte; - constexpr AllocationType allocationType = AllocationType::LINEAR_STREAM; + constexpr AllocationType allocationType = AllocationType::linearStream; AllocationProperties properties{rootDeviceIndex, true, heapSize, allocationType, isMultiOsContextCapable(), false, osContext->getDeviceBitfield()}; diff --git a/shared/source/command_stream/command_stream_receiver_simulated_hw.h b/shared/source/command_stream/command_stream_receiver_simulated_hw.h index 8f774746e8..5520831cb4 100644 --- a/shared/source/command_stream/command_stream_receiver_simulated_hw.h +++ b/shared/source/command_stream/command_stream_receiver_simulated_hw.h @@ -95,7 +95,7 @@ class CommandStreamReceiverSimulatedHw : public CommandStreamReceiverSimulatedCo void *cpuAddress; size_t allocSize; this->getParametersForMemory(graphicsAllocation, gpuAddress, cpuAddress, allocSize); - int hint = graphicsAllocation.getAllocationType() == AllocationType::COMMAND_BUFFER + int hint = graphicsAllocation.getAllocationType() == AllocationType::commandBuffer ? AubMemDump::DataTypeHintValues::TraceBatchBuffer : AubMemDump::DataTypeHintValues::TraceNotype; diff --git a/shared/source/command_stream/experimental_command_buffer.cpp b/shared/source/command_stream/experimental_command_buffer.cpp index 95206046a9..0b6b24d3f7 100644 --- a/shared/source/command_stream/experimental_command_buffer.cpp +++ b/shared/source/command_stream/experimental_command_buffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -25,9 +25,9 @@ ExperimentalCommandBuffer::ExperimentalCommandBuffer(CommandStreamReceiver *csr, currentStream(nullptr), timerResolution(profilingTimerResolution) { auto rootDeviceIndex = csr->getRootDeviceIndex(); - timestamps = csr->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize, AllocationType::INTERNAL_HOST_MEMORY, csr->getOsContext().getDeviceBitfield()}); + timestamps = csr->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize, AllocationType::internalHostMemory, csr->getOsContext().getDeviceBitfield()}); memset(timestamps->getUnderlyingBuffer(), 0, timestamps->getUnderlyingBufferSize()); - experimentalAllocation = csr->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize, AllocationType::INTERNAL_HOST_MEMORY, csr->getOsContext().getDeviceBitfield()}); + experimentalAllocation = csr->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize, AllocationType::internalHostMemory, csr->getOsContext().getDeviceBitfield()}); memset(experimentalAllocation->getUnderlyingBuffer(), 0, experimentalAllocation->getUnderlyingBufferSize()); } diff --git a/shared/source/command_stream/scratch_space_controller_base.cpp b/shared/source/command_stream/scratch_space_controller_base.cpp index f75092a39f..4319a34bc0 100644 --- a/shared/source/command_stream/scratch_space_controller_base.cpp +++ b/shared/source/command_stream/scratch_space_controller_base.cpp @@ -49,7 +49,7 @@ void ScratchSpaceControllerBase::setRequiredScratchSpace(void *sshBaseAddress, } void ScratchSpaceControllerBase::createScratchSpaceAllocation() { - scratchAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, scratchSizeBytes, AllocationType::SCRATCH_SURFACE, this->csrAllocationStorage.getDeviceBitfield()}); + scratchAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, scratchSizeBytes, AllocationType::scratchSurface, this->csrAllocationStorage.getDeviceBitfield()}); UNRECOVERABLE_IF(scratchAllocation == nullptr); } diff --git a/shared/source/command_stream/scratch_space_controller_xehp_and_later.cpp b/shared/source/command_stream/scratch_space_controller_xehp_and_later.cpp index f4d5967ac4..0e6d5af55a 100644 --- a/shared/source/command_stream/scratch_space_controller_xehp_and_later.cpp +++ b/shared/source/command_stream/scratch_space_controller_xehp_and_later.cpp @@ -172,7 +172,7 @@ void ScratchSpaceControllerXeHPAndLater::prepareScratchAllocation(uint32_t requi scratchSurfaceDirty = true; scratchSizeBytes = requiredScratchSizeInBytes; perThreadScratchSize = requiredPerThreadScratchSizeAlignedUp; - AllocationProperties properties{this->rootDeviceIndex, true, scratchSizeBytes, AllocationType::SCRATCH_SURFACE, multiTileCapable, false, osContext.getDeviceBitfield()}; + AllocationProperties properties{this->rootDeviceIndex, true, scratchSizeBytes, AllocationType::scratchSurface, multiTileCapable, false, osContext.getDeviceBitfield()}; scratchAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); } if (privateScratchSpaceSupported) { @@ -189,7 +189,7 @@ void ScratchSpaceControllerXeHPAndLater::prepareScratchAllocation(uint32_t requi privateScratchSizeBytes = requiredPrivateScratchSizeInBytes; perThreadPrivateScratchSize = requiredPerThreadPrivateScratchSizeAlignedUp; scratchSurfaceDirty = true; - AllocationProperties properties{this->rootDeviceIndex, true, privateScratchSizeBytes, AllocationType::PRIVATE_SURFACE, multiTileCapable, false, osContext.getDeviceBitfield()}; + AllocationProperties properties{this->rootDeviceIndex, true, privateScratchSizeBytes, AllocationType::privateSurface, multiTileCapable, false, osContext.getDeviceBitfield()}; privateScratchAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); } } diff --git a/shared/source/debugger/debugger_l0.cpp b/shared/source/debugger/debugger_l0.cpp index 6d16bd748e..383e6113e1 100644 --- a/shared/source/debugger/debugger_l0.cpp +++ b/shared/source/debugger/debugger_l0.cpp @@ -46,7 +46,7 @@ void DebuggerL0::initialize() { auto &engines = device->getMemoryManager()->getRegisteredEngines(device->getRootDeviceIndex()); NEO::AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize, - NEO::AllocationType::DEBUG_SBA_TRACKING_BUFFER, + NEO::AllocationType::debugSbaTrackingBuffer, false, device->getDeviceBitfield()}; @@ -79,7 +79,7 @@ void DebuggerL0::initialize() { auto &rootDeviceEnvironment = device->getRootDeviceEnvironment(); NEO::AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize64k, - NEO::AllocationType::DEBUG_MODULE_AREA, + NEO::AllocationType::debugModuleArea, false, device->getDeviceBitfield()}; moduleDebugArea = device->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); diff --git a/shared/source/debugger/linux/debugger_l0_linux.cpp b/shared/source/debugger/linux/debugger_l0_linux.cpp index f5eeb9e0c3..4e7123de2f 100644 --- a/shared/source/debugger/linux/debugger_l0_linux.cpp +++ b/shared/source/debugger/linux/debugger_l0_linux.cpp @@ -75,7 +75,7 @@ bool DebuggerL0::attachZebinModuleToSegmentAllocations(const StackVec(allocation); - DEBUG_BREAK_IF(allocation->getAllocationType() == AllocationType::KERNEL_ISA_INTERNAL); + DEBUG_BREAK_IF(allocation->getAllocationType() == AllocationType::kernelIsaInternal); drmAllocation->linkWithRegisteredHandle(elfHandle); drmAllocation->linkWithRegisteredHandle(moduleHandle); } diff --git a/shared/source/debugger/windows/debugger_l0_windows.cpp b/shared/source/debugger/windows/debugger_l0_windows.cpp index 1293867b57..ff791aac6d 100644 --- a/shared/source/debugger/windows/debugger_l0_windows.cpp +++ b/shared/source/debugger/windows/debugger_l0_windows.cpp @@ -44,16 +44,16 @@ void DebuggerL0::registerAllocationType(GraphicsAllocation *allocation) { auto wddmAllocation = static_cast(allocation); switch (wddmAllocation->getAllocationType()) { - case AllocationType::DEBUG_CONTEXT_SAVE_AREA: + case AllocationType::debugContextSaveArea: dataType = SIP_CONTEXT_SAVE_AREA; break; - case AllocationType::DEBUG_SBA_TRACKING_BUFFER: + case AllocationType::debugSbaTrackingBuffer: dataType = SBA_BUFFER_AREA; break; - case AllocationType::DEBUG_MODULE_AREA: + case AllocationType::debugModuleArea: dataType = MODULE_HEAP_DEBUG_AREA; break; - case AllocationType::KERNEL_ISA: + case AllocationType::kernelIsa: dataType = ISA; default: break; diff --git a/shared/source/device/device.cpp b/shared/source/device/device.cpp index 2d5816e6dd..5c8b72ec45 100644 --- a/shared/source/device/device.cpp +++ b/shared/source/device/device.cpp @@ -694,7 +694,7 @@ void Device::initializeRayTracing(uint32_t maxBvhLevels) { if (rtMemoryBackedBuffer == nullptr) { auto size = RayTracingHelper::getTotalMemoryBackedFifoSize(*this); - AllocationProperties allocProps(getRootDeviceIndex(), true, size, AllocationType::BUFFER, true, getDeviceBitfield()); + AllocationProperties allocProps(getRootDeviceIndex(), true, size, AllocationType::buffer, true, getDeviceBitfield()); auto &productHelper = getProductHelper(); allocProps.flags.resource48Bit = productHelper.is48bResourceNeededForRayTracing(); allocProps.flags.isUSMDeviceAllocation = true; @@ -890,7 +890,7 @@ void Device::allocateRTDispatchGlobals(uint32_t maxBvhLevels) { GraphicsAllocation *dispatchGlobalsArrayAllocation = nullptr; AllocationProperties arrayAllocProps(getRootDeviceIndex(), true, dispatchGlobalsSize, - AllocationType::GLOBAL_SURFACE, true, getDeviceBitfield()); + AllocationType::globalSurface, true, getDeviceBitfield()); arrayAllocProps.flags.resource48Bit = productHelper.is48bResourceNeededForRayTracing(); arrayAllocProps.flags.isUSMDeviceAllocation = true; dispatchGlobalsArrayAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties(arrayAllocProps); @@ -905,7 +905,7 @@ void Device::allocateRTDispatchGlobals(uint32_t maxBvhLevels) { ? this->getDeviceBitfield() : subdevices[tile]->getDeviceBitfield(); - AllocationProperties allocProps(getRootDeviceIndex(), true, rtStackSize, AllocationType::BUFFER, true, deviceBitfield); + AllocationProperties allocProps(getRootDeviceIndex(), true, rtStackSize, AllocationType::buffer, true, deviceBitfield); allocProps.flags.resource48Bit = productHelper.is48bResourceNeededForRayTracing(); allocProps.flags.isUSMDeviceAllocation = true; diff --git a/shared/source/direct_submission/direct_submission_hw.inl b/shared/source/direct_submission/direct_submission_hw.inl index 1a5704d056..2391d2a5a6 100644 --- a/shared/source/direct_submission/direct_submission_hw.inl +++ b/shared/source/direct_submission/direct_submission_hw.inl @@ -328,7 +328,7 @@ bool DirectSubmissionHw::allocateResources() { const auto allocationSize = alignUp(minimumRequiredSize + additionalAllocationSize, MemoryConstants::pageSize64k); const AllocationProperties commandStreamAllocationProperties{rootDeviceIndex, true, allocationSize, - AllocationType::RING_BUFFER, + AllocationType::ringBuffer, isMultiOsContextCapable, false, osContext.getDeviceBitfield()}; for (uint32_t ringBufferIndex = 0; ringBufferIndex < RingBufferUse::initialRingBufferCount; ringBufferIndex++) { @@ -341,7 +341,7 @@ bool DirectSubmissionHw::allocateResources() { const AllocationProperties semaphoreAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize, - AllocationType::SEMAPHORE_BUFFER, + AllocationType::semaphoreBuffer, isMultiOsContextCapable, false, osContext.getDeviceBitfield()}; semaphores = memoryManager->allocateGraphicsMemoryWithProperties(semaphoreAllocationProperties); UNRECOVERABLE_IF(semaphores == nullptr); @@ -358,7 +358,7 @@ bool DirectSubmissionHw::allocateResources() { if (this->relaxedOrderingEnabled) { const AllocationProperties allocationProperties(rootDeviceIndex, true, MemoryConstants::pageSize64k, - AllocationType::DEFERRED_TASKS_LIST, + AllocationType::deferredTasksList, isMultiOsContextCapable, false, osContext.getDeviceBitfield()); deferredTasksListAllocation = memoryManager->allocateGraphicsMemoryWithProperties(allocationProperties); @@ -368,7 +368,7 @@ bool DirectSubmissionHw::allocateResources() { const AllocationProperties relaxedOrderingSchedulerAllocationProperties(rootDeviceIndex, true, MemoryConstants::pageSize64k, - AllocationType::COMMAND_BUFFER, + AllocationType::commandBuffer, isMultiOsContextCapable, false, osContext.getDeviceBitfield()); relaxedOrderingSchedulerAllocation = memoryManager->allocateGraphicsMemoryWithProperties(relaxedOrderingSchedulerAllocationProperties); @@ -1095,7 +1095,7 @@ inline GraphicsAllocation *DirectSubmissionHw::switchRing const auto allocationSize = alignUp(minimumRequiredSize + additionalAllocationSize, MemoryConstants::pageSize64k); const AllocationProperties commandStreamAllocationProperties{rootDeviceIndex, true, allocationSize, - AllocationType::RING_BUFFER, + AllocationType::ringBuffer, isMultiOsContextCapable, false, osContext.getDeviceBitfield()}; nextAllocation = memoryManager->allocateGraphicsMemoryWithProperties(commandStreamAllocationProperties); this->currentRingBuffer = static_cast(this->ringBuffers.size()); diff --git a/shared/source/execution_environment/root_device_environment.cpp b/shared/source/execution_environment/root_device_environment.cpp index f64cbcd4b7..9824a03780 100644 --- a/shared/source/execution_environment/root_device_environment.cpp +++ b/shared/source/execution_environment/root_device_environment.cpp @@ -244,7 +244,7 @@ void RootDeviceEnvironment::setDummyBlitProperties(uint32_t rootDeviceIndex) { rootDeviceIndex, true, size, - NEO::AllocationType::BUFFER, + NEO::AllocationType::buffer, false, false, systemMemoryBitfield); diff --git a/shared/source/gen12lp/command_encoder_gen12lp.cpp b/shared/source/gen12lp/command_encoder_gen12lp.cpp index afcbd46d41..314bf4b63c 100644 --- a/shared/source/gen12lp/command_encoder_gen12lp.cpp +++ b/shared/source/gen12lp/command_encoder_gen12lp.cpp @@ -72,7 +72,7 @@ void EncodeSurfaceState::encodeExtraBufferParams(EncodeSurfaceStateArgs auto surfaceState = reinterpret_cast(args.outMemory); const bool isL3Allowed = surfaceState->getMemoryObjectControlState() == args.gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER); if (isL3Allowed) { - const bool isConstantSurface = args.allocation && args.allocation->getAllocationType() == AllocationType::CONSTANT_SURFACE; + const bool isConstantSurface = args.allocation && args.allocation->getAllocationType() == AllocationType::constantSurface; bool useL1 = args.isReadOnly || isConstantSurface; if (debugManager.flags.ForceL1Caching.get() != 1) { diff --git a/shared/source/gen12lp/gfx_core_helper_gen12lp.cpp b/shared/source/gen12lp/gfx_core_helper_gen12lp.cpp index 8dae83c024..f1e7979e60 100644 --- a/shared/source/gen12lp/gfx_core_helper_gen12lp.cpp +++ b/shared/source/gen12lp/gfx_core_helper_gen12lp.cpp @@ -200,7 +200,7 @@ void GfxCoreHelperHw::setExtraAllocationData(AllocationData &allocationD } } if (productHelper.isStorageInfoAdjustmentRequired()) { - if (properties.allocationType == AllocationType::BUFFER && !properties.flags.preferCompressed && !properties.flags.shareable) { + if (properties.allocationType == AllocationType::buffer && !properties.flags.preferCompressed && !properties.flags.shareable) { allocationData.storageInfo.isLockable = true; } } diff --git a/shared/source/gmm_helper/cache_settings_helper.cpp b/shared/source/gmm_helper/cache_settings_helper.cpp index fee19a12b7..dae50f0973 100644 --- a/shared/source/gmm_helper/cache_settings_helper.cpp +++ b/shared/source/gmm_helper/cache_settings_helper.cpp @@ -19,7 +19,7 @@ namespace NEO { GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getGmmUsageType(AllocationType allocationType, bool forceUncached, const ProductHelper &productHelper) { if (debugManager.flags.ForceUncachedGmmUsageType.get()) { - UNRECOVERABLE_IF(allocationType == AllocationType::UNKNOWN); + UNRECOVERABLE_IF(allocationType == AllocationType::unknown); if ((1llu << (static_cast(allocationType) - 1)) & debugManager.flags.ForceUncachedGmmUsageType.get()) { forceUncached = true; } @@ -49,40 +49,40 @@ bool CacheSettingsHelper::preferNoCpuAccess(GMM_RESOURCE_USAGE_TYPE_ENUM gmmReso GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCachingEnabled(AllocationType allocationType, const ProductHelper &productHelper) { switch (allocationType) { - case AllocationType::IMAGE: + case AllocationType::image: return GMM_RESOURCE_USAGE_OCL_IMAGE; - case AllocationType::INTERNAL_HEAP: - case AllocationType::LINEAR_STREAM: + case AllocationType::internalHeap: + case AllocationType::linearStream: if (debugManager.flags.DisableCachingForHeaps.get()) { return getDefaultUsageTypeWithCachingDisabled(allocationType); } return GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER; - case AllocationType::CONSTANT_SURFACE: + case AllocationType::constantSurface: if (debugManager.flags.ForceL1Caching.get() == 0) { return getDefaultUsageTypeWithCachingDisabled(allocationType); } return GMM_RESOURCE_USAGE_OCL_BUFFER_CONST; - case AllocationType::BUFFER: - case AllocationType::SHARED_BUFFER: - case AllocationType::SVM_GPU: - case AllocationType::UNIFIED_SHARED_MEMORY: - case AllocationType::EXTERNAL_HOST_PTR: + case AllocationType::buffer: + case AllocationType::sharedBuffer: + case AllocationType::svmGpu: + case AllocationType::unifiedSharedMemory: + case AllocationType::externalHostPtr: if (debugManager.flags.DisableCachingForStatefulBufferAccess.get()) { return getDefaultUsageTypeWithCachingDisabled(allocationType); } return GMM_RESOURCE_USAGE_OCL_BUFFER; - case AllocationType::BUFFER_HOST_MEMORY: - case AllocationType::INTERNAL_HOST_MEMORY: - case AllocationType::MAP_ALLOCATION: - case AllocationType::FILL_PATTERN: - case AllocationType::SVM_CPU: - case AllocationType::SVM_ZERO_COPY: + case AllocationType::bufferHostMemory: + case AllocationType::internalHostMemory: + case AllocationType::mapAllocation: + case AllocationType::fillPattern: + case AllocationType::svmCpu: + case AllocationType::svmZeroCopy: if (debugManager.flags.DisableCachingForStatefulBufferAccess.get()) { return getDefaultUsageTypeWithCachingDisabled(allocationType); } return GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; - case AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: - case AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: + case AllocationType::gpuTimestampDeviceBuffer: + case AllocationType::timestampPacketTagBuffer: if (productHelper.isDcFlushAllowed()) { return getDefaultUsageTypeWithCachingDisabled(allocationType); } @@ -94,10 +94,10 @@ GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCaching GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCachingDisabled(AllocationType allocationType) { switch (allocationType) { - case AllocationType::PREEMPTION: + case AllocationType::preemption: return GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC; - case AllocationType::INTERNAL_HEAP: - case AllocationType::LINEAR_STREAM: + case AllocationType::internalHeap: + case AllocationType::linearStream: return GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED; default: return GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED; diff --git a/shared/source/gmm_helper/gmm.cpp b/shared/source/gmm_helper/gmm.cpp index caa11c54d7..95a3666052 100644 --- a/shared/source/gmm_helper/gmm.cpp +++ b/shared/source/gmm_helper/gmm.cpp @@ -127,7 +127,7 @@ void Gmm::setupImageResourceParams(ImageInfo &imgInfo, bool preferCompressed) { auto &productHelper = gmmHelper->getRootDeviceEnvironment().getHelper(); resourceParams.NoGfxMemory = 1; // dont allocate, only query for params - resourceParams.Usage = CacheSettingsHelper::getGmmUsageType(AllocationType::IMAGE, false, productHelper); + resourceParams.Usage = CacheSettingsHelper::getGmmUsageType(AllocationType::image, false, productHelper); resourceParams.Format = imgInfo.surfaceFormat->gmmSurfaceFormat; resourceParams.Flags.Gpu.Texture = 1; diff --git a/shared/source/helpers/app_resource_helper.cpp b/shared/source/helpers/app_resource_helper.cpp index e017e338ad..6dfd3e7b15 100644 --- a/shared/source/helpers/app_resource_helper.cpp +++ b/shared/source/helpers/app_resource_helper.cpp @@ -22,99 +22,99 @@ void AppResourceHelper::copyResourceTagStr(char *dst, AllocationType type, size_ const char *AppResourceHelper::getResourceTagStr(AllocationType type) { switch (type) { - case AllocationType::UNKNOWN: + case AllocationType::unknown: return "UNKNOWN"; - case AllocationType::BUFFER: + case AllocationType::buffer: return "BUFFER"; - case AllocationType::BUFFER_HOST_MEMORY: + case AllocationType::bufferHostMemory: return "BFHSTMEM"; - case AllocationType::COMMAND_BUFFER: + case AllocationType::commandBuffer: return "CMNDBUFF"; - case AllocationType::CONSTANT_SURFACE: + case AllocationType::constantSurface: return "CSNTSRFC"; - case AllocationType::EXTERNAL_HOST_PTR: + case AllocationType::externalHostPtr: return "EXHSTPTR"; - case AllocationType::FILL_PATTERN: + case AllocationType::fillPattern: return "FILPATRN"; - case AllocationType::GLOBAL_SURFACE: + case AllocationType::globalSurface: return "GLBLSRFC"; - case AllocationType::IMAGE: + case AllocationType::image: return "IMAGE"; - case AllocationType::INDIRECT_OBJECT_HEAP: + case AllocationType::indirectObjectHeap: return "INOBHEAP"; - case AllocationType::INSTRUCTION_HEAP: + case AllocationType::instructionHeap: return "INSTHEAP"; - case AllocationType::INTERNAL_HEAP: + case AllocationType::internalHeap: return "INTLHEAP"; - case AllocationType::INTERNAL_HOST_MEMORY: + case AllocationType::internalHostMemory: return "INHSTMEM"; - case AllocationType::KERNEL_ARGS_BUFFER: + case AllocationType::kernelArgsBuffer: return "KARGBUF"; - case AllocationType::KERNEL_ISA: + case AllocationType::kernelIsa: return "KERNLISA"; - case AllocationType::KERNEL_ISA_INTERNAL: + case AllocationType::kernelIsaInternal: return "KRLISAIN"; - case AllocationType::LINEAR_STREAM: + case AllocationType::linearStream: return "LINRSTRM"; - case AllocationType::MAP_ALLOCATION: + case AllocationType::mapAllocation: return "MAPALLOC"; - case AllocationType::MCS: + case AllocationType::mcs: return "MCS"; - case AllocationType::PIPE: + case AllocationType::pipe: return "PIPE"; - case AllocationType::PREEMPTION: + case AllocationType::preemption: return "PRMPTION"; - case AllocationType::PRINTF_SURFACE: + case AllocationType::printfSurface: return "PRNTSRFC"; - case AllocationType::PRIVATE_SURFACE: + case AllocationType::privateSurface: return "PRVTSRFC"; - case AllocationType::PROFILING_TAG_BUFFER: + case AllocationType::profilingTagBuffer: return "PROFTGBF"; - case AllocationType::SCRATCH_SURFACE: + case AllocationType::scratchSurface: return "SCRHSRFC"; - case AllocationType::SHARED_BUFFER: + case AllocationType::sharedBuffer: return "SHRDBUFF"; - case AllocationType::SHARED_IMAGE: + case AllocationType::sharedImage: return "SHERDIMG"; - case AllocationType::SHARED_RESOURCE_COPY: + case AllocationType::sharedResourceCopy: return "SRDRSCCP"; - case AllocationType::SURFACE_STATE_HEAP: + case AllocationType::surfaceStateHeap: return "SRFCSTHP"; - case AllocationType::SVM_CPU: + case AllocationType::svmCpu: return "SVM_CPU"; - case AllocationType::SVM_GPU: + case AllocationType::svmGpu: return "SVM_GPU"; - case AllocationType::SVM_ZERO_COPY: + case AllocationType::svmZeroCopy: return "SVM0COPY"; - case AllocationType::TAG_BUFFER: + case AllocationType::tagBuffer: return "TAGBUFER"; - case AllocationType::GLOBAL_FENCE: + case AllocationType::globalFence: return "GLBLFENC"; - case AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: + case AllocationType::timestampPacketTagBuffer: return "TSPKTGBF"; - case AllocationType::WRITE_COMBINED: + case AllocationType::writeCombined: return "WRTCMBND"; - case AllocationType::RING_BUFFER: + case AllocationType::ringBuffer: return "RINGBUFF"; - case AllocationType::SEMAPHORE_BUFFER: + case AllocationType::semaphoreBuffer: return "SMPHRBUF"; - case AllocationType::DEBUG_CONTEXT_SAVE_AREA: + case AllocationType::debugContextSaveArea: return "DBCXSVAR"; - case AllocationType::DEBUG_SBA_TRACKING_BUFFER: + case AllocationType::debugSbaTrackingBuffer: return "DBSBATRB"; - case AllocationType::DEBUG_MODULE_AREA: + case AllocationType::debugModuleArea: return "DBMDLARE"; - case AllocationType::UNIFIED_SHARED_MEMORY: + case AllocationType::unifiedSharedMemory: return "USHRDMEM"; - case AllocationType::WORK_PARTITION_SURFACE: + case AllocationType::workPartitionSurface: return "WRPRTSRF"; - case AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: + case AllocationType::gpuTimestampDeviceBuffer: return "GPUTSDBF"; - case AllocationType::SW_TAG_BUFFER: + case AllocationType::swTagBuffer: return "SWTAGBF"; - case AllocationType::DEFERRED_TASKS_LIST: + case AllocationType::deferredTasksList: return "TSKLIST"; - case AllocationType::ASSERT_BUFFER: + case AllocationType::assertBuffer: return "ASSRTBUF"; default: return "NOTFOUND"; diff --git a/shared/source/helpers/bindless_heaps_helper.cpp b/shared/source/helpers/bindless_heaps_helper.cpp index 3502a89b70..9c4e221a93 100644 --- a/shared/source/helpers/bindless_heaps_helper.cpp +++ b/shared/source/helpers/bindless_heaps_helper.cpp @@ -55,7 +55,7 @@ BindlessHeapsHelper::~BindlessHeapsHelper() { } GraphicsAllocation *BindlessHeapsHelper::getHeapAllocation(size_t heapSize, size_t alignment, bool allocInFrontWindow) { - auto allocationType = AllocationType::LINEAR_STREAM; + auto allocationType = AllocationType::linearStream; NEO::AllocationProperties properties{rootDeviceIndex, true, heapSize, allocationType, isMultiOsContextCapable, deviceBitfield}; properties.flags.use32BitFrontWindow = allocInFrontWindow; properties.alignment = alignment; diff --git a/shared/source/helpers/flat_batch_buffer_helper_hw.inl b/shared/source/helpers/flat_batch_buffer_helper_hw.inl index fde322c3a6..d6ff91ff56 100644 --- a/shared/source/helpers/flat_batch_buffer_helper_hw.inl +++ b/shared/source/helpers/flat_batch_buffer_helper_hw.inl @@ -36,7 +36,7 @@ GraphicsAllocation *FlatBatchBufferHelperHw::flattenBatchBuffer(uint3 batchBuffer.chainedBatchBuffer->setAubWritable(false, GraphicsAllocation::defaultBank); auto sizeMainBatchBuffer = batchBuffer.chainedBatchBufferStartOffset - batchBuffer.startOffset; auto alignedMainBatchBufferSize = alignUp(sizeMainBatchBuffer + indirectPatchCommandsSize + batchBuffer.chainedBatchBuffer->getUnderlyingBufferSize(), MemoryConstants::pageSize); - AllocationProperties flatBatchBufferProperties(rootDeviceIndex, alignedMainBatchBufferSize, AllocationType::INTERNAL_HOST_MEMORY, deviceBitfield); + AllocationProperties flatBatchBufferProperties(rootDeviceIndex, alignedMainBatchBufferSize, AllocationType::internalHostMemory, deviceBitfield); flatBatchBufferProperties.alignment = MemoryConstants::pageSize; flatBatchBuffer = getMemoryManager()->allocateGraphicsMemoryWithProperties(flatBatchBufferProperties); @@ -114,7 +114,7 @@ GraphicsAllocation *FlatBatchBufferHelperHw::flattenBatchBuffer(uint3 flatBatchBufferSize = alignUp(flatBatchBufferSize, MemoryConstants::pageSize); flatBatchBufferSize += CSRequirements::csOverfetchSize; - AllocationProperties flatBatchBufferProperties(rootDeviceIndex, static_cast(flatBatchBufferSize), AllocationType::INTERNAL_HOST_MEMORY, deviceBitfield); + AllocationProperties flatBatchBufferProperties(rootDeviceIndex, static_cast(flatBatchBufferSize), AllocationType::internalHostMemory, deviceBitfield); flatBatchBufferProperties.alignment = MemoryConstants::pageSize; flatBatchBuffer = getMemoryManager()->allocateGraphicsMemoryWithProperties(flatBatchBufferProperties); UNRECOVERABLE_IF(flatBatchBuffer == nullptr); diff --git a/shared/source/helpers/heap_assigner.cpp b/shared/source/helpers/heap_assigner.cpp index eeed96da60..d4f0267602 100644 --- a/shared/source/helpers/heap_assigner.cpp +++ b/shared/source/helpers/heap_assigner.cpp @@ -18,7 +18,7 @@ HeapAssigner::HeapAssigner(bool allowExternalHeap) { } bool HeapAssigner::useInternal32BitHeap(AllocationType allocType) { return GraphicsAllocation::isIsaAllocationType(allocType) || - allocType == AllocationType::INTERNAL_HEAP; + allocType == AllocationType::internalHeap; } bool HeapAssigner::use32BitHeap(AllocationType allocType) { return useExternal32BitHeap(allocType) || useInternal32BitHeap(allocType); @@ -31,7 +31,7 @@ HeapIndex HeapAssigner::get32BitHeapIndex(AllocationType allocType, bool useLoca } bool HeapAssigner::useExternal32BitHeap(AllocationType allocType) { if (apiAllowExternalHeapForSshAndDsh) { - return allocType == AllocationType::LINEAR_STREAM; + return allocType == AllocationType::linearStream; } return false; } diff --git a/shared/source/helpers/heap_helper.cpp b/shared/source/helpers/heap_helper.cpp index 201ee433cc..782afc2f4e 100644 --- a/shared/source/helpers/heap_helper.cpp +++ b/shared/source/helpers/heap_helper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 Intel Corporation + * Copyright (C) 2019-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -16,9 +16,9 @@ namespace NEO { GraphicsAllocation *HeapHelper::getHeapAllocation(uint32_t heapType, size_t heapSize, size_t alignment, uint32_t rootDeviceIndex) { - auto allocationType = AllocationType::LINEAR_STREAM; + auto allocationType = AllocationType::linearStream; if (IndirectHeap::Type::INDIRECT_OBJECT == heapType) { - allocationType = AllocationType::INTERNAL_HEAP; + allocationType = AllocationType::internalHeap; } auto allocation = this->storageForReuse->obtainReusableAllocation(heapSize, allocationType); diff --git a/shared/source/helpers/state_base_address_base.inl b/shared/source/helpers/state_base_address_base.inl index 5e2c3b49d5..d256ef66f5 100644 --- a/shared/source/helpers/state_base_address_base.inl +++ b/shared/source/helpers/state_base_address_base.inl @@ -101,7 +101,7 @@ void StateBaseAddressHelper::programStateBaseAddress( args.stateBaseAddressCmd->setInstructionBufferSize(MemoryConstants::sizeOf4GBinPageEntities); auto &productHelper = args.gmmHelper->getRootDeviceEnvironment().template getHelper(); - auto resourceUsage = CacheSettingsHelper::getGmmUsageType(AllocationType::INTERNAL_HEAP, debugManager.flags.DisableCachingForHeaps.get(), productHelper); + auto resourceUsage = CacheSettingsHelper::getGmmUsageType(AllocationType::internalHeap, debugManager.flags.DisableCachingForHeaps.get(), productHelper); args.stateBaseAddressCmd->setInstructionMemoryObjectControlState(args.gmmHelper->getMOCS(resourceUsage)); } diff --git a/shared/source/helpers/state_base_address_xehp_and_later.inl b/shared/source/helpers/state_base_address_xehp_and_later.inl index fd60f70002..2e8a296e5e 100644 --- a/shared/source/helpers/state_base_address_xehp_and_later.inl +++ b/shared/source/helpers/state_base_address_xehp_and_later.inl @@ -65,7 +65,7 @@ void StateBaseAddressHelper::appendStateBaseAddressParameters( auto &productHelper = args.gmmHelper->getRootDeviceEnvironment().template getHelper(); - auto heapResourceUsage = CacheSettingsHelper::getGmmUsageType(AllocationType::INTERNAL_HEAP, debugManager.flags.DisableCachingForHeaps.get(), productHelper); + auto heapResourceUsage = CacheSettingsHelper::getGmmUsageType(AllocationType::internalHeap, debugManager.flags.DisableCachingForHeaps.get(), productHelper); auto heapMocsValue = args.gmmHelper->getMOCS(heapResourceUsage); args.stateBaseAddressCmd->setSurfaceStateMemoryObjectControlState(heapMocsValue); diff --git a/shared/source/helpers/timestamp_packet.h b/shared/source/helpers/timestamp_packet.h index 3f76ccdc31..f7bb3b3dcd 100644 --- a/shared/source/helpers/timestamp_packet.h +++ b/shared/source/helpers/timestamp_packet.h @@ -30,7 +30,7 @@ template class TimestampPackets : public TagTypeBase { public: static constexpr AllocationType getAllocationType() { - return AllocationType::TIMESTAMP_PACKET_TAG_BUFFER; + return AllocationType::timestampPacketTagBuffer; } static constexpr TagNodeType getTagNodeType() { return TagNodeType::timestampPacket; } diff --git a/shared/source/memory_manager/allocation_properties.h b/shared/source/memory_manager/allocation_properties.h index 875a3bf666..6552d79051 100644 --- a/shared/source/memory_manager/allocation_properties.h +++ b/shared/source/memory_manager/allocation_properties.h @@ -36,7 +36,7 @@ struct AllocationProperties { uint32_t rootDeviceIndex = std::numeric_limits::max(); size_t size = 0; size_t alignment = 0; - AllocationType allocationType = AllocationType::UNKNOWN; + AllocationType allocationType = AllocationType::unknown; GraphicsAllocation::UsmInitialPlacement usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::DEFAULT; ImageInfo *imgInfo = nullptr; bool multiStorageResource = false; @@ -115,7 +115,7 @@ struct AllocationData { uint32_t allFlags = 0; }; static_assert(sizeof(AllocationData::flags) == sizeof(AllocationData::allFlags), ""); - AllocationType type = AllocationType::UNKNOWN; + AllocationType type = AllocationType::unknown; GraphicsAllocation::UsmInitialPlacement usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::DEFAULT; GfxMemoryAllocationMethod allocationMethod = GfxMemoryAllocationMethod::NotDefined; const void *hostPtr = nullptr; diff --git a/shared/source/memory_manager/allocation_type.h b/shared/source/memory_manager/allocation_type.h index 7bd4681f78..0ee3bb9555 100644 --- a/shared/source/memory_manager/allocation_type.h +++ b/shared/source/memory_manager/allocation_type.h @@ -11,54 +11,54 @@ namespace NEO { enum class AllocationType { - UNKNOWN = 0, - BUFFER, - BUFFER_HOST_MEMORY, - COMMAND_BUFFER, - CONSTANT_SURFACE, - EXTERNAL_HOST_PTR, - FILL_PATTERN, - GLOBAL_SURFACE, - IMAGE, - INDIRECT_OBJECT_HEAP, - INSTRUCTION_HEAP, - INTERNAL_HEAP, - INTERNAL_HOST_MEMORY, - KERNEL_ARGS_BUFFER, - KERNEL_ISA, - KERNEL_ISA_INTERNAL, - LINEAR_STREAM, - MAP_ALLOCATION, - MCS, - PIPE, - PREEMPTION, - PRINTF_SURFACE, - PRIVATE_SURFACE, - PROFILING_TAG_BUFFER, - SCRATCH_SURFACE, - SHARED_BUFFER, - SHARED_IMAGE, - SHARED_RESOURCE_COPY, - SURFACE_STATE_HEAP, - SVM_CPU, - SVM_GPU, - SVM_ZERO_COPY, - TAG_BUFFER, - GLOBAL_FENCE, - TIMESTAMP_PACKET_TAG_BUFFER, - WRITE_COMBINED, - RING_BUFFER, - SEMAPHORE_BUFFER, - DEBUG_CONTEXT_SAVE_AREA, - DEBUG_SBA_TRACKING_BUFFER, - DEBUG_MODULE_AREA, - UNIFIED_SHARED_MEMORY, - WORK_PARTITION_SURFACE, - GPU_TIMESTAMP_DEVICE_BUFFER, - SW_TAG_BUFFER, - DEFERRED_TASKS_LIST, - ASSERT_BUFFER, - COUNT + unknown = 0, + buffer, + bufferHostMemory, + commandBuffer, + constantSurface, + externalHostPtr, + fillPattern, + globalSurface, + image, + indirectObjectHeap, + instructionHeap, + internalHeap, + internalHostMemory, + kernelArgsBuffer, + kernelIsa, + kernelIsaInternal, + linearStream, + mapAllocation, + mcs, + pipe, + preemption, + printfSurface, + privateSurface, + profilingTagBuffer, + scratchSurface, + sharedBuffer, + sharedImage, + sharedResourceCopy, + surfaceStateHeap, + svmCpu, + svmGpu, + svmZeroCopy, + tagBuffer, + globalFence, + timestampPacketTagBuffer, + writeCombined, + ringBuffer, + semaphoreBuffer, + debugContextSaveArea, + debugSbaTrackingBuffer, + debugModuleArea, + unifiedSharedMemory, + workPartitionSurface, + gpuTimestampDeviceBuffer, + swTagBuffer, + deferredTasksList, + assertBuffer, + count }; enum class GfxMemoryAllocationMethod : uint32_t { diff --git a/shared/source/memory_manager/definitions/storage_info.cpp b/shared/source/memory_manager/definitions/storage_info.cpp index 484bacf35e..9a3a45adbf 100644 --- a/shared/source/memory_manager/definitions/storage_info.cpp +++ b/shared/source/memory_manager/definitions/storage_info.cpp @@ -23,7 +23,7 @@ StorageInfo::StorageInfo() = default; StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationProperties &properties) { StorageInfo storageInfo{}; - storageInfo.isLockable = GraphicsAllocation::isLockable(properties.allocationType) || (properties.makeDeviceBufferLockable && properties.allocationType == AllocationType::BUFFER); + storageInfo.isLockable = GraphicsAllocation::isLockable(properties.allocationType) || (properties.makeDeviceBufferLockable && properties.allocationType == AllocationType::buffer); if (properties.subDevicesBitfield.count() == 0) { return storageInfo; } @@ -53,10 +53,10 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope sizeof(storageInfo.resourceTag)); switch (properties.allocationType) { - case AllocationType::CONSTANT_SURFACE: - case AllocationType::KERNEL_ISA: - case AllocationType::KERNEL_ISA_INTERNAL: - case AllocationType::DEBUG_MODULE_AREA: { + case AllocationType::constantSurface: + case AllocationType::kernelIsa: + case AllocationType::kernelIsaInternal: + case AllocationType::debugModuleArea: { auto placeAllocOnMultiTile = (properties.subDevicesBitfield.count() != 1); if (placeAllocOnMultiTile) { storageInfo.cloningOfPageTables = false; @@ -68,14 +68,14 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope storageInfo.tileInstanced = false; } } break; - case AllocationType::DEBUG_CONTEXT_SAVE_AREA: - case AllocationType::WORK_PARTITION_SURFACE: + case AllocationType::debugContextSaveArea: + case AllocationType::workPartitionSurface: storageInfo.cloningOfPageTables = false; storageInfo.memoryBanks = allTilesValue; storageInfo.tileInstanced = true; break; - case AllocationType::PRIVATE_SURFACE: - case AllocationType::DEBUG_SBA_TRACKING_BUFFER: + case AllocationType::privateSurface: + case AllocationType::debugSbaTrackingBuffer: storageInfo.cloningOfPageTables = false; if (properties.subDevicesBitfield.count() == 1) { @@ -86,18 +86,18 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope storageInfo.tileInstanced = true; } break; - case AllocationType::COMMAND_BUFFER: - case AllocationType::INTERNAL_HEAP: - case AllocationType::LINEAR_STREAM: + case AllocationType::commandBuffer: + case AllocationType::internalHeap: + case AllocationType::linearStream: storageInfo.cloningOfPageTables = properties.flags.multiOsContextCapable; storageInfo.memoryBanks = preferredTile; if (!properties.flags.multiOsContextCapable) { storageInfo.pageTablesVisibility = preferredTile; } break; - case AllocationType::SCRATCH_SURFACE: - case AllocationType::PREEMPTION: - case AllocationType::DEFERRED_TASKS_LIST: + case AllocationType::scratchSurface: + case AllocationType::preemption: + case AllocationType::deferredTasksList: if (properties.flags.multiOsContextCapable) { storageInfo.cloningOfPageTables = false; storageInfo.memoryBanks = allTilesValue; @@ -107,14 +107,14 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope storageInfo.pageTablesVisibility = preferredTile; } break; - case AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: + case AllocationType::gpuTimestampDeviceBuffer: storageInfo.cloningOfPageTables = true; if (!properties.flags.multiOsContextCapable) { storageInfo.pageTablesVisibility = preferredTile; } break; - case AllocationType::BUFFER: - case AllocationType::SVM_GPU: { + case AllocationType::buffer: + case AllocationType::svmGpu: { auto colouringPolicy = properties.colouringPolicy; auto granularity = properties.colouringGranularity; @@ -153,7 +153,7 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope } break; } - case AllocationType::UNIFIED_SHARED_MEMORY: + case AllocationType::unifiedSharedMemory: storageInfo.memoryBanks = allTilesValue; if (debugManager.flags.OverrideMultiStoragePlacement.get() != -1) { storageInfo.memoryBanks = debugManager.flags.OverrideMultiStoragePlacement.get(); @@ -176,9 +176,9 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope } if (forceLocalMemoryForDirectSubmission) { - if (properties.allocationType == AllocationType::COMMAND_BUFFER || - properties.allocationType == AllocationType::RING_BUFFER || - properties.allocationType == AllocationType::SEMAPHORE_BUFFER) { + if (properties.allocationType == AllocationType::commandBuffer || + properties.allocationType == AllocationType::ringBuffer || + properties.allocationType == AllocationType::semaphoreBuffer) { if (properties.flags.multiOsContextCapable) { storageInfo.memoryBanks = {}; for (auto bank = 0u; bank < deviceCount; bank++) { @@ -192,7 +192,7 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope } } if (debugManager.flags.ForceMultiTileAllocPlacement.get()) { - UNRECOVERABLE_IF(properties.allocationType == AllocationType::UNKNOWN); + UNRECOVERABLE_IF(properties.allocationType == AllocationType::unknown); if ((1llu << (static_cast(properties.allocationType) - 1)) & debugManager.flags.ForceMultiTileAllocPlacement.get()) { storageInfo.cloningOfPageTables = false; storageInfo.memoryBanks = allTilesValue; @@ -200,7 +200,7 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope } } if (debugManager.flags.ForceSingleTileAllocPlacement.get()) { - UNRECOVERABLE_IF(properties.allocationType == AllocationType::UNKNOWN); + UNRECOVERABLE_IF(properties.allocationType == AllocationType::unknown); if ((1llu << (static_cast(properties.allocationType) - 1)) & debugManager.flags.ForceSingleTileAllocPlacement.get()) { storageInfo.cloningOfPageTables = true; storageInfo.memoryBanks = preferredTile; diff --git a/shared/source/memory_manager/graphics_allocation.h b/shared/source/memory_manager/graphics_allocation.h index 91185e75c6..760427940a 100644 --- a/shared/source/memory_manager/graphics_allocation.h +++ b/shared/source/memory_manager/graphics_allocation.h @@ -201,47 +201,47 @@ class GraphicsAllocation : public IDNode { } static bool isCpuAccessRequired(AllocationType allocationType) { - return allocationType == AllocationType::COMMAND_BUFFER || - allocationType == AllocationType::CONSTANT_SURFACE || - allocationType == AllocationType::GLOBAL_SURFACE || - allocationType == AllocationType::INTERNAL_HEAP || - allocationType == AllocationType::LINEAR_STREAM || - allocationType == AllocationType::PIPE || - allocationType == AllocationType::PRINTF_SURFACE || - allocationType == AllocationType::TIMESTAMP_PACKET_TAG_BUFFER || - allocationType == AllocationType::RING_BUFFER || - allocationType == AllocationType::SEMAPHORE_BUFFER || - allocationType == AllocationType::DEBUG_CONTEXT_SAVE_AREA || - allocationType == AllocationType::DEBUG_SBA_TRACKING_BUFFER || - allocationType == AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER || - allocationType == AllocationType::DEBUG_MODULE_AREA || - allocationType == AllocationType::ASSERT_BUFFER; + return allocationType == AllocationType::commandBuffer || + allocationType == AllocationType::constantSurface || + allocationType == AllocationType::globalSurface || + allocationType == AllocationType::internalHeap || + allocationType == AllocationType::linearStream || + allocationType == AllocationType::pipe || + allocationType == AllocationType::printfSurface || + allocationType == AllocationType::timestampPacketTagBuffer || + allocationType == AllocationType::ringBuffer || + allocationType == AllocationType::semaphoreBuffer || + allocationType == AllocationType::debugContextSaveArea || + allocationType == AllocationType::debugSbaTrackingBuffer || + allocationType == AllocationType::gpuTimestampDeviceBuffer || + allocationType == AllocationType::debugModuleArea || + allocationType == AllocationType::assertBuffer; } static bool isLockable(AllocationType allocationType) { return isCpuAccessRequired(allocationType) || isIsaAllocationType(allocationType) || - allocationType == AllocationType::BUFFER_HOST_MEMORY || - allocationType == AllocationType::SHARED_RESOURCE_COPY; + allocationType == AllocationType::bufferHostMemory || + allocationType == AllocationType::sharedResourceCopy; } static bool isKernelIsaAllocationType(AllocationType type) { - return type == AllocationType::KERNEL_ISA || - type == AllocationType::KERNEL_ISA_INTERNAL; + return type == AllocationType::kernelIsa || + type == AllocationType::kernelIsaInternal; } static bool isIsaAllocationType(AllocationType type) { return isKernelIsaAllocationType(type) || - type == AllocationType::DEBUG_MODULE_AREA; + type == AllocationType::debugModuleArea; } static bool isDebugSurfaceAllocationType(AllocationType type) { - return type == AllocationType::DEBUG_CONTEXT_SAVE_AREA || - type == AllocationType::DEBUG_SBA_TRACKING_BUFFER; + return type == AllocationType::debugContextSaveArea || + type == AllocationType::debugSbaTrackingBuffer; } static bool isConstantOrGlobalSurfaceAllocationType(AllocationType type) { - return type == AllocationType::CONSTANT_SURFACE || - type == AllocationType::GLOBAL_SURFACE; + return type == AllocationType::constantSurface || + type == AllocationType::globalSurface; } static uint32_t getNumHandlesForKmdSharedAllocation(uint32_t numBanks); @@ -374,7 +374,7 @@ class GraphicsAllocation : public IDNode { void *lockedPtr = nullptr; MemoryPool memoryPool = MemoryPool::MemoryNull; - AllocationType allocationType = AllocationType::UNKNOWN; + AllocationType allocationType = AllocationType::unknown; StackVec usageInfos; std::atomic registeredContextsNum{0}; diff --git a/shared/source/memory_manager/memory_manager.cpp b/shared/source/memory_manager/memory_manager.cpp index 51af0374fd..009790486d 100644 --- a/shared/source/memory_manager/memory_manager.cpp +++ b/shared/source/memory_manager/memory_manager.cpp @@ -103,8 +103,8 @@ bool MemoryManager::isLimitedGPU(uint32_t rootDeviceIndex) { bool MemoryManager::isLimitedGPUOnType(uint32_t rootDeviceIndex, AllocationType type) { return isLimitedGPU(rootDeviceIndex) && - (type != AllocationType::MAP_ALLOCATION) && - (type != AllocationType::IMAGE); + (type != AllocationType::mapAllocation) && + (type != AllocationType::image); } void *MemoryManager::alignedMallocWrapper(size_t bytes, size_t alignment) { @@ -351,7 +351,7 @@ OsContext *MemoryManager::createAndRegisterOsContext(CommandStreamReceiver *comm bool MemoryManager::getAllocationData(AllocationData &allocationData, const AllocationProperties &properties, const void *hostPtr, const StorageInfo &storageInfo) { UNRECOVERABLE_IF(hostPtr == nullptr && !properties.flags.allocateMemory); - UNRECOVERABLE_IF(properties.allocationType == AllocationType::UNKNOWN); + UNRECOVERABLE_IF(properties.allocationType == AllocationType::unknown); auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[properties.rootDeviceIndex]; auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo(); @@ -363,17 +363,17 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo bool mayRequireL3Flush = false; switch (properties.allocationType) { - case AllocationType::BUFFER: - case AllocationType::BUFFER_HOST_MEMORY: - case AllocationType::CONSTANT_SURFACE: - case AllocationType::GLOBAL_SURFACE: - case AllocationType::PIPE: - case AllocationType::PRINTF_SURFACE: - case AllocationType::PRIVATE_SURFACE: - case AllocationType::SCRATCH_SURFACE: - case AllocationType::WORK_PARTITION_SURFACE: - case AllocationType::WRITE_COMBINED: - case AllocationType::ASSERT_BUFFER: + case AllocationType::buffer: + case AllocationType::bufferHostMemory: + case AllocationType::constantSurface: + case AllocationType::globalSurface: + case AllocationType::pipe: + case AllocationType::printfSurface: + case AllocationType::privateSurface: + case AllocationType::scratchSurface: + case AllocationType::workPartitionSurface: + case AllocationType::writeCombined: + case AllocationType::assertBuffer: allow64KbPages = true; allow32Bit = true; default: @@ -381,63 +381,63 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo } switch (properties.allocationType) { - case AllocationType::SVM_GPU: - case AllocationType::SVM_ZERO_COPY: - case AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: - case AllocationType::PREEMPTION: + case AllocationType::svmGpu: + case AllocationType::svmZeroCopy: + case AllocationType::gpuTimestampDeviceBuffer: + case AllocationType::preemption: allow64KbPages = true; default: break; } switch (properties.allocationType) { - case AllocationType::BUFFER: - case AllocationType::BUFFER_HOST_MEMORY: - case AllocationType::WRITE_COMBINED: + case AllocationType::buffer: + case AllocationType::bufferHostMemory: + case AllocationType::writeCombined: forcePin = true; default: break; } switch (properties.allocationType) { - case AllocationType::BUFFER: - case AllocationType::BUFFER_HOST_MEMORY: - case AllocationType::EXTERNAL_HOST_PTR: - case AllocationType::GLOBAL_SURFACE: - case AllocationType::IMAGE: - case AllocationType::MAP_ALLOCATION: - case AllocationType::PIPE: - case AllocationType::SHARED_BUFFER: - case AllocationType::SHARED_IMAGE: - case AllocationType::SHARED_RESOURCE_COPY: - case AllocationType::SVM_CPU: - case AllocationType::SVM_GPU: - case AllocationType::SVM_ZERO_COPY: - case AllocationType::WRITE_COMBINED: + case AllocationType::buffer: + case AllocationType::bufferHostMemory: + case AllocationType::externalHostPtr: + case AllocationType::globalSurface: + case AllocationType::image: + case AllocationType::mapAllocation: + case AllocationType::pipe: + case AllocationType::sharedBuffer: + case AllocationType::sharedImage: + case AllocationType::sharedResourceCopy: + case AllocationType::svmCpu: + case AllocationType::svmGpu: + case AllocationType::svmZeroCopy: + case AllocationType::writeCombined: mayRequireL3Flush = true; default: break; } switch (properties.allocationType) { - case AllocationType::COMMAND_BUFFER: - case AllocationType::RING_BUFFER: - case AllocationType::SEMAPHORE_BUFFER: - case AllocationType::BUFFER_HOST_MEMORY: - case AllocationType::EXTERNAL_HOST_PTR: - case AllocationType::FILL_PATTERN: - case AllocationType::MAP_ALLOCATION: - case AllocationType::MCS: - case AllocationType::PROFILING_TAG_BUFFER: - case AllocationType::SVM_CPU: - case AllocationType::SVM_ZERO_COPY: - case AllocationType::TAG_BUFFER: - case AllocationType::GLOBAL_FENCE: - case AllocationType::INTERNAL_HOST_MEMORY: - case AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: - case AllocationType::DEBUG_CONTEXT_SAVE_AREA: - case AllocationType::DEBUG_SBA_TRACKING_BUFFER: - case AllocationType::SW_TAG_BUFFER: + case AllocationType::commandBuffer: + case AllocationType::ringBuffer: + case AllocationType::semaphoreBuffer: + case AllocationType::bufferHostMemory: + case AllocationType::externalHostPtr: + case AllocationType::fillPattern: + case AllocationType::mapAllocation: + case AllocationType::mcs: + case AllocationType::profilingTagBuffer: + case AllocationType::svmCpu: + case AllocationType::svmZeroCopy: + case AllocationType::tagBuffer: + case AllocationType::globalFence: + case AllocationType::internalHostMemory: + case AllocationType::timestampPacketTagBuffer: + case AllocationType::debugContextSaveArea: + case AllocationType::debugSbaTrackingBuffer: + case AllocationType::swTagBuffer: allocationData.flags.useSystemMemory = true; default: break; @@ -448,27 +448,27 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo } switch (properties.allocationType) { - case AllocationType::DEFERRED_TASKS_LIST: - case AllocationType::COMMAND_BUFFER: - case AllocationType::IMAGE: - case AllocationType::INDIRECT_OBJECT_HEAP: - case AllocationType::INSTRUCTION_HEAP: - case AllocationType::INTERNAL_HEAP: - case AllocationType::KERNEL_ISA: - case AllocationType::KERNEL_ISA_INTERNAL: - case AllocationType::LINEAR_STREAM: - case AllocationType::MCS: - case AllocationType::PREEMPTION: - case AllocationType::SCRATCH_SURFACE: - case AllocationType::WORK_PARTITION_SURFACE: - case AllocationType::SHARED_IMAGE: - case AllocationType::SHARED_RESOURCE_COPY: - case AllocationType::SURFACE_STATE_HEAP: - case AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: - case AllocationType::DEBUG_MODULE_AREA: - case AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: - case AllocationType::RING_BUFFER: - case AllocationType::SEMAPHORE_BUFFER: + case AllocationType::deferredTasksList: + case AllocationType::commandBuffer: + case AllocationType::image: + case AllocationType::indirectObjectHeap: + case AllocationType::instructionHeap: + case AllocationType::internalHeap: + case AllocationType::kernelIsa: + case AllocationType::kernelIsaInternal: + case AllocationType::linearStream: + case AllocationType::mcs: + case AllocationType::preemption: + case AllocationType::scratchSurface: + case AllocationType::workPartitionSurface: + case AllocationType::sharedImage: + case AllocationType::sharedResourceCopy: + case AllocationType::surfaceStateHeap: + case AllocationType::timestampPacketTagBuffer: + case AllocationType::debugModuleArea: + case AllocationType::gpuTimestampDeviceBuffer: + case AllocationType::ringBuffer: + case AllocationType::semaphoreBuffer: allocationData.flags.resource48Bit = true; break; default: @@ -496,7 +496,7 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo allocationData.flags.zeroMemory = 1; } - if (properties.allocationType == AllocationType::DEBUG_MODULE_AREA) { + if (properties.allocationType == AllocationType::debugModuleArea) { allocationData.flags.use32BitFrontWindow = true; } else { allocationData.flags.use32BitFrontWindow = properties.flags.use32BitFrontWindow; @@ -602,7 +602,7 @@ GraphicsAllocation *MemoryManager::allocateInternalGraphicsMemoryWithHostCopy(ui size_t size) { NEO::AllocationProperties copyProperties{rootDeviceIndex, size, - NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::AllocationType::internalHostMemory, bitField}; copyProperties.alignment = MemoryConstants::pageSize; auto allocation = this->allocateGraphicsMemoryWithProperties(copyProperties); @@ -626,7 +626,7 @@ bool MemoryManager::mapAuxGpuVA(GraphicsAllocation *graphicsAllocation) { } GraphicsAllocation *MemoryManager::allocateGraphicsMemory(const AllocationData &allocationData) { - if (allocationData.type == AllocationType::IMAGE || allocationData.type == AllocationType::SHARED_RESOURCE_COPY) { + if (allocationData.type == AllocationType::image || allocationData.type == AllocationType::sharedResourceCopy) { UNRECOVERABLE_IF(allocationData.imgInfo == nullptr); return allocateGraphicsMemoryForImage(allocationData); } @@ -682,21 +682,21 @@ GraphicsAllocation *MemoryManager::allocateGraphicsMemoryForImage(const Allocati } bool MemoryManager::isExternalAllocation(AllocationType allocationType) { - if (allocationType == AllocationType::BUFFER || - allocationType == AllocationType::BUFFER_HOST_MEMORY || - allocationType == AllocationType::EXTERNAL_HOST_PTR || - allocationType == AllocationType::FILL_PATTERN || - allocationType == AllocationType::IMAGE || - allocationType == AllocationType::MAP_ALLOCATION || - allocationType == AllocationType::PIPE || - allocationType == AllocationType::SHARED_BUFFER || - allocationType == AllocationType::SHARED_IMAGE || - allocationType == AllocationType::SHARED_RESOURCE_COPY || - allocationType == AllocationType::SVM_CPU || - allocationType == AllocationType::SVM_GPU || - allocationType == AllocationType::SVM_ZERO_COPY || - allocationType == AllocationType::UNIFIED_SHARED_MEMORY || - allocationType == AllocationType::WRITE_COMBINED) { + if (allocationType == AllocationType::buffer || + allocationType == AllocationType::bufferHostMemory || + allocationType == AllocationType::externalHostPtr || + allocationType == AllocationType::fillPattern || + allocationType == AllocationType::image || + allocationType == AllocationType::mapAllocation || + allocationType == AllocationType::pipe || + allocationType == AllocationType::sharedBuffer || + allocationType == AllocationType::sharedImage || + allocationType == AllocationType::sharedResourceCopy || + allocationType == AllocationType::svmCpu || + allocationType == AllocationType::svmGpu || + allocationType == AllocationType::svmZeroCopy || + allocationType == AllocationType::unifiedSharedMemory || + allocationType == AllocationType::writeCombined) { return true; } return false; @@ -856,8 +856,8 @@ bool MemoryManager::isHostPointerTrackingEnabled(uint32_t rootDeviceIndex) { } bool MemoryManager::useNonSvmHostPtrAlloc(AllocationType allocationType, uint32_t rootDeviceIndex) { - bool isExternalHostPtrAlloc = (allocationType == AllocationType::EXTERNAL_HOST_PTR); - bool isMapAlloc = (allocationType == AllocationType::MAP_ALLOCATION); + bool isExternalHostPtrAlloc = (allocationType == AllocationType::externalHostPtr); + bool isMapAlloc = (allocationType == AllocationType::mapAllocation); if (forceNonSvmForExternalHostPtr && isExternalHostPtrAlloc) { return true; @@ -909,14 +909,14 @@ bool MemoryManager::isCopyRequired(ImageInfo &imgInfo, const void *hostPtr) { void MemoryManager::overrideAllocationData(AllocationData &allocationData, const AllocationProperties &properties) { if (debugManager.flags.ForceSystemMemoryPlacement.get()) { - UNRECOVERABLE_IF(properties.allocationType == AllocationType::UNKNOWN); + UNRECOVERABLE_IF(properties.allocationType == AllocationType::unknown); if ((1llu << (static_cast(properties.allocationType) - 1)) & debugManager.flags.ForceSystemMemoryPlacement.get()) { allocationData.flags.useSystemMemory = true; } } if (debugManager.flags.ForceNonSystemMemoryPlacement.get()) { - UNRECOVERABLE_IF(properties.allocationType == AllocationType::UNKNOWN); + UNRECOVERABLE_IF(properties.allocationType == AllocationType::unknown); if ((1llu << (static_cast(properties.allocationType) - 1)) & debugManager.flags.ForceNonSystemMemoryPlacement.get()) { allocationData.flags.useSystemMemory = false; } @@ -924,7 +924,7 @@ void MemoryManager::overrideAllocationData(AllocationData &allocationData, const int32_t directRingPlacement = debugManager.flags.DirectSubmissionBufferPlacement.get(); int32_t directRingAddressing = debugManager.flags.DirectSubmissionBufferAddressing.get(); - if (properties.allocationType == AllocationType::RING_BUFFER) { + if (properties.allocationType == AllocationType::ringBuffer) { if (directRingPlacement != -1) { if (directRingPlacement == 0) { allocationData.flags.requiresCpuAccess = true; @@ -945,7 +945,7 @@ void MemoryManager::overrideAllocationData(AllocationData &allocationData, const } int32_t directSemaphorePlacement = debugManager.flags.DirectSubmissionSemaphorePlacement.get(); int32_t directSemaphoreAddressing = debugManager.flags.DirectSubmissionSemaphoreAddressing.get(); - if (properties.allocationType == AllocationType::SEMAPHORE_BUFFER) { + if (properties.allocationType == AllocationType::semaphoreBuffer) { if (directSemaphorePlacement != -1) { if (directSemaphorePlacement == 0) { allocationData.flags.requiresCpuAccess = true; @@ -967,10 +967,10 @@ void MemoryManager::overrideAllocationData(AllocationData &allocationData, const bool MemoryManager::isAllocationTypeToCapture(AllocationType type) const { switch (type) { - case AllocationType::SCRATCH_SURFACE: - case AllocationType::PRIVATE_SURFACE: - case AllocationType::LINEAR_STREAM: - case AllocationType::INTERNAL_HEAP: + case AllocationType::scratchSurface: + case AllocationType::privateSurface: + case AllocationType::linearStream: + case AllocationType::internalHeap: return true; default: break; @@ -980,7 +980,7 @@ bool MemoryManager::isAllocationTypeToCapture(AllocationType type) const { bool MemoryManager::isLocalMemoryUsedForIsa(uint32_t rootDeviceIndex) { std::call_once(checkIsaPlacementOnceFlags[rootDeviceIndex], [&] { - AllocationProperties properties = {rootDeviceIndex, 0x1000, AllocationType::KERNEL_ISA, 1}; + AllocationProperties properties = {rootDeviceIndex, 0x1000, AllocationType::kernelIsa, 1}; AllocationData data; getAllocationData(data, properties, nullptr, StorageInfo()); isaInLocalMemory[rootDeviceIndex] = !data.flags.useSystemMemory; @@ -1019,7 +1019,7 @@ bool MemoryManager::allocateBindlessSlot(GraphicsAllocation *allocation) { if (bindlessHelper && allocation->getBindlessOffset() == std::numeric_limits::max()) { auto &gfxCoreHelper = peekExecutionEnvironment().rootDeviceEnvironments[allocation->getRootDeviceIndex()]->getHelper(); - const auto isImage = allocation->getAllocationType() == AllocationType::IMAGE || allocation->getAllocationType() == AllocationType::SHARED_IMAGE; + const auto isImage = allocation->getAllocationType() == AllocationType::image || allocation->getAllocationType() == AllocationType::sharedImage; auto surfStateCount = isImage ? 2 : 1; auto surfaceStateSize = surfStateCount * gfxCoreHelper.getRenderSurfaceStateSize(); diff --git a/shared/source/memory_manager/memory_manager.h b/shared/source/memory_manager/memory_manager.h index 860719d05d..fc64f49bb3 100644 --- a/shared/source/memory_manager/memory_manager.h +++ b/shared/source/memory_manager/memory_manager.h @@ -256,7 +256,7 @@ class MemoryManager { bool isLocalMemoryUsedForIsa(uint32_t rootDeviceIndex); MOCKABLE_VIRTUAL bool isNonSvmBuffer(const void *hostPtr, AllocationType allocationType, uint32_t rootDeviceIndex) { - return !force32bitAllocations && hostPtr && !isHostPointerTrackingEnabled(rootDeviceIndex) && (allocationType == AllocationType::BUFFER_HOST_MEMORY); + return !force32bitAllocations && hostPtr && !isHostPointerTrackingEnabled(rootDeviceIndex) && (allocationType == AllocationType::bufferHostMemory); } virtual void releaseDeviceSpecificMemResources(uint32_t rootDeviceIndex){}; diff --git a/shared/source/memory_manager/os_agnostic_memory_manager.cpp b/shared/source/memory_manager/os_agnostic_memory_manager.cpp index 53f757b023..cd1944f23d 100644 --- a/shared/source/memory_manager/os_agnostic_memory_manager.cpp +++ b/shared/source/memory_manager/os_agnostic_memory_manager.cpp @@ -74,7 +74,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryWithAlignment } auto alignment = allocationData.alignment; - if (allocationData.type == AllocationType::SVM_CPU) { + if (allocationData.type == AllocationType::svmCpu) { alignment = MemoryConstants::pageSize2M; sizeAligned = alignUp(allocationData.size, MemoryConstants::pageSize2M); } @@ -88,7 +88,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryWithAlignment memoryAllocation = createMemoryAllocation(allocationData.type, ptr, ptr, reinterpret_cast(ptr), allocationData.size, counter, MemoryPool::System4KBPages, allocationData.rootDeviceIndex, allocationData.flags.uncacheable, allocationData.flags.flushL3, false); - if (allocationData.type == AllocationType::SVM_CPU) { + if (allocationData.type == AllocationType::svmCpu) { // add padding in case mapPtr is not aligned size_t reserveSize = sizeAligned + alignment; void *gpuPtr = reserveCpuAddressRange(reserveSize, allocationData.rootDeviceIndex); @@ -335,7 +335,7 @@ void OsAgnosticMemoryManager::freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllo } auto aubCenter = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->aubCenter.get(); - if (aubCenter && aubCenter->getAubManager() && debugManager.flags.EnableFreeMemory.get() && gfxAllocation->getAllocationType() != AllocationType::EXTERNAL_HOST_PTR) { + if (aubCenter && aubCenter->getAubManager() && debugManager.flags.EnableFreeMemory.get() && gfxAllocation->getAllocationType() != AllocationType::externalHostPtr) { aubCenter->getAubManager()->freeMemory( peekExecutionEnvironment().rootDeviceEnvironments[gfxAllocation->getRootDeviceIndex()].get()->gmmHelper.get()->decanonize(gfxAllocation->getGpuAddress()), gfxAllocation->getUnderlyingBufferSize()); } @@ -603,7 +603,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryInDevicePool( return nullptr; } bool use32Allocator = heapAssigners[allocationData.rootDeviceIndex]->use32BitHeap(allocationData.type); - if (allocationData.type == AllocationType::SVM_GPU) { + if (allocationData.type == AllocationType::svmGpu) { auto storage = allocateSystemMemory(allocationData.size, MemoryConstants::pageSize2M); auto canonizedGpuAddress = gmmHelper->canonize(reinterpret_cast(allocationData.hostPtr)); allocation = new MemoryAllocation(allocationData.rootDeviceIndex, numHandles, allocationData.type, storage, storage, canonizedGpuAddress, @@ -612,8 +612,8 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryInDevicePool( } else { std::unique_ptr gmm; size_t sizeAligned64k = 0; - if (allocationData.type == AllocationType::IMAGE || - allocationData.type == AllocationType::SHARED_RESOURCE_COPY) { + if (allocationData.type == AllocationType::image || + allocationData.type == AllocationType::sharedResourceCopy) { allocationData.imgInfo->useLocalMemory = true; gmm = std::make_unique(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), *allocationData.imgInfo, allocationData.storageInfo, allocationData.flags.preferCompressed); @@ -648,7 +648,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryInDevicePool( } auto systemMemory = allocateSystemMemory(sizeAligned64k, MemoryConstants::pageSize64k); - if (allocationData.type == AllocationType::PREEMPTION) { + if (allocationData.type == AllocationType::preemption) { memset(systemMemory, 0, sizeAligned64k); } auto sizeOfHeapChunk = sizeAligned64k; diff --git a/shared/source/memory_manager/unified_memory_manager.cpp b/shared/source/memory_manager/unified_memory_manager.cpp index 4304313d22..7ce57ea93b 100644 --- a/shared/source/memory_manager/unified_memory_manager.cpp +++ b/shared/source/memory_manager/unified_memory_manager.cpp @@ -429,7 +429,7 @@ void *SVMAllocsManager::createUnifiedKmdMigratedAllocation(size_t size, const Sv AllocationProperties gpuProperties{rootDeviceIndex, true, alignedSize, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, false, false, deviceBitfield}; @@ -551,7 +551,7 @@ void SVMAllocsManager::freeSVMAllocImpl(void *ptr, FreePolicyType policy, SvmAll if (svmData->cpuAllocation && pageFaultManager) { pageFaultManager->removeAllocation(svmData->cpuAllocation->getUnderlyingBuffer()); } - if (svmData->gpuAllocations.getAllocationType() == AllocationType::SVM_ZERO_COPY) { + if (svmData->gpuAllocations.getAllocationType() == AllocationType::svmZeroCopy) { freeZeroCopySvmAllocation(svmData); } else { freeSvmAllocationWithDeviceStorage(svmData); @@ -586,7 +586,7 @@ void *SVMAllocsManager::createZeroCopySvmAllocation(size_t size, const SvmAlloca AllocationProperties properties{rootDeviceIndex, true, // allocateMemory size, - AllocationType::SVM_ZERO_COPY, + AllocationType::svmZeroCopy, false, // isMultiStorageAllocation deviceBitfield}; MemoryPropertiesHelper::fillCachePolicyInProperties(properties, false, svmProperties.readOnly, false, properties.cacheRegion); @@ -622,7 +622,7 @@ void *SVMAllocsManager::createUnifiedAllocationWithDeviceStorage(size_t size, co auto cpuAlignment = std::max(pageSizeForAlignment, memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[rootDeviceIndex]->getProductHelper().getSvmCpuAlignment()); AllocationProperties cpuProperties{rootDeviceIndex, !useExternalHostPtrForCpu, // allocateMemory - alignUp(alignedSize, cpuAlignment), AllocationType::SVM_CPU, + alignUp(alignedSize, cpuAlignment), AllocationType::svmCpu, false, // isMultiStorageAllocation subDevices}; cpuProperties.alignment = cpuAlignment; @@ -653,7 +653,7 @@ void *SVMAllocsManager::createUnifiedAllocationWithDeviceStorage(size_t size, co AllocationProperties gpuProperties{rootDeviceIndex, false, alignedSize, - AllocationType::SVM_GPU, + AllocationType::svmGpu, false, multiStorageAllocation, subDevices}; @@ -796,19 +796,19 @@ void SVMAllocsManager::removeSvmMapOperation(const void *regionSvmPtr) { AllocationType SVMAllocsManager::getGraphicsAllocationTypeAndCompressionPreference(const UnifiedMemoryProperties &unifiedMemoryProperties, bool &compressionEnabled) const { compressionEnabled = false; - AllocationType allocationType = AllocationType::BUFFER_HOST_MEMORY; + AllocationType allocationType = AllocationType::bufferHostMemory; if (unifiedMemoryProperties.memoryType == InternalMemoryType::DEVICE_UNIFIED_MEMORY) { if (unifiedMemoryProperties.allocationFlags.allocFlags.allocWriteCombined) { - allocationType = AllocationType::WRITE_COMBINED; + allocationType = AllocationType::writeCombined; } else { UNRECOVERABLE_IF(nullptr == unifiedMemoryProperties.device); if (CompressionSelector::allowStatelessCompression()) { compressionEnabled = true; } - if (unifiedMemoryProperties.requestedAllocationType != AllocationType::UNKNOWN) { + if (unifiedMemoryProperties.requestedAllocationType != AllocationType::unknown) { allocationType = unifiedMemoryProperties.requestedAllocationType; } else { - allocationType = AllocationType::BUFFER; + allocationType = AllocationType::buffer; } } } diff --git a/shared/source/memory_manager/unified_memory_manager.h b/shared/source/memory_manager/unified_memory_manager.h index ae45b6913e..7cf83bcd09 100644 --- a/shared/source/memory_manager/unified_memory_manager.h +++ b/shared/source/memory_manager/unified_memory_manager.h @@ -147,7 +147,7 @@ class SVMAllocsManager { size_t alignment; const RootDeviceIndicesContainer &rootDeviceIndices; const std::map &subdeviceBitfields; - AllocationType requestedAllocationType = AllocationType::UNKNOWN; + AllocationType requestedAllocationType = AllocationType::unknown; }; struct SvmCacheAllocationInfo { diff --git a/shared/source/os_interface/linux/drm_allocation.cpp b/shared/source/os_interface/linux/drm_allocation.cpp index c10302c38b..eed818744c 100644 --- a/shared/source/os_interface/linux/drm_allocation.cpp +++ b/shared/source/os_interface/linux/drm_allocation.cpp @@ -322,16 +322,16 @@ void DrmAllocation::registerBOBindExtHandle(Drm *drm) { DrmResourceClass resourceClass = DrmResourceClass::MaxSize; switch (this->allocationType) { - case AllocationType::DEBUG_CONTEXT_SAVE_AREA: + case AllocationType::debugContextSaveArea: resourceClass = DrmResourceClass::ContextSaveArea; break; - case AllocationType::DEBUG_SBA_TRACKING_BUFFER: + case AllocationType::debugSbaTrackingBuffer: resourceClass = DrmResourceClass::SbaTrackingBuffer; break; - case AllocationType::KERNEL_ISA: + case AllocationType::kernelIsa: resourceClass = DrmResourceClass::Isa; break; - case AllocationType::DEBUG_MODULE_AREA: + case AllocationType::debugModuleArea: resourceClass = DrmResourceClass::ModuleHeapDebugArea; break; default: @@ -421,9 +421,9 @@ bool DrmAllocation::shouldAllocationPageFault(const Drm *drm) { } switch (this->allocationType) { - case AllocationType::UNIFIED_SHARED_MEMORY: + case AllocationType::unifiedSharedMemory: return drm->hasKmdMigrationSupport(); - case AllocationType::BUFFER: + case AllocationType::buffer: return debugManager.flags.UseKmdMigrationForBuffers.get() > 0; default: return false; diff --git a/shared/source/os_interface/linux/drm_memory_manager.cpp b/shared/source/os_interface/linux/drm_memory_manager.cpp index bba01804f0..ecc5382009 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.cpp +++ b/shared/source/os_interface/linux/drm_memory_manager.cpp @@ -293,7 +293,7 @@ NEO::BufferObject *DrmMemoryManager::allocUserptr(uintptr_t address, size_t size PRINT_DEBUG_STRING(debugManager.flags.PrintBOCreateDestroyResult.get(), stdout, "Created new BO with GEM_USERPTR, handle: BO-%d\n", userptr.handle); - auto patIndex = drm.getPatIndex(nullptr, AllocationType::EXTERNAL_HOST_PTR, CacheRegion::defaultRegion, CachePolicy::writeBack, false, true); + auto patIndex = drm.getPatIndex(nullptr, AllocationType::externalHostPtr, CacheRegion::defaultRegion, CachePolicy::writeBack, false, true); auto res = new (std::nothrow) BufferObject(rootDeviceIndex, &drm, patIndex, userptr.handle, size, maxOsContextCount); if (!res) { @@ -344,7 +344,7 @@ DrmAllocation *DrmMemoryManager::allocateGraphicsMemoryWithAlignmentImpl(const A uint64_t alignedGpuAddress = 0; size_t alignedStorageSize = cSize; size_t alignedVirtualAddressRangeSize = cSize; - auto svmCpuAllocation = allocationData.type == AllocationType::SVM_CPU; + auto svmCpuAllocation = allocationData.type == AllocationType::svmCpu; if (svmCpuAllocation) { // add padding in case reserved addr is not aligned alignedStorageSize = alignUp(cSize, cAlignment); @@ -409,7 +409,7 @@ DrmAllocation *DrmMemoryManager::createAllocWithAlignmentFromUserptr(const Alloc } void DrmMemoryManager::obtainGpuAddress(const AllocationData &allocationData, BufferObject *bo, uint64_t gpuAddress) { - if ((isLimitedRange(allocationData.rootDeviceIndex) || allocationData.type == AllocationType::SVM_CPU) && + if ((isLimitedRange(allocationData.rootDeviceIndex) || allocationData.type == AllocationType::svmCpu) && !allocationData.flags.isUSMHostAllocation) { bo->setAddress(gpuAddress); } @@ -433,7 +433,7 @@ GraphicsAllocation *DrmMemoryManager::allocateUSMHostGraphicsMemory(const Alloca // if limitedRangeAlloction is enabled, memory allocation for bo in the limited Range heap is required uint64_t gpuAddress = 0; - auto svmCpuAllocation = allocationData.type == AllocationType::SVM_CPU; + auto svmCpuAllocation = allocationData.type == AllocationType::svmCpu; if (isLimitedRange(allocationData.rootDeviceIndex) || svmCpuAllocation) { gpuAddress = acquireGpuRange(cSize, allocationData.rootDeviceIndex, HeapIndex::HEAP_STANDARD); if (!gpuAddress) { @@ -469,7 +469,7 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryWithHostPtr(const Al GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryWithGpuVa(const AllocationData &allocationData) { - if (allocationData.type == NEO::AllocationType::DEBUG_SBA_TRACKING_BUFFER && + if (allocationData.type == NEO::AllocationType::debugSbaTrackingBuffer && allocationData.storageInfo.subDeviceBitfield.count() > 1) { return createMultiHostAllocation(allocationData); } @@ -1299,7 +1299,7 @@ void *DrmMemoryManager::lockResourceImpl(GraphicsAllocation &graphicsAllocation) auto bo = static_cast(graphicsAllocation).getBO(); - if (graphicsAllocation.getAllocationType() == AllocationType::WRITE_COMBINED) { + if (graphicsAllocation.getAllocationType() == AllocationType::writeCombined) { auto addr = lockBufferObject(bo); auto alignedAddr = alignUp(addr, MemoryConstants::pageSize64k); auto notUsedSize = ptrDiff(alignedAddr, addr); @@ -1633,18 +1633,18 @@ AllocationStatus getGpuAddress(const AlignmentSelector &alignmentSelector, HeapA auto allocType = allocationData.type; switch (allocType) { - case AllocationType::SVM_GPU: + case AllocationType::svmGpu: gpuAddress = reinterpret_cast(allocationData.hostPtr); sizeAllocated = 0; break; - case AllocationType::KERNEL_ISA: - case AllocationType::KERNEL_ISA_INTERNAL: - case AllocationType::INTERNAL_HEAP: - case AllocationType::DEBUG_MODULE_AREA: + case AllocationType::kernelIsa: + case AllocationType::kernelIsaInternal: + case AllocationType::internalHeap: + case AllocationType::debugModuleArea: gpuAddress = getCanonizedHeapAllocationAddress(heapAssigner.get32BitHeapIndex(allocType, true, hwInfo, allocationData.flags.use32BitFrontWindow), gmmHelper, gfxPartition, sizeAllocated, false); break; - case AllocationType::WRITE_COMBINED: + case AllocationType::writeCombined: sizeAllocated = 0; break; default: @@ -1674,7 +1674,7 @@ AllocationStatus getGpuAddress(const AlignmentSelector &alignmentSelector, HeapA break; } - if (allocType != NEO::AllocationType::WRITE_COMBINED && gpuAddress == 0llu) { + if (allocType != NEO::AllocationType::writeCombined && gpuAddress == 0llu) { return AllocationStatus::Error; } else { return AllocationStatus::Success; @@ -1771,11 +1771,11 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryInDevicePool(const A if (!this->localMemorySupported[allocationData.rootDeviceIndex] || allocationData.flags.useSystemMemory || (allocationData.flags.allow32Bit && this->force32bitAllocations) || - allocationData.type == AllocationType::SHARED_RESOURCE_COPY) { + allocationData.type == AllocationType::sharedResourceCopy) { return nullptr; } - if (allocationData.type == AllocationType::UNIFIED_SHARED_MEMORY) { + if (allocationData.type == AllocationType::unifiedSharedMemory) { auto allocation = this->createSharedUnifiedMemoryAllocation(allocationData); status = allocation ? AllocationStatus::Success : AllocationStatus::Error; return allocation; @@ -1787,13 +1787,13 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryInDevicePool(const A size_t sizeAligned = 0; auto gmmHelper = getGmmHelper(allocationData.rootDeviceIndex); - if (allocationData.type == AllocationType::IMAGE) { + if (allocationData.type == AllocationType::image) { allocationData.imgInfo->useLocalMemory = true; gmm = std::make_unique(gmmHelper, *allocationData.imgInfo, allocationData.storageInfo, allocationData.flags.preferCompressed); sizeAligned = alignUp(allocationData.imgInfo->size, MemoryConstants::pageSize64k); } else { - if (allocationData.type == AllocationType::WRITE_COMBINED) { + if (allocationData.type == AllocationType::writeCombined) { sizeAligned = alignUp(allocationData.size + MemoryConstants::pageSize64k, 2 * MemoryConstants::megaByte) + 2 * MemoryConstants::megaByte; } else { sizeAligned = alignUp(allocationData.size, MemoryConstants::pageSize64k); @@ -1823,7 +1823,7 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryInDevicePool(const A status = AllocationStatus::Error; return nullptr; } - if (allocationData.type == AllocationType::WRITE_COMBINED) { + if (allocationData.type == AllocationType::writeCombined) { auto cpuAddress = lockResource(allocation.get()); if (!cpuAddress) { cleanupBeforeReturn(allocationData, gfxPartition, drmAllocation, graphicsAllocation, gpuAddress, sizeAllocated); @@ -1969,7 +1969,7 @@ bool DrmMemoryManager::createDrmAllocation(Drm *drm, DrmAllocation *allocation, auto currentBank = 0u; auto iterationOffset = 0u; auto banksCnt = storageInfo.getTotalBanksCnt(); - auto useKmdMigrationForBuffers = (AllocationType::BUFFER == allocation->getAllocationType() && (debugManager.flags.UseKmdMigrationForBuffers.get() > 0)); + auto useKmdMigrationForBuffers = (AllocationType::buffer == allocation->getAllocationType() && (debugManager.flags.UseKmdMigrationForBuffers.get() > 0)); auto handles = storageInfo.getNumBanks(); bool useChunking = false; @@ -1978,7 +1978,7 @@ bool DrmMemoryManager::createDrmAllocation(Drm *drm, DrmAllocation *allocation, if (checkAllocationForChunking(allocation->getUnderlyingBufferSize(), drm->getMinimalSizeForChunking(), (allocation->storageInfo.subDeviceBitfield.count() > 1), (!executionEnvironment.isDebuggingEnabled()), (drm->getChunkingMode() & chunkingModeDevice), - (AllocationType::BUFFER == allocation->getAllocationType()))) { + (AllocationType::buffer == allocation->getAllocationType()))) { handles = 1; allocation->resizeBufferObjects(handles); bos.resize(handles); @@ -2027,7 +2027,7 @@ bool DrmMemoryManager::createDrmAllocation(Drm *drm, DrmAllocation *allocation, // only support pairing of handles with PRELIM_I915_PARAM_SET_PAIR for implicit scaling scenarios, which // have 2 handles - if (AllocationType::BUFFER == allocation->getAllocationType() && handles == 2 && drm->getSetPairAvailable()) { + if (AllocationType::buffer == allocation->getAllocationType() && handles == 2 && drm->getSetPairAvailable()) { pairHandle = bos[handleId]->peekHandle(); } } @@ -2090,11 +2090,11 @@ bool DrmMemoryManager::allocationTypeForCompletionFence(AllocationType allocatio if (allowAllAllocations) { return true; } - if (allocationType == AllocationType::COMMAND_BUFFER || - allocationType == AllocationType::DEFERRED_TASKS_LIST || - allocationType == AllocationType::RING_BUFFER || - allocationType == AllocationType::SEMAPHORE_BUFFER || - allocationType == AllocationType::TAG_BUFFER) { + if (allocationType == AllocationType::commandBuffer || + allocationType == AllocationType::deferredTasksList || + allocationType == AllocationType::ringBuffer || + allocationType == AllocationType::semaphoreBuffer || + allocationType == AllocationType::tagBuffer) { return true; } return false; @@ -2483,7 +2483,7 @@ DrmAllocation *DrmMemoryManager::createUSMHostAllocationFromSharedHandle(osHandl patIndex = drm.getPatIndex(nullptr, properties.allocationType, CacheRegion::defaultRegion, CachePolicy::writeBack, false, MemoryPoolHelper::isSystemMemoryPool(memoryPool)); bo = new BufferObject(properties.rootDeviceIndex, &drm, patIndex, boHandle, size, maxOsContextCount); - if (properties.allocationType == AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER) { + if (properties.allocationType == AllocationType::gpuTimestampDeviceBuffer) { cpuPointer = this->mmapFunction(0, size + MemoryConstants::pageSize64k, PROT_NONE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); auto alignedAddr = alignUp(cpuPointer, MemoryConstants::pageSize64k); auto notUsedSize = ptrDiff(alignedAddr, cpuPointer); diff --git a/shared/source/os_interface/windows/wddm_device_command_stream.inl b/shared/source/os_interface/windows/wddm_device_command_stream.inl index c36ed42bba..76beeed553 100644 --- a/shared/source/os_interface/windows/wddm_device_command_stream.inl +++ b/shared/source/os_interface/windows/wddm_device_command_stream.inl @@ -180,9 +180,9 @@ void WddmCommandStreamReceiver::flushMonitorFence() { template void WddmCommandStreamReceiver::kmDafLockAllocations(ResidencyContainer &allocationsForResidency) { for (auto &graphicsAllocation : allocationsForResidency) { - if ((AllocationType::LINEAR_STREAM == graphicsAllocation->getAllocationType()) || - (AllocationType::FILL_PATTERN == graphicsAllocation->getAllocationType()) || - (AllocationType::COMMAND_BUFFER == graphicsAllocation->getAllocationType())) { + if ((AllocationType::linearStream == graphicsAllocation->getAllocationType()) || + (AllocationType::fillPattern == graphicsAllocation->getAllocationType()) || + (AllocationType::commandBuffer == graphicsAllocation->getAllocationType())) { wddm->kmDafLock(static_cast(graphicsAllocation)->getDefaultHandle()); } } diff --git a/shared/source/os_interface/windows/wddm_memory_manager.cpp b/shared/source/os_interface/windows/wddm_memory_manager.cpp index 0d8eacbc39..cec3bfcbd5 100644 --- a/shared/source/os_interface/windows/wddm_memory_manager.cpp +++ b/shared/source/os_interface/windows/wddm_memory_manager.cpp @@ -192,7 +192,7 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryUsingKmdAndMapItToC size_t sizeAligned = alignUp(allocationData.size, allowLargePages ? MemoryConstants::pageSize64k : MemoryConstants::pageSize); if (sizeAligned > getHugeGfxMemoryChunkSize(GfxMemoryAllocationMethod::AllocateByKmd)) { - const bool isBufferHostMemory = allocationData.type == NEO::AllocationType::BUFFER_HOST_MEMORY; + const bool isBufferHostMemory = allocationData.type == NEO::AllocationType::bufferHostMemory; return allocateHugeGraphicsMemory(allocationData, isBufferHostMemory); } @@ -322,7 +322,7 @@ GraphicsAllocation *WddmMemoryManager::allocateHugeGraphicsMemory(const Allocati auto wddmAllocGpuPtr = sharedVirtualAddress ? hostPtr : nullptr; void *mapPtr = wddmAllocation->getAlignedCpuPtr(); - if (allocationData.type == AllocationType::SVM_CPU) { + if (allocationData.type == AllocationType::svmCpu) { // add padding in case mapPtr is not aligned size_t reserveSizeAligned = alignedSize + allocationData.alignment; bool ret = getWddm(wddmAllocation->getRootDeviceIndex()).reserveValidAddressRange(reserveSizeAligned, mapPtr); @@ -400,7 +400,7 @@ GraphicsAllocation *WddmMemoryManager::allocateSystemMemoryAndCreateGraphicsAllo wddmAllocation->setDefaultGmm(gmm); void *mapPtr = wddmAllocation->getAlignedCpuPtr(); - if (allocationData.type == AllocationType::SVM_CPU) { + if (allocationData.type == AllocationType::svmCpu) { // add padding in case mapPtr is not aligned size_t reserveSizeAligned = sizeAligned + allocationData.alignment; bool ret = getWddm(wddmAllocation->getRootDeviceIndex()).reserveValidAddressRange(reserveSizeAligned, mapPtr); @@ -840,7 +840,7 @@ MemoryManager::AllocationStatus WddmMemoryManager::populateOsHandles(OsHandleSto osHandle->gmm = new Gmm(executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getGmmHelper(), handleStorage.fragmentStorageData[i].cpuPtr, handleStorage.fragmentStorageData[i].fragmentSize, 0u, - CacheSettingsHelper::getGmmUsageType(AllocationType::EXTERNAL_HOST_PTR, false, productHelper), {}, gmmRequirements); + CacheSettingsHelper::getGmmUsageType(AllocationType::externalHostPtr, false, productHelper), {}, gmmRequirements); allocatedFragmentIndexes[allocatedFragmentsCounter] = i; allocatedFragmentsCounter++; } @@ -1282,9 +1282,9 @@ void splitGmmsInAllocation(GmmHelper *gmmHelper, WddmAllocation *wddmAllocation, uint32_t getPriorityForAllocation(AllocationType allocationType) { if (GraphicsAllocation::isIsaAllocationType(allocationType) || - allocationType == AllocationType::COMMAND_BUFFER || - allocationType == AllocationType::INTERNAL_HEAP || - allocationType == AllocationType::LINEAR_STREAM) { + allocationType == AllocationType::commandBuffer || + allocationType == AllocationType::internalHeap || + allocationType == AllocationType::linearStream) { return DXGI_RESOURCE_PRIORITY_HIGH; } return DXGI_RESOURCE_PRIORITY_NORMAL; @@ -1377,8 +1377,8 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryInDevicePool(const size_t alignment = 0; auto numBanks = allocationData.storageInfo.getNumBanks(); bool singleBankAllocation = numBanks == 1; - if (allocationData.type == AllocationType::IMAGE || - allocationData.type == AllocationType::SHARED_RESOURCE_COPY) { + if (allocationData.type == AllocationType::image || + allocationData.type == AllocationType::sharedResourceCopy) { allocationData.imgInfo->useLocalMemory = true; gmm = std::make_unique(gmmHelper, *allocationData.imgInfo, allocationData.storageInfo, allocationData.flags.preferCompressed); alignment = MemoryConstants::pageSize64k; @@ -1428,7 +1428,7 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryInDevicePool(const } void *requiredGpuVa = nullptr; - if (allocationData.type == AllocationType::SVM_GPU) { + if (allocationData.type == AllocationType::svmGpu) { requiredGpuVa = const_cast(allocationData.hostPtr); } @@ -1474,7 +1474,7 @@ bool WddmMemoryManager::mapGpuVirtualAddress(WddmAllocation *allocation, const v } else if (allocation->storageInfo.multiStorage) { return mapMultiHandleAllocationWithRetry(allocation, requiredPtr); } - } else if (allocation->getAllocationType() == AllocationType::WRITE_COMBINED) { + } else if (allocation->getAllocationType() == AllocationType::writeCombined) { requiredPtr = lockResource(allocation); allocation->setCpuAddress(const_cast(requiredPtr)); } @@ -1500,14 +1500,14 @@ void WddmMemoryManager::registerAllocationInOs(GraphicsAllocation *allocation) { } bool WddmMemoryManager::isStatelessAccessRequired(AllocationType type) { - if (type == AllocationType::BUFFER || - type == AllocationType::SHARED_BUFFER || - type == AllocationType::SCRATCH_SURFACE || - type == AllocationType::LINEAR_STREAM || - type == AllocationType::PRIVATE_SURFACE || - type == AllocationType::CONSTANT_SURFACE || - type == AllocationType::GLOBAL_SURFACE || - type == AllocationType::PRINTF_SURFACE) { + if (type == AllocationType::buffer || + type == AllocationType::sharedBuffer || + type == AllocationType::scratchSurface || + type == AllocationType::linearStream || + type == AllocationType::privateSurface || + type == AllocationType::constantSurface || + type == AllocationType::globalSurface || + type == AllocationType::printfSurface) { return true; } return false; diff --git a/shared/source/program/kernel_info.cpp b/shared/source/program/kernel_info.cpp index 278271ab0d..d852bba528 100644 --- a/shared/source/program/kernel_info.cpp +++ b/shared/source/program/kernel_info.cpp @@ -57,7 +57,7 @@ int32_t KernelInfo::getArgNumByName(const char *name) const { bool KernelInfo::createKernelAllocation(const Device &device, bool internalIsa) { UNRECOVERABLE_IF(kernelAllocation); auto kernelIsaSize = heapInfo.kernelHeapSize; - const auto allocType = internalIsa ? AllocationType::KERNEL_ISA_INTERNAL : AllocationType::KERNEL_ISA; + const auto allocType = internalIsa ? AllocationType::kernelIsaInternal : AllocationType::kernelIsa; if (device.getMemoryManager()->isKernelBinaryReuseEnabled()) { auto lock = device.getMemoryManager()->lockKernelAllocationMap(); diff --git a/shared/source/program/program_initialization.cpp b/shared/source/program/program_initialization.cpp index 5380224fe5..09eecd267c 100644 --- a/shared/source/program/program_initialization.cpp +++ b/shared/source/program/program_initialization.cpp @@ -29,7 +29,7 @@ GraphicsAllocation *allocateGlobalsSurface(NEO::SVMAllocsManager *const svmAlloc if (linkerInput != nullptr) { globalsAreExported = constant ? linkerInput->getTraits().exportsGlobalConstants : linkerInput->getTraits().exportsGlobalVariables; } - const auto allocationType = constant ? AllocationType::CONSTANT_SURFACE : AllocationType::GLOBAL_SURFACE; + const auto allocationType = constant ? AllocationType::constantSurface : AllocationType::globalSurface; if (globalsAreExported && (svmAllocManager != nullptr)) { RootDeviceIndicesContainer rootDeviceIndices; rootDeviceIndices.pushUnique(rootDeviceIndex); diff --git a/shared/source/program/sync_buffer_handler.cpp b/shared/source/program/sync_buffer_handler.cpp index 9aa936bc1f..f299e98b84 100644 --- a/shared/source/program/sync_buffer_handler.cpp +++ b/shared/source/program/sync_buffer_handler.cpp @@ -32,7 +32,7 @@ void SyncBufferHandler::makeResident(CommandStreamReceiver &csr) { void SyncBufferHandler::allocateNewBuffer() { AllocationProperties allocationProperties{device.getRootDeviceIndex(), true, bufferSize, - AllocationType::LINEAR_STREAM, + AllocationType::linearStream, (device.getNumGenericSubDevices() > 1u), /* multiOsContextCapable */ false, device.getDeviceBitfield()}; graphicsAllocation = memoryManager.allocateGraphicsMemoryWithProperties(allocationProperties); diff --git a/shared/source/release_helper/release_helper_common_xe_lpg.inl b/shared/source/release_helper/release_helper_common_xe_lpg.inl index 5f6ddcfd0e..f19493246f 100644 --- a/shared/source/release_helper/release_helper_common_xe_lpg.inl +++ b/shared/source/release_helper/release_helper_common_xe_lpg.inl @@ -18,8 +18,8 @@ bool ReleaseHelperHw::isMatrixMultiplyAccumulateSupported() const { template <> std::optional ReleaseHelperHw::getPreferredAllocationMethod(AllocationType allocationType) const { switch (allocationType) { - case AllocationType::TAG_BUFFER: - case AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: + case AllocationType::tagBuffer: + case AllocationType::timestampPacketTagBuffer: return {}; default: return GfxMemoryAllocationMethod::AllocateByKmd; diff --git a/shared/source/utilities/hw_timestamps.h b/shared/source/utilities/hw_timestamps.h index 2ddb63ea65..3e0f2f68a9 100644 --- a/shared/source/utilities/hw_timestamps.h +++ b/shared/source/utilities/hw_timestamps.h @@ -24,7 +24,7 @@ class HwTimeStamps : public TagTypeBase { } static constexpr AllocationType getAllocationType() { - return AllocationType::PROFILING_TAG_BUFFER; + return AllocationType::profilingTagBuffer; } static constexpr TagNodeType getTagNodeType() { return TagNodeType::hwTimeStamps; } diff --git a/shared/source/utilities/logger.cpp b/shared/source/utilities/logger.cpp index 3a06ec7e66..71e44cdf9d 100644 --- a/shared/source/utilities/logger.cpp +++ b/shared/source/utilities/logger.cpp @@ -151,99 +151,99 @@ const char *getAllocationTypeString(GraphicsAllocation const *graphicsAllocation auto type = graphicsAllocation->getAllocationType(); switch (type) { - case AllocationType::BUFFER: + case AllocationType::buffer: return "BUFFER"; - case AllocationType::BUFFER_HOST_MEMORY: + case AllocationType::bufferHostMemory: return "BUFFER_HOST_MEMORY"; - case AllocationType::COMMAND_BUFFER: + case AllocationType::commandBuffer: return "COMMAND_BUFFER"; - case AllocationType::CONSTANT_SURFACE: + case AllocationType::constantSurface: return "CONSTANT_SURFACE"; - case AllocationType::EXTERNAL_HOST_PTR: + case AllocationType::externalHostPtr: return "EXTERNAL_HOST_PTR"; - case AllocationType::FILL_PATTERN: + case AllocationType::fillPattern: return "FILL_PATTERN"; - case AllocationType::GLOBAL_SURFACE: + case AllocationType::globalSurface: return "GLOBAL_SURFACE"; - case AllocationType::IMAGE: + case AllocationType::image: return "IMAGE"; - case AllocationType::INDIRECT_OBJECT_HEAP: + case AllocationType::indirectObjectHeap: return "INDIRECT_OBJECT_HEAP"; - case AllocationType::INSTRUCTION_HEAP: + case AllocationType::instructionHeap: return "INSTRUCTION_HEAP"; - case AllocationType::INTERNAL_HEAP: + case AllocationType::internalHeap: return "INTERNAL_HEAP"; - case AllocationType::INTERNAL_HOST_MEMORY: + case AllocationType::internalHostMemory: return "INTERNAL_HOST_MEMORY"; - case AllocationType::KERNEL_ARGS_BUFFER: + case AllocationType::kernelArgsBuffer: return "KERNEL_ARGS_BUFFER"; - case AllocationType::KERNEL_ISA: + case AllocationType::kernelIsa: return "KERNEL_ISA"; - case AllocationType::KERNEL_ISA_INTERNAL: + case AllocationType::kernelIsaInternal: return "KERNEL_ISA_INTERNAL"; - case AllocationType::LINEAR_STREAM: + case AllocationType::linearStream: return "LINEAR_STREAM"; - case AllocationType::MAP_ALLOCATION: + case AllocationType::mapAllocation: return "MAP_ALLOCATION"; - case AllocationType::MCS: + case AllocationType::mcs: return "MCS"; - case AllocationType::PIPE: + case AllocationType::pipe: return "PIPE"; - case AllocationType::PREEMPTION: + case AllocationType::preemption: return "PREEMPTION"; - case AllocationType::PRINTF_SURFACE: + case AllocationType::printfSurface: return "PRINTF_SURFACE"; - case AllocationType::PRIVATE_SURFACE: + case AllocationType::privateSurface: return "PRIVATE_SURFACE"; - case AllocationType::PROFILING_TAG_BUFFER: + case AllocationType::profilingTagBuffer: return "PROFILING_TAG_BUFFER"; - case AllocationType::SCRATCH_SURFACE: + case AllocationType::scratchSurface: return "SCRATCH_SURFACE"; - case AllocationType::SHARED_BUFFER: + case AllocationType::sharedBuffer: return "SHARED_BUFFER"; - case AllocationType::SHARED_IMAGE: + case AllocationType::sharedImage: return "SHARED_IMAGE"; - case AllocationType::SHARED_RESOURCE_COPY: + case AllocationType::sharedResourceCopy: return "SHARED_RESOURCE_COPY"; - case AllocationType::SURFACE_STATE_HEAP: + case AllocationType::surfaceStateHeap: return "SURFACE_STATE_HEAP"; - case AllocationType::SVM_CPU: + case AllocationType::svmCpu: return "SVM_CPU"; - case AllocationType::SVM_GPU: + case AllocationType::svmGpu: return "SVM_GPU"; - case AllocationType::SVM_ZERO_COPY: + case AllocationType::svmZeroCopy: return "SVM_ZERO_COPY"; - case AllocationType::TAG_BUFFER: + case AllocationType::tagBuffer: return "TAG_BUFFER"; - case AllocationType::GLOBAL_FENCE: + case AllocationType::globalFence: return "GLOBAL_FENCE"; - case AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: + case AllocationType::timestampPacketTagBuffer: return "TIMESTAMP_PACKET_TAG_BUFFER"; - case AllocationType::UNKNOWN: + case AllocationType::unknown: return "UNKNOWN"; - case AllocationType::WRITE_COMBINED: + case AllocationType::writeCombined: return "WRITE_COMBINED"; - case AllocationType::DEBUG_CONTEXT_SAVE_AREA: + case AllocationType::debugContextSaveArea: return "DEBUG_CONTEXT_SAVE_AREA"; - case AllocationType::DEBUG_SBA_TRACKING_BUFFER: + case AllocationType::debugSbaTrackingBuffer: return "DEBUG_SBA_TRACKING_BUFFER"; - case AllocationType::DEBUG_MODULE_AREA: + case AllocationType::debugModuleArea: return "DEBUG_MODULE_AREA"; - case AllocationType::WORK_PARTITION_SURFACE: + case AllocationType::workPartitionSurface: return "WORK_PARTITION_SURFACE"; - case AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: + case AllocationType::gpuTimestampDeviceBuffer: return "GPU_TIMESTAMP_DEVICE_BUFFER"; - case AllocationType::RING_BUFFER: + case AllocationType::ringBuffer: return "RING_BUFFER"; - case AllocationType::SEMAPHORE_BUFFER: + case AllocationType::semaphoreBuffer: return "SEMAPHORE_BUFFER"; - case AllocationType::UNIFIED_SHARED_MEMORY: + case AllocationType::unifiedSharedMemory: return "UNIFIED_SHARED_MEMORY"; - case AllocationType::SW_TAG_BUFFER: + case AllocationType::swTagBuffer: return "SW_TAG_BUFFER"; - case AllocationType::DEFERRED_TASKS_LIST: + case AllocationType::deferredTasksList: return "DEFERRED_TASKS_LIST"; - case AllocationType::ASSERT_BUFFER: + case AllocationType::assertBuffer: return "ASSERT_BUFFER"; default: return "ILLEGAL_VALUE"; diff --git a/shared/source/utilities/perf_counter.h b/shared/source/utilities/perf_counter.h index 0ac210405c..0b6f5406d6 100644 --- a/shared/source/utilities/perf_counter.h +++ b/shared/source/utilities/perf_counter.h @@ -20,7 +20,7 @@ class HwPerfCounter : public TagTypeBase { } static constexpr AllocationType getAllocationType() { - return AllocationType::PROFILING_TAG_BUFFER; + return AllocationType::profilingTagBuffer; } static constexpr TagNodeType getTagNodeType() { return TagNodeType::hwPerfCounter; } diff --git a/shared/source/utilities/software_tags_manager.cpp b/shared/source/utilities/software_tags_manager.cpp index abaa4e9f2e..1efe9d0623 100644 --- a/shared/source/utilities/software_tags_manager.cpp +++ b/shared/source/utilities/software_tags_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -34,7 +34,7 @@ void SWTagsManager::allocateBXMLHeap(Device &device) { const AllocationProperties properties{ device.getRootDeviceIndex(), heapSizeInBytes, - AllocationType::SW_TAG_BUFFER, + AllocationType::swTagBuffer, device.getDeviceBitfield()}; bxmlHeap = memoryManager->allocateGraphicsMemoryWithProperties(properties); @@ -47,7 +47,7 @@ void SWTagsManager::allocateSWTagHeap(Device &device) { const AllocationProperties properties{ device.getRootDeviceIndex(), maxTagHeapSize, - AllocationType::SW_TAG_BUFFER, + AllocationType::swTagBuffer, device.getDeviceBitfield()}; tagHeap = memoryManager->allocateGraphicsMemoryWithProperties(properties); diff --git a/shared/source/xe_hpc_core/gfx_core_helper_xe_hpc_core.cpp b/shared/source/xe_hpc_core/gfx_core_helper_xe_hpc_core.cpp index 04774a4e60..0e74280842 100644 --- a/shared/source/xe_hpc_core/gfx_core_helper_xe_hpc_core.cpp +++ b/shared/source/xe_hpc_core/gfx_core_helper_xe_hpc_core.cpp @@ -211,7 +211,7 @@ void GfxCoreHelperHw::setL1CachePolicy(bool useL1Cache, typename Family: template <> void GfxCoreHelperHw::setExtraAllocationData(AllocationData &allocationData, const AllocationProperties &properties, const RootDeviceEnvironment &rootDeviceEnvironment) const { - if (properties.allocationType == AllocationType::TIMESTAMP_PACKET_TAG_BUFFER || properties.allocationType == AllocationType::COMMAND_BUFFER) { + if (properties.allocationType == AllocationType::timestampPacketTagBuffer || properties.allocationType == AllocationType::commandBuffer) { allocationData.flags.useSystemMemory = false; } @@ -228,9 +228,9 @@ void GfxCoreHelperHw::setExtraAllocationData(AllocationData &allocationD } if (forceLocalMemoryForDirectSubmission) { - if (properties.allocationType == AllocationType::COMMAND_BUFFER || - properties.allocationType == AllocationType::RING_BUFFER || - properties.allocationType == AllocationType::SEMAPHORE_BUFFER) { + if (properties.allocationType == AllocationType::commandBuffer || + properties.allocationType == AllocationType::ringBuffer || + properties.allocationType == AllocationType::semaphoreBuffer) { allocationData.flags.useSystemMemory = false; allocationData.flags.requiresCpuAccess = true; } diff --git a/shared/source/xe_hpg_core/gfx_core_helper_xe_hpg_core.cpp b/shared/source/xe_hpg_core/gfx_core_helper_xe_hpg_core.cpp index 7cd11f2893..bf75ac2d56 100644 --- a/shared/source/xe_hpg_core/gfx_core_helper_xe_hpg_core.cpp +++ b/shared/source/xe_hpg_core/gfx_core_helper_xe_hpg_core.cpp @@ -142,13 +142,13 @@ void GfxCoreHelperHw::setExtraAllocationData(AllocationData &allocationD auto &productHelper = rootDeviceEnvironment.getHelper(); if (LocalMemoryAccessMode::CpuAccessDisallowed == productHelper.getLocalMemoryAccessMode(hwInfo)) { - if (properties.allocationType == AllocationType::LINEAR_STREAM || - properties.allocationType == AllocationType::INTERNAL_HEAP || - properties.allocationType == AllocationType::PRINTF_SURFACE || - properties.allocationType == AllocationType::ASSERT_BUFFER || - properties.allocationType == AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER || - properties.allocationType == AllocationType::RING_BUFFER || - properties.allocationType == AllocationType::SEMAPHORE_BUFFER) { + if (properties.allocationType == AllocationType::linearStream || + properties.allocationType == AllocationType::internalHeap || + properties.allocationType == AllocationType::printfSurface || + properties.allocationType == AllocationType::assertBuffer || + properties.allocationType == AllocationType::gpuTimestampDeviceBuffer || + properties.allocationType == AllocationType::ringBuffer || + properties.allocationType == AllocationType::semaphoreBuffer) { allocationData.flags.useSystemMemory = true; } if (!allocationData.flags.useSystemMemory) { @@ -156,24 +156,24 @@ void GfxCoreHelperHw::setExtraAllocationData(AllocationData &allocationD allocationData.storageInfo.isLockable = false; } } else if (hwInfo.featureTable.flags.ftrLocalMemory && - (properties.allocationType == AllocationType::COMMAND_BUFFER || - properties.allocationType == AllocationType::RING_BUFFER || - properties.allocationType == AllocationType::SEMAPHORE_BUFFER)) { + (properties.allocationType == AllocationType::commandBuffer || + properties.allocationType == AllocationType::ringBuffer || + properties.allocationType == AllocationType::semaphoreBuffer)) { allocationData.flags.useSystemMemory = false; allocationData.flags.requiresCpuAccess = true; } if (CompressionSelector::allowStatelessCompression()) { - if (properties.allocationType == AllocationType::GLOBAL_SURFACE || - properties.allocationType == AllocationType::CONSTANT_SURFACE || - properties.allocationType == AllocationType::PRINTF_SURFACE) { + if (properties.allocationType == AllocationType::globalSurface || + properties.allocationType == AllocationType::constantSurface || + properties.allocationType == AllocationType::printfSurface) { allocationData.flags.requiresCpuAccess = false; allocationData.storageInfo.isLockable = false; } } if (productHelper.isStorageInfoAdjustmentRequired()) { - if (properties.allocationType == AllocationType::BUFFER && !properties.flags.preferCompressed && !properties.flags.shareable) { + if (properties.allocationType == AllocationType::buffer && !properties.flags.preferCompressed && !properties.flags.shareable) { allocationData.storageInfo.isLockable = true; } } diff --git a/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl b/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl index 9ae3fa21e5..36ff39d504 100644 --- a/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl +++ b/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl @@ -94,7 +94,7 @@ bool ProductHelperHw::isPlatformDp4aSupported() const { template <> bool ProductHelperHw::overrideAllocationCacheable(const AllocationData &allocationData) const { - return allocationData.type == AllocationType::COMMAND_BUFFER; + return allocationData.type == AllocationType::commandBuffer; } template <> diff --git a/shared/test/common/mocks/linux/mock_drm_memory_manager.cpp b/shared/test/common/mocks/linux/mock_drm_memory_manager.cpp index b656932196..87104335ef 100644 --- a/shared/test/common/mocks/linux/mock_drm_memory_manager.cpp +++ b/shared/test/common/mocks/linux/mock_drm_memory_manager.cpp @@ -53,7 +53,7 @@ TestedDrmMemoryManager::TestedDrmMemoryManager(bool enableLocalMemory, BufferObject *TestedDrmMemoryManager::findAndReferenceSharedBufferObject(int boHandle, uint32_t rootDeviceIndex) { if (failOnfindAndReferenceSharedBufferObject) { DrmMockCustom drmMock(*executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]); - auto patIndex = drmMock.getPatIndex(nullptr, AllocationType::BUFFER, CacheRegion::defaultRegion, CachePolicy::writeBack, false, false); + auto patIndex = drmMock.getPatIndex(nullptr, AllocationType::buffer, CacheRegion::defaultRegion, CachePolicy::writeBack, false, false); return new (std::nothrow) BufferObject(rootDeviceIndex, &drmMock, patIndex, boHandle, 4096u, 2u); } return MemoryManagerCreate::findAndReferenceSharedBufferObject(boHandle, rootDeviceIndex); diff --git a/shared/test/common/mocks/mock_allocation_properties.h b/shared/test/common/mocks/mock_allocation_properties.h index a5b56d607c..1e673bb63d 100644 --- a/shared/test/common/mocks/mock_allocation_properties.h +++ b/shared/test/common/mocks/mock_allocation_properties.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -12,11 +12,11 @@ namespace NEO { struct MockAllocationProperties : public AllocationProperties { - MockAllocationProperties(uint32_t rootDeviceIndex, size_t size) : AllocationProperties(rootDeviceIndex, true, size, AllocationType::INTERNAL_HOST_MEMORY, false, mockDeviceBitfield) {} + MockAllocationProperties(uint32_t rootDeviceIndex, size_t size) : AllocationProperties(rootDeviceIndex, true, size, AllocationType::internalHostMemory, false, mockDeviceBitfield) {} MockAllocationProperties(uint32_t rootDeviceIndex, size_t size, AllocationType type) : AllocationProperties(rootDeviceIndex, true, size, type, false, mockDeviceBitfield) {} - MockAllocationProperties(uint32_t rootDeviceIndex, size_t size, DeviceBitfield deviceBitfield) : AllocationProperties(rootDeviceIndex, true, size, AllocationType::INTERNAL_HOST_MEMORY, false, deviceBitfield) {} - MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size) : AllocationProperties(rootDeviceIndex, allocateMemory, size, AllocationType::INTERNAL_HOST_MEMORY, false, mockDeviceBitfield) {} - MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size, DeviceBitfield deviceBitfield) : AllocationProperties(rootDeviceIndex, allocateMemory, size, AllocationType::INTERNAL_HOST_MEMORY, false, deviceBitfield) {} + MockAllocationProperties(uint32_t rootDeviceIndex, size_t size, DeviceBitfield deviceBitfield) : AllocationProperties(rootDeviceIndex, true, size, AllocationType::internalHostMemory, false, deviceBitfield) {} + MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size) : AllocationProperties(rootDeviceIndex, allocateMemory, size, AllocationType::internalHostMemory, false, mockDeviceBitfield) {} + MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size, DeviceBitfield deviceBitfield) : AllocationProperties(rootDeviceIndex, allocateMemory, size, AllocationType::internalHostMemory, false, deviceBitfield) {} MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size, AllocationType allocationType) : AllocationProperties(rootDeviceIndex, allocateMemory, size, allocationType, false, mockDeviceBitfield) {} MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size, AllocationType allocationType, DeviceBitfield deviceBitfield) : AllocationProperties(rootDeviceIndex, allocateMemory, size, allocationType, false, deviceBitfield) {} }; diff --git a/shared/test/common/mocks/mock_gmm.h b/shared/test/common/mocks/mock_gmm.h index d63c73ca2f..cd2a208df7 100644 --- a/shared/test/common/mocks/mock_gmm.h +++ b/shared/test/common/mocks/mock_gmm.h @@ -47,7 +47,7 @@ class MockGmm : public Gmm { imgDesc.imageWidth = 5; imgDesc.imageHeight = 5; auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr); - return memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, true, &imgInfo, AllocationType::IMAGE, mockDeviceBitfield}); + return memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, true, &imgInfo, AllocationType::image, mockDeviceBitfield}); } }; } // namespace NEO diff --git a/shared/test/common/mocks/mock_graphics_allocation.h b/shared/test/common/mocks/mock_graphics_allocation.h index 061a7f5203..9d470b166b 100644 --- a/shared/test/common/mocks/mock_graphics_allocation.h +++ b/shared/test/common/mocks/mock_graphics_allocation.h @@ -33,16 +33,16 @@ class MockGraphicsAllocation : public MemoryAllocation { using MemoryAllocation::usageInfos; MockGraphicsAllocation() - : MemoryAllocation(0, AllocationType::UNKNOWN, nullptr, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu) {} + : MemoryAllocation(0, AllocationType::unknown, nullptr, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu) {} MockGraphicsAllocation(void *buffer, size_t sizeIn) - : MemoryAllocation(0, AllocationType::UNKNOWN, buffer, castToUint64(buffer), 0llu, sizeIn, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount) {} + : MemoryAllocation(0, AllocationType::unknown, buffer, castToUint64(buffer), 0llu, sizeIn, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount) {} MockGraphicsAllocation(void *buffer, uint64_t gpuAddr, size_t sizeIn) - : MemoryAllocation(0, AllocationType::UNKNOWN, buffer, gpuAddr, 0llu, sizeIn, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount) {} + : MemoryAllocation(0, AllocationType::unknown, buffer, gpuAddr, 0llu, sizeIn, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount) {} MockGraphicsAllocation(uint32_t rootDeviceIndex, void *buffer, size_t sizeIn) - : MemoryAllocation(rootDeviceIndex, AllocationType::UNKNOWN, buffer, castToUint64(buffer), 0llu, sizeIn, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount) {} + : MemoryAllocation(rootDeviceIndex, AllocationType::unknown, buffer, castToUint64(buffer), 0llu, sizeIn, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount) {} void resetInspectionIds() { for (auto &usageInfo : usageInfos) { diff --git a/shared/test/common/mocks/mock_memory_manager.cpp b/shared/test/common/mocks/mock_memory_manager.cpp index 7b8049220f..4303aa2381 100644 --- a/shared/test/common/mocks/mock_memory_manager.cpp +++ b/shared/test/common/mocks/mock_memory_manager.cpp @@ -230,7 +230,7 @@ GraphicsAllocation *MockMemoryManager::createGraphicsAllocationFromSharedHandle( GraphicsAllocation *MockMemoryManager::createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) { if (toOsHandle(handle) != invalidSharedHandle) { - auto graphicsAllocation = createMemoryAllocation(NEO::AllocationType::SHARED_BUFFER, nullptr, reinterpret_cast(1), 1, + auto graphicsAllocation = createMemoryAllocation(NEO::AllocationType::sharedBuffer, nullptr, reinterpret_cast(1), 1, 4096u, toOsHandle(handle), MemoryPool::SystemCpuInaccessible, rootDeviceIndex, false, false, false); graphicsAllocation->setSharedHandle(toOsHandle(handle)); diff --git a/shared/test/common/mocks/mock_sip.cpp b/shared/test/common/mocks/mock_sip.cpp index de2af58ff2..25962e7368 100644 --- a/shared/test/common/mocks/mock_sip.cpp +++ b/shared/test/common/mocks/mock_sip.cpp @@ -41,7 +41,7 @@ const std::vector &MockSipKernel::getStateSaveAreaHeader() const { void MockSipKernel::createMockSipAllocation() { this->mockSipMemoryAllocation = std::make_unique(0u, - AllocationType::KERNEL_ISA_INTERNAL, + AllocationType::kernelIsaInternal, nullptr, MemoryConstants::pageSize * 10u, 0u, diff --git a/shared/test/common/mocks/windows/mock_wddm_allocation.h b/shared/test/common/mocks/windows/mock_wddm_allocation.h index 6d602bc0ca..535b44a0af 100644 --- a/shared/test/common/mocks/windows/mock_wddm_allocation.h +++ b/shared/test/common/mocks/windows/mock_wddm_allocation.h @@ -15,7 +15,7 @@ namespace NEO { class MockWddmAllocation : public WddmAllocation { public: MockWddmAllocation(GmmHelper *gmmHelper) : MockWddmAllocation(gmmHelper, EngineLimits::maxHandleCount) {} - MockWddmAllocation(GmmHelper *gmmHelper, uint32_t numGmms) : WddmAllocation(0, numGmms, AllocationType::UNKNOWN, + MockWddmAllocation(GmmHelper *gmmHelper, uint32_t numGmms) : WddmAllocation(0, numGmms, AllocationType::unknown, nullptr, 0, 0, nullptr, MemoryPool::MemoryNull, 0u, 3u), gpuPtr(gpuAddress), handle(handles[0]) { for (uint32_t i = 0; i < numGmms; i++) { diff --git a/shared/test/unit_test/aub/aub_helper_tests.cpp b/shared/test/unit_test/aub/aub_helper_tests.cpp index 9bcfb82a06..a455e6fec2 100644 --- a/shared/test/unit_test/aub/aub_helper_tests.cpp +++ b/shared/test/unit_test/aub/aub_helper_tests.cpp @@ -92,30 +92,30 @@ TEST(AubHelper, WhenHBMSizePerTileInGigabytesIsSetThenGetMemBankSizeReturnsCorre } TEST(AubHelper, givenAllocationTypeWhenAskingIfOneTimeWritableThenReturnCorrectResult) { - for (uint32_t i = 0; i < static_cast(AllocationType::COUNT); i++) { + for (uint32_t i = 0; i < static_cast(AllocationType::count); i++) { auto allocType = static_cast(i); bool isOneTimeWritable = AubHelper::isOneTimeAubWritableAllocationType(allocType); switch (allocType) { - case AllocationType::PIPE: - case AllocationType::CONSTANT_SURFACE: - case AllocationType::GLOBAL_SURFACE: - case AllocationType::KERNEL_ISA: - case AllocationType::KERNEL_ISA_INTERNAL: - case AllocationType::PRIVATE_SURFACE: - case AllocationType::SCRATCH_SURFACE: - case AllocationType::WORK_PARTITION_SURFACE: - case AllocationType::BUFFER: - case AllocationType::BUFFER_HOST_MEMORY: - case AllocationType::IMAGE: - case AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: - case AllocationType::EXTERNAL_HOST_PTR: - case AllocationType::MAP_ALLOCATION: - case AllocationType::SVM_GPU: - case AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: - case AllocationType::ASSERT_BUFFER: - case AllocationType::TAG_BUFFER: + case AllocationType::pipe: + case AllocationType::constantSurface: + case AllocationType::globalSurface: + case AllocationType::kernelIsa: + case AllocationType::kernelIsaInternal: + case AllocationType::privateSurface: + case AllocationType::scratchSurface: + case AllocationType::workPartitionSurface: + case AllocationType::buffer: + case AllocationType::bufferHostMemory: + case AllocationType::image: + case AllocationType::timestampPacketTagBuffer: + case AllocationType::externalHostPtr: + case AllocationType::mapAllocation: + case AllocationType::svmGpu: + case AllocationType::gpuTimestampDeviceBuffer: + case AllocationType::assertBuffer: + case AllocationType::tagBuffer: EXPECT_TRUE(isOneTimeWritable); break; default: diff --git a/shared/test/unit_test/aub_mem_dump/aub_alloc_dump_tests.cpp b/shared/test/unit_test/aub_mem_dump/aub_alloc_dump_tests.cpp index f55cf7f317..e52006502b 100644 --- a/shared/test/unit_test/aub_mem_dump/aub_alloc_dump_tests.cpp +++ b/shared/test/unit_test/aub_mem_dump/aub_alloc_dump_tests.cpp @@ -37,43 +37,43 @@ HWTEST_F(AubAllocDumpTests, givenBufferOrImageWhenGraphicsAllocationIsKnownThenI auto memoryManager = pDevice->getMemoryManager(); auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{pDevice->getRootDeviceIndex(), MemoryConstants::pageSize}); - gfxAllocation->setAllocationType(AllocationType::BUFFER); + gfxAllocation->setAllocationType(AllocationType::buffer); EXPECT_FALSE(gfxAllocation->isMemObjectsAllocationWithWritableFlags()); EXPECT_FALSE(AubAllocDump::isWritableBuffer(*gfxAllocation)); - gfxAllocation->setAllocationType(AllocationType::BUFFER); + gfxAllocation->setAllocationType(AllocationType::buffer); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); - gfxAllocation->setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + gfxAllocation->setAllocationType(AllocationType::bufferHostMemory); gfxAllocation->setMemObjectsAllocationWithWritableFlags(false); EXPECT_FALSE(AubAllocDump::isWritableBuffer(*gfxAllocation)); - gfxAllocation->setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + gfxAllocation->setAllocationType(AllocationType::bufferHostMemory); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); - gfxAllocation->setAllocationType(AllocationType::EXTERNAL_HOST_PTR); + gfxAllocation->setAllocationType(AllocationType::externalHostPtr); gfxAllocation->setMemObjectsAllocationWithWritableFlags(false); EXPECT_FALSE(AubAllocDump::isWritableBuffer(*gfxAllocation)); - gfxAllocation->setAllocationType(AllocationType::EXTERNAL_HOST_PTR); + gfxAllocation->setAllocationType(AllocationType::externalHostPtr); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); - gfxAllocation->setAllocationType(AllocationType::MAP_ALLOCATION); + gfxAllocation->setAllocationType(AllocationType::mapAllocation); gfxAllocation->setMemObjectsAllocationWithWritableFlags(false); EXPECT_FALSE(AubAllocDump::isWritableBuffer(*gfxAllocation)); - gfxAllocation->setAllocationType(AllocationType::MAP_ALLOCATION); + gfxAllocation->setAllocationType(AllocationType::mapAllocation); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); - gfxAllocation->setAllocationType(AllocationType::IMAGE); + gfxAllocation->setAllocationType(AllocationType::image); gfxAllocation->setMemObjectsAllocationWithWritableFlags(false); EXPECT_FALSE(AubAllocDump::isWritableImage(*gfxAllocation)); - gfxAllocation->setAllocationType(AllocationType::IMAGE); + gfxAllocation->setAllocationType(AllocationType::image); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableImage(*gfxAllocation)); @@ -120,7 +120,7 @@ HWTEST_F(AubAllocDumpTests, givenNonWritableBufferWhenDumpAllocationIsCalledAndD debugManager.flags.AUBDumpBufferFormat.set("BIN"); auto memoryManager = pDevice->getMemoryManager(); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); std::unique_ptr mockAubFileStream(new AubFileStreamMock()); auto format = AubAllocDump::getDumpFormat(*gfxAllocation); diff --git a/shared/test/unit_test/command_container/command_container_tests.cpp b/shared/test/unit_test/command_container/command_container_tests.cpp index e603a521e3..edb1b82908 100644 --- a/shared/test/unit_test/command_container/command_container_tests.cpp +++ b/shared/test/unit_test/command_container/command_container_tests.cpp @@ -101,12 +101,12 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenCreatingCommandBufferThenCorre cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); ASSERT_NE(0u, cmdContainer.getCmdBufferAllocations().size()); - EXPECT_EQ(AllocationType::COMMAND_BUFFER, cmdContainer.getCmdBufferAllocations()[0]->getAllocationType()); + EXPECT_EQ(AllocationType::commandBuffer, cmdContainer.getCmdBufferAllocations()[0]->getAllocationType()); cmdContainer.allocateNextCommandBuffer(); ASSERT_LE(2u, cmdContainer.getCmdBufferAllocations().size()); - EXPECT_EQ(AllocationType::COMMAND_BUFFER, cmdContainer.getCmdBufferAllocations()[1]->getAllocationType()); + EXPECT_EQ(AllocationType::commandBuffer, cmdContainer.getCmdBufferAllocations()[1]->getAllocationType()); } TEST_F(CommandContainerTest, givenCreateSecondaryCmdBufferInHostMemWhenInitializeThenCreateAdditionalLinearStream) { @@ -148,10 +148,10 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingHeapsThenSetCorrectA EXPECT_EQ(heap, nullptr); } else { if (HeapType::INDIRECT_OBJECT == heapType) { - EXPECT_EQ(AllocationType::INTERNAL_HEAP, heap->getGraphicsAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::internalHeap, heap->getGraphicsAllocation()->getAllocationType()); EXPECT_NE(0u, heap->getHeapGpuStartOffset()); } else { - EXPECT_EQ(AllocationType::LINEAR_STREAM, heap->getGraphicsAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::linearStream, heap->getGraphicsAllocation()->getAllocationType()); EXPECT_EQ(0u, heap->getHeapGpuStartOffset()); } } @@ -212,7 +212,7 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenHeapNotRequiredThenHeapIsN TEST_F(CommandContainerTest, givenEnabledLocalMemoryAndIsaInSystemMemoryWhenCmdContainerIsInitializedThenInstructionBaseAddressIsSetToInternalHeap) { DebugManagerStateRestore dbgRestore; - debugManager.flags.ForceSystemMemoryPlacement.set(1 << (static_cast(AllocationType::KERNEL_ISA) - 1)); + debugManager.flags.ForceSystemMemoryPlacement.set(1 << (static_cast(AllocationType::kernelIsa) - 1)); auto executionEnvironment = new NEO::ExecutionEnvironment(); const size_t numDevices = 1; @@ -915,7 +915,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenSetCmdBufferThenCmdBufferSetCo AllocationProperties properties{pDevice->getRootDeviceIndex(), true /* allocateMemory*/, 2048, - AllocationType::COMMAND_BUFFER, + AllocationType::commandBuffer, (pDevice->getNumGenericSubDevices() > 1u) /* multiOsContextCapable */, false, pDevice->getDeviceBitfield()}; diff --git a/shared/test/unit_test/command_container/command_encoder_tests.cpp b/shared/test/unit_test/command_container/command_encoder_tests.cpp index 8a9cb0a6ea..c8d6e55e46 100644 --- a/shared/test/unit_test/command_container/command_encoder_tests.cpp +++ b/shared/test/unit_test/command_container/command_encoder_tests.cpp @@ -104,7 +104,7 @@ HWTEST_F(CommandEncoderTests, whenEncodeMemoryPrefetchCalledThenDoNothing) { uint8_t buffer[MemoryConstants::pageSize] = {}; LinearStream linearStream(buffer, sizeof(buffer)); - GraphicsAllocation allocation(0, AllocationType::UNKNOWN, nullptr, 123, 456, 789, MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); + GraphicsAllocation allocation(0, AllocationType::unknown, nullptr, 123, 456, 789, MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); EncodeMemoryPrefetch::programMemoryPrefetch(linearStream, allocation, 2, 0, *mockExecutionEnvironment.rootDeviceEnvironments[0]); diff --git a/shared/test/unit_test/command_container/command_encoder_tests_xe_hpg_core_and_later.cpp b/shared/test/unit_test/command_container/command_encoder_tests_xe_hpg_core_and_later.cpp index d8c84b6f04..7f3b2c2d3c 100644 --- a/shared/test/unit_test/command_container/command_encoder_tests_xe_hpg_core_and_later.cpp +++ b/shared/test/unit_test/command_container/command_encoder_tests_xe_hpg_core_and_later.cpp @@ -23,7 +23,7 @@ HWTEST2_F(CommandEncoderXeHpgCorePlusTests, givenSpecifiedL1CacheControlWhenAppe DebugManagerStateRestore restorer; auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); size_t allocationSize = MemoryConstants::pageSize; - AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, AllocationType::buffer, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); auto rssCmd = FamilyType::cmdInitRenderSurfaceState; diff --git a/shared/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp b/shared/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp index 66ba8fadde..3d48215dec 100644 --- a/shared/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp +++ b/shared/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp @@ -732,22 +732,22 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenWriteMe auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{pDevice->getRootDeviceIndex(), MemoryConstants::pageSize}); const AllocationType onlyOneTimeAubWritableTypes[] = { - AllocationType::PIPE, - AllocationType::CONSTANT_SURFACE, - AllocationType::GLOBAL_SURFACE, - AllocationType::KERNEL_ISA, - AllocationType::KERNEL_ISA_INTERNAL, - AllocationType::PRIVATE_SURFACE, - AllocationType::SCRATCH_SURFACE, - AllocationType::WORK_PARTITION_SURFACE, - AllocationType::BUFFER, - AllocationType::BUFFER_HOST_MEMORY, - AllocationType::IMAGE, - AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, - AllocationType::MAP_ALLOCATION, - AllocationType::SVM_GPU, - AllocationType::EXTERNAL_HOST_PTR, - AllocationType::ASSERT_BUFFER}; + AllocationType::pipe, + AllocationType::constantSurface, + AllocationType::globalSurface, + AllocationType::kernelIsa, + AllocationType::kernelIsaInternal, + AllocationType::privateSurface, + AllocationType::scratchSurface, + AllocationType::workPartitionSurface, + AllocationType::buffer, + AllocationType::bufferHostMemory, + AllocationType::image, + AllocationType::timestampPacketTagBuffer, + AllocationType::mapAllocation, + AllocationType::svmGpu, + AllocationType::externalHostPtr, + AllocationType::assertBuffer}; for (auto allocationType : onlyOneTimeAubWritableTypes) { gfxAllocation->setAubWritable(true, GraphicsAllocation::defaultBank); @@ -766,7 +766,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcess aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); aubCsr->initializeEngine(); - auto gfxBufferAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxBufferAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); auto gfxImageAllocation = MockGmm::allocateImage2d(*memoryManager); @@ -787,7 +787,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); - auto gfxBufferAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxBufferAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); aubCsr->setAubWritable(false, *gfxBufferAllocation); auto gfxImageAllocation = MockGmm::allocateImage2d(*memoryManager); @@ -812,7 +812,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcess memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); - auto gfxBufferAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxBufferAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); aubCsr->setAubWritable(false, *gfxBufferAllocation); auto gfxImageAllocation = MockGmm::allocateImage2d(*memoryManager); diff --git a/shared/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp b/shared/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp index 65bdec8173..891dc38e1d 100644 --- a/shared/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp +++ b/shared/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp @@ -280,7 +280,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenNoCpuPtrAndNotLockableAllocationWhe constexpr uint64_t initGpuAddress = 1234; constexpr size_t initSize = 10; MockGraphicsAllocation allocation(nullptr, initGpuAddress, initSize); - allocation.setAllocationType(AllocationType::BUFFER); + allocation.setAllocationType(AllocationType::buffer); allocation.overrideMemoryPool(MemoryPool::LocalMemory); aubExecutionEnvironment->executionEnvironment->rootDeviceEnvironments[0]->initGmm(); @@ -318,7 +318,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenNoCpuPtrAndLockableAllocationWhenGe constexpr uint64_t initGpuAddress = 1234; constexpr size_t initSize = 10; MockGraphicsAllocation allocation(nullptr, initGpuAddress, initSize); - allocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + allocation.setAllocationType(AllocationType::bufferHostMemory); allocation.overrideMemoryPool(MemoryPool::LocalMemory); aubExecutionEnvironment->executionEnvironment->rootDeviceEnvironments[0]->initGmm(); @@ -615,7 +615,7 @@ HWTEST_F(AubCommandStreamReceiverNoHostPtrTests, givenAubCommandStreamReceiverWh auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr); AllocationProperties allocProperties{0u /* rootDeviceIndex */, true /* allocateMemory */, - &imgInfo, AllocationType::IMAGE, deviceBitfield}; + &imgInfo, AllocationType::image, deviceBitfield}; auto imageAllocation = memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr); ASSERT_NE(nullptr, imageAllocation); @@ -1052,7 +1052,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenTimestampBufferAllocationWhenAubWri ASSERT_NE(nullptr, memoryManager); size_t alignedSize = MemoryConstants::pageSize64k; - AllocationType allocationType = NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER; + AllocationType allocationType = NEO::AllocationType::gpuTimestampDeviceBuffer; AllocationProperties allocationProperties{pDevice->getRootDeviceIndex(), true, diff --git a/shared/test/unit_test/command_stream/aub_command_stream_receiver_3_tests.cpp b/shared/test/unit_test/command_stream/aub_command_stream_receiver_3_tests.cpp index d42d54f1d1..fc5a56f769 100644 --- a/shared/test/unit_test/command_stream/aub_command_stream_receiver_3_tests.cpp +++ b/shared/test/unit_test/command_stream/aub_command_stream_receiver_3_tests.cpp @@ -104,7 +104,7 @@ HWTEST_F(AubCsrTest, WhenWriteWithAubManagerIsCalledThenAubManagerIsInvokedWithC executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->aubCenter.reset(new AubCenter()); executionEnvironment->initializeMemoryManager(); - auto allocation = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize, AllocationType::COMMAND_BUFFER}); + auto allocation = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize, AllocationType::commandBuffer}); MockAubManager aubManager; std::unique_ptr> aubCsr(new MockAubCsr("", false, *executionEnvironment, rootDeviceIndex, deviceBitfield)); @@ -120,7 +120,7 @@ HWTEST_F(AubCsrTest, WhenWriteWithAubManagerIsCalledThenAubManagerIsInvokedWithC aubManager.writeMemory2Called = false; - auto allocation2 = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize, AllocationType::LINEAR_STREAM}); + auto allocation2 = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize, AllocationType::linearStream}); aubManager.storeAllocationParams = true; aubCsr->writeMemoryWithAubManager(*allocation2, true, 1, 1); @@ -282,7 +282,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA auto mockHardwareContext = static_cast(aubCsr.hardwareContextController->hardwareContexts[0].get()); auto memoryManager = pDevice->getMemoryManager(); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); GmmRequirements gmmRequirements{}; @@ -310,7 +310,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenBcsEngineWhenDumpAllocationCalledTh auto mockHardwareContext = static_cast(aubCsr.hardwareContextController->hardwareContexts[0].get()); auto memoryManager = pDevice->getMemoryManager(); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); @@ -338,7 +338,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenCompressedGraphicsAllocationWritabl auto mockHardwareContext = static_cast(aubCsr.hardwareContextController->hardwareContexts[0].get()); auto memoryManager = pDevice->getMemoryManager(); - AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()); properties.flags.preferCompressed = true; auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); @@ -367,7 +367,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA auto mockHardwareContext = static_cast(aubCsr.hardwareContextController->hardwareContexts[0].get()); auto memoryManager = pDevice->getMemoryManager(); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); @@ -390,7 +390,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationNonWritableWhenDu auto mockHardwareContext = static_cast(aubCsr.hardwareContextController->hardwareContexts[0].get()); auto memoryManager = pDevice->getMemoryManager(); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(false); EXPECT_FALSE(AubAllocDump::isWritableBuffer(*gfxAllocation)); @@ -414,7 +414,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationNotDumpableWhenDu auto mockHardwareContext = static_cast(aubCsr.hardwareContextController->hardwareContexts[0].get()); auto memoryManager = pDevice->getMemoryManager(); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); gfxAllocation->setAllocDumpable(false, false); @@ -439,7 +439,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationDumpableWhenDumpA auto mockHardwareContext = static_cast(aubCsr.hardwareContextController->hardwareContexts[0].get()); auto memoryManager = pDevice->getMemoryManager(); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); GmmRequirements gmmRequirements{}; @@ -511,7 +511,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWhenDumpAllocatio auto mockHardwareContext = static_cast(aubCsr.hardwareContextController->hardwareContexts[0].get()); auto memoryManager = pDevice->getMemoryManager(); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); gfxAllocation->setAllocDumpable(false, false); @@ -544,7 +544,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA auto mockHardwareContext = static_cast(aubCsr.hardwareContextController->hardwareContexts[0].get()); auto memoryManager = pDevice->getMemoryManager(); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); GmmRequirements gmmRequirements{}; diff --git a/shared/test/unit_test/command_stream/aub_file_stream_tests.cpp b/shared/test/unit_test/command_stream/aub_file_stream_tests.cpp index 5405290b68..ab7f7d0ec1 100644 --- a/shared/test/unit_test/command_stream/aub_file_stream_tests.cpp +++ b/shared/test/unit_test/command_stream/aub_file_stream_tests.cpp @@ -270,7 +270,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenDumpAllocationIsCa auto mockAubFileStream = std::make_unique(); auto aubExecutionEnvironment = getEnvironment>(true, true, true); auto aubCsr = aubExecutionEnvironment->template getCsr>(); - GraphicsAllocation allocation{0, AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount}; + GraphicsAllocation allocation{0, AllocationType::unknown, nullptr, 0, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount}; aubCsr->stream = static_cast(mockAubFileStream.get()); diff --git a/shared/test/unit_test/command_stream/command_stream_receiver_simulated_tests.cpp b/shared/test/unit_test/command_stream/command_stream_receiver_simulated_tests.cpp index 4ea4ba490e..428948146e 100644 --- a/shared/test/unit_test/command_stream/command_stream_receiver_simulated_tests.cpp +++ b/shared/test/unit_test/command_stream/command_stream_receiver_simulated_tests.cpp @@ -37,7 +37,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndAllocationWithStorageIn executionEnvironment.rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hardwareInfo); executionEnvironment.initializeMemoryManager(); - MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, + MemoryAllocation allocation(0, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000u, MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x2u; @@ -56,7 +56,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndNonLocalMemoryAllocatio executionEnvironment.rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hardwareInfo); executionEnvironment.initializeMemoryManager(); - MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, + MemoryAllocation allocation(0, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000u, MemoryConstants::pageSize, 0, MemoryPool::System4KBPages, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x2u; @@ -72,7 +72,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndAllocationWithStorageIn executionEnvironment.rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hardwareInfo); executionEnvironment.initializeMemoryManager(); - MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, + MemoryAllocation allocation(0, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000u, MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x0u; @@ -91,7 +91,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndNonLocalMemoryAllocatio executionEnvironment.rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hardwareInfo); executionEnvironment.initializeMemoryManager(); - MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, + MemoryAllocation allocation(0, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000u, MemoryConstants::pageSize, 0, MemoryPool::System64KBPages, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x3u; @@ -110,7 +110,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryNoncloneableAllocationWith executionEnvironment.rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hardwareInfo); executionEnvironment.initializeMemoryManager(); - MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, + MemoryAllocation allocation(0, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000u, MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x3u; allocation.storageInfo.cloningOfPageTables = false; @@ -134,7 +134,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryCloneableAllocationWithMan executionEnvironment.rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hardwareInfo); executionEnvironment.initializeMemoryManager(); - MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, + MemoryAllocation allocation(0, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000u, MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x3u; allocation.storageInfo.cloningOfPageTables = true; @@ -158,7 +158,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryNoncloneableAllocationWith executionEnvironment.rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hardwareInfo); executionEnvironment.initializeMemoryManager(); - MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, + MemoryAllocation allocation(0, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000u, MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x3u; allocation.storageInfo.cloningOfPageTables = false; @@ -183,7 +183,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndAllocationWithStorageIn executionEnvironment.rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hardwareInfo); executionEnvironment.initializeMemoryManager(); - MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, + MemoryAllocation allocation(0, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000u, MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x0u; @@ -310,7 +310,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenSimulatedCommandStreamReceiverWhenClo auto mockHardwareContext = static_cast(csr->hardwareContextController->hardwareContexts[0].get()); int dummy = 1; - GraphicsAllocation graphicsAllocation{0, AllocationType::UNKNOWN, + GraphicsAllocation graphicsAllocation{0, AllocationType::unknown, &dummy, 0, 0, sizeof(dummy), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = true; csr->writeMemoryWithAubManager(graphicsAllocation, false, 0, 0); @@ -336,7 +336,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenCompressedAllocationWhenCloningPageTa gmm.isCompressionEnabled = true; int dummy = 1; - GraphicsAllocation graphicsAllocation{0, AllocationType::UNKNOWN, + GraphicsAllocation graphicsAllocation{0, AllocationType::unknown, &dummy, 0, 0, sizeof(dummy), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = true; @@ -369,7 +369,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenUncachedAllocationWhenCloningPageTabl gmm.isCompressionEnabled = false; int dummy = 1; - GraphicsAllocation graphicsAllocation{0, AllocationType::UNKNOWN, + GraphicsAllocation graphicsAllocation{0, AllocationType::unknown, &dummy, 0, 0, sizeof(dummy), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = true; @@ -397,7 +397,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenTileInstancedAllocationWhenWriteMemor csr->multiOsContextCapable = true; int dummy = 1; - GraphicsAllocation graphicsAllocation{0, AllocationType::UNKNOWN, + GraphicsAllocation graphicsAllocation{0, AllocationType::unknown, &dummy, 0, 0, sizeof(dummy), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = false; graphicsAllocation.storageInfo.tileInstanced = true; @@ -432,7 +432,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenCompressedTileInstancedAllocationWhen gmm.isCompressionEnabled = true; int dummy = 1; - GraphicsAllocation graphicsAllocation{0, AllocationType::UNKNOWN, + GraphicsAllocation graphicsAllocation{0, AllocationType::unknown, &dummy, 0, 0, sizeof(dummy), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = false; graphicsAllocation.storageInfo.tileInstanced = true; @@ -474,7 +474,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenUncachedTileInstancedAllocationWhenWr gmm.isCompressionEnabled = false; int dummy = 1; - GraphicsAllocation graphicsAllocation{0, AllocationType::UNKNOWN, + GraphicsAllocation graphicsAllocation{0, AllocationType::unknown, &dummy, 0, 0, sizeof(dummy), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = false; graphicsAllocation.storageInfo.tileInstanced = true; @@ -507,7 +507,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenTileInstancedAllocationWithMissingMem csr->multiOsContextCapable = true; int dummy = 1; - GraphicsAllocation graphicsAllocation{0, AllocationType::UNKNOWN, + GraphicsAllocation graphicsAllocation{0, AllocationType::unknown, &dummy, 0, 0, sizeof(dummy), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = false; graphicsAllocation.storageInfo.tileInstanced = true; @@ -523,7 +523,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenCommandBufferAllocationWhenWriteMemor csr->aubManager = mockManager.get(); int dummy = 1; - GraphicsAllocation graphicsAllocation{0, AllocationType::COMMAND_BUFFER, + GraphicsAllocation graphicsAllocation{0, AllocationType::commandBuffer, &dummy, 0, 0, sizeof(dummy), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = true; csr->writeMemoryWithAubManager(graphicsAllocation, false, 0, 0); @@ -557,7 +557,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenSpecificMemoryPoolAllocationWhenWrite mockHardwareContext->writeMemoryPageSizePassed = 0; mockHardwareContext->writeMemory2Called = false; - GraphicsAllocation graphicsAllocation{0, AllocationType::COMMAND_BUFFER, + GraphicsAllocation graphicsAllocation{0, AllocationType::commandBuffer, &dummy, 0, 0, sizeof(dummy), poolsWith4kPages[i], MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = true; csr->writeMemoryWithAubManager(graphicsAllocation, false, 0, 0); @@ -590,7 +590,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenSpecificMemoryPoolAllocationWhenWrite mockHardwareContext->writeMemoryPageSizePassed = 0; mockHardwareContext->writeMemory2Called = false; - GraphicsAllocation graphicsAllocation{0, AllocationType::COMMAND_BUFFER, + GraphicsAllocation graphicsAllocation{0, AllocationType::commandBuffer, &dummy, 0, 0, sizeof(dummy), poolsWith64kPages[i], MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = true; csr->writeMemoryWithAubManager(graphicsAllocation, false, 0, 0); diff --git a/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp b/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp index 4adbb167e1..9ac6b381ea 100644 --- a/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp +++ b/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp @@ -175,7 +175,7 @@ HWTEST_F(CommandStreamReceiverTest, givenFlagEnabledForCommandBuffersWhenCallFil EXPECT_EQ(1u, commandStreamReceiver->getResidencyAllocations().size()); auto allocation = internalAllocationStorage->getAllocationsForReuse().peekHead(); - EXPECT_EQ(AllocationType::COMMAND_BUFFER, allocation->getAllocationType()); + EXPECT_EQ(AllocationType::commandBuffer, allocation->getAllocationType()); } HWTEST_F(CommandStreamReceiverTest, givenFlagEnabledForInternalHeapsWhenCallFillReusableAllocationsListThenAllocateInternalHeapAndMakeItResident) { @@ -192,7 +192,7 @@ HWTEST_F(CommandStreamReceiverTest, givenFlagEnabledForInternalHeapsWhenCallFill EXPECT_EQ(1u, commandStreamReceiver->getResidencyAllocations().size()); auto allocation = internalAllocationStorage->getAllocationsForReuse().peekHead(); - EXPECT_EQ(AllocationType::INTERNAL_HEAP, allocation->getAllocationType()); + EXPECT_EQ(AllocationType::internalHeap, allocation->getAllocationType()); } HWTEST_F(CommandStreamReceiverTest, givenUnsetPreallocationsPerQueueWhenRequestPreallocationCalledThenPreallocateCommandBufferCorrectly) { @@ -394,7 +394,7 @@ TEST_F(CommandStreamReceiverTest, givenCommandStreamReceiverWhenGetCSIsCalledThe auto commandStreamAllocation = commandStream.getGraphicsAllocation(); ASSERT_NE(nullptr, commandStreamAllocation); - EXPECT_EQ(AllocationType::COMMAND_BUFFER, commandStreamAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::commandBuffer, commandStreamAllocation->getAllocationType()); } HWTEST_F(CommandStreamReceiverTest, whenStoreAllocationThenStoredAllocationHasTaskCountFromCsr) { @@ -618,7 +618,7 @@ HWTEST_F(CommandStreamReceiverTest, givenGpuHangAndNonEmptyAllocationsListWhenCa size_t size = 100; auto gmmHelper = pDevice->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(hostPtr)); - auto temporaryAllocation = std::make_unique(0, AllocationType::EXTERNAL_HOST_PTR, hostPtr, size, 0, + auto temporaryAllocation = std::make_unique(0, AllocationType::externalHostPtr, hostPtr, size, 0, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount, canonizedGpuAddress); temporaryAllocation->updateTaskCount(0u, 0u); csr.getInternalAllocationStorage()->storeAllocationWithTaskCount(std::move(temporaryAllocation), TEMPORARY_ALLOCATION, 2u); @@ -660,7 +660,7 @@ TEST_F(CommandStreamReceiverTest, GivenNoParamatersWhenMakingResidentThenResiden TEST_F(CommandStreamReceiverTest, WhenDebugSurfaceIsAllocatedThenCorrectTypeIsSet) { auto allocation = commandStreamReceiver->allocateDebugSurface(1024); - EXPECT_EQ(AllocationType::DEBUG_CONTEXT_SAVE_AREA, allocation->getAllocationType()); + EXPECT_EQ(AllocationType::debugContextSaveArea, allocation->getAllocationType()); } TEST_F(CommandStreamReceiverTest, givenForced32BitAddressingWhenDebugSurfaceIsAllocatedThenRegularAllocationIsReturned) { @@ -1407,7 +1407,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenInitializeTa for (auto rootDeviceIndex = 0u; rootDeviceIndex < numRootDevices; rootDeviceIndex++) { auto tagAllocation = deviceFactory.rootDevices[rootDeviceIndex]->commandStreamReceivers[0]->getTagAllocation(); EXPECT_NE(nullptr, tagAllocation); - EXPECT_EQ(AllocationType::TAG_BUFFER, deviceFactory.rootDevices[rootDeviceIndex]->commandStreamReceivers[0]->getTagAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::tagBuffer, deviceFactory.rootDevices[rootDeviceIndex]->commandStreamReceivers[0]->getTagAllocation()->getAllocationType()); EXPECT_TRUE(deviceFactory.rootDevices[rootDeviceIndex]->commandStreamReceivers[0]->getTagAddress() != nullptr); EXPECT_EQ(*deviceFactory.rootDevices[rootDeviceIndex]->commandStreamReceivers[0]->getTagAddress(), initialHardwareTag); auto tagsMultiAllocation = deviceFactory.rootDevices[rootDeviceIndex]->commandStreamReceivers[0]->getTagsMultiAllocation(); @@ -1447,7 +1447,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenItIsDestroye bool destructorCalled = false; int gpuTag = 0; - auto mockGraphicsAllocation = new MockGraphicsAllocationWithDestructorTracing(0, AllocationType::UNKNOWN, &gpuTag, 0llu, 0llu, 1u, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); + auto mockGraphicsAllocation = new MockGraphicsAllocationWithDestructorTracing(0, AllocationType::unknown, &gpuTag, 0llu, 0llu, 1u, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); mockGraphicsAllocation->destructorCalled = &destructorCalled; MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); auto csr = std::make_unique(executionEnvironment, 0, 1); @@ -1473,7 +1473,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenInitializeTa EXPECT_EQ(nullptr, csr->getTagAllocation()); csr->initializeTagAllocation(); EXPECT_NE(nullptr, csr->getTagAllocation()); - EXPECT_EQ(AllocationType::TAG_BUFFER, csr->getTagAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::tagBuffer, csr->getTagAllocation()->getAllocationType()); EXPECT_EQ(csr->getTagAllocation()->getUnderlyingBuffer(), csr->getTagAddress()); auto tagAddress = csr->getTagAddress(); for (uint32_t i = 0; i < 2; i++) { @@ -1493,7 +1493,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenEnsureTagAll csr->initializeTagAllocation(); EXPECT_NE(nullptr, csr->getTagAllocation()); - EXPECT_EQ(AllocationType::TAG_BUFFER, csr->getTagAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::tagBuffer, csr->getTagAllocation()->getAllocationType()); EXPECT_EQ(csr->getTagAllocation()->getUnderlyingBuffer(), csr->getTagAddress()); auto tagAddress = csr->getTagAddress(); @@ -1607,7 +1607,7 @@ TEST(CommandStreamReceiverSimpleTest, givenNewResourceFlushEnabledWhenProvidingN DeviceBitfield deviceBitfield(1); MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield); MockGraphicsAllocation mockAllocation; - mockAllocation.setAllocationType(AllocationType::KERNEL_ISA); + mockAllocation.setAllocationType(AllocationType::kernelIsa); csr.useNewResourceImplicitFlush = true; csr.newResources = false; @@ -1761,7 +1761,7 @@ TEST(CommandStreamReceiverSimpleTest, givenMultipleActivePartitionsWhenWaitingFo size_t size = 100; auto gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(hostPtr)); - auto temporaryAllocation = std::make_unique(0, AllocationType::EXTERNAL_HOST_PTR, hostPtr, size, 0, + auto temporaryAllocation = std::make_unique(0, AllocationType::externalHostPtr, hostPtr, size, 0, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount, canonizedGpuAddress); temporaryAllocation->updateTaskCount(0u, 0u); csr.getInternalAllocationStorage()->storeAllocationWithTaskCount(std::move(temporaryAllocation), TEMPORARY_ALLOCATION, 2u); @@ -1871,7 +1871,7 @@ TEST_F(CreateAllocationForHostSurfaceTest, givenTemporaryAllocationWhenCreateAll size_t size = 100; auto gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(hostPtr)); - auto temporaryAllocation = std::make_unique(0, AllocationType::EXTERNAL_HOST_PTR, hostPtr, size, 0, + auto temporaryAllocation = std::make_unique(0, AllocationType::externalHostPtr, hostPtr, size, 0, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount, canonizedGpuAddress); auto allocationPtr = temporaryAllocation.get(); temporaryAllocation->updateTaskCount(0u, 0u); @@ -1901,7 +1901,7 @@ TEST_F(CreateAllocationForHostSurfaceTest, givenTemporaryAllocationWhenCreateAll size_t size = 100; auto gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(hostPtr)); - auto temporaryAllocation = std::make_unique(0, AllocationType::EXTERNAL_HOST_PTR, hostPtr, size, 0, + auto temporaryAllocation = std::make_unique(0, AllocationType::externalHostPtr, hostPtr, size, 0, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount, canonizedGpuAddress); auto allocationPtr = temporaryAllocation.get(); temporaryAllocation->updateTaskCount(0u, 0u); @@ -1920,7 +1920,7 @@ TEST_F(CreateAllocationForHostSurfaceTest, givenTemporaryAllocationWhenCreateAll size_t size = 100; auto gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(hostPtr)); - auto temporaryAllocation = std::make_unique(0, AllocationType::EXTERNAL_HOST_PTR, hostPtr, size, 0, + auto temporaryAllocation = std::make_unique(0, AllocationType::externalHostPtr, hostPtr, size, 0, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount, canonizedGpuAddress); auto allocationPtr = temporaryAllocation.get(); temporaryAllocation->updateTaskCount(10u, 0u); @@ -1958,7 +1958,7 @@ TEST_F(CreateAllocationForHostSurfaceTest, givenReadOnlyHostPointerWhenAllocatio bool runPopulateOsHandlesExpects = false; bool runAllocateGraphicsMemoryForNonSvmHostPtrExpects = false; - if (!mockMemoryManager->useNonSvmHostPtrAlloc(AllocationType::EXTERNAL_HOST_PTR, device->getRootDeviceIndex())) { + if (!mockMemoryManager->useNonSvmHostPtrAlloc(AllocationType::externalHostPtr, device->getRootDeviceIndex())) { runPopulateOsHandlesExpects = true; mockMemoryManager->populateOsHandlesResult = MemoryManager::AllocationStatus::InvalidHostPointer; } else { @@ -1997,7 +1997,7 @@ TEST_F(CreateAllocationForHostSurfaceTest, givenReadOnlyHostPointerWhenAllocatio bool runPopulateOsHandlesExpects = false; bool runAllocateGraphicsMemoryForNonSvmHostPtrExpects = false; - if (!mockMemoryManager->useNonSvmHostPtrAlloc(AllocationType::EXTERNAL_HOST_PTR, device->getRootDeviceIndex())) { + if (!mockMemoryManager->useNonSvmHostPtrAlloc(AllocationType::externalHostPtr, device->getRootDeviceIndex())) { runPopulateOsHandlesExpects = true; mockMemoryManager->populateOsHandlesResult = MemoryManager::AllocationStatus::InvalidHostPointer; } else { @@ -2042,7 +2042,7 @@ TEST_F(ReducedAddrSpaceCommandStreamReceiverTest, } TEST_F(CommandStreamReceiverTest, givenMinimumSizeDoesNotExceedCurrentWhenCallingEnsureCommandBufferAllocationThenDoNotReallocate) { - GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::commandBuffer, pDevice->getDeviceBitfield()}); LinearStream commandStream{allocation}; commandStreamReceiver->ensureCommandBufferAllocation(commandStream, 100u, 0u); @@ -2057,7 +2057,7 @@ TEST_F(CommandStreamReceiverTest, givenMinimumSizeDoesNotExceedCurrentWhenCallin } TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentWhenCallingEnsureCommandBufferAllocationThenReallocate) { - GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::commandBuffer, pDevice->getDeviceBitfield()}); LinearStream commandStream{allocation}; commandStreamReceiver->ensureCommandBufferAllocation(commandStream, 129u, 0u); @@ -2066,7 +2066,7 @@ TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentWhenCallingEnsur } TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentWhenCallingEnsureCommandBufferAllocationThenReallocateAndAlignSizeTo64kb) { - GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::commandBuffer, pDevice->getDeviceBitfield()}); LinearStream commandStream{allocation}; commandStreamReceiver->ensureCommandBufferAllocation(commandStream, 129u, 0u); @@ -2084,7 +2084,7 @@ TEST_F(CommandStreamReceiverTest, givenForceCommandBufferAlignmentWhenEnsureComm DebugManagerStateRestore restorer; debugManager.flags.ForceCommandBufferAlignment.set(2048); - GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::commandBuffer, pDevice->getDeviceBitfield()}); LinearStream commandStream{allocation}; commandStreamReceiver->ensureCommandBufferAllocation(commandStream, 129u, 0u); @@ -2095,7 +2095,7 @@ TEST_F(CommandStreamReceiverTest, givenForceCommandBufferAlignmentWhenEnsureComm } TEST_F(CommandStreamReceiverTest, givenAdditionalAllocationSizeWhenCallingEnsureCommandBufferAllocationThenSizesOfAllocationAndCommandBufferAreCorrect) { - GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::commandBuffer, pDevice->getDeviceBitfield()}); LinearStream commandStream{allocation}; commandStreamReceiver->ensureCommandBufferAllocation(commandStream, 129u, 350u); @@ -2117,7 +2117,7 @@ TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentAndNoAllocations } TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentAndAllocationsForReuseWhenCallingEnsureCommandBufferAllocationThenObtainAllocationFromInternalAllocationStorage) { - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize64k, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize64k, AllocationType::commandBuffer, pDevice->getDeviceBitfield()}); internalAllocationStorage->storeAllocation(std::unique_ptr{allocation}, REUSABLE_ALLOCATION); LinearStream commandStream; @@ -2149,7 +2149,7 @@ HWTEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentAndEarlyPreall } TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentAndNoSuitableReusableAllocationWhenCallingEnsureCommandBufferAllocationThenObtainAllocationMemoryManager) { - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize64k, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize64k, AllocationType::commandBuffer, pDevice->getDeviceBitfield()}); internalAllocationStorage->storeAllocation(std::unique_ptr{allocation}, REUSABLE_ALLOCATION); LinearStream commandStream; diff --git a/shared/test/unit_test/command_stream/compute_mode_tests.h b/shared/test/unit_test/command_stream/compute_mode_tests.h index b621c6c69f..fb21f9e2cf 100644 --- a/shared/test/unit_test/command_stream/compute_mode_tests.h +++ b/shared/test/unit_test/command_stream/compute_mode_tests.h @@ -83,7 +83,7 @@ struct ComputeModeRequirements : public ::testing::Test { csr = new MyCsr(*device->executionEnvironment, device->getDeviceBitfield()); device->resetCommandStreamReceiver(csr); - AllocationProperties properties(device->getRootDeviceIndex(), false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(device->getRootDeviceIndex(), false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, {}); alloc = device->getMemoryManager()->createGraphicsAllocationFromSharedHandle(static_cast(123), properties, false, false, true, nullptr); } diff --git a/shared/test/unit_test/command_stream/tbx_command_stream_tests.cpp b/shared/test/unit_test/command_stream/tbx_command_stream_tests.cpp index 840b6966d4..0f93ffd8b4 100644 --- a/shared/test/unit_test/command_stream/tbx_command_stream_tests.cpp +++ b/shared/test/unit_test/command_stream/tbx_command_stream_tests.cpp @@ -183,7 +183,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenWriteMemoryIsCa MemoryManager *memoryManager = tbxCsr->getMemoryManager(); ASSERT_NE(nullptr, memoryManager); - auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pCommandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pCommandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); ASSERT_NE(nullptr, graphicsAllocation); EXPECT_TRUE(tbxCsr->isTbxWritable(*graphicsAllocation)); @@ -199,7 +199,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenWriteMemoryIsCa MemoryManager *memoryManager = tbxCsr->getMemoryManager(); ASSERT_NE(nullptr, memoryManager); - auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pCommandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pCommandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); ASSERT_NE(nullptr, graphicsAllocation); tbxCsr->setTbxWritable(false, *graphicsAllocation); @@ -810,7 +810,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenProcessResidencyIsCalledWithDumpT memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); tbxCsr->setTbxWritable(false, *gfxAllocation); tbxCsr->dumpTbxNonWritable = true; @@ -830,7 +830,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenProcessResidencyIsCalledWithoutDu memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); tbxCsr->setTbxWritable(false, *gfxAllocation); EXPECT_FALSE(tbxCsr->dumpTbxNonWritable); @@ -923,7 +923,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWhenDumpAllocationIsCalle auto mockHardwareContext = static_cast(tbxCsr.hardwareContextController->hardwareContexts[0].get()); auto memoryManager = pDevice->getMemoryManager(); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); tbxCsr.dumpAllocation(*gfxAllocation); EXPECT_FALSE(mockHardwareContext->dumpSurfaceCalled); @@ -939,7 +939,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWritableWhenDumpAllocatio auto mockHardwareContext = static_cast(tbxCsr.hardwareContextController->hardwareContexts[0].get()); auto memoryManager = pDevice->getMemoryManager(); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); @@ -961,7 +961,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWritableWhenDumpAllocatio auto mockHardwareContext = static_cast(tbxCsr.hardwareContextController->hardwareContexts[0].get()); auto memoryManager = pDevice->getMemoryManager(); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); GmmRequirements gmmRequirements{}; @@ -989,7 +989,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWhenDumpAllocationIsCalle auto mockHardwareContext = static_cast(tbxCsr.hardwareContextController->hardwareContexts[0].get()); auto memoryManager = pDevice->getMemoryManager(); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); gfxAllocation->setAllocDumpable(false, false); @@ -1065,7 +1065,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWhenDumpAllocationIsCalle auto mockHardwareContext = static_cast(tbxCsr.hardwareContextController->hardwareContexts[0].get()); auto memoryManager = pDevice->getMemoryManager(); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); gfxAllocation->setAllocDumpable(false, false); @@ -1099,7 +1099,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWhenDumpAllocationIsCalle EXPECT_EQ(nullptr, executionEnvironment.rootDeviceEnvironments[0]->aubCenter->getAubManager()); auto memoryManager = pDevice->getMemoryManager(); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, pDevice->getDeviceBitfield()}); tbxCsr.dumpAllocation(*gfxAllocation); EXPECT_TRUE(tbxCsr.dumpAllocationCalled); @@ -1114,7 +1114,7 @@ HWTEST_F(TbxCommandStreamTests, givenTimestampBufferAllocationWhenTbxWriteMemory ASSERT_NE(nullptr, memoryManager); size_t alignedSize = MemoryConstants::pageSize64k; - AllocationType allocationType = NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER; + AllocationType allocationType = NEO::AllocationType::gpuTimestampDeviceBuffer; AllocationProperties allocationProperties{pDevice->getRootDeviceIndex(), true, diff --git a/shared/test/unit_test/debug_settings/debug_settings_manager_tests.cpp b/shared/test/unit_test/debug_settings/debug_settings_manager_tests.cpp index d0d1498a37..b0795c98c6 100644 --- a/shared/test/unit_test/debug_settings/debug_settings_manager_tests.cpp +++ b/shared/test/unit_test/debug_settings/debug_settings_manager_tests.cpp @@ -328,7 +328,7 @@ TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledOnDisabledDebugManagerW } TEST(AllocationInfoLogging, givenBaseGraphicsAllocationWhenGettingImplementationSpecificAllocationInfoThenReturnEmptyInfoString) { - GraphicsAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); + GraphicsAllocation graphicsAllocation(0, AllocationType::unknown, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); EXPECT_STREQ(graphicsAllocation.getAllocationInfoString().c_str(), ""); } diff --git a/shared/test/unit_test/debugger/linux/test_l0_debugger_linux.cpp b/shared/test/unit_test/debugger/linux/test_l0_debugger_linux.cpp index 790cdf769b..1f2ab30976 100644 --- a/shared/test/unit_test/debugger/linux/test_l0_debugger_linux.cpp +++ b/shared/test/unit_test/debugger/linux/test_l0_debugger_linux.cpp @@ -75,7 +75,7 @@ TEST_F(L0DebuggerSharedLinuxTest, givenNoOSInterfaceThenRegisterElfAndLinkWithAl debugData.vIsaSize = 10; drmMock->registeredDataSize = 0; - MockDrmAllocation isaAllocation(neoDevice->getRootDeviceIndex(), AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); + MockDrmAllocation isaAllocation(neoDevice->getRootDeviceIndex(), AllocationType::kernelIsa, MemoryPool::System4KBPages); MockBufferObject bo(neoDevice->getRootDeviceIndex(), drmMock, 3, 0, 0, 1); isaAllocation.bufferObjects[0] = &bo; diff --git a/shared/test/unit_test/debugger/test_l0_debugger.cpp b/shared/test/unit_test/debugger/test_l0_debugger.cpp index c3921be3d3..121088aa23 100644 --- a/shared/test/unit_test/debugger/test_l0_debugger.cpp +++ b/shared/test/unit_test/debugger/test_l0_debugger.cpp @@ -95,7 +95,7 @@ TEST(Debugger, givenDebuggingEnabledInExecEnvWhenAllocatingIsaThenSingleBankIsUs std::unique_ptr neoDevice(NEO::MockDevice::create(executionEnvironment, 0u)); auto allocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {neoDevice->getRootDeviceIndex(), 4096, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()}); + {neoDevice->getRootDeviceIndex(), 4096, NEO::AllocationType::kernelIsa, neoDevice->getDeviceBitfield()}); if (allocation->getMemoryPool() == MemoryPool::LocalMemory) { EXPECT_EQ(1u, allocation->storageInfo.getMemoryBanks()); @@ -123,7 +123,7 @@ TEST(Debugger, givenTileAttachAndDebuggingEnabledInExecEnvWhenAllocatingIsaThenM std::unique_ptr neoDevice(NEO::MockDevice::create(executionEnvironment, 0u)); auto allocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {neoDevice->getRootDeviceIndex(), 4096, NEO::AllocationType::KERNEL_ISA, DeviceBitfield{3}}); + {neoDevice->getRootDeviceIndex(), 4096, NEO::AllocationType::kernelIsa, DeviceBitfield{3}}); if (allocation->getMemoryPool() == MemoryPool::LocalMemory) { EXPECT_EQ(3u, allocation->storageInfo.getMemoryBanks()); @@ -170,7 +170,7 @@ HWTEST_F(L0DebuggerTest, givenDebuggerWithoutMemoryOperationsHandlerWhenNotifyin auto debugger = std::make_unique>(pDevice); StackVec allocs; - NEO::GraphicsAllocation alloc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, + NEO::GraphicsAllocation alloc(0, NEO::AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); allocs.push_back(&alloc); @@ -199,7 +199,7 @@ HWTEST_F(L0DebuggerTest, givenDebuggerWhenCreatedThenModuleHeapDebugAreaIsCreate EXPECT_EQ(1, memoryOperationsHandler->makeResidentCalledCount); auto allocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {neoDevice->getRootDeviceIndex(), 4096, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()}); + {neoDevice->getRootDeviceIndex(), 4096, NEO::AllocationType::kernelIsa, neoDevice->getDeviceBitfield()}); EXPECT_EQ(allocation->storageInfo.getMemoryBanks(), debugArea->storageInfo.getMemoryBanks()); diff --git a/shared/test/unit_test/debugger/test_l0_debugger_single_address_space.cpp b/shared/test/unit_test/debugger/test_l0_debugger_single_address_space.cpp index 134f077d0b..de8cb7e852 100644 --- a/shared/test/unit_test/debugger/test_l0_debugger_single_address_space.cpp +++ b/shared/test/unit_test/debugger/test_l0_debugger_single_address_space.cpp @@ -69,7 +69,7 @@ HWTEST_F(SingleAddressSpaceFixture, givenSingleAddressSpaceWhenDebuggerIsCreated auto sbaAllocation = debugger->getSbaTrackingBuffer(engine.osContext->getContextId()); ASSERT_NE(nullptr, sbaAllocation); allocations.push_back(sbaAllocation); - EXPECT_EQ(NEO::AllocationType::DEBUG_SBA_TRACKING_BUFFER, sbaAllocation->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::debugSbaTrackingBuffer, sbaAllocation->getAllocationType()); } for (uint32_t i = 0; i < allocations.size() - 1; i++) { @@ -119,7 +119,7 @@ HWTEST2_P(L0DebuggerBBlevelParameterizedTest, GivenNonZeroSbaAddressesWhenProgra AllocationProperties commandBufferProperties = {pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, - AllocationType::COMMAND_BUFFER, + AllocationType::commandBuffer, false, pDevice->getDeviceBitfield()}; auto streamAllocation = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(commandBufferProperties); @@ -239,7 +239,7 @@ HWTEST2_P(L0DebuggerBBlevelParameterizedTest, GivenOneNonZeroSbaAddressesWhenPro AllocationProperties commandBufferProperties = {pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, - AllocationType::COMMAND_BUFFER, + AllocationType::commandBuffer, false, pDevice->getDeviceBitfield()}; auto streamAllocation = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(commandBufferProperties); @@ -345,7 +345,7 @@ HWTEST2_F(SingleAddressSpaceFixture, GivenAllZeroSbaAddressesWhenProgrammingSbaT AllocationProperties commandBufferProperties = {pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, - AllocationType::COMMAND_BUFFER, + AllocationType::commandBuffer, false, pDevice->getDeviceBitfield()}; auto streamAllocation = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(commandBufferProperties); diff --git a/shared/test/unit_test/direct_submission/direct_submission_tests_2.cpp b/shared/test/unit_test/direct_submission/direct_submission_tests_2.cpp index 4c0cad44d5..ebeeea2b21 100644 --- a/shared/test/unit_test/direct_submission/direct_submission_tests_2.cpp +++ b/shared/test/unit_test/direct_submission/direct_submission_tests_2.cpp @@ -1520,13 +1520,13 @@ HWTEST_F(DirectSubmissionRelaxedOrderingTests, whenAllocatingResourcesThenCreate auto allocsIter = mockMemoryOperations->gfxAllocationsForMakeResident.rbegin(); - EXPECT_EQ(AllocationType::COMMAND_BUFFER, directSubmission.relaxedOrderingSchedulerAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::commandBuffer, directSubmission.relaxedOrderingSchedulerAllocation->getAllocationType()); EXPECT_NE(nullptr, directSubmission.relaxedOrderingSchedulerAllocation); EXPECT_EQ(directSubmission.relaxedOrderingSchedulerAllocation, *allocsIter); allocsIter++; - EXPECT_EQ(AllocationType::DEFERRED_TASKS_LIST, directSubmission.deferredTasksListAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::deferredTasksList, directSubmission.deferredTasksListAllocation->getAllocationType()); EXPECT_NE(nullptr, directSubmission.deferredTasksListAllocation); EXPECT_EQ(directSubmission.deferredTasksListAllocation, *allocsIter); } diff --git a/shared/test/unit_test/direct_submission/linux/drm_direct_submission_tests.cpp b/shared/test/unit_test/direct_submission/linux/drm_direct_submission_tests.cpp index eed463038f..4115354b7c 100644 --- a/shared/test/unit_test/direct_submission/linux/drm_direct_submission_tests.cpp +++ b/shared/test/unit_test/direct_submission/linux/drm_direct_submission_tests.cpp @@ -969,7 +969,7 @@ HWTEST_F(DrmDirectSubmissionTest, LinearStream stream; const AllocationProperties commandBufferProperties{device->getRootDeviceIndex(), 0x1000, - AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()}; + AllocationType::commandBuffer, device->getDeviceBitfield()}; commandBuffer = executionEnvironment.memoryManager->allocateGraphicsMemoryWithProperties(commandBufferProperties); stream.replaceGraphicsAllocation(commandBuffer); @@ -1027,7 +1027,7 @@ HWTEST_F(DrmDirectSubmissionTest, LinearStream stream; const AllocationProperties commandBufferProperties{device->getRootDeviceIndex(), 0x1000, - AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()}; + AllocationType::commandBuffer, device->getDeviceBitfield()}; commandBuffer = executionEnvironment.memoryManager->allocateGraphicsMemoryWithProperties(commandBufferProperties); stream.replaceGraphicsAllocation(commandBuffer); diff --git a/shared/test/unit_test/direct_submission/windows/wddm_direct_submission_tests.cpp b/shared/test/unit_test/direct_submission/windows/wddm_direct_submission_tests.cpp index 93daf05b42..b5ce57b906 100644 --- a/shared/test/unit_test/direct_submission/windows/wddm_direct_submission_tests.cpp +++ b/shared/test/unit_test/direct_submission/windows/wddm_direct_submission_tests.cpp @@ -181,7 +181,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenAllocateOsResourcesFenceCreation MemoryManager *memoryManager = device->getExecutionEnvironment()->memoryManager.get(); const auto allocationSize = MemoryConstants::pageSize; const AllocationProperties commandStreamAllocationProperties{device->getRootDeviceIndex(), allocationSize, - AllocationType::RING_BUFFER, device->getDeviceBitfield()}; + AllocationType::ringBuffer, device->getDeviceBitfield()}; GraphicsAllocation *ringBuffer = memoryManager->allocateGraphicsMemoryWithProperties(commandStreamAllocationProperties); ASSERT_NE(nullptr, ringBuffer); @@ -718,7 +718,7 @@ HWTEST_F(WddmDirectSubmissionTest, auto memoryManager = executionEnvironment->memoryManager.get(); const AllocationProperties commandBufferProperties{device->getRootDeviceIndex(), 0x1000, - AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()}; + AllocationType::commandBuffer, device->getDeviceBitfield()}; clientCommandBuffer = memoryManager->allocateGraphicsMemoryWithProperties(commandBufferProperties); ASSERT_NE(nullptr, clientCommandBuffer); @@ -784,7 +784,7 @@ HWTEST_F(WddmDirectSubmissionTest, auto memoryManager = executionEnvironment->memoryManager.get(); const AllocationProperties commandBufferProperties{device->getRootDeviceIndex(), 0x1000, - AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()}; + AllocationType::commandBuffer, device->getDeviceBitfield()}; clientCommandBuffer = memoryManager->allocateGraphicsMemoryWithProperties(commandBufferProperties); ASSERT_NE(nullptr, clientCommandBuffer); @@ -893,7 +893,7 @@ HWTEST_F(WddmDirectSubmissionTest, auto memoryManager = executionEnvironment->memoryManager.get(); const AllocationProperties commandBufferProperties{device->getRootDeviceIndex(), 0x1000, - AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()}; + AllocationType::commandBuffer, device->getDeviceBitfield()}; clientCommandBuffer = memoryManager->allocateGraphicsMemoryWithProperties(commandBufferProperties); ASSERT_NE(nullptr, clientCommandBuffer); @@ -956,7 +956,7 @@ HWTEST_F(WddmDirectSubmissionTest, auto memoryManager = executionEnvironment->memoryManager.get(); const AllocationProperties commandBufferProperties{device->getRootDeviceIndex(), 0x1000, - AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()}; + AllocationType::commandBuffer, device->getDeviceBitfield()}; clientCommandBuffer = memoryManager->allocateGraphicsMemoryWithProperties(commandBufferProperties); ASSERT_NE(nullptr, clientCommandBuffer); @@ -1015,7 +1015,7 @@ HWTEST_F(WddmDirectSubmissionTest, auto memoryManager = executionEnvironment->memoryManager.get(); const AllocationProperties commandBufferProperties{device->getRootDeviceIndex(), 0x1000, - AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()}; + AllocationType::commandBuffer, device->getDeviceBitfield()}; clientCommandBuffer = memoryManager->allocateGraphicsMemoryWithProperties(commandBufferProperties); ASSERT_NE(nullptr, clientCommandBuffer); diff --git a/shared/test/unit_test/encoders/test_encode_states.cpp b/shared/test/unit_test/encoders/test_encode_states.cpp index 6e92028cbe..5a92c7dec6 100644 --- a/shared/test/unit_test/encoders/test_encode_states.cpp +++ b/shared/test/unit_test/encoders/test_encode_states.cpp @@ -278,7 +278,7 @@ HWTEST_F(CommandEncodeStatesTest, givenCreatedSurfaceStateBufferWhenAllocationPr uint64_t gpuAddr = 0x4000u; size_t allocSize = size; length.length = static_cast(allocSize - 1); - GraphicsAllocation allocation(0, AllocationType::UNKNOWN, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1); + GraphicsAllocation allocation(0, AllocationType::unknown, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1); NEO::EncodeSurfaceStateArgs args; args.outMemory = stateBuffer; diff --git a/shared/test/unit_test/fixtures/direct_submission_fixture.h b/shared/test/unit_test/fixtures/direct_submission_fixture.h index dc85742b0d..be6a233c5b 100644 --- a/shared/test/unit_test/fixtures/direct_submission_fixture.h +++ b/shared/test/unit_test/fixtures/direct_submission_fixture.h @@ -42,7 +42,7 @@ struct DirectSubmissionDispatchBufferFixture : public DirectSubmissionFixture { DirectSubmissionFixture::setUp(); MemoryManager *memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); const AllocationProperties commandBufferProperties{pDevice->getRootDeviceIndex(), 0x1000, - AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}; + AllocationType::commandBuffer, pDevice->getDeviceBitfield()}; commandBuffer = memoryManager->allocateGraphicsMemoryWithProperties(commandBufferProperties); stream = std::make_unique(commandBuffer); stream->getSpace(0x40); diff --git a/shared/test/unit_test/gen12lp/coherency_tests_gen12lp.inl b/shared/test/unit_test/gen12lp/coherency_tests_gen12lp.inl index 05301b7540..ac49cbdda2 100644 --- a/shared/test/unit_test/gen12lp/coherency_tests_gen12lp.inl +++ b/shared/test/unit_test/gen12lp/coherency_tests_gen12lp.inl @@ -45,7 +45,7 @@ struct Gen12LpCoherencyRequirements : public ::testing::Test { device.reset(MockDevice::createWithNewExecutionEnvironment(defaultHwInfo.get())); csr = new MyCsr(*device->executionEnvironment); device->resetCommandStreamReceiver(csr); - AllocationProperties properties(device->getRootDeviceIndex(), false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(device->getRootDeviceIndex(), false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, {}); alloc = device->getMemoryManager()->createGraphicsAllocationFromSharedHandle(static_cast(123), properties, false, false, true, nullptr); } diff --git a/shared/test/unit_test/gen12lp/dg1/gfx_core_helper_tests_dg1.cpp b/shared/test/unit_test/gen12lp/dg1/gfx_core_helper_tests_dg1.cpp index a8851be9f6..1e4b8cb4ea 100644 --- a/shared/test/unit_test/gen12lp/dg1/gfx_core_helper_tests_dg1.cpp +++ b/shared/test/unit_test/gen12lp/dg1/gfx_core_helper_tests_dg1.cpp @@ -69,7 +69,7 @@ DG1TEST_F(GfxCoreHelperTestDg1, givenBufferAllocationTypeWhenSetExtraAllocationD const auto &gfxCoreHelper = getHelper(); AllocationData allocData{}; allocData.flags.useSystemMemory = true; - AllocationProperties allocProperties(0, 1, AllocationType::BUFFER, {}); + AllocationProperties allocProperties(0, 1, AllocationType::buffer, {}); allocData.storageInfo.isLockable = false; allocProperties.flags.shareable = false; gfxCoreHelper.setExtraAllocationData(allocData, allocProperties, pDevice->getRootDeviceEnvironment()); @@ -80,7 +80,7 @@ DG1TEST_F(GfxCoreHelperTestDg1, givenBufferAllocationTypeWhenSetExtraAllocationD const auto &gfxCoreHelper = getHelper(); AllocationData allocData{}; allocData.flags.useSystemMemory = true; - AllocationProperties allocProperties(0, 1, AllocationType::BUFFER, {}); + AllocationProperties allocProperties(0, 1, AllocationType::buffer, {}); allocData.storageInfo.isLockable = false; allocProperties.flags.shareable = true; gfxCoreHelper.setExtraAllocationData(allocData, allocProperties, pDevice->getRootDeviceEnvironment()); diff --git a/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp b/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp index 75acfdc818..2aca28a262 100644 --- a/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp +++ b/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp @@ -682,7 +682,7 @@ TEST(GmmTest, givenHwInfoWhenDeviceIsCreatedThenSetThisHwInfoToGmmHelper) { TEST(GmmTest, givenAllocationTypeWhenGettingUsageTypeThenReturnCorrectValue) { MockExecutionEnvironment mockExecutionEnvironment{}; const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); - for (uint32_t i = 0; i < static_cast(AllocationType::COUNT); i++) { + for (uint32_t i = 0; i < static_cast(AllocationType::count); i++) { auto allocationType = static_cast(i); for (auto forceUncached : {true, false}) { @@ -690,30 +690,30 @@ TEST(GmmTest, givenAllocationTypeWhenGettingUsageTypeThenReturnCorrectValue) { auto expectedUsage = GMM_RESOURCE_USAGE_UNKNOWN; switch (allocationType) { - case AllocationType::CONSTANT_SURFACE: + case AllocationType::constantSurface: expectedUsage = forceUncached ? GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED : GMM_RESOURCE_USAGE_OCL_BUFFER_CONST; break; - case AllocationType::IMAGE: + case AllocationType::image: expectedUsage = forceUncached ? GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED : GMM_RESOURCE_USAGE_OCL_IMAGE; break; - case AllocationType::PREEMPTION: + case AllocationType::preemption: expectedUsage = forceUncached ? GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC : GMM_RESOURCE_USAGE_OCL_BUFFER; break; - case AllocationType::INTERNAL_HEAP: - case AllocationType::LINEAR_STREAM: + case AllocationType::internalHeap: + case AllocationType::linearStream: expectedUsage = forceUncached ? GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED : GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER; break; - case AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: - case AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: + case AllocationType::gpuTimestampDeviceBuffer: + case AllocationType::timestampPacketTagBuffer: expectedUsage = (forceUncached || productHelper.isDcFlushAllowed()) ? GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED : GMM_RESOURCE_USAGE_OCL_BUFFER; break; - case AllocationType::BUFFER_HOST_MEMORY: - case AllocationType::INTERNAL_HOST_MEMORY: - case AllocationType::MAP_ALLOCATION: - case AllocationType::FILL_PATTERN: - case AllocationType::SVM_CPU: - case AllocationType::SVM_ZERO_COPY: + case AllocationType::bufferHostMemory: + case AllocationType::internalHostMemory: + case AllocationType::mapAllocation: + case AllocationType::fillPattern: + case AllocationType::svmCpu: + case AllocationType::svmZeroCopy: expectedUsage = forceUncached ? GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED : GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; break; default: @@ -732,16 +732,16 @@ TEST(GmmTest, givenForceAllResourcesUncachedFlagSetWhenGettingUsageTypeThenRetur MockExecutionEnvironment mockExecutionEnvironment{}; const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); - for (uint32_t i = 0; i < static_cast(AllocationType::COUNT); i++) { + for (uint32_t i = 0; i < static_cast(AllocationType::count); i++) { auto allocationType = static_cast(i); auto usage = CacheSettingsHelper::getGmmUsageType(allocationType, false, productHelper); auto expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED; - if (allocationType == AllocationType::PREEMPTION) { + if (allocationType == AllocationType::preemption) { expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC; - } else if ((allocationType == AllocationType::INTERNAL_HEAP) || (allocationType == AllocationType::LINEAR_STREAM)) { + } else if ((allocationType == AllocationType::internalHeap) || (allocationType == AllocationType::linearStream)) { expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED; } @@ -774,10 +774,10 @@ TEST(GmmTest, givenInternalHeapOrLinearStreamWhenDebugFlagIsSetThenReturnUncache MockExecutionEnvironment mockExecutionEnvironment{}; const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); - auto usage = CacheSettingsHelper::getGmmUsageType(AllocationType::INTERNAL_HEAP, false, productHelper); + auto usage = CacheSettingsHelper::getGmmUsageType(AllocationType::internalHeap, false, productHelper); EXPECT_EQ(GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED, usage); - usage = CacheSettingsHelper::getGmmUsageType(AllocationType::LINEAR_STREAM, false, productHelper); + usage = CacheSettingsHelper::getGmmUsageType(AllocationType::linearStream, false, productHelper); EXPECT_EQ(GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED, usage); } @@ -788,7 +788,7 @@ TEST(GmmTest, givenConstSurfaceWhenDebugFlagIsSetThenReturnUncachedType) { const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); EXPECT_EQ(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED, - CacheSettingsHelper::getGmmUsageType(AllocationType::CONSTANT_SURFACE, false, productHelper)); + CacheSettingsHelper::getGmmUsageType(AllocationType::constantSurface, false, productHelper)); } TEST(GmmTest, givenUncachedDebugFlagMaskSetWhenAskingForUsageTypeThenReturnUncached) { @@ -797,19 +797,19 @@ TEST(GmmTest, givenUncachedDebugFlagMaskSetWhenAskingForUsageTypeThenReturnUncac MockExecutionEnvironment mockExecutionEnvironment{}; const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); - constexpr int64_t bufferMask = 1 << (static_cast(AllocationType::BUFFER) - 1); - constexpr int64_t imageMask = 1 << (static_cast(AllocationType::IMAGE) - 1); + constexpr int64_t bufferMask = 1 << (static_cast(AllocationType::buffer) - 1); + constexpr int64_t imageMask = 1 << (static_cast(AllocationType::image) - 1); debugManager.flags.ForceUncachedGmmUsageType.set(bufferMask | imageMask); EXPECT_EQ(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED, - CacheSettingsHelper::getGmmUsageType(AllocationType::BUFFER, false, productHelper)); + CacheSettingsHelper::getGmmUsageType(AllocationType::buffer, false, productHelper)); EXPECT_EQ(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED, - CacheSettingsHelper::getGmmUsageType(AllocationType::IMAGE, false, productHelper)); + CacheSettingsHelper::getGmmUsageType(AllocationType::image, false, productHelper)); EXPECT_NE(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED, - CacheSettingsHelper::getGmmUsageType(AllocationType::BUFFER_HOST_MEMORY, false, productHelper)); + CacheSettingsHelper::getGmmUsageType(AllocationType::bufferHostMemory, false, productHelper)); } TEST(GmmTest, givenAllocationForStatefulAccessWhenDebugFlagIsSetThenReturnUncachedType) { @@ -817,17 +817,17 @@ TEST(GmmTest, givenAllocationForStatefulAccessWhenDebugFlagIsSetThenReturnUncach debugManager.flags.DisableCachingForStatefulBufferAccess.set(true); MockExecutionEnvironment mockExecutionEnvironment{}; const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); - for (auto allocType : {AllocationType::BUFFER, - AllocationType::BUFFER_HOST_MEMORY, - AllocationType::EXTERNAL_HOST_PTR, - AllocationType::FILL_PATTERN, - AllocationType::INTERNAL_HOST_MEMORY, - AllocationType::MAP_ALLOCATION, - AllocationType::SHARED_BUFFER, - AllocationType::SVM_CPU, - AllocationType::SVM_GPU, - AllocationType::SVM_ZERO_COPY, - AllocationType::UNIFIED_SHARED_MEMORY}) { + for (auto allocType : {AllocationType::buffer, + AllocationType::bufferHostMemory, + AllocationType::externalHostPtr, + AllocationType::fillPattern, + AllocationType::internalHostMemory, + AllocationType::mapAllocation, + AllocationType::sharedBuffer, + AllocationType::svmCpu, + AllocationType::svmGpu, + AllocationType::svmZeroCopy, + AllocationType::unifiedSharedMemory}) { EXPECT_EQ(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED, CacheSettingsHelper::getGmmUsageType(allocType, false, productHelper)); } diff --git a/shared/test/unit_test/heap_assigner/heap_assigner_tests.cpp b/shared/test/unit_test/heap_assigner/heap_assigner_tests.cpp index be51634b46..12e4347aee 100644 --- a/shared/test/unit_test/heap_assigner/heap_assigner_tests.cpp +++ b/shared/test/unit_test/heap_assigner/heap_assigner_tests.cpp @@ -21,34 +21,34 @@ class AlocationHelperTests : public Test { HWTEST_F(AlocationHelperTests, givenKernelIsaTypeWhenUse32BitHeapCalledThenTrueReturned) { - EXPECT_TRUE(heapAssigner.use32BitHeap(AllocationType::KERNEL_ISA)); - EXPECT_TRUE(heapAssigner.use32BitHeap(AllocationType::KERNEL_ISA_INTERNAL)); + EXPECT_TRUE(heapAssigner.use32BitHeap(AllocationType::kernelIsa)); + EXPECT_TRUE(heapAssigner.use32BitHeap(AllocationType::kernelIsaInternal)); } HWTEST_F(AlocationHelperTests, givenKernelIsaTypeWhenUseIternalAllocatorThenUseHeapInternal) { - auto heapIndex = heapAssigner.get32BitHeapIndex(AllocationType::KERNEL_ISA, true, *defaultHwInfo, false); + auto heapIndex = heapAssigner.get32BitHeapIndex(AllocationType::kernelIsa, true, *defaultHwInfo, false); EXPECT_EQ(heapIndex, NEO::HeapIndex::HEAP_INTERNAL_DEVICE_MEMORY); - heapIndex = heapAssigner.get32BitHeapIndex(AllocationType::KERNEL_ISA_INTERNAL, true, *defaultHwInfo, false); + heapIndex = heapAssigner.get32BitHeapIndex(AllocationType::kernelIsaInternal, true, *defaultHwInfo, false); EXPECT_EQ(heapIndex, NEO::HeapIndex::HEAP_INTERNAL_DEVICE_MEMORY); } HWTEST_F(AlocationHelperTests, givenNotInternalTypeWhenUseIternalAllocatorThenUseHeapExternal) { - auto heapIndex = heapAssigner.get32BitHeapIndex(AllocationType::LINEAR_STREAM, true, *defaultHwInfo, false); + auto heapIndex = heapAssigner.get32BitHeapIndex(AllocationType::linearStream, true, *defaultHwInfo, false); EXPECT_EQ(heapIndex, NEO::HeapIndex::HEAP_EXTERNAL_DEVICE_MEMORY); } HWTEST_F(AlocationHelperTests, givenKernelIsaTypesWhenUseInternalAllocatorCalledThenTrueReturned) { - EXPECT_TRUE(heapAssigner.useInternal32BitHeap(AllocationType::KERNEL_ISA)); - EXPECT_TRUE(heapAssigner.useInternal32BitHeap(AllocationType::KERNEL_ISA_INTERNAL)); + EXPECT_TRUE(heapAssigner.useInternal32BitHeap(AllocationType::kernelIsa)); + EXPECT_TRUE(heapAssigner.useInternal32BitHeap(AllocationType::kernelIsaInternal)); } HWTEST_F(AlocationHelperTests, givenInternalHeapTypeWhenUseInternalAllocatorCalledThenTrueReturned) { - EXPECT_TRUE(heapAssigner.useInternal32BitHeap(AllocationType::INTERNAL_HEAP)); + EXPECT_TRUE(heapAssigner.useInternal32BitHeap(AllocationType::internalHeap)); } HWTEST_F(AlocationHelperTests, givenNotInternalHeapTypeWhenUseInternalAllocatorCalledThenFalseReturned) { - EXPECT_FALSE(heapAssigner.useInternal32BitHeap(AllocationType::BUFFER)); + EXPECT_FALSE(heapAssigner.useInternal32BitHeap(AllocationType::buffer)); } } // namespace NEO diff --git a/shared/test/unit_test/helpers/app_resource_tests.cpp b/shared/test/unit_test/helpers/app_resource_tests.cpp index b9930e258c..8501738ac2 100644 --- a/shared/test/unit_test/helpers/app_resource_tests.cpp +++ b/shared/test/unit_test/helpers/app_resource_tests.cpp @@ -37,8 +37,8 @@ TEST_F(AppResourceTests, givenIncorrectGraphicsAllocationTypeWhenGettingResource } TEST_F(AppResourceTests, givenGraphicsAllocationTypeWhenGettingResourceTagThenForEveryDefinedTypeProperTagExist) { - auto firstTypeIdx = static_cast(AllocationType::UNKNOWN); - auto lastTypeIdx = static_cast(AllocationType::COUNT); + auto firstTypeIdx = static_cast(AllocationType::unknown); + auto lastTypeIdx = static_cast(AllocationType::count); for (int typeIdx = firstTypeIdx; typeIdx < lastTypeIdx; typeIdx++) { auto allocationType = static_cast(typeIdx); @@ -54,54 +54,54 @@ struct AllocationTypeTagTestCase { const char *str; }; -AllocationTypeTagTestCase allocationTypeTagValues[static_cast(AllocationType::COUNT)] = { - {AllocationType::BUFFER, "BUFFER"}, - {AllocationType::BUFFER_HOST_MEMORY, "BFHSTMEM"}, - {AllocationType::COMMAND_BUFFER, "CMNDBUFF"}, - {AllocationType::CONSTANT_SURFACE, "CSNTSRFC"}, - {AllocationType::EXTERNAL_HOST_PTR, "EXHSTPTR"}, - {AllocationType::FILL_PATTERN, "FILPATRN"}, - {AllocationType::GLOBAL_SURFACE, "GLBLSRFC"}, - {AllocationType::IMAGE, "IMAGE"}, - {AllocationType::INDIRECT_OBJECT_HEAP, "INOBHEAP"}, - {AllocationType::INSTRUCTION_HEAP, "INSTHEAP"}, - {AllocationType::INTERNAL_HEAP, "INTLHEAP"}, - {AllocationType::INTERNAL_HOST_MEMORY, "INHSTMEM"}, - {AllocationType::KERNEL_ARGS_BUFFER, "KARGBUF"}, - {AllocationType::KERNEL_ISA, "KERNLISA"}, - {AllocationType::KERNEL_ISA_INTERNAL, "KRLISAIN"}, - {AllocationType::LINEAR_STREAM, "LINRSTRM"}, - {AllocationType::MAP_ALLOCATION, "MAPALLOC"}, - {AllocationType::MCS, "MCS"}, - {AllocationType::PIPE, "PIPE"}, - {AllocationType::PREEMPTION, "PRMPTION"}, - {AllocationType::PRINTF_SURFACE, "PRNTSRFC"}, - {AllocationType::PRIVATE_SURFACE, "PRVTSRFC"}, - {AllocationType::PROFILING_TAG_BUFFER, "PROFTGBF"}, - {AllocationType::SCRATCH_SURFACE, "SCRHSRFC"}, - {AllocationType::WORK_PARTITION_SURFACE, "WRPRTSRF"}, - {AllocationType::SHARED_BUFFER, "SHRDBUFF"}, - {AllocationType::SHARED_IMAGE, "SHERDIMG"}, - {AllocationType::SHARED_RESOURCE_COPY, "SRDRSCCP"}, - {AllocationType::SURFACE_STATE_HEAP, "SRFCSTHP"}, - {AllocationType::SVM_CPU, "SVM_CPU"}, - {AllocationType::SVM_GPU, "SVM_GPU"}, - {AllocationType::SVM_ZERO_COPY, "SVM0COPY"}, - {AllocationType::TAG_BUFFER, "TAGBUFER"}, - {AllocationType::GLOBAL_FENCE, "GLBLFENC"}, - {AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, "TSPKTGBF"}, - {AllocationType::UNKNOWN, "UNKNOWN"}, - {AllocationType::WRITE_COMBINED, "WRTCMBND"}, - {AllocationType::RING_BUFFER, "RINGBUFF"}, - {AllocationType::SEMAPHORE_BUFFER, "SMPHRBUF"}, - {AllocationType::DEBUG_CONTEXT_SAVE_AREA, "DBCXSVAR"}, - {AllocationType::DEBUG_SBA_TRACKING_BUFFER, "DBSBATRB"}, - {AllocationType::DEBUG_MODULE_AREA, "DBMDLARE"}, - {AllocationType::UNIFIED_SHARED_MEMORY, "USHRDMEM"}, - {AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, "GPUTSDBF"}, - {AllocationType::SW_TAG_BUFFER, "SWTAGBF"}, - {AllocationType::DEFERRED_TASKS_LIST, "TSKLIST"}, - {AllocationType::ASSERT_BUFFER, "ASSRTBUF"}}; +AllocationTypeTagTestCase allocationTypeTagValues[static_cast(AllocationType::count)] = { + {AllocationType::buffer, "BUFFER"}, + {AllocationType::bufferHostMemory, "BFHSTMEM"}, + {AllocationType::commandBuffer, "CMNDBUFF"}, + {AllocationType::constantSurface, "CSNTSRFC"}, + {AllocationType::externalHostPtr, "EXHSTPTR"}, + {AllocationType::fillPattern, "FILPATRN"}, + {AllocationType::globalSurface, "GLBLSRFC"}, + {AllocationType::image, "IMAGE"}, + {AllocationType::indirectObjectHeap, "INOBHEAP"}, + {AllocationType::instructionHeap, "INSTHEAP"}, + {AllocationType::internalHeap, "INTLHEAP"}, + {AllocationType::internalHostMemory, "INHSTMEM"}, + {AllocationType::kernelArgsBuffer, "KARGBUF"}, + {AllocationType::kernelIsa, "KERNLISA"}, + {AllocationType::kernelIsaInternal, "KRLISAIN"}, + {AllocationType::linearStream, "LINRSTRM"}, + {AllocationType::mapAllocation, "MAPALLOC"}, + {AllocationType::mcs, "MCS"}, + {AllocationType::pipe, "PIPE"}, + {AllocationType::preemption, "PRMPTION"}, + {AllocationType::printfSurface, "PRNTSRFC"}, + {AllocationType::privateSurface, "PRVTSRFC"}, + {AllocationType::profilingTagBuffer, "PROFTGBF"}, + {AllocationType::scratchSurface, "SCRHSRFC"}, + {AllocationType::workPartitionSurface, "WRPRTSRF"}, + {AllocationType::sharedBuffer, "SHRDBUFF"}, + {AllocationType::sharedImage, "SHERDIMG"}, + {AllocationType::sharedResourceCopy, "SRDRSCCP"}, + {AllocationType::surfaceStateHeap, "SRFCSTHP"}, + {AllocationType::svmCpu, "SVM_CPU"}, + {AllocationType::svmGpu, "SVM_GPU"}, + {AllocationType::svmZeroCopy, "SVM0COPY"}, + {AllocationType::tagBuffer, "TAGBUFER"}, + {AllocationType::globalFence, "GLBLFENC"}, + {AllocationType::timestampPacketTagBuffer, "TSPKTGBF"}, + {AllocationType::unknown, "UNKNOWN"}, + {AllocationType::writeCombined, "WRTCMBND"}, + {AllocationType::ringBuffer, "RINGBUFF"}, + {AllocationType::semaphoreBuffer, "SMPHRBUF"}, + {AllocationType::debugContextSaveArea, "DBCXSVAR"}, + {AllocationType::debugSbaTrackingBuffer, "DBSBATRB"}, + {AllocationType::debugModuleArea, "DBMDLARE"}, + {AllocationType::unifiedSharedMemory, "USHRDMEM"}, + {AllocationType::gpuTimestampDeviceBuffer, "GPUTSDBF"}, + {AllocationType::swTagBuffer, "SWTAGBF"}, + {AllocationType::deferredTasksList, "TSKLIST"}, + {AllocationType::assertBuffer, "ASSRTBUF"}}; class AllocationTypeTagString : public ::testing::TestWithParam {}; TEST_P(AllocationTypeTagString, givenGraphicsAllocationTypeWhenCopyTagToStorageInfoThenCorrectTagIsReturned) { diff --git a/shared/test/unit_test/helpers/bindless_heaps_helper_tests.cpp b/shared/test/unit_test/helpers/bindless_heaps_helper_tests.cpp index 0c3daf5f1d..c3b4b54bee 100644 --- a/shared/test/unit_test/helpers/bindless_heaps_helper_tests.cpp +++ b/shared/test/unit_test/helpers/bindless_heaps_helper_tests.cpp @@ -126,14 +126,14 @@ TEST_F(BindlessHeapsHelperTests, givenBindlessHeapHelperWhenAllocateSsInHeapForI memManager->mockExecutionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->bindlessHeapsHelper.reset(bindlessHeapHelper.release()); MockGraphicsAllocation alloc; - alloc.allocationType = AllocationType::IMAGE; + alloc.allocationType = AllocationType::image; EXPECT_TRUE(getMemoryManager()->allocateBindlessSlot(&alloc)); auto ssInHeapInfo1 = alloc.getBindlessInfo(); EXPECT_EQ(surfaceStateSize * 2, ssInHeapInfo1.ssSize); MockGraphicsAllocation alloc2; - alloc2.allocationType = AllocationType::SHARED_IMAGE; + alloc2.allocationType = AllocationType::sharedImage; EXPECT_TRUE(getMemoryManager()->allocateBindlessSlot(&alloc2)); auto ssInHeapInfo2 = alloc2.getBindlessInfo(); @@ -254,7 +254,7 @@ TEST_F(BindlessHeapsHelperTests, givenBindlessHeapHelperWhenFreeGraphicsMemoryIs EXPECT_EQ(ssInHeapInfoFromReuseVector.ssPtr, ssInHeapInfo.ssPtr); MockGraphicsAllocation *alloc2 = new MockGraphicsAllocation; - alloc2->allocationType = AllocationType::IMAGE; + alloc2->allocationType = AllocationType::image; memManager->allocateBindlessSlot(alloc2); auto ssInHeapInfo2 = alloc2->getBindlessInfo(); diff --git a/shared/test/unit_test/helpers/blit_commands_helper_tests.cpp b/shared/test/unit_test/helpers/blit_commands_helper_tests.cpp index dca326fbff..8499f654ea 100644 --- a/shared/test/unit_test/helpers/blit_commands_helper_tests.cpp +++ b/shared/test/unit_test/helpers/blit_commands_helper_tests.cpp @@ -253,7 +253,7 @@ HWTEST_F(BlitTests, givenMemoryWhenFillPatternWithBlitThenCommandIsProgrammed) { uint32_t pattern[4] = {1, 0, 0, 0}; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; @@ -271,7 +271,7 @@ HWTEST_F(BlitTests, givenMemorySizeBiggerThanMaxWidthButLessThanTwiceMaxWidthWhe uint32_t pattern[4] = {1, 0, 0, 0}; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth) - 1, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); @@ -294,7 +294,7 @@ HWTEST_F(BlitTests, givenMemoryPointerOffsetVerifyCorrectDestinationBaseAddress) uint32_t pattern[4] = {5, 0, 0, 0}; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; @@ -322,7 +322,7 @@ HWTEST_F(BlitTests, givenMemorySizeTwiceBiggerThanMaxWidthWhenFillPatternWithBli uint32_t pattern[4] = {1, 0, 0, 0}; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth * sizeof(uint32_t)), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; @@ -351,7 +351,7 @@ HWTEST_F(BlitTests, givenMemorySizeIsLessThanTwicenMaxWidthWhenFillPatternWithBl uint32_t pattern[4] = {1, 0, 0, 0}; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, ((BlitterConstants::maxBlitWidth + 1) * sizeof(uint32_t)), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; @@ -394,7 +394,7 @@ HWTEST2_F(BlitTests, givenMemoryWhenFillPatternSizeIs4BytesThen32BitMaskISSetCor uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; diff --git a/shared/test/unit_test/helpers/blit_commands_helper_tests.inl b/shared/test/unit_test/helpers/blit_commands_helper_tests.inl index 8d58019937..326f4ce639 100644 --- a/shared/test/unit_test/helpers/blit_commands_helper_tests.inl +++ b/shared/test/unit_test/helpers/blit_commands_helper_tests.inl @@ -43,7 +43,7 @@ class GivenLinearStreamWhenCallDispatchBlitMemoryColorFillThenCorrectDepthIsProg auto gmmHelper = device->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(ptr)); MockGraphicsAllocation mockAllocation(0, - AllocationType::INTERNAL_HOST_MEMORY, + AllocationType::internalHostMemory, ptr, size, 0u, diff --git a/shared/test/unit_test/helpers/blit_commands_helper_tests_gen12lp.cpp b/shared/test/unit_test/helpers/blit_commands_helper_tests_gen12lp.cpp index 4af1ec74c6..6729b23b57 100644 --- a/shared/test/unit_test/helpers/blit_commands_helper_tests_gen12lp.cpp +++ b/shared/test/unit_test/helpers/blit_commands_helper_tests_gen12lp.cpp @@ -81,10 +81,10 @@ HWTEST2_F(BlitTests, givenIncorrectBytePerPixelWhenAppendColorDepthThenAbortIsTh HWTEST2_F(BlitTests, givenSrcAndDestinationImagesWhenAppendSliceOffsetsThenAddressAreCorectOffseted, IsGen12LP) { using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT; auto gmm = std::make_unique(pDevice->getGmmHelper()); - MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocationSrc.setGmm(gmm.get(), 0); @@ -119,10 +119,10 @@ HWTEST2_F(BlitTests, givenSrcAndDestinationImagesWhenAppendSliceOffsetsThenAddre HWTEST2_F(BlitTests, givenInputAndDefaultSlicePitchWhenAppendBlitCommandsForImagesThenSlicePitchesAreCorrect, IsGen12LP) { using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT; - MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); auto bltCmd = FamilyType::cmdInitXyCopyBlt; @@ -183,10 +183,10 @@ HWTEST2_F(BlitTests, givenTiledSrcAndDestinationImagesWhenAppendImageCommandsThe myResourecInfo->pitch = 0x100; myResourecInfo->flags.Info.TiledY = 1; gmm->gmmResourceInfo.reset(myResourecInfo.release()); - MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocationSrc.setGmm(gmm.get(), 0); @@ -214,10 +214,10 @@ HWTEST2_F(BlitTests, givenLinearSrcAndDestinationImagesWhenAppendImageCommandsTh myResourecInfo->pitch = 0x100; myResourecInfo->flags.Info.Linear = 1; gmm->gmmResourceInfo.reset(myResourecInfo.release()); - MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocationSrc.setGmm(gmm.get(), 0); diff --git a/shared/test/unit_test/helpers/gfx_core_helper_tests.cpp b/shared/test/unit_test/helpers/gfx_core_helper_tests.cpp index e863b6de11..2158f258d7 100644 --- a/shared/test/unit_test/helpers/gfx_core_helper_tests.cpp +++ b/shared/test/unit_test/helpers/gfx_core_helper_tests.cpp @@ -513,7 +513,7 @@ HWTEST_F(GfxCoreHelperTest, givenCreatedSurfaceStateBufferWhenAllocationProvided uint64_t gpuAddr = 0x4000u; size_t allocSize = size; length.length = static_cast(allocSize - 1); - GraphicsAllocation allocation(0, AllocationType::UNKNOWN, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 0u); + GraphicsAllocation allocation(0, AllocationType::unknown, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 0u); GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = false; @@ -553,7 +553,7 @@ HWTEST_F(GfxCoreHelperTest, givenCreatedSurfaceStateBufferWhenGmmAndAllocationCo void *cpuAddr = reinterpret_cast(0x4000); uint64_t gpuAddr = 0x4000u; size_t allocSize = size; - GraphicsAllocation allocation(0, AllocationType::BUFFER, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 0u); + GraphicsAllocation allocation(0, AllocationType::buffer, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 0u); GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = false; @@ -588,7 +588,7 @@ HWTEST_F(GfxCoreHelperTest, givenCreatedSurfaceStateBufferWhenGmmCompressionDisa void *cpuAddr = reinterpret_cast(0x4000); uint64_t gpuAddr = 0x4000u; size_t allocSize = size; - GraphicsAllocation allocation(0, AllocationType::BUFFER, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1); + GraphicsAllocation allocation(0, AllocationType::buffer, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1); GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = false; @@ -624,7 +624,7 @@ HWTEST_F(GfxCoreHelperTest, givenOverrideMocsIndexForScratchSpaceWhenSurfaceStat void *cpuAddr = reinterpret_cast(0x4000); uint64_t gpuAddr = 0x4000u; size_t allocSize = size; - GraphicsAllocation allocation(0, AllocationType::BUFFER, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1); + GraphicsAllocation allocation(0, AllocationType::buffer, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1); GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = false; @@ -659,7 +659,7 @@ HWTEST_F(GfxCoreHelperTest, givenCreatedSurfaceStateBufferWhenGmmAndAllocationCo void *cpuAddr = reinterpret_cast(0x4000); uint64_t gpuAddr = 0x4000u; size_t allocSize = size; - GraphicsAllocation allocation(0, AllocationType::BUFFER, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1u); + GraphicsAllocation allocation(0, AllocationType::buffer, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1u); GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = false; diff --git a/shared/test/unit_test/helpers/state_base_address_tests.cpp b/shared/test/unit_test/helpers/state_base_address_tests.cpp index cfac27b120..24026c859e 100644 --- a/shared/test/unit_test/helpers/state_base_address_tests.cpp +++ b/shared/test/unit_test/helpers/state_base_address_tests.cpp @@ -385,7 +385,7 @@ HWTEST2_F(SbaTest, givenDebugFlagSetWhenAppendingSbaThenProgramCorrectL1CachePol HWTEST2_F(SbaTest, givenDebugFlagSetWhenAppendingRssThenProgramCorrectL1CachePolicy, IsAtLeastXeHpgCore) { auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); size_t allocationSize = MemoryConstants::pageSize; - AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, AllocationType::buffer, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); auto rssCmd = FamilyType::cmdInitRenderSurfaceState; diff --git a/shared/test/unit_test/helpers/test_blit_commands_helper_pvc_and_later.cpp b/shared/test/unit_test/helpers/test_blit_commands_helper_pvc_and_later.cpp index 6bb87b0428..a884856a33 100644 --- a/shared/test/unit_test/helpers/test_blit_commands_helper_pvc_and_later.cpp +++ b/shared/test/unit_test/helpers/test_blit_commands_helper_pvc_and_later.cpp @@ -22,7 +22,7 @@ HWTEST2_F(BlitTests, givenOneBytePatternWhenFillPatternWithBlitThenCommandIsProg uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; @@ -39,7 +39,7 @@ HWTEST2_F(BlitTests, givenDeviceWithoutDefaultGmmWhenAppendBlitCommandsForVillBu uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; @@ -63,7 +63,7 @@ HWTEST2_F(BlitTests, givenGmmWithDisabledCompresionWhenAppendBlitCommandsForVill uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocation.setGmm(gmm.get(), 0u); @@ -88,7 +88,7 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionWhenAppendBlitCommandsForVillB uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocation.setGmm(gmm.get(), 0u); @@ -119,7 +119,7 @@ HWTEST2_F(BlitTests, givenOverridedMocksValueWhenAppendBlitCommandsForVillBuffer uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; @@ -143,7 +143,7 @@ HWTEST2_F(BlitTests, givenEnableStatelessCompressionWithUnifiedMemoryAndSystemMe uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; @@ -175,7 +175,7 @@ HWTEST2_F(BlitTests, givenEnableStatelessCompressionWithUnifiedMemoryAndLocalMem uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; @@ -197,7 +197,7 @@ HWTEST2_F(BlitTests, givenMemorySizeBiggerThanMaxWidthButLessThanTwiceMaxWidthWh uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitSetWidth) - 1, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; @@ -218,7 +218,7 @@ HWTEST2_F(BlitTests, givenMemorySizeTwiceBiggerThanMaxWidthWhenFillPatternWithBl uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitSetWidth), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; diff --git a/shared/test/unit_test/helpers/test_blit_commands_helper_xehp_and_later.cpp b/shared/test/unit_test/helpers/test_blit_commands_helper_xehp_and_later.cpp index cbbfe3e7ca..a6d38123b6 100644 --- a/shared/test/unit_test/helpers/test_blit_commands_helper_xehp_and_later.cpp +++ b/shared/test/unit_test/helpers/test_blit_commands_helper_xehp_and_later.cpp @@ -47,7 +47,7 @@ struct CompressionParamsSupportedMatcher { HWTEST2_F(BlitTests, givenDeviceWithoutDefaultGmmWhenAppendBlitCommandsForFillBufferThenDstCompressionDisabled, CompressionParamsSupportedMatcher) { using XY_COLOR_BLT = typename FamilyType::XY_COLOR_BLT; auto blitCmd = FamilyType::cmdInitXyColorBlt; - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -60,7 +60,7 @@ HWTEST2_F(BlitTests, givenGmmWithDisabledCompresionWhenAppendBlitCommandsForFill auto blitCmd = FamilyType::cmdInitXyColorBlt; auto gmm = std::make_unique(pDevice->getGmmHelper()); gmm->isCompressionEnabled = false; - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocation.setGmm(gmm.get(), 0); @@ -74,7 +74,7 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionWhenAppendBlitCommandsForFillB auto blitCmd = FamilyType::cmdInitXyColorBlt; auto gmm = std::make_unique(pDevice->getGmmHelper()); gmm->isCompressionEnabled = true; - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocation.setGmm(gmm.get(), 0); @@ -90,7 +90,7 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionWhenAppendBlitCommandsForFillB auto gmmContext = pDevice->getGmmHelper(); auto gmm = std::make_unique(gmmContext); gmm->isCompressionEnabled = true; - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); mockAllocation.setGmm(gmm.get(), 0); @@ -110,7 +110,7 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionAndDebugFlagSetWhenAppendBlitC auto gmm = std::make_unique(pDevice->getGmmHelper()); gmm->isCompressionEnabled = true; - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); mockAllocation.setGmm(gmm.get(), 0); @@ -126,7 +126,7 @@ HWTEST2_F(BlitTests, givenOverridedMocksValueWhenAppendBlitCommandsForFillBuffer debugManager.flags.OverrideBlitterMocs.set(1); auto blitCmd = FamilyType::cmdInitXyColorBlt; - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -139,7 +139,7 @@ HWTEST2_F(BlitTests, givenOverridedBliterTargetToZeroWhenAppendBlitCommandsForFi debugManager.flags.OverrideBlitterTargetMemory.set(0); auto blitCmd = FamilyType::cmdInitXyColorBlt; - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -153,7 +153,7 @@ HWTEST2_F(BlitTests, givenOverridedBliterTargetToOneWhenAppendBlitCommandsForFil debugManager.flags.OverrideBlitterTargetMemory.set(1); auto blitCmd = FamilyType::cmdInitXyColorBlt; - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -167,7 +167,7 @@ HWTEST2_F(BlitTests, givenOverridedBliterTargetToTwoWhenAppendBlitCommandsForFil debugManager.flags.OverrideBlitterTargetMemory.set(2); auto blitCmd = FamilyType::cmdInitXyColorBlt; - MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -262,7 +262,7 @@ HWTEST2_F(BlitTests, givenPlaneWhenGetBlitAllocationPropertiesIsCalledThenCompre auto gmm = std::make_unique(pDevice->getGmmHelper()); auto &resInfo = static_cast(gmm->gmmResourceInfo.get())->getResourceFlags()->Info; resInfo.MediaCompressed = true; - MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); auto gmmClientContext = static_cast(pDevice->getGmmClientContext()); @@ -346,7 +346,7 @@ HWTEST2_F(BlitTests, givenCompressionInfoWhenAppendImageCommandsThenCorrectPrope auto resourceInfoSrc = static_cast(gmmSrc->gmmResourceInfo.get()); resourceInfoSrc->getResourceFlags()->Info.MediaCompressed = mediaCompressedSrc; resourceInfoSrc->getResourceFlags()->Info.RenderCompressed = renderCompressedSrc; - MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocationSrc.setGmm(gmmSrc.get(), 0); @@ -357,7 +357,7 @@ HWTEST2_F(BlitTests, givenCompressionInfoWhenAppendImageCommandsThenCorrectPrope auto resourceInfoDst = static_cast(gmmDst->gmmResourceInfo.get()); resourceInfoDst->getResourceFlags()->Info.MediaCompressed = mediaCompressedDst; resourceInfoDst->getResourceFlags()->Info.RenderCompressed = renderCompressedDst; - MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocationDst.setGmm(gmmDst.get(), 0); diff --git a/shared/test/unit_test/indirect_heap/indirect_heap_tests.cpp b/shared/test/unit_test/indirect_heap/indirect_heap_tests.cpp index 89e29a48ed..399be51886 100644 --- a/shared/test/unit_test/indirect_heap/indirect_heap_tests.cpp +++ b/shared/test/unit_test/indirect_heap/indirect_heap_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,7 +15,7 @@ struct IndirectHeapTest : public ::testing::Test { class MyMockGraphicsAllocation : public GraphicsAllocation { public: MyMockGraphicsAllocation(void *ptr, size_t size) - : GraphicsAllocation(0, AllocationType::UNKNOWN, ptr, castToUint64(ptr), 0, size, MemoryPool::System4KBPages, 1) {} + : GraphicsAllocation(0, AllocationType::unknown, ptr, castToUint64(ptr), 0, size, MemoryPool::System4KBPages, 1) {} }; uint8_t buffer[256]; diff --git a/shared/test/unit_test/memory_manager/graphics_allocation_tests.cpp b/shared/test/unit_test/memory_manager/graphics_allocation_tests.cpp index 80b463d176..6753dfa471 100644 --- a/shared/test/unit_test/memory_manager/graphics_allocation_tests.cpp +++ b/shared/test/unit_test/memory_manager/graphics_allocation_tests.cpp @@ -15,15 +15,15 @@ using namespace NEO; TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenIsCreatedThenAllInspectionIdsAreSetToZero) { - MockGraphicsAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); + MockGraphicsAllocation graphicsAllocation(0, AllocationType::unknown, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); for (auto i = 0u; i < MemoryManager::maxOsContextCount; i++) { EXPECT_EQ(0u, graphicsAllocation.getInspectionId(i)); } } TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenIsCreatedThenTaskCountsAreInitializedProperly) { - GraphicsAllocation graphicsAllocation1(0, AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); - GraphicsAllocation graphicsAllocation2(0, AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); + GraphicsAllocation graphicsAllocation1(0, AllocationType::unknown, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); + GraphicsAllocation graphicsAllocation2(0, AllocationType::unknown, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); for (auto i = 0u; i < MemoryManager::maxOsContextCount; i++) { EXPECT_EQ(MockGraphicsAllocation::objectNotUsed, graphicsAllocation1.getTaskCount(i)); EXPECT_EQ(MockGraphicsAllocation::objectNotUsed, graphicsAllocation2.getTaskCount(i)); @@ -125,48 +125,48 @@ TEST(GraphicsAllocationTest, givenResidentGraphicsAllocationWhenCheckIfResidency } TEST(GraphicsAllocationTest, whenAllocationTypeIsCommandBufferThenCpuAccessIsRequired) { - EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::COMMAND_BUFFER)); + EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::commandBuffer)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsConstantSurfaceThenCpuAccessIsRequired) { - EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::CONSTANT_SURFACE)); + EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::constantSurface)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsGlobalSurfaceThenCpuAccessIsRequired) { - EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::GLOBAL_SURFACE)); + EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::globalSurface)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsInternalHeapThenCpuAccessIsRequired) { - EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::INTERNAL_HEAP)); + EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::internalHeap)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsKernelIsaThenCpuAccessIsNotRequired) { - EXPECT_FALSE(GraphicsAllocation::isCpuAccessRequired(AllocationType::KERNEL_ISA)); + EXPECT_FALSE(GraphicsAllocation::isCpuAccessRequired(AllocationType::kernelIsa)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsKernelIsaInternalThenCpuAccessIsNotRequired) { - EXPECT_FALSE(GraphicsAllocation::isCpuAccessRequired(AllocationType::KERNEL_ISA_INTERNAL)); + EXPECT_FALSE(GraphicsAllocation::isCpuAccessRequired(AllocationType::kernelIsaInternal)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsLinearStreamThenCpuAccessIsRequired) { - EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::LINEAR_STREAM)); + EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::linearStream)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsPipeThenCpuAccessIsRequired) { - EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::PIPE)); + EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::pipe)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsTimestampPacketThenCpuAccessIsRequired) { - EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::TIMESTAMP_PACKET_TAG_BUFFER)); + EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::timestampPacketTagBuffer)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsGpuTimestampDeviceBufferThenCpuAccessIsRequired) { - EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER)); + EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::gpuTimestampDeviceBuffer)); } TEST(GraphicsAllocationTest, whenAllocationRequiresCpuAccessThenAllocationIsLockable) { - auto firstAllocationIdx = static_cast(AllocationType::UNKNOWN); - auto lastAllocationIdx = static_cast(AllocationType::COUNT); + auto firstAllocationIdx = static_cast(AllocationType::unknown); + auto lastAllocationIdx = static_cast(AllocationType::count); for (int allocationIdx = firstAllocationIdx; allocationIdx != lastAllocationIdx; allocationIdx++) { auto allocationType = static_cast(allocationIdx); @@ -177,32 +177,32 @@ TEST(GraphicsAllocationTest, whenAllocationRequiresCpuAccessThenAllocationIsLock } TEST(GraphicsAllocationTest, whenAllocationTypeIsISAThenAllocationIsLockable) { - EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::KERNEL_ISA)); - EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::KERNEL_ISA_INTERNAL)); + EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::kernelIsa)); + EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::kernelIsaInternal)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsBufferThenAllocationIsNotLockable) { - EXPECT_FALSE(GraphicsAllocation::isLockable(AllocationType::BUFFER)); + EXPECT_FALSE(GraphicsAllocation::isLockable(AllocationType::buffer)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsBufferHostMemoryThenAllocationIsLockable) { - EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::BUFFER_HOST_MEMORY)); + EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::bufferHostMemory)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsGpuTimestampDeviceBufferThenAllocationIsLockable) { - EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER)); + EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::gpuTimestampDeviceBuffer)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsSvmGpuThenAllocationIsNotLockable) { - EXPECT_FALSE(GraphicsAllocation::isLockable(AllocationType::SVM_GPU)); + EXPECT_FALSE(GraphicsAllocation::isLockable(AllocationType::svmGpu)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsSharedResourceCopyThenAllocationIsLockable) { - EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::SHARED_RESOURCE_COPY)); + EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::sharedResourceCopy)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsImageThenAllocationIsNotLockable) { - EXPECT_FALSE(GraphicsAllocation::isLockable(AllocationType::IMAGE)); + EXPECT_FALSE(GraphicsAllocation::isLockable(AllocationType::image)); } TEST(GraphicsAllocationTest, givenNumMemoryBanksWhenGettingNumHandlesForKmdSharedAllocationThenReturnCorrectValue) { @@ -266,7 +266,7 @@ TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenQueryingUsedPageSizeThen MemoryPool::SystemCpuInaccessible}; for (auto pool : page4kPools) { - MockGraphicsAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, 0u, 0u, static_cast(1), pool, MemoryManager::maxOsContextCount); + MockGraphicsAllocation graphicsAllocation(0, AllocationType::unknown, nullptr, 0u, 0u, static_cast(1), pool, MemoryManager::maxOsContextCount); EXPECT_EQ(MemoryConstants::pageSize, graphicsAllocation.getUsedPageSize()); } @@ -276,7 +276,7 @@ TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenQueryingUsedPageSizeThen MemoryPool::LocalMemory}; for (auto pool : page64kPools) { - MockGraphicsAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, pool, MemoryManager::maxOsContextCount); + MockGraphicsAllocation graphicsAllocation(0, AllocationType::unknown, nullptr, 0u, 0u, 0, pool, MemoryManager::maxOsContextCount); EXPECT_EQ(MemoryConstants::pageSize64k, graphicsAllocation.getUsedPageSize()); } diff --git a/shared/test/unit_test/memory_manager/internal_allocation_storage_tests.cpp b/shared/test/unit_test/memory_manager/internal_allocation_storage_tests.cpp index a153d838ef..6e3af9799b 100644 --- a/shared/test/unit_test/memory_manager/internal_allocation_storage_tests.cpp +++ b/shared/test/unit_test/memory_manager/internal_allocation_storage_tests.cpp @@ -78,14 +78,14 @@ TEST_F(InternalAllocationStorageTest, whenCleanAllocationListThenRemoveOnlyCompl } TEST_F(InternalAllocationStorageTest, whenAllocationIsStoredAsReusableButIsStillUsedThenCannotBeObtained) { - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield}); storage->storeAllocationWithTaskCount(std::unique_ptr(allocation), REUSABLE_ALLOCATION, 2u); auto *hwTag = csr->getTagAddress(); *hwTag = 1u; - auto newAllocation = storage->obtainReusableAllocation(1, AllocationType::BUFFER); + auto newAllocation = storage->obtainReusableAllocation(1, AllocationType::buffer); EXPECT_EQ(nullptr, newAllocation); storage->cleanAllocationList(2u, REUSABLE_ALLOCATION); } @@ -95,14 +95,14 @@ TEST_F(InternalAllocationStorageTest, whenGetDeferredAllocationsThenReturnDeferr } TEST_F(InternalAllocationStorageTest, whenAllocationIsStoredAsTemporaryAndIsStillUsedThenCanBeObtained) { - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield}); storage->storeAllocationWithTaskCount(std::unique_ptr(allocation), TEMPORARY_ALLOCATION, 2u); auto *hwTag = csr->getTagAddress(); *hwTag = 1u; - auto newAllocation = storage->obtainTemporaryAllocationWithPtr(1, allocation->getUnderlyingBuffer(), AllocationType::BUFFER); + auto newAllocation = storage->obtainTemporaryAllocationWithPtr(1, allocation->getUnderlyingBuffer(), AllocationType::buffer); EXPECT_EQ(allocation, newAllocation.get()); EXPECT_TRUE(csr->getTemporaryAllocations().peekIsEmpty()); memoryManager->freeGraphicsMemory(newAllocation.release()); @@ -112,23 +112,23 @@ TEST_F(InternalAllocationStorageTest, givenTemporaryAllocationWhenAllocationIsOb const uint32_t initialTaskCount = 37u; const uint32_t contextId = csr->getOsContext().getContextId(); - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield}); storage->storeAllocationWithTaskCount(std::unique_ptr(allocation), TEMPORARY_ALLOCATION, initialTaskCount); ASSERT_EQ(initialTaskCount, allocation->getTaskCount(contextId)); - auto newAllocation = storage->obtainTemporaryAllocationWithPtr(1, allocation->getUnderlyingBuffer(), AllocationType::BUFFER); + auto newAllocation = storage->obtainTemporaryAllocationWithPtr(1, allocation->getUnderlyingBuffer(), AllocationType::buffer); EXPECT_EQ(allocation, newAllocation.get()); EXPECT_EQ(CompletionStamp::notReady, allocation->getTaskCount(contextId)); memoryManager->freeGraphicsMemory(newAllocation.release()); } TEST_F(InternalAllocationStorageTest, whenObtainAllocationFromEmptyReuseListThenReturnNullptr) { - auto allocation2 = storage->obtainReusableAllocation(1, AllocationType::BUFFER); + auto allocation2 = storage->obtainReusableAllocation(1, AllocationType::buffer); EXPECT_EQ(nullptr, allocation2); } TEST_F(InternalAllocationStorageTest, whenCompletedAllocationIsStoredAsReusableAndThenCanBeObtained) { - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield}); EXPECT_NE(nullptr, allocation); storage->storeAllocationWithTaskCount(std::unique_ptr(allocation), REUSABLE_ALLOCATION, 2u); @@ -137,7 +137,7 @@ TEST_F(InternalAllocationStorageTest, whenCompletedAllocationIsStoredAsReusableA auto *hwTag = csr->getTagAddress(); *hwTag = 2u; - auto reusedAllocation = storage->obtainReusableAllocation(1, AllocationType::BUFFER).release(); + auto reusedAllocation = storage->obtainReusableAllocation(1, AllocationType::buffer).release(); EXPECT_EQ(allocation, reusedAllocation); EXPECT_TRUE(csr->getAllocationsForReuse().peekIsEmpty()); @@ -146,7 +146,7 @@ TEST_F(InternalAllocationStorageTest, whenCompletedAllocationIsStoredAsReusableA TEST_F(InternalAllocationStorageTest, whenNotUsedAllocationIsStoredAsReusableAndThenCanBeObtained) { - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield}); EXPECT_NE(nullptr, allocation); EXPECT_FALSE(allocation->isUsed()); EXPECT_EQ(0u, csr->peekTaskCount()); @@ -156,7 +156,7 @@ TEST_F(InternalAllocationStorageTest, whenNotUsedAllocationIsStoredAsReusableAnd EXPECT_EQ(0u, allocation->getTaskCount(csr->getOsContext().getContextId())); EXPECT_FALSE(csr->getAllocationsForReuse().peekIsEmpty()); - auto reusedAllocation = storage->obtainReusableAllocation(1, AllocationType::BUFFER).release(); + auto reusedAllocation = storage->obtainReusableAllocation(1, AllocationType::buffer).release(); EXPECT_EQ(allocation, reusedAllocation); EXPECT_TRUE(csr->getAllocationsForReuse().peekIsEmpty()); @@ -167,9 +167,9 @@ TEST_F(InternalAllocationStorageTest, whenObtainAllocationFromMidlleOfReusableLi auto &reusableAllocations = csr->getAllocationsForReuse(); EXPECT_TRUE(reusableAllocations.peekIsEmpty()); - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, 1, AllocationType::BUFFER, mockDeviceBitfield}); - auto allocation2 = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, 10000, AllocationType::BUFFER, mockDeviceBitfield}); - auto allocation3 = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, 1, AllocationType::BUFFER, mockDeviceBitfield}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, 1, AllocationType::buffer, mockDeviceBitfield}); + auto allocation2 = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, 10000, AllocationType::buffer, mockDeviceBitfield}); + auto allocation3 = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, 1, AllocationType::buffer, mockDeviceBitfield}); EXPECT_TRUE(reusableAllocations.peekIsEmpty()); EXPECT_EQ(nullptr, allocation2->next); @@ -199,7 +199,7 @@ TEST_F(InternalAllocationStorageTest, whenObtainAllocationFromMidlleOfReusableLi EXPECT_EQ(allocation3, allocation2->next); EXPECT_EQ(allocation, allocation2->prev); - auto reusableAllocation = storage->obtainReusableAllocation(10000, AllocationType::BUFFER).release(); + auto reusableAllocation = storage->obtainReusableAllocation(10000, AllocationType::buffer).release(); EXPECT_EQ(reusableAllocation, allocation2); EXPECT_EQ(nullptr, allocation2->next); EXPECT_EQ(nullptr, allocation2->prev); @@ -220,12 +220,12 @@ TEST_F(InternalAllocationStorageTest, whenObtainAllocationFromMidlleOfReusableLi TEST_F(InternalAllocationStorageTest, givenAllocationWhenItIsPutOnReusableListWhenOtherAllocationTypeIsRequestedThenNullIsReturned) { EXPECT_TRUE(csr->getAllocationsForReuse().peekIsEmpty()); - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield}); storage->storeAllocation(std::unique_ptr(allocation), REUSABLE_ALLOCATION); EXPECT_FALSE(csr->getAllocationsForReuse().peekIsEmpty()); - auto internalAllocation = storage->obtainReusableAllocation(1, AllocationType::INTERNAL_HEAP); + auto internalAllocation = storage->obtainReusableAllocation(1, AllocationType::internalHeap); EXPECT_EQ(nullptr, internalAllocation); } @@ -295,11 +295,11 @@ HWTEST_F(InternalAllocationStorageTest, givenMultipleActivePartitionsWhenDetachi EXPECT_FALSE(csr->getAllocationsForReuse().peekIsEmpty()); allocation->updateTaskCount(1u, csr->getOsContext().getContextId()); - std::unique_ptr allocationReusable = csr->getAllocationsForReuse().detachAllocation(0, nullptr, csr, AllocationType::INTERNAL_HOST_MEMORY); + std::unique_ptr allocationReusable = csr->getAllocationsForReuse().detachAllocation(0, nullptr, csr, AllocationType::internalHostMemory); EXPECT_EQ(nullptr, allocationReusable.get()); *tagAddress = 0x1; - allocationReusable = csr->getAllocationsForReuse().detachAllocation(0, nullptr, csr, AllocationType::INTERNAL_HOST_MEMORY); + allocationReusable = csr->getAllocationsForReuse().detachAllocation(0, nullptr, csr, AllocationType::internalHostMemory); EXPECT_EQ(allocation, allocationReusable.get()); memoryManager->freeGraphicsMemory(allocationReusable.release()); diff --git a/shared/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp b/shared/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp index c4d50d44f1..00ee93828c 100644 --- a/shared/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp +++ b/shared/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp @@ -60,10 +60,10 @@ TEST(AllocationFlagsTest, givenAllocateMemoryFlagWhenGetAllocationFlagsIsCalledT auto pDevice = deviceFactory.rootDevices[0]; MemoryProperties memoryProperties{}; memoryProperties.pDevice = pDevice; - auto allocationProperties = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, true, 0, AllocationType::BUFFER, false, hwInfo, {}, true); + auto allocationProperties = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, true, 0, AllocationType::buffer, false, hwInfo, {}, true); EXPECT_TRUE(allocationProperties.flags.allocateMemory); - auto allocationProperties2 = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, false, 0, AllocationType::BUFFER, false, hwInfo, {}, true); + auto allocationProperties2 = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, false, 0, AllocationType::buffer, false, hwInfo, {}, true); EXPECT_FALSE(allocationProperties2.flags.allocateMemory); } @@ -75,12 +75,12 @@ TEST(UncacheableFlagsTest, givenUncachedResourceFlagWhenGetAllocationFlagsIsCall memoryProperties.pDevice = pDevice; memoryProperties.flags.locallyUncachedResource = true; auto allocationFlags = MemoryPropertiesHelper::getAllocationProperties( - 0, memoryProperties, false, 0, AllocationType::BUFFER, false, pDevice->getHardwareInfo(), {}, true); + 0, memoryProperties, false, 0, AllocationType::buffer, false, pDevice->getHardwareInfo(), {}, true); EXPECT_TRUE(allocationFlags.flags.uncacheable); memoryProperties.flags.locallyUncachedResource = false; auto allocationFlags2 = MemoryPropertiesHelper::getAllocationProperties( - 0, memoryProperties, false, 0, AllocationType::BUFFER, false, pDevice->getHardwareInfo(), {}, true); + 0, memoryProperties, false, 0, AllocationType::buffer, false, pDevice->getHardwareInfo(), {}, true); EXPECT_FALSE(allocationFlags2.flags.uncacheable); } @@ -94,13 +94,13 @@ TEST(AllocationFlagsTest, givenReadOnlyResourceFlagWhenGetAllocationFlagsIsCalle auto allocationFlags = MemoryPropertiesHelper::getAllocationProperties( - 0, memoryProperties, true, 0, AllocationType::BUFFER, false, pDevice->getHardwareInfo(), {}, false); + 0, memoryProperties, true, 0, AllocationType::buffer, false, pDevice->getHardwareInfo(), {}, false); EXPECT_FALSE(allocationFlags.flags.flushL3RequiredForRead); EXPECT_FALSE(allocationFlags.flags.flushL3RequiredForWrite); memoryProperties.flags.readOnly = false; auto allocationFlags2 = MemoryPropertiesHelper::getAllocationProperties( - 0, memoryProperties, true, 0, AllocationType::BUFFER, false, pDevice->getHardwareInfo(), {}, false); + 0, memoryProperties, true, 0, AllocationType::buffer, false, pDevice->getHardwareInfo(), {}, false); EXPECT_TRUE(allocationFlags2.flags.flushL3RequiredForRead); EXPECT_TRUE(allocationFlags2.flags.flushL3RequiredForWrite); } @@ -237,7 +237,7 @@ HWTEST_F(MemoryManagerTests, givenDefaultHwInfoWhenAllocatingDebugAreaThenHeapIn MemoryManagerCreate osAgnosticMemoryManager(false, true, executionEnvironment); NEO::AllocationProperties properties{0, true, MemoryConstants::pageSize64k, - NEO::AllocationType::DEBUG_MODULE_AREA, + NEO::AllocationType::debugModuleArea, false, mockDeviceBitfield}; properties.flags.use32BitFrontWindow = true; @@ -274,7 +274,7 @@ HWTEST2_F(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocatingDebugAreaThen MemoryManagerCreate osAgnosticMemoryManager(false, true, executionEnvironment); NEO::AllocationProperties properties{0, true, MemoryConstants::pageSize64k, - NEO::AllocationType::DEBUG_MODULE_AREA, + NEO::AllocationType::debugModuleArea, false, mockDeviceBitfield}; properties.flags.use32BitFrontWindow = true; @@ -326,8 +326,8 @@ TEST(BaseMemoryManagerTest, givenDebugVariableSetWhenCompressedBufferIsCreatedTh executionEnvironment.initGmm(); MemoryManagerCreate memoryManager(false, true, executionEnvironment); - AllocationProperties allocPropertiesBuffer(mockRootDeviceIndex, 1, AllocationType::BUFFER, mockDeviceBitfield); - AllocationProperties allocPropertiesBufferCompressed(mockRootDeviceIndex, 1, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties allocPropertiesBuffer(mockRootDeviceIndex, 1, AllocationType::buffer, mockDeviceBitfield); + AllocationProperties allocPropertiesBufferCompressed(mockRootDeviceIndex, 1, AllocationType::buffer, mockDeviceBitfield); allocPropertiesBufferCompressed.flags.preferCompressed = true; debugManager.flags.RenderCompressedBuffersEnabled.set(1); @@ -353,7 +353,7 @@ TEST(BaseMemoryManagerTest, givenCalltoAllocatePhysicalGraphicsMemoryThenPhysica executionEnvironment.initGmm(); MemoryManagerCreate memoryManager(false, true, executionEnvironment); - AllocationProperties allocPropertiesBuffer(mockRootDeviceIndex, 1, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties allocPropertiesBuffer(mockRootDeviceIndex, 1, AllocationType::buffer, mockDeviceBitfield); auto allocationBuffer = memoryManager.allocatePhysicalGraphicsMemory(allocPropertiesBuffer); EXPECT_NE(nullptr, allocationBuffer); @@ -374,7 +374,7 @@ TEST(BaseMemoryManagerTest, givenCalltoAllocatePhysicalGraphicsMemoryWithoutLoca MemoryManagerCreate memoryManager(false, true, executionEnvironment); memoryManager.localMemorySupported[0] = 0; - AllocationProperties allocPropertiesBuffer(mockRootDeviceIndex, 1, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties allocPropertiesBuffer(mockRootDeviceIndex, 1, AllocationType::buffer, mockDeviceBitfield); auto allocationBuffer = memoryManager.allocatePhysicalGraphicsMemory(allocPropertiesBuffer); EXPECT_NE(nullptr, allocationBuffer); @@ -396,7 +396,7 @@ TEST(BaseMemoryManagerTest, givenCalltoAllocatePhysicalGraphicsMemoryWithoutLoca MemoryManagerCreate memoryManager(false, true, executionEnvironment); memoryManager.localMemorySupported[0] = 0; - AllocationProperties allocPropertiesBuffer(mockRootDeviceIndex, 1, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties allocPropertiesBuffer(mockRootDeviceIndex, 1, AllocationType::buffer, mockDeviceBitfield); auto allocationBuffer = memoryManager.allocatePhysicalGraphicsMemory(allocPropertiesBuffer); EXPECT_EQ(nullptr, allocationBuffer); @@ -408,7 +408,7 @@ TEST(BaseMemoryManagerTest, givenCalltoAllocatePhysicalGraphicsMemoryWithLocalMe MemoryManagerCreate memoryManager(false, true, executionEnvironment); memoryManager.localMemorySupported[0] = 1; - AllocationProperties allocPropertiesBuffer(mockRootDeviceIndex, 1, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties allocPropertiesBuffer(mockRootDeviceIndex, 1, AllocationType::buffer, mockDeviceBitfield); auto allocationBuffer = memoryManager.allocatePhysicalGraphicsMemory(allocPropertiesBuffer); EXPECT_EQ(nullptr, allocationBuffer); @@ -426,7 +426,7 @@ TEST(BaseMemoryManagerTest, givenCalltoMapAndUnMapThenVirtialAddressSetUnSetOnPh executionEnvironment.initGmm(); MemoryManagerCreate memoryManager(false, true, executionEnvironment); - AllocationProperties allocPropertiesBuffer(mockRootDeviceIndex, 1, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties allocPropertiesBuffer(mockRootDeviceIndex, 1, AllocationType::buffer, mockDeviceBitfield); auto allocationBuffer = memoryManager.allocatePhysicalGraphicsMemory(allocPropertiesBuffer); EXPECT_NE(nullptr, allocationBuffer); @@ -461,7 +461,7 @@ TEST(BaseMemoryManagerTest, givenCalltoAllocatePhysicalGraphicsMemoryWithFailedR MemoryManagerCreate memoryManager(false, true, executionEnvironment); memoryManager.localMemorySupported[0] = 1; - AllocationProperties allocPropertiesBuffer(mockRootDeviceIndex, 1, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties allocPropertiesBuffer(mockRootDeviceIndex, 1, AllocationType::buffer, mockDeviceBitfield); auto allocationBuffer = memoryManager.allocatePhysicalGraphicsMemory(allocPropertiesBuffer); EXPECT_EQ(nullptr, allocationBuffer); @@ -474,7 +474,7 @@ TEST(BaseMemoryManagerTest, givenCalltoAllocatePhysicalGraphicsMemoryWithFailedL memoryManager.localMemorySupported[0] = 1; memoryManager.failAllocate = true; - AllocationProperties allocPropertiesBuffer(mockRootDeviceIndex, 1, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties allocPropertiesBuffer(mockRootDeviceIndex, 1, AllocationType::buffer, mockDeviceBitfield); auto allocationBuffer = memoryManager.allocatePhysicalGraphicsMemory(allocPropertiesBuffer); EXPECT_EQ(nullptr, allocationBuffer); @@ -530,7 +530,7 @@ TEST(BaseMemoryManagerTest, givenSvmGpuAllocationTypeWhenAllocateSystemMemoryFai allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = AllocationType::SVM_GPU; + allocData.type = AllocationType::svmGpu; allocData.hostPtr = reinterpret_cast(0x1000); memoryManager.failInAllocate = true; @@ -554,7 +554,7 @@ TEST(BaseMemoryManagerTest, givenSvmGpuAllocationTypeWhenAllocationSucceedThenRe allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = AllocationType::SVM_GPU; + allocData.type = AllocationType::svmGpu; allocData.hostPtr = reinterpret_cast(0x1000); auto allocation = memoryManager.allocateGraphicsMemoryInDevicePool(allocData, status); @@ -571,7 +571,7 @@ TEST(MemoryAllocationTest, givenMultiTileVisiblityWhenAskedForFlagsThenL3NeedsTo auto pDevice = deviceFactory.rootDevices[0]; MemoryProperties memoryProperties{}; memoryProperties.pDevice = pDevice; - auto allocationFlags = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, true, 0, AllocationType::BUFFER, false, pDevice->getHardwareInfo(), {}, false); + auto allocationFlags = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, true, 0, AllocationType::buffer, false, pDevice->getHardwareInfo(), {}, false); EXPECT_TRUE(allocationFlags.flags.flushL3RequiredForRead); EXPECT_TRUE(allocationFlags.flags.flushL3RequiredForWrite); } @@ -584,7 +584,7 @@ TEST(MemoryAllocationTest, givenMultiTileVisiblityAndUncachedWhenAskedForFlagsTh memoryProperties.flags.locallyUncachedResource = true; auto allocationFlags = MemoryPropertiesHelper::getAllocationProperties( - 0, memoryProperties, true, 0, AllocationType::BUFFER, false, pDevice->getHardwareInfo(), {}, false); + 0, memoryProperties, true, 0, AllocationType::buffer, false, pDevice->getHardwareInfo(), {}, false); EXPECT_FALSE(allocationFlags.flags.flushL3RequiredForRead); EXPECT_FALSE(allocationFlags.flags.flushL3RequiredForWrite); } @@ -593,7 +593,7 @@ TEST(MemoryAllocationTest, givenAubDumpForceAllToLocalMemoryWhenMemoryAllocation DebugManagerStateRestore debugRestorer; debugManager.flags.AUBDumpForceAllToLocalMemory.set(true); - MemoryAllocation allocation(mockRootDeviceIndex, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000, + MemoryAllocation allocation(mockRootDeviceIndex, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000, 0x1000, 0, MemoryPool::System4KBPages, false, false, MemoryManager::maxOsContextCount); EXPECT_EQ(MemoryPool::LocalMemory, allocation.getMemoryPool()); } @@ -602,7 +602,7 @@ TEST(MemoryAllocationTest, givenAubDumpForceAllToLocalMemoryWhenMemoryAllocation DebugManagerStateRestore debugRestorer; debugManager.flags.AUBDumpForceAllToLocalMemory.set(true); - MemoryAllocation allocation(mockRootDeviceIndex, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000, + MemoryAllocation allocation(mockRootDeviceIndex, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000, 0x1000, 0, MemoryPool::System4KBPages, false, false, MemoryManager::maxOsContextCount); allocation.overrideMemoryPool(MemoryPool::System64KBPages); EXPECT_EQ(MemoryPool::LocalMemory, allocation.getMemoryPool()); @@ -612,7 +612,7 @@ TEST(MemoryManagerTest, givenDisabledLocalMemoryWhenAllocateInternalAllocationIn MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, false, executionEnvironment); - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP, mockDeviceBitfield}, nullptr); + auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::internalHeap, mockDeviceBitfield}, nullptr); EXPECT_NE(nullptr, allocation); EXPECT_TRUE(allocation->is32BitAllocation()); EXPECT_NE(MemoryPool::LocalMemory, allocation->getMemoryPool()); @@ -641,13 +641,13 @@ HWTEST_F(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocatingKernelIsaThenL MockExecutionEnvironment executionEnvironment(&hwInfo); MockMemoryManager memoryManager(false, true, executionEnvironment); - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::KERNEL_ISA, mockDeviceBitfield}, nullptr); + auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::kernelIsa, mockDeviceBitfield}, nullptr); EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool()); EXPECT_TRUE(memoryManager.allocationInDevicePoolCreated); memoryManager.freeGraphicsMemory(allocation); - allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::KERNEL_ISA_INTERNAL, mockDeviceBitfield}, nullptr); + allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::kernelIsaInternal, mockDeviceBitfield}, nullptr); EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool()); EXPECT_TRUE(memoryManager.allocationInDevicePoolCreated); @@ -658,7 +658,7 @@ HWTEST_F(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocateKernelIsaInDevic MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP, mockDeviceBitfield}, nullptr); + auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::internalHeap, mockDeviceBitfield}, nullptr); EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool()); EXPECT_TRUE(memoryManager.allocationInDevicePoolCreated); @@ -669,7 +669,7 @@ HWTEST_F(MemoryManagerTests, givenEnabledLocalMemoryWhenLinearStreamIsAllocatedI MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::LINEAR_STREAM, mockDeviceBitfield}, nullptr); + auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::linearStream, mockDeviceBitfield}, nullptr); EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool()); EXPECT_TRUE(memoryManager.allocationInDevicePoolCreated); @@ -705,34 +705,34 @@ TEST(MemoryManagerTest, givenNotSetUseSystemMemoryWhenGraphicsAllocationInDevice MockMemoryManager memoryManager(false, true, executionEnvironment); - AllocationProperties allocProperties(mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties allocProperties(mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield); auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr); EXPECT_NE(nullptr, allocation); EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool()); EXPECT_EQ(allocation->getUnderlyingBufferSize(), memoryManager.getLocalMemoryUsageBankSelector(allocation->getAllocationType(), allocation->getRootDeviceIndex())->getOccupiedMemorySizeForBank(0)); memoryManager.freeGraphicsMemory(allocation); - EXPECT_EQ(0u, memoryManager.getLocalMemoryUsageBankSelector(AllocationType::EXTERNAL_HOST_PTR, mockRootDeviceIndex)->getOccupiedMemorySizeForBank(0)); + EXPECT_EQ(0u, memoryManager.getLocalMemoryUsageBankSelector(AllocationType::externalHostPtr, mockRootDeviceIndex)->getOccupiedMemorySizeForBank(0)); } TEST(MemoryManagerTest, givenSetUseSystemMemoryWhenGraphicsAllocationInDevicePoolIsAllocatedThenlocalMemoryUsageIsNotUpdated) { MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - AllocationProperties allocProperties(mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::EXTERNAL_HOST_PTR, mockDeviceBitfield); + AllocationProperties allocProperties(mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::externalHostPtr, mockDeviceBitfield); auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr); EXPECT_NE(nullptr, allocation); EXPECT_EQ(0u, memoryManager.getLocalMemoryUsageBankSelector(allocation->getAllocationType(), allocation->getRootDeviceIndex())->getOccupiedMemorySizeForBank(0)); memoryManager.freeGraphicsMemory(allocation); - EXPECT_EQ(0u, memoryManager.getLocalMemoryUsageBankSelector(AllocationType::EXTERNAL_HOST_PTR, mockRootDeviceIndex)->getOccupiedMemorySizeForBank(0)); + EXPECT_EQ(0u, memoryManager.getLocalMemoryUsageBankSelector(AllocationType::externalHostPtr, mockRootDeviceIndex)->getOccupiedMemorySizeForBank(0)); } TEST(MemoryManagerTest, givenInternalAllocationTypeWhenIsAllocatedInDevicePoolThenIntenalUsageBankSelectorIsUpdated) { MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - AllocationProperties allocProperties(mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); + AllocationProperties allocProperties(mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::semaphoreBuffer, mockDeviceBitfield); auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr); EXPECT_NE(nullptr, allocation); @@ -753,7 +753,7 @@ TEST(MemoryManagerTest, givenExternalAllocationTypeWhenIsAllocatedInDevicePoolTh MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - AllocationProperties allocProperties(mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties allocProperties(mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield); auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr); EXPECT_NE(nullptr, allocation); @@ -777,7 +777,7 @@ struct MemoryManagerDirectSubmissionImplicitScalingTest : public ::testing::Test executionEnvironment = std::make_unique(defaultHwInfo.get()); auto allTilesMask = executionEnvironment->rootDeviceEnvironments[mockRootDeviceIndex]->deviceAffinityMask.getGenericSubDevicesMask(); - allocationProperties = std::make_unique(mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::UNKNOWN, allTilesMask); + allocationProperties = std::make_unique(mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::unknown, allTilesMask); allocationProperties->flags.multiOsContextCapable = true; constexpr auto enableLocalMemory = true; @@ -798,7 +798,7 @@ struct MemoryManagerDirectSubmissionImplicitScalingTest : public ::testing::Test HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenCommandBufferTypeWhenIsAllocatedForMultiOsContextThenMemoryIsPlacedOnFirstAvailableMemoryBankInLocalMemory, IsXeHpcCore) { - allocationProperties->allocationType = AllocationType::COMMAND_BUFFER; + allocationProperties->allocationType = AllocationType::commandBuffer; auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(*allocationProperties, nullptr); EXPECT_NE(nullptr, allocation); @@ -810,7 +810,7 @@ HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenCommandBufferTy HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenRingBufferTypeWhenIsAllocatedForMultiOsContextThenMemoryIsPlacedOnFirstAvailableMemoryBankInLocalMemory, IsXeHpcCore) { - allocationProperties->allocationType = AllocationType::RING_BUFFER; + allocationProperties->allocationType = AllocationType::ringBuffer; auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(*allocationProperties, nullptr); EXPECT_NE(nullptr, allocation); @@ -822,7 +822,7 @@ HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenRingBufferTypeW HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenSemaphoreBufferTypeWhenIsAllocatedForMultiOsContextThenMemoryIsPlacedOnFirstAvailableMemoryBankInLocalMemory, IsXeHpcCore) { - allocationProperties->allocationType = AllocationType::SEMAPHORE_BUFFER; + allocationProperties->allocationType = AllocationType::semaphoreBuffer; auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(*allocationProperties, nullptr); EXPECT_NE(nullptr, allocation); @@ -835,7 +835,7 @@ HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenSemaphoreBuffer HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenDirectSubmissionForceLocalMemoryStorageDisabledWhenAllocatingMemoryForRingOrSemaphoreBufferThenAllocateInSystemMemory, IsXeHpcCore) { debugManager.flags.DirectSubmissionForceLocalMemoryStorageMode.set(0); for (auto &multiTile : ::testing::Bool()) { - for (auto &allocationType : {AllocationType::RING_BUFFER, AllocationType::SEMAPHORE_BUFFER}) { + for (auto &allocationType : {AllocationType::ringBuffer, AllocationType::semaphoreBuffer}) { allocationProperties->allocationType = allocationType; allocationProperties->flags.multiOsContextCapable = multiTile; auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(*allocationProperties, nullptr); @@ -853,7 +853,7 @@ HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenDirectSubmissio HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenDirectSubmissionForceLocalMemoryStorageEnabledForMultiTileEsWhenAllocatingMemoryForCommandOrRingOrSemaphoreBufferThenFirstBankIsSelectedOnlyForMultiTileEngines, IsXeHpcCore) { debugManager.flags.DirectSubmissionForceLocalMemoryStorageMode.set(1); for (auto &multiTile : ::testing::Bool()) { - for (auto &allocationType : {AllocationType::COMMAND_BUFFER, AllocationType::RING_BUFFER, AllocationType::SEMAPHORE_BUFFER}) { + for (auto &allocationType : {AllocationType::commandBuffer, AllocationType::ringBuffer, AllocationType::semaphoreBuffer}) { allocationProperties->allocationType = allocationType; allocationProperties->flags.multiOsContextCapable = multiTile; auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(*allocationProperties, nullptr); @@ -864,7 +864,7 @@ HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenDirectSubmissio EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool()); EXPECT_EQ(firstTileMask, allocation->storageInfo.getMemoryBanks()); } else { - if (allocationType != AllocationType::COMMAND_BUFFER) { + if (allocationType != AllocationType::commandBuffer) { EXPECT_NE(firstTileMask, allocation->storageInfo.getMemoryBanks()); } } diff --git a/shared/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.cpp b/shared/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.cpp index b1380cc89f..7e68fb4e34 100644 --- a/shared/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.cpp +++ b/shared/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.cpp @@ -29,7 +29,7 @@ using MemoryManagerGetAlloctionDataTests = ::testing::Test; TEST_F(MemoryManagerGetAlloctionDataTests, givenHostMemoryAllocationTypeAndAllocateMemoryFlagAndNullptrWhenAllocationDataIsQueriedThenCorrectFlagsAndSizeAreSet) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::BUFFER_HOST_MEMORY, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::bufferHostMemory, false, mockDeviceBitfield); MockMemoryManager mockMemoryManager; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); @@ -40,7 +40,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenHostMemoryAllocationTypeAndAlloc TEST_F(MemoryManagerGetAlloctionDataTests, givenNonHostMemoryAllocatoinTypeWhenAllocationDataIsQueriedThenUseSystemMemoryFlagsIsNotSet) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::buffer, false, mockDeviceBitfield); MockMemoryManager mockMemoryManager; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); @@ -51,8 +51,8 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenNonHostMemoryAllocatoinTypeWhenA } TEST_F(MemoryManagerGetAlloctionDataTests, givenForceSystemMemoryFlagWhenAllocationDataIsQueriedThenUseSystemMemoryFlagsIsSet) { - auto firstAllocationIdx = static_cast(AllocationType::UNKNOWN); - auto lastAllocationIdx = static_cast(AllocationType::COUNT); + auto firstAllocationIdx = static_cast(AllocationType::unknown); + auto lastAllocationIdx = static_cast(AllocationType::count); for (int allocationIdx = firstAllocationIdx + 1; allocationIdx != lastAllocationIdx; allocationIdx++) { AllocationData allocData; @@ -67,7 +67,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenForceSystemMemoryFlagWhenAllocat HWTEST_F(MemoryManagerGetAlloctionDataTests, givenCommandBufferAllocationTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::COMMAND_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::commandBuffer, false, mockDeviceBitfield); MockMemoryManager mockMemoryManager; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); @@ -78,7 +78,7 @@ HWTEST_F(MemoryManagerGetAlloctionDataTests, givenCommandBufferAllocationTypeWhe TEST_F(MemoryManagerGetAlloctionDataTests, givenAllocateMemoryFlagTrueWhenHostPtrIsNotNullThenAllocationDataHasHostPtrNulled) { AllocationData allocData; char memory = 0; - AllocationProperties properties(mockRootDeviceIndex, true, sizeof(memory), AllocationType::BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, sizeof(memory), AllocationType::buffer, false, mockDeviceBitfield); MockMemoryManager mockMemoryManager; mockMemoryManager.getAllocationData(allocData, properties, &memory, mockMemoryManager.createStorageInfoFromProperties(properties)); @@ -89,7 +89,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenAllocateMemoryFlagTrueWhenHostPt TEST_F(MemoryManagerGetAlloctionDataTests, givenBufferTypeWhenAllocationDataIsQueriedThenForcePinFlagIsSet) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::buffer, false, mockDeviceBitfield); MockMemoryManager mockMemoryManager; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); @@ -99,7 +99,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenBufferTypeWhenAllocationDataIsQu TEST_F(MemoryManagerGetAlloctionDataTests, givenBufferHostMemoryTypeWhenAllocationDataIsQueriedThenForcePinFlagIsSet) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::BUFFER_HOST_MEMORY, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::bufferHostMemory, false, mockDeviceBitfield); MockMemoryManager mockMemoryManager; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); @@ -109,7 +109,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenBufferHostMemoryTypeWhenAllocati TEST_F(MemoryManagerGetAlloctionDataTests, givenBufferCompressedTypeWhenAllocationDataIsQueriedThenForcePinFlagIsSet) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::buffer, false, mockDeviceBitfield); properties.flags.preferCompressed = true; MockMemoryManager mockMemoryManager; @@ -120,7 +120,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenBufferCompressedTypeWhenAllocati TEST_F(MemoryManagerGetAlloctionDataTests, givenWriteCombinedTypeWhenAllocationDataIsQueriedThenForcePinFlagIsSet) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::WRITE_COMBINED, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::writeCombined, false, mockDeviceBitfield); MockMemoryManager mockMemoryManager; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); @@ -130,7 +130,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenWriteCombinedTypeWhenAllocationD TEST_F(MemoryManagerGetAlloctionDataTests, givenDefaultAllocationFlagsWhenAllocationDataIsQueriedThenAllocateMemoryIsFalse) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, false, 0, AllocationType::BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, false, 0, AllocationType::buffer, false, mockDeviceBitfield); properties.flags.preferCompressed = true; char memory; MockMemoryManager mockMemoryManager; @@ -141,7 +141,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenDefaultAllocationFlagsWhenAlloca TEST_F(MemoryManagerGetAlloctionDataTests, givenDebugModeWhenCertainAllocationTypesAreSelectedThenSystemPlacementIsChoosen) { DebugManagerStateRestore restorer; - auto allocationType = AllocationType::BUFFER; + auto allocationType = AllocationType::buffer; auto mask = 1llu << (static_cast(allocationType) - 1); debugManager.flags.ForceSystemMemoryPlacement.set(mask); @@ -153,7 +153,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenDebugModeWhenCertainAllocationTy EXPECT_TRUE(allocData.flags.useSystemMemory); allocData.flags.useSystemMemory = false; - allocationType = AllocationType::WRITE_COMBINED; + allocationType = AllocationType::writeCombined; mask |= 1llu << (static_cast(allocationType) - 1); debugManager.flags.ForceSystemMemoryPlacement.set(mask); @@ -167,7 +167,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenDebugModeWhenCertainAllocationTy EXPECT_TRUE(allocData.flags.useSystemMemory); allocData.flags.useSystemMemory = false; - allocationType = AllocationType::IMAGE; + allocationType = AllocationType::image; mask = 1llu << (static_cast(allocationType) - 1); debugManager.flags.ForceSystemMemoryPlacement.set(mask); @@ -194,7 +194,7 @@ TEST_P(MemoryManagerGetAlloctionData32BitAnd64kbPagesAllowedTest, given64kbAllow AllocationData allocData; AllocationProperties properties(mockRootDeviceIndex, 10, allocType, mockDeviceBitfield); - bool bufferCompressedType = (allocType == AllocationType::BUFFER); + bool bufferCompressedType = (allocType == AllocationType::buffer); properties.flags.preferCompressed = bufferCompressedType; @@ -225,28 +225,28 @@ TEST_P(MemoryManagerGetAlloctionData32BitAnd64kbPagesNotAllowedTest, givenAlloca EXPECT_EQ(allocType, allocData.type); } -static const AllocationType allocationTypesWith32BitAnd64KbPagesAllowed[] = {AllocationType::BUFFER, - AllocationType::BUFFER_HOST_MEMORY, - AllocationType::PIPE, - AllocationType::SCRATCH_SURFACE, - AllocationType::WORK_PARTITION_SURFACE, - AllocationType::PRIVATE_SURFACE, - AllocationType::PRINTF_SURFACE, - AllocationType::CONSTANT_SURFACE, - AllocationType::GLOBAL_SURFACE, - AllocationType::WRITE_COMBINED, - AllocationType::ASSERT_BUFFER}; +static const AllocationType allocationTypesWith32BitAnd64KbPagesAllowed[] = {AllocationType::buffer, + AllocationType::bufferHostMemory, + AllocationType::pipe, + AllocationType::scratchSurface, + AllocationType::workPartitionSurface, + AllocationType::privateSurface, + AllocationType::printfSurface, + AllocationType::constantSurface, + AllocationType::globalSurface, + AllocationType::writeCombined, + AllocationType::assertBuffer}; INSTANTIATE_TEST_CASE_P(Allow32BitAnd64kbPagesTypes, MemoryManagerGetAlloctionData32BitAnd64kbPagesAllowedTest, ::testing::ValuesIn(allocationTypesWith32BitAnd64KbPagesAllowed)); -static const AllocationType allocationTypesWith32BitAnd64KbPagesNotAllowed[] = {AllocationType::COMMAND_BUFFER, - AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, - AllocationType::PROFILING_TAG_BUFFER, - AllocationType::IMAGE, - AllocationType::INSTRUCTION_HEAP, - AllocationType::SHARED_RESOURCE_COPY}; +static const AllocationType allocationTypesWith32BitAnd64KbPagesNotAllowed[] = {AllocationType::commandBuffer, + AllocationType::timestampPacketTagBuffer, + AllocationType::profilingTagBuffer, + AllocationType::image, + AllocationType::instructionHeap, + AllocationType::sharedResourceCopy}; INSTANTIATE_TEST_CASE_P(Disallow32BitAnd64kbPagesTypes, MemoryManagerGetAlloctionData32BitAnd64kbPagesNotAllowedTest, @@ -258,7 +258,7 @@ TEST(MemoryManagerTest, givenForced32BitSetWhenGraphicsMemoryFor32BitAllowedType memoryManager.setForce32BitAllocations(true); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::buffer, mockDeviceBitfield); memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); @@ -281,7 +281,7 @@ TEST(MemoryManagerTest, givenEnabledShareableWhenGraphicsAllocationIsAllocatedTh MockMemoryManager memoryManager(false, false, executionEnvironment); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::buffer, mockDeviceBitfield); properties.flags.shareable = true; memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); @@ -299,7 +299,7 @@ TEST(MemoryManagerTest, givenEnabledShareableWhenGraphicsAllocationIsCalledAndSy MockMemoryManager memoryManager(false, false, executionEnvironment); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::buffer, mockDeviceBitfield); properties.flags.shareable = true; memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); @@ -318,7 +318,7 @@ TEST(MemoryManagerTest, givenForced32BitEnabledWhenGraphicsMemoryWihtoutAllow32B memoryManager.setForce32BitAllocations(true); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::buffer, mockDeviceBitfield); memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); allocData.flags.allow32Bit = false; @@ -336,7 +336,7 @@ TEST(MemoryManagerTest, givenForced32BitDisabledWhenGraphicsMemoryWith32BitFlagF memoryManager.setForce32BitAllocations(false); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::buffer, mockDeviceBitfield); memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); @@ -352,7 +352,7 @@ TEST(MemoryManagerTest, givenEnabled64kbPagesWhenGraphicsMemoryMustBeHostMemoryA executionEnvironment.initGmm(); MockMemoryManager memoryManager(true, false, executionEnvironment); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::bufferHostMemory, mockDeviceBitfield); memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); @@ -370,7 +370,7 @@ TEST(MemoryManagerTest, givenEnabled64kbPagesWhenGraphicsMemoryWithoutAllow64kbP MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(true, false, executionEnvironment); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::buffer, mockDeviceBitfield); memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); allocData.flags.allow64kbPages = false; @@ -387,7 +387,7 @@ TEST(MemoryManagerTest, givenDisabled64kbPagesWhenGraphicsMemoryMustBeHostMemory MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, false, executionEnvironment); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::bufferHostMemory, mockDeviceBitfield); memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); @@ -406,7 +406,7 @@ TEST(MemoryManagerTest, givenForced32BitAndEnabled64kbPagesWhenGraphicsMemoryMus memoryManager.setForce32BitAllocations(true); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::bufferHostMemory, mockDeviceBitfield); memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); @@ -425,7 +425,7 @@ TEST(MemoryManagerTest, givenEnabled64kbPagesWhenGraphicsMemoryIsAllocatedWithHo MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(true, false, executionEnvironment); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, false, 1, AllocationType::BUFFER_HOST_MEMORY, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, false, 1, AllocationType::bufferHostMemory, false, mockDeviceBitfield); char memory[1]; memoryManager.getAllocationData(allocData, properties, &memory, memoryManager.createStorageInfoFromProperties(properties)); @@ -444,7 +444,7 @@ TEST(MemoryManagerTest, givenMemoryManagerWhenGraphicsMemoryAllocationInDevicePo memoryManager.failInDevicePool = true; - auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}); + auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield}); ASSERT_NE(nullptr, allocation); EXPECT_TRUE(memoryManager.allocationCreated); EXPECT_EQ(MemoryPool::System4KBPages, allocation->getMemoryPool()); @@ -456,7 +456,7 @@ TEST(MemoryManagerTest, givenMemoryManagerWhenBufferTypeIsPassedThenAllocateGrap MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}); + auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield}); EXPECT_NE(nullptr, allocation); memoryManager.freeGraphicsMemory(allocation); } @@ -467,7 +467,7 @@ TEST(MemoryManagerTest, givenMemoryManagerWhenBufferTypeIsPassedAndAllocateInDev memoryManager.failInDevicePoolWithError = true; - auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}); + auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield}); ASSERT_EQ(nullptr, allocation); EXPECT_FALSE(memoryManager.allocationInDevicePoolCreated); @@ -477,7 +477,7 @@ TEST(MemoryManagerTest, givenMemoryManagerWhenBufferTypeIsPassedAndAllocateInDev TEST(MemoryManagerTest, givenSvmAllocationTypeWhenGetAllocationDataIsCalledThenAllocatingMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::svmZeroCopy, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.allocateMemory); } @@ -485,7 +485,7 @@ TEST(MemoryManagerTest, givenSvmAllocationTypeWhenGetAllocationDataIsCalledThenA TEST(MemoryManagerTest, givenSvmAllocationTypeWhenGetAllocationDataIsCalledThen64kbPagesAreAllowedAnd32BitAllocationIsDisallowed) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::svmZeroCopy, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.allow64kbPages); EXPECT_FALSE(allocData.flags.allow32Bit); @@ -494,7 +494,7 @@ TEST(MemoryManagerTest, givenSvmAllocationTypeWhenGetAllocationDataIsCalledThen6 TEST(MemoryManagerTest, givenTagBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::TAG_BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::tagBuffer, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); } @@ -502,7 +502,7 @@ TEST(MemoryManagerTest, givenTagBufferTypeWhenGetAllocationDataIsCalledThenSyste TEST(MemoryManagerTest, givenGlobalFenceTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::GLOBAL_FENCE, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::globalFence, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); } @@ -510,7 +510,7 @@ TEST(MemoryManagerTest, givenGlobalFenceTypeWhenGetAllocationDataIsCalledThenSys TEST(MemoryManagerTest, givenPreemptionTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::PREEMPTION, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::preemption, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); } @@ -518,7 +518,7 @@ TEST(MemoryManagerTest, givenPreemptionTypeWhenGetAllocationDataIsCalledThenSyst TEST(MemoryManagerTest, givenPreemptionTypeWhenGetAllocationDataIsCalledThen64kbPagesAllowed) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::PREEMPTION, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::preemption, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.allow64kbPages); } @@ -526,7 +526,7 @@ TEST(MemoryManagerTest, givenPreemptionTypeWhenGetAllocationDataIsCalledThen64kb TEST(MemoryManagerTest, givenPreemptionTypeWhenGetAllocationDataIsCalledThen48BitResourceIsTrue) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::PREEMPTION, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::preemption, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.resource48Bit); } @@ -534,7 +534,7 @@ TEST(MemoryManagerTest, givenPreemptionTypeWhenGetAllocationDataIsCalledThen48Bi TEST(MemoryManagerTest, givenDeferredTasksListTypeWhenGetAllocationDataIsCalledThen48BitResourceIsTrue) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::DEFERRED_TASKS_LIST, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::deferredTasksList, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.resource48Bit); } @@ -542,7 +542,7 @@ TEST(MemoryManagerTest, givenDeferredTasksListTypeWhenGetAllocationDataIsCalledT TEST(MemoryManagerTest, givenMCSTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::MCS, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::mcs, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); } @@ -550,7 +550,7 @@ TEST(MemoryManagerTest, givenMCSTypeWhenGetAllocationDataIsCalledThenSystemMemor TEST(MemoryManagerTest, givenPipeTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::PIPE, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::pipe, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); } @@ -558,7 +558,7 @@ TEST(MemoryManagerTest, givenPipeTypeWhenGetAllocationDataIsCalledThenSystemMemo TEST(MemoryManagerTest, givenGlobalSurfaceTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::GLOBAL_SURFACE, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::globalSurface, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); } @@ -566,7 +566,7 @@ TEST(MemoryManagerTest, givenGlobalSurfaceTypeWhenGetAllocationDataIsCalledThenS TEST(MemoryManagerTest, givenWriteCombinedTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::WRITE_COMBINED, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::writeCombined, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); } @@ -574,7 +574,7 @@ TEST(MemoryManagerTest, givenWriteCombinedTypeWhenGetAllocationDataIsCalledThenS TEST(MemoryManagerTest, givenInternalHostMemoryTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::INTERNAL_HOST_MEMORY, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::internalHostMemory, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); } @@ -582,7 +582,7 @@ TEST(MemoryManagerTest, givenInternalHostMemoryTypeWhenGetAllocationDataIsCalled TEST(MemoryManagerTest, givenFillPatternTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::FILL_PATTERN, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::fillPattern, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); } @@ -592,7 +592,7 @@ using GetAllocationDataTestHw = ::testing::Test; HWTEST_F(GetAllocationDataTestHw, givenLinearStreamTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::LINEAR_STREAM, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::linearStream, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -601,7 +601,7 @@ HWTEST_F(GetAllocationDataTestHw, givenLinearStreamTypeWhenGetAllocationDataIsCa HWTEST_F(GetAllocationDataTestHw, givenTimestampPacketTagBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequestedAndRequireCpuAccess) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::timestampPacketTagBuffer, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_EQ(UnitTestHelper::requiresTimestampPacketsInSystemMemory(*defaultHwInfo), allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -610,7 +610,7 @@ HWTEST_F(GetAllocationDataTestHw, givenTimestampPacketTagBufferTypeWhenGetAlloca TEST(MemoryManagerTest, givenProfilingTagBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::PROFILING_TAG_BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::profilingTagBuffer, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); EXPECT_FALSE(allocData.flags.requiresCpuAccess); @@ -619,7 +619,7 @@ TEST(MemoryManagerTest, givenProfilingTagBufferTypeWhenGetAllocationDataIsCalled TEST(MemoryManagerTest, givenAllocationPropertiesWithMultiOsContextCapableFlagEnabledWhenAllocateMemoryThenAllocationDataIsMultiOsContextCapable) { MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, false, executionEnvironment); - AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield}; properties.flags.multiOsContextCapable = true; AllocationData allocData; @@ -630,7 +630,7 @@ TEST(MemoryManagerTest, givenAllocationPropertiesWithMultiOsContextCapableFlagEn TEST(MemoryManagerTest, givenAllocationPropertiesWithMultiOsContextCapableFlagDisabledWhenAllocateMemoryThenAllocationDataIsNotMultiOsContextCapable) { MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, false, executionEnvironment); - AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield}; properties.flags.multiOsContextCapable = false; AllocationData allocData; @@ -641,7 +641,7 @@ TEST(MemoryManagerTest, givenAllocationPropertiesWithMultiOsContextCapableFlagDi TEST(MemoryManagerTest, givenConstantSurfaceTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::CONSTANT_SURFACE, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::constantSurface, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); } @@ -649,7 +649,7 @@ TEST(MemoryManagerTest, givenConstantSurfaceTypeWhenGetAllocationDataIsCalledThe HWTEST_F(GetAllocationDataTestHw, givenInternalHeapTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::INTERNAL_HEAP, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::internalHeap, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -658,7 +658,7 @@ HWTEST_F(GetAllocationDataTestHw, givenInternalHeapTypeWhenGetAllocationDataIsCa HWTEST_F(GetAllocationDataTestHw, givenGpuTimestampDeviceBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::gpuTimestampDeviceBuffer, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -666,7 +666,7 @@ HWTEST_F(GetAllocationDataTestHw, givenGpuTimestampDeviceBufferTypeWhenGetAlloca HWTEST_F(GetAllocationDataTestHw, givenPrintfAllocationWhenGetAllocationDataIsCalledThenDontForceSystemMemoryAndRequireCpuAccess) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::gpuTimestampDeviceBuffer, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -675,7 +675,7 @@ HWTEST_F(GetAllocationDataTestHw, givenPrintfAllocationWhenGetAllocationDataIsCa HWTEST_F(GetAllocationDataTestHw, givenLinearStreamAllocationWhenGetAllocationDataIsCalledThenDontForceSystemMemoryAndRequireCpuAccess) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::LINEAR_STREAM, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::linearStream, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -684,7 +684,7 @@ HWTEST_F(GetAllocationDataTestHw, givenLinearStreamAllocationWhenGetAllocationDa HWTEST_F(GetAllocationDataTestHw, givenConstantSurfaceAllocationWhenGetAllocationDataIsCalledThenDontForceSystemMemoryAndRequireCpuAccess) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::CONSTANT_SURFACE, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::constantSurface, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -692,11 +692,11 @@ HWTEST_F(GetAllocationDataTestHw, givenConstantSurfaceAllocationWhenGetAllocatio HWTEST_F(GetAllocationDataTestHw, givenKernelIsaTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::KERNEL_ISA, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::kernelIsa, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_NE(defaultHwInfo->featureTable.flags.ftrLocalMemory, allocData.flags.useSystemMemory); - AllocationProperties properties2{mockRootDeviceIndex, 1, AllocationType::KERNEL_ISA_INTERNAL, mockDeviceBitfield}; + AllocationProperties properties2{mockRootDeviceIndex, 1, AllocationType::kernelIsaInternal, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties2, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_NE(defaultHwInfo->featureTable.flags.ftrLocalMemory, allocData.flags.useSystemMemory); } @@ -704,7 +704,7 @@ HWTEST_F(GetAllocationDataTestHw, givenKernelIsaTypeWhenGetAllocationDataIsCalle HWTEST_F(GetAllocationDataTestHw, givenLinearStreamWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::LINEAR_STREAM, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::linearStream, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -713,7 +713,7 @@ HWTEST_F(GetAllocationDataTestHw, givenLinearStreamWhenGetAllocationDataIsCalled HWTEST_F(GetAllocationDataTestHw, givenPrintfAllocationWhenGetAllocationDataIsCalledThenDontUseSystemMemoryAndRequireCpuAccess) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::PRINTF_SURFACE, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::printfSurface, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -722,7 +722,7 @@ HWTEST_F(GetAllocationDataTestHw, givenPrintfAllocationWhenGetAllocationDataIsCa HWTEST_F(GetAllocationDataTestHw, givenAssertAllocationWhenGetAllocationDataIsCalledThenDontUseSystemMemoryAndRequireCpuAccess) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::ASSERT_BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::assertBuffer, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.requiresCpuAccess); } @@ -731,7 +731,7 @@ TEST(MemoryManagerTest, givenExternalHostMemoryWhenGetAllocationDataIsCalledThen AllocationData allocData; auto hostPtr = reinterpret_cast(0x1234); MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, false, 1, AllocationType::EXTERNAL_HOST_PTR, false, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, false, 1, AllocationType::externalHostPtr, false, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, hostPtr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); EXPECT_FALSE(allocData.flags.allocateMemory); @@ -746,11 +746,11 @@ TEST(MemoryManagerTest, GivenAllocationPropertiesWhenGettingAllocationDataThenSa AllocationData allocData; MockExecutionEnvironment executionEnvironment{defaultHwInfo.get(), true, rootDevicesCount}; MockMemoryManager mockMemoryManager{executionEnvironment}; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::buffer, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_EQ(allocData.rootDeviceIndex, 0u); - AllocationProperties properties2{rootDevicesCount - 1, 1, AllocationType::BUFFER, mockDeviceBitfield}; + AllocationProperties properties2{rootDevicesCount - 1, 1, AllocationType::buffer, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties2, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_EQ(allocData.rootDeviceIndex, properties2.rootDeviceIndex); } @@ -759,7 +759,7 @@ TEST(MemoryManagerTest, givenMapAllocationWhenGetAllocationDataIsCalledThenItHas AllocationData allocData; auto hostPtr = reinterpret_cast(0x1234); MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, false, 1, AllocationType::MAP_ALLOCATION, false, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, false, 1, AllocationType::mapAllocation, false, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, hostPtr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); EXPECT_FALSE(allocData.flags.allocateMemory); @@ -771,7 +771,7 @@ TEST(MemoryManagerTest, givenMapAllocationWhenGetAllocationDataIsCalledThenItHas HWTEST_F(GetAllocationDataTestHw, givenRingBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 0x10000u, AllocationType::RING_BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 0x10000u, AllocationType::ringBuffer, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.allocateMemory); @@ -785,7 +785,7 @@ HWTEST_F(GetAllocationDataTestHw, givenRingBufferAllocationWhenGetAllocationData HWTEST_F(GetAllocationDataTestHw, givenSemaphoreBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 0x1000u, AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 0x1000u, AllocationType::semaphoreBuffer, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.allocateMemory); @@ -798,7 +798,7 @@ HWTEST_F(GetAllocationDataTestHw, givenSemaphoreBufferAllocationWhenGetAllocatio TEST(MemoryManagerTest, givenDirectBufferPlacementSetWhenDefaultIsUsedThenExpectNoFlagsChanged) { AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::RING_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::ringBuffer, mockDeviceBitfield); MockMemoryManager::overrideAllocationData(allocationData, properties); EXPECT_EQ(0u, allocationData.flags.requiresCpuAccess); @@ -809,7 +809,7 @@ TEST(MemoryManagerTest, givenDirectBufferPlacementSetWhenOverrideToNonSystemThen DebugManagerStateRestore restorer; debugManager.flags.DirectSubmissionBufferPlacement.set(0); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::RING_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::ringBuffer, mockDeviceBitfield); MockMemoryManager::overrideAllocationData(allocationData, properties); EXPECT_EQ(1u, allocationData.flags.requiresCpuAccess); @@ -820,7 +820,7 @@ TEST(MemoryManagerTest, givenDirectBufferPlacementSetWhenOverrideToSystemThenExp DebugManagerStateRestore restorer; debugManager.flags.DirectSubmissionBufferPlacement.set(1); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::RING_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::ringBuffer, mockDeviceBitfield); MockMemoryManager::overrideAllocationData(allocationData, properties); EXPECT_EQ(0u, allocationData.flags.requiresCpuAccess); @@ -829,7 +829,7 @@ TEST(MemoryManagerTest, givenDirectBufferPlacementSetWhenOverrideToSystemThenExp TEST(MemoryManagerTest, givenDirectSemaphorePlacementSetWhenDefaultIsUsedThenExpectNoFlagsChanged) { AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::semaphoreBuffer, mockDeviceBitfield); MockMemoryManager::overrideAllocationData(allocationData, properties); EXPECT_EQ(0u, allocationData.flags.requiresCpuAccess); @@ -840,7 +840,7 @@ TEST(MemoryManagerTest, givenDirectSemaphorePlacementSetWhenOverrideToNonSystemT DebugManagerStateRestore restorer; debugManager.flags.DirectSubmissionSemaphorePlacement.set(0); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::semaphoreBuffer, mockDeviceBitfield); MockMemoryManager::overrideAllocationData(allocationData, properties); EXPECT_EQ(1u, allocationData.flags.requiresCpuAccess); @@ -851,7 +851,7 @@ TEST(MemoryManagerTest, givenDirectSemaphorePlacementSetWhenOverrideToSystemThen DebugManagerStateRestore restorer; debugManager.flags.DirectSubmissionSemaphorePlacement.set(1); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::semaphoreBuffer, mockDeviceBitfield); MockMemoryManager::overrideAllocationData(allocationData, properties); EXPECT_EQ(0u, allocationData.flags.requiresCpuAccess); @@ -862,7 +862,7 @@ TEST(MemoryManagerTest, givenDirectBufferAddressingWhenOverrideToNo48BitThenExpe DebugManagerStateRestore restorer; debugManager.flags.DirectSubmissionBufferAddressing.set(0); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::RING_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::ringBuffer, mockDeviceBitfield); allocationData.flags.resource48Bit = 1; MockMemoryManager::overrideAllocationData(allocationData, properties); @@ -873,7 +873,7 @@ TEST(MemoryManagerTest, givenDirectBufferAddressingWhenOverrideTo48BitThenExpect DebugManagerStateRestore restorer; debugManager.flags.DirectSubmissionBufferAddressing.set(1); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::RING_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::ringBuffer, mockDeviceBitfield); allocationData.flags.resource48Bit = 0; MockMemoryManager::overrideAllocationData(allocationData, properties); @@ -882,7 +882,7 @@ TEST(MemoryManagerTest, givenDirectBufferAddressingWhenOverrideTo48BitThenExpect TEST(MemoryManagerTest, givenDirectBufferAddressingDefaultWhenNoOverrideThenExpect48BitFlagSame) { AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::RING_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::ringBuffer, mockDeviceBitfield); allocationData.flags.resource48Bit = 0; MockMemoryManager::overrideAllocationData(allocationData, properties); @@ -898,7 +898,7 @@ TEST(MemoryManagerTest, givenDirectSemaphoreAddressingWhenOverrideToNo48BitThenE DebugManagerStateRestore restorer; debugManager.flags.DirectSubmissionSemaphoreAddressing.set(0); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::semaphoreBuffer, mockDeviceBitfield); allocationData.flags.resource48Bit = 1; MockMemoryManager::overrideAllocationData(allocationData, properties); @@ -909,7 +909,7 @@ TEST(MemoryManagerTest, givenDirectSemaphoreAddressingWhenOverrideTo48BitThenExp DebugManagerStateRestore restorer; debugManager.flags.DirectSubmissionSemaphoreAddressing.set(1); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::semaphoreBuffer, mockDeviceBitfield); allocationData.flags.resource48Bit = 0; MockMemoryManager::overrideAllocationData(allocationData, properties); @@ -918,7 +918,7 @@ TEST(MemoryManagerTest, givenDirectSemaphoreAddressingWhenOverrideTo48BitThenExp TEST(MemoryManagerTest, givenDirectSemaphoreAddressingDefaultWhenNoOverrideThenExpect48BitFlagSame) { AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::semaphoreBuffer, mockDeviceBitfield); allocationData.flags.resource48Bit = 0; MockMemoryManager::overrideAllocationData(allocationData, properties); @@ -932,12 +932,12 @@ TEST(MemoryManagerTest, givenDirectSemaphoreAddressingDefaultWhenNoOverrideThenE TEST(MemoryManagerTest, givenForceNonSystemMaskWhenAllocationTypeMatchesMaskThenExpectSystemFlagFalse) { DebugManagerStateRestore restorer; - auto allocationType = AllocationType::BUFFER; + auto allocationType = AllocationType::buffer; auto mask = 1llu << (static_cast(allocationType) - 1); debugManager.flags.ForceNonSystemMemoryPlacement.set(mask); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::buffer, mockDeviceBitfield); allocationData.flags.useSystemMemory = 1; MockMemoryManager::overrideAllocationData(allocationData, properties); EXPECT_EQ(0u, allocationData.flags.useSystemMemory); @@ -945,12 +945,12 @@ TEST(MemoryManagerTest, givenForceNonSystemMaskWhenAllocationTypeMatchesMaskThen TEST(MemoryManagerTest, givenForceNonSystemMaskWhenAllocationTypeNotMatchesMaskThenExpectSystemFlagTrue) { DebugManagerStateRestore restorer; - auto allocationType = AllocationType::BUFFER; + auto allocationType = AllocationType::buffer; auto mask = 1llu << (static_cast(allocationType) - 1); debugManager.flags.ForceNonSystemMemoryPlacement.set(mask); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::COMMAND_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::commandBuffer, mockDeviceBitfield); allocationData.flags.useSystemMemory = 1; MockMemoryManager::overrideAllocationData(allocationData, properties); EXPECT_EQ(1u, allocationData.flags.useSystemMemory); @@ -959,7 +959,7 @@ TEST(MemoryManagerTest, givenForceNonSystemMaskWhenAllocationTypeNotMatchesMaskT TEST(MemoryManagerTest, givenDebugContextSaveAreaTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::DEBUG_CONTEXT_SAVE_AREA, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::debugContextSaveArea, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.zeroMemory); @@ -967,8 +967,8 @@ TEST(MemoryManagerTest, givenDebugContextSaveAreaTypeWhenGetAllocationDataIsCall TEST(MemoryManagerTest, givenAllocationTypeConstantOrGlobalSurfaceWhenGetAllocationDataIsCalledThenZeroMemoryFlagIsSet) { MockMemoryManager mockMemoryManager; - AllocationProperties propertiesGlobal{mockRootDeviceIndex, 1, AllocationType::GLOBAL_SURFACE, mockDeviceBitfield}; - AllocationProperties propertiesConstant{mockRootDeviceIndex, 1, AllocationType::CONSTANT_SURFACE, mockDeviceBitfield}; + AllocationProperties propertiesGlobal{mockRootDeviceIndex, 1, AllocationType::globalSurface, mockDeviceBitfield}; + AllocationProperties propertiesConstant{mockRootDeviceIndex, 1, AllocationType::constantSurface, mockDeviceBitfield}; { AllocationData allocData; mockMemoryManager.getAllocationData(allocData, propertiesGlobal, nullptr, mockMemoryManager.createStorageInfoFromProperties(propertiesGlobal)); @@ -984,7 +984,7 @@ TEST(MemoryManagerTest, givenAllocationTypeConstantOrGlobalSurfaceWhenGetAllocat TEST(MemoryManagerTest, givenPropertiesWithOsContextWhenGetAllocationDataIsCalledThenOsContextIsSet) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{0, 1, AllocationType::DEBUG_CONTEXT_SAVE_AREA, mockDeviceBitfield}; + AllocationProperties properties{0, 1, AllocationType::debugContextSaveArea, mockDeviceBitfield}; MockExecutionEnvironment mockExecutionEnvironment{}; auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); @@ -999,7 +999,7 @@ TEST(MemoryManagerTest, givenPropertiesWithOsContextWhenGetAllocationDataIsCalle TEST(MemoryManagerTest, givenPropertiesWithGpuAddressWhenGetAllocationDataIsCalledThenGpuAddressIsSet) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::DEBUG_CONTEXT_SAVE_AREA, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::debugContextSaveArea, mockDeviceBitfield}; properties.gpuAddress = 0x4000; @@ -1011,7 +1011,7 @@ TEST(MemoryManagerTest, givenEnableLocalMemoryAndMemoryManagerWhenBufferTypeIsPa MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}, + auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield}, nullptr); EXPECT_NE(nullptr, allocation); memoryManager.freeGraphicsMemory(allocation); @@ -1052,46 +1052,46 @@ TEST_P(MemoryManagerGetAlloctionDataHaveNotToBeForcedTo48BitTest, givenAllocatio } static const AllocationType allocationHaveToBeForcedTo48Bit[] = { - AllocationType::COMMAND_BUFFER, - AllocationType::IMAGE, - AllocationType::INDIRECT_OBJECT_HEAP, - AllocationType::INSTRUCTION_HEAP, - AllocationType::INTERNAL_HEAP, - AllocationType::KERNEL_ISA, - AllocationType::LINEAR_STREAM, - AllocationType::MCS, - AllocationType::SCRATCH_SURFACE, - AllocationType::WORK_PARTITION_SURFACE, - AllocationType::SHARED_IMAGE, - AllocationType::SHARED_RESOURCE_COPY, - AllocationType::SURFACE_STATE_HEAP, - AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, - AllocationType::RING_BUFFER, - AllocationType::SEMAPHORE_BUFFER, - AllocationType::DEFERRED_TASKS_LIST, + AllocationType::commandBuffer, + AllocationType::image, + AllocationType::indirectObjectHeap, + AllocationType::instructionHeap, + AllocationType::internalHeap, + AllocationType::kernelIsa, + AllocationType::linearStream, + AllocationType::mcs, + AllocationType::scratchSurface, + AllocationType::workPartitionSurface, + AllocationType::sharedImage, + AllocationType::sharedResourceCopy, + AllocationType::surfaceStateHeap, + AllocationType::timestampPacketTagBuffer, + AllocationType::ringBuffer, + AllocationType::semaphoreBuffer, + AllocationType::deferredTasksList, }; static const AllocationType allocationHaveNotToBeForcedTo48Bit[] = { - AllocationType::BUFFER, - AllocationType::BUFFER_HOST_MEMORY, - AllocationType::CONSTANT_SURFACE, - AllocationType::EXTERNAL_HOST_PTR, - AllocationType::FILL_PATTERN, - AllocationType::GLOBAL_SURFACE, - AllocationType::INTERNAL_HOST_MEMORY, - AllocationType::MAP_ALLOCATION, - AllocationType::PIPE, - AllocationType::PRINTF_SURFACE, - AllocationType::PRIVATE_SURFACE, - AllocationType::PROFILING_TAG_BUFFER, - AllocationType::SHARED_BUFFER, - AllocationType::SVM_CPU, - AllocationType::SVM_GPU, - AllocationType::SVM_ZERO_COPY, - AllocationType::TAG_BUFFER, - AllocationType::GLOBAL_FENCE, - AllocationType::WRITE_COMBINED, - AllocationType::DEBUG_CONTEXT_SAVE_AREA, + AllocationType::buffer, + AllocationType::bufferHostMemory, + AllocationType::constantSurface, + AllocationType::externalHostPtr, + AllocationType::fillPattern, + AllocationType::globalSurface, + AllocationType::internalHostMemory, + AllocationType::mapAllocation, + AllocationType::pipe, + AllocationType::printfSurface, + AllocationType::privateSurface, + AllocationType::profilingTagBuffer, + AllocationType::sharedBuffer, + AllocationType::svmCpu, + AllocationType::svmGpu, + AllocationType::svmZeroCopy, + AllocationType::tagBuffer, + AllocationType::globalFence, + AllocationType::writeCombined, + AllocationType::debugContextSaveArea, }; INSTANTIATE_TEST_CASE_P(ForceTo48Bit, diff --git a/shared/test/unit_test/memory_manager/memory_manager_multi_device_tests.cpp b/shared/test/unit_test/memory_manager/memory_manager_multi_device_tests.cpp index 06b5d018aa..868d88de4e 100644 --- a/shared/test/unit_test/memory_manager/memory_manager_multi_device_tests.cpp +++ b/shared/test/unit_test/memory_manager/memory_manager_multi_device_tests.cpp @@ -19,8 +19,8 @@ using namespace NEO; using MemoryManagerMultiDeviceTest = MemoryAllocatorMultiDeviceFixture<10>; TEST_P(MemoryManagerMultiDeviceTest, givenRootDeviceIndexSpecifiedWhenAllocateGraphicsMemoryIsCalledThenGraphicsAllocationHasTheSameRootDeviceIndex) { - std::vector allocationTypes{AllocationType::BUFFER, - AllocationType::KERNEL_ISA}; + std::vector allocationTypes{AllocationType::buffer, + AllocationType::kernelIsa}; for (auto allocationType : allocationTypes) { for (uint32_t rootDeviceIndex = 0; rootDeviceIndex < getNumRootDevices(); ++rootDeviceIndex) { AllocationProperties properties{rootDeviceIndex, true, MemoryConstants::pageSize, allocationType, false, false, mockDeviceBitfield}; @@ -70,7 +70,7 @@ TEST_P(MemoryManagerMultiDeviceTest, givenRootDeviceIndexSpecifiedWhenAllocateGr auto maxRootDeviceIndex = *std::max_element(rootDeviceIndices.begin(), rootDeviceIndices.end(), std::less()); auto tagsMultiAllocation = new MultiGraphicsAllocation(maxRootDeviceIndex); - AllocationProperties unifiedMemoryProperties{rootDeviceIndices.at(0), MemoryConstants::pageSize, AllocationType::TAG_BUFFER, systemMemoryBitfield}; + AllocationProperties unifiedMemoryProperties{rootDeviceIndices.at(0), MemoryConstants::pageSize, AllocationType::tagBuffer, systemMemoryBitfield}; memoryManager->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, unifiedMemoryProperties, *tagsMultiAllocation); EXPECT_NE(nullptr, tagsMultiAllocation); @@ -97,7 +97,7 @@ TEST_P(MemoryManagerMultiDeviceTest, givenRootDeviceIndexSpecifiedWhenAllocateGr auto maxRootDeviceIndex = *std::max_element(rootDeviceIndices.begin(), rootDeviceIndices.end(), std::less()); auto tagsMultiAllocation = new MultiGraphicsAllocation(maxRootDeviceIndex); - AllocationProperties unifiedMemoryProperties{rootDeviceIndices.at(0), MemoryConstants::pageSize, AllocationType::TAG_BUFFER, systemMemoryBitfield}; + AllocationProperties unifiedMemoryProperties{rootDeviceIndices.at(0), MemoryConstants::pageSize, AllocationType::tagBuffer, systemMemoryBitfield}; memoryManager->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, unifiedMemoryProperties, *tagsMultiAllocation); EXPECT_NE(nullptr, tagsMultiAllocation); diff --git a/shared/test/unit_test/memory_manager/memory_manager_tests.cpp b/shared/test/unit_test/memory_manager/memory_manager_tests.cpp index 3fe1b067e9..c9a8522e5b 100644 --- a/shared/test/unit_test/memory_manager/memory_manager_tests.cpp +++ b/shared/test/unit_test/memory_manager/memory_manager_tests.cpp @@ -69,7 +69,7 @@ TEST(MemoryManagerTest, WhenCallingSetAtomicAccessWithOsAgnosticThenNoChanges) { TEST(MemoryManagerTest, whenGettingPreferredAllocationMethodThenNotDefinedIsReturned) { MockMemoryManager memoryManager; - for (auto i = 0; i < static_cast(AllocationType::COUNT); i++) { + for (auto i = 0; i < static_cast(AllocationType::count); i++) { AllocationProperties allocationProperties{0u, 0u, static_cast(i), {}}; EXPECT_EQ(GfxMemoryAllocationMethod::NotDefined, memoryManager.getPreferredAllocationMethod(allocationProperties)); } @@ -78,10 +78,10 @@ TEST(MemoryManagerTest, whenGettingPreferredAllocationMethodThenNotDefinedIsRetu TEST(MemoryManagerTest, WhenCallingIsAllocationTypeToCaptureThenScratchAndPrivateTypesReturnTrue) { MockMemoryManager mockMemoryManager; - EXPECT_TRUE(mockMemoryManager.isAllocationTypeToCapture(AllocationType::SCRATCH_SURFACE)); - EXPECT_TRUE(mockMemoryManager.isAllocationTypeToCapture(AllocationType::PRIVATE_SURFACE)); - EXPECT_TRUE(mockMemoryManager.isAllocationTypeToCapture(AllocationType::LINEAR_STREAM)); - EXPECT_TRUE(mockMemoryManager.isAllocationTypeToCapture(AllocationType::INTERNAL_HEAP)); + EXPECT_TRUE(mockMemoryManager.isAllocationTypeToCapture(AllocationType::scratchSurface)); + EXPECT_TRUE(mockMemoryManager.isAllocationTypeToCapture(AllocationType::privateSurface)); + EXPECT_TRUE(mockMemoryManager.isAllocationTypeToCapture(AllocationType::linearStream)); + EXPECT_TRUE(mockMemoryManager.isAllocationTypeToCapture(AllocationType::internalHeap)); } TEST(MemoryManagerTest, givenAllocationWithNullCpuPtrThenMemoryCopyToAllocationReturnsFalse) { @@ -169,14 +169,14 @@ TEST(MemoryManagerTest, givenMultipleDevicesMemoryManagerWhenGettingDefaultConte } TEST(MemoryManagerTest, givenFailureOnRegisterSystemMemoryAllocationWhenAllocatingMemoryThenNullptrIsReturned) { - AllocationProperties properties(mockRootDeviceIndex, true, MemoryConstants::cacheLineSize, AllocationType::BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, MemoryConstants::cacheLineSize, AllocationType::buffer, false, mockDeviceBitfield); MockMemoryManager memoryManager; memoryManager.registerSysMemAllocResult = MemoryManager::AllocationStatus::Error; EXPECT_EQ(nullptr, memoryManager.allocateGraphicsMemoryWithProperties(properties)); } TEST(MemoryManagerTest, givenFailureOnRegisterLocalMemoryAllocationWhenAllocatingMemoryThenNullptrIsReturned) { - AllocationProperties properties(mockRootDeviceIndex, true, MemoryConstants::cacheLineSize, AllocationType::BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, MemoryConstants::cacheLineSize, AllocationType::buffer, false, mockDeviceBitfield); MockMemoryManager memoryManager(true, true); memoryManager.registerLocalMemAllocResult = MemoryManager::AllocationStatus::Error; EXPECT_EQ(nullptr, memoryManager.allocateGraphicsMemoryWithProperties(properties)); @@ -322,7 +322,7 @@ TEST(OsAgnosticMemoryManager, whenCallingCreateGraphicsAllocationFromMultipleSha AllocationProperties properties = {mockRootDeviceIndex, true, MemoryConstants::pageSize, - AllocationType::BUFFER, + AllocationType::buffer, false, mockDeviceBitfield}; bool requireSpecificBitness{}; @@ -339,7 +339,7 @@ TEST(OsAgnosticMemoryManager, whenCallingCreateGraphicsAllocationFromSharedHandl MemoryManagerCreate memoryManager(false, false, executionEnvironment); osHandle handle = 1; auto size = 4096u; - AllocationProperties properties(mockRootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, false, size, AllocationType::sharedBuffer, false, mockDeviceBitfield); auto sharedAllocation = memoryManager.createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); EXPECT_NE(nullptr, sharedAllocation); EXPECT_EQ(reinterpret_cast(1u), sharedAllocation->getUnderlyingBuffer()); @@ -359,7 +359,7 @@ TEST(OsAgnosticMemoryManager, whenCallingCreateGraphicsAllocationFromSharedHandl osHandle handle = 1; auto size = 4096u; uint64_t basePointer = 0x1234; - AllocationProperties properties(mockRootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, false, size, AllocationType::sharedBuffer, false, mockDeviceBitfield); auto sharedAllocation = memoryManager.createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, reinterpret_cast(basePointer)); EXPECT_NE(nullptr, sharedAllocation); EXPECT_EQ(reinterpret_cast(0x1234), sharedAllocation->getUnderlyingBuffer()); @@ -401,7 +401,7 @@ TEST(MemoryManagerTest, givenLocalMemoryRequiredWhenSelectingHeapThenPickDeviceH } TEST(MemoryManagerTest, whenCreatingAllocPropertiesForMultiStorageResourceThenMultiStorageResourcesFlagIsSetToTrue) { - AllocationProperties properties{0, false, 0u, AllocationType::SCRATCH_SURFACE, false, true, 0}; + AllocationProperties properties{0, false, 0u, AllocationType::scratchSurface, false, true, 0}; EXPECT_TRUE(properties.multiStorageResource); } @@ -451,7 +451,7 @@ TEST(GraphicsAllocationTest, GivenNonSharedResourceHandleWhenAllocationIsCreated auto gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(cpuPtr)); osHandle sharedHandle = Sharing::nonSharedResource; - GraphicsAllocation gfxAllocation(0, AllocationType::UNKNOWN, cpuPtr, size, sharedHandle, MemoryPool::MemoryNull, 0u, canonizedGpuAddress); + GraphicsAllocation gfxAllocation(0, AllocationType::unknown, cpuPtr, size, sharedHandle, MemoryPool::MemoryNull, 0u, canonizedGpuAddress); uint64_t expectedGpuAddr = static_cast(reinterpret_cast(gfxAllocation.getUnderlyingBuffer())); EXPECT_EQ(expectedGpuAddr, gfxAllocation.getGpuAddress()); @@ -465,7 +465,7 @@ TEST(GraphicsAllocationTest, WhenGettingAddressesThenAddressesAreCorrect) { uint64_t gpuBaseAddr = 0x10000; size_t size = 0x1000; - GraphicsAllocation gfxAllocation(0, AllocationType::UNKNOWN, cpuPtr, gpuAddr, gpuBaseAddr, size, MemoryPool::MemoryNull, 0u); + GraphicsAllocation gfxAllocation(0, AllocationType::unknown, cpuPtr, gpuAddr, gpuBaseAddr, size, MemoryPool::MemoryNull, 0u); EXPECT_EQ(gpuAddr, gfxAllocation.getGpuAddress()); @@ -486,7 +486,7 @@ TEST(GraphicsAllocationTest, WhenGettingGpuAddressToPatchThenOffsetIsCorrect) { uint64_t gpuBaseAddr = 0x10000; size_t size = 0x1000; - GraphicsAllocation gfxAllocation(0, AllocationType::UNKNOWN, cpuPtr, gpuAddr, gpuBaseAddr, size, MemoryPool::MemoryNull, 0u); + GraphicsAllocation gfxAllocation(0, AllocationType::unknown, cpuPtr, gpuAddr, gpuBaseAddr, size, MemoryPool::MemoryNull, 0u); EXPECT_EQ(gpuAddr - gpuBaseAddr, gfxAllocation.getGpuAddressToPatch()); } @@ -497,7 +497,7 @@ TEST(GraphicsAllocationTest, WhenSetSizeThenUnderlyingBufferSizeIsSet) { uint64_t gpuBaseAddr = 0x10000; size_t size = 0x2000; - GraphicsAllocation gfxAllocation(0, AllocationType::UNKNOWN, cpuPtr, gpuAddr, gpuBaseAddr, size, MemoryPool::MemoryNull, 0u); + GraphicsAllocation gfxAllocation(0, AllocationType::unknown, cpuPtr, gpuAddr, gpuBaseAddr, size, MemoryPool::MemoryNull, 0u); EXPECT_EQ(size, gfxAllocation.getUnderlyingBufferSize()); size = 0x3000; @@ -779,7 +779,7 @@ TEST_F(MemoryAllocatorTest, GivenPointerAndSizeWhenAskedToCreateGrahicsAllocatio TEST_F(MemoryAllocatorTest, givenMemoryManagerWhenAskedFor32bitAllocationThen32bitGraphicsAllocationIsReturned) { size_t size = 10; - auto allocation = memoryManager->allocate32BitGraphicsMemory(device->getRootDeviceIndex(), size, nullptr, AllocationType::BUFFER); + auto allocation = memoryManager->allocate32BitGraphicsMemory(device->getRootDeviceIndex(), size, nullptr, AllocationType::buffer); EXPECT_NE(nullptr, allocation); EXPECT_NE(nullptr, allocation->getUnderlyingBuffer()); EXPECT_EQ(size, allocation->getUnderlyingBufferSize()); @@ -789,8 +789,8 @@ TEST_F(MemoryAllocatorTest, givenMemoryManagerWhenAskedFor32bitAllocationThen32b TEST_F(MemoryAllocatorTest, givenNotEnoughSpaceInAllocatorWhenAskedFor32bitAllocationThenNullptrIsReturned) { size_t size = 0xfffff000; - auto allocationFirst = memoryManager->allocate32BitGraphicsMemory(device->getRootDeviceIndex(), 0x5000, nullptr, AllocationType::BUFFER); - auto allocation = memoryManager->allocate32BitGraphicsMemory(device->getRootDeviceIndex(), size, nullptr, AllocationType::BUFFER); + auto allocationFirst = memoryManager->allocate32BitGraphicsMemory(device->getRootDeviceIndex(), 0x5000, nullptr, AllocationType::buffer); + auto allocation = memoryManager->allocate32BitGraphicsMemory(device->getRootDeviceIndex(), size, nullptr, AllocationType::buffer); EXPECT_EQ(nullptr, allocation); memoryManager->freeGraphicsMemory(allocationFirst); } @@ -798,8 +798,8 @@ TEST_F(MemoryAllocatorTest, givenNotEnoughSpaceInAllocatorWhenAskedFor32bitAlloc TEST_F(MemoryAllocatorTest, givenNotEnoughSpaceInAllocatorWhenAskedFor32bitAllocationWithHostPtrThenNullptrIsReturned) { size_t size = 0xfffff000; void *ptr = (void *)0x10000; - auto allocationFirst = memoryManager->allocate32BitGraphicsMemory(device->getRootDeviceIndex(), 0x5000, nullptr, AllocationType::BUFFER); - auto allocation = memoryManager->allocate32BitGraphicsMemory(device->getRootDeviceIndex(), size, ptr, AllocationType::BUFFER); + auto allocationFirst = memoryManager->allocate32BitGraphicsMemory(device->getRootDeviceIndex(), 0x5000, nullptr, AllocationType::buffer); + auto allocation = memoryManager->allocate32BitGraphicsMemory(device->getRootDeviceIndex(), size, ptr, AllocationType::buffer); EXPECT_EQ(nullptr, allocation); memoryManager->freeGraphicsMemory(allocationFirst); } @@ -807,7 +807,7 @@ TEST_F(MemoryAllocatorTest, givenNotEnoughSpaceInAllocatorWhenAskedFor32bitAlloc TEST_F(MemoryAllocatorTest, givenMemoryManagerWhenAskedFor32bitAllocationWithPtrThen32bitGraphicsAllocationWithGpuAddressIsReturned) { size_t size = 10; void *ptr = (void *)0x1000; - auto allocation = memoryManager->allocate32BitGraphicsMemory(device->getRootDeviceIndex(), size, ptr, AllocationType::BUFFER); + auto allocation = memoryManager->allocate32BitGraphicsMemory(device->getRootDeviceIndex(), size, ptr, AllocationType::buffer); EXPECT_NE(nullptr, allocation); EXPECT_NE(nullptr, allocation->getUnderlyingBuffer()); EXPECT_EQ(size, allocation->getUnderlyingBufferSize()); @@ -822,7 +822,7 @@ TEST_F(MemoryAllocatorTest, givenMemoryManagerWhenAskedFor32bitAllocationWithPtr TEST_F(MemoryAllocatorTest, givenAllocationWithFragmentsWhenCallingFreeGraphicsMemoryThenDoNotCallHandleFenceCompletion) { auto size = 3u * MemoryConstants::pageSize; auto *ptr = reinterpret_cast(0xbeef1); - AllocationProperties properties{device->getRootDeviceIndex(), false, size, AllocationType::BUFFER, false, device->getDeviceBitfield()}; + AllocationProperties properties{device->getRootDeviceIndex(), false, size, AllocationType::buffer, false, device->getDeviceBitfield()}; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, ptr); EXPECT_EQ(3u, allocation->fragmentsStorage.fragmentCount); @@ -834,7 +834,7 @@ TEST_F(MemoryAllocatorTest, givenAllocationWithFragmentsWhenCallingFreeGraphicsM TEST_F(MemoryAllocatorTest, GivenShareableEnabledAndDisabledWhenAskedToCreateGrahicsAllocationThenValidAllocationIsReturned) { AllocationData allocationData; - allocationData.type = AllocationType::BUFFER; + allocationData.type = AllocationType::buffer; allocationData.flags.shareable = 1u; auto shareableAllocation = memoryManager->allocateGraphicsMemory(allocationData); @@ -849,7 +849,7 @@ TEST_F(MemoryAllocatorTest, GivenShareableEnabledAndDisabledWhenAskedToCreateGra } TEST_F(MemoryAllocatorTest, givenAllocationWithoutFragmentsWhenCallingFreeGraphicsMemoryThenCallHandleFenceCompletion) { - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, device->getDeviceBitfield()}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, device->getDeviceBitfield()}); EXPECT_EQ(0u, allocation->fragmentsStorage.fragmentCount); EXPECT_EQ(0u, memoryManager->handleFenceCompletionCalled); @@ -875,7 +875,7 @@ HWTEST_F(MemoryAllocatorTest, givenSupportFor1MbAlignmentWhenAllocateGraphicsMem auto osAgnosticMemoryManager = std::make_unique>(true, false, *executionEnvironment); osAgnosticMemoryManager->failInDevicePool = true; - MockAllocationProperties properties(mockRootDeviceIndex, true, size, AllocationType::BUFFER, mockDeviceBitfield); + MockAllocationProperties properties(mockRootDeviceIndex, true, size, AllocationType::buffer, mockDeviceBitfield); properties.flags.preferCompressed = true; auto allocationWithEnabled1MbAlignment = osAgnosticMemoryManager->allocateGraphicsMemoryWithProperties(properties, ptr); @@ -1004,19 +1004,19 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWhenIsLimitedGPUOnTypeIsCalledTh MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MyOsAgnosticMemoryManager memoryManager(executionEnvironment); memoryManager.is32bit = false; - EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::BUFFER)); - EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::IMAGE)); - EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::MAP_ALLOCATION)); + EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::buffer)); + EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::image)); + EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::mapAllocation)); memoryManager.is32bit = true; if (executionEnvironment.rootDeviceEnvironments[mockRootDeviceIndex]->isFullRangeSvm()) { - EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::BUFFER)); - EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::IMAGE)); - EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::MAP_ALLOCATION)); + EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::buffer)); + EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::image)); + EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::mapAllocation)); } else { - EXPECT_TRUE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::BUFFER)); - EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::IMAGE)); - EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::MAP_ALLOCATION)); + EXPECT_TRUE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::buffer)); + EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::image)); + EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::mapAllocation)); } } @@ -1031,7 +1031,7 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWhenAskedFor32BitAllocationWhenL memoryManager.forceLimitedRangeAllocator(0, 0xFFFFFFFFF); AllocationData allocationData; - memoryManager.getAllocationData(allocationData, {mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}, nullptr, StorageInfo{}); + memoryManager.getAllocationData(allocationData, {mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield}, nullptr, StorageInfo{}); auto gfxAllocation = memoryManager.allocateGraphicsMemoryWithAlignment(allocationData); ASSERT_NE(gfxAllocation, nullptr); EXPECT_NE(gfxAllocation->getGpuBaseAddress(), 0ull); @@ -1049,7 +1049,7 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWhenAskedForNon32BitAllocationWh memoryManager.forceLimitedRangeAllocator(0, 0xFFFFFFFFF); AllocationData allocationData; - memoryManager.getAllocationData(allocationData, {mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}, nullptr, StorageInfo{}); + memoryManager.getAllocationData(allocationData, {mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield}, nullptr, StorageInfo{}); auto gfxAllocation = memoryManager.allocateGraphicsMemoryWithAlignment(allocationData); ASSERT_NE(gfxAllocation, nullptr); EXPECT_EQ(gfxAllocation->getGpuBaseAddress(), 0ull); @@ -1240,7 +1240,7 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWhenAllocate32BitGraphicsMemoryW void *ptr = reinterpret_cast(0x1001); auto size = MemoryConstants::pageSize; - auto allocation = memoryManager.allocate32BitGraphicsMemory(mockRootDeviceIndex, size, ptr, AllocationType::BUFFER); + auto allocation = memoryManager.allocate32BitGraphicsMemory(mockRootDeviceIndex, size, ptr, AllocationType::buffer); ASSERT_NE(nullptr, allocation); EXPECT_EQ(MemoryPool::System4KBPagesWith32BitGpuAddressing, allocation->getMemoryPool()); @@ -1254,7 +1254,7 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWhenAllocate32BitGraphicsMemoryW void *ptr = nullptr; auto size = MemoryConstants::pageSize; - auto allocation = memoryManager.allocate32BitGraphicsMemory(mockRootDeviceIndex, size, ptr, AllocationType::BUFFER); + auto allocation = memoryManager.allocate32BitGraphicsMemory(mockRootDeviceIndex, size, ptr, AllocationType::buffer); ASSERT_NE(nullptr, allocation); EXPECT_EQ(MemoryPool::System4KBPagesWith32BitGpuAddressing, allocation->getMemoryPool()); @@ -1268,7 +1268,7 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWith64KBPagesEnabledWhenAllocate if (memoryManager.isLimitedGPU(0)) { GTEST_SKIP(); } - auto svmAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}); + auto svmAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::svmZeroCopy, mockDeviceBitfield}); EXPECT_NE(nullptr, svmAllocation); EXPECT_EQ(MemoryPool::System64KBPages, svmAllocation->getMemoryPool()); memoryManager.freeGraphicsMemory(svmAllocation); @@ -1281,7 +1281,7 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWith64KBPagesDisabledWhenAllocat if (memoryManager.isLimitedGPU(0)) { GTEST_SKIP(); } - auto svmAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}); + auto svmAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::svmZeroCopy, mockDeviceBitfield}); EXPECT_EQ(MemoryPool::System4KBPages, svmAllocation->getMemoryPool()); memoryManager.freeGraphicsMemory(svmAllocation); } @@ -1291,7 +1291,7 @@ TEST(OsAgnosticMemoryManager, givenDefaultMemoryManagerWhenCreateGraphicsAllocat MemoryManagerCreate memoryManager(false, false, executionEnvironment); osHandle handle = 1; auto size = 4096u; - AllocationProperties properties(mockRootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, false, size, AllocationType::sharedBuffer, false, mockDeviceBitfield); auto sharedAllocation = memoryManager.createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); EXPECT_NE(nullptr, sharedAllocation); EXPECT_FALSE(sharedAllocation->isCoherent()); @@ -1308,7 +1308,7 @@ TEST(OsAgnosticMemoryManager, givenDefaultMemoryManagerWhenCreateGraphicsAllocat osHandle handle = 1; auto size = 4096u; void *mapPointer = reinterpret_cast(0x1234); - AllocationProperties properties(mockRootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, false, size, AllocationType::sharedBuffer, false, mockDeviceBitfield); auto sharedAllocation = memoryManager.createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, mapPointer); EXPECT_NE(nullptr, sharedAllocation); EXPECT_FALSE(sharedAllocation->isCoherent()); @@ -1324,7 +1324,7 @@ TEST(OsAgnosticMemoryManager, givenDefaultMemoryManagerWhenCreateGraphicsAllocat MemoryManagerCreate memoryManager(false, false, executionEnvironment); osHandle handle = 1; auto size = 4096u; - AllocationProperties properties(mockRootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, false, size, AllocationType::sharedBuffer, false, false, mockDeviceBitfield); EXPECT_EQ(properties.subDevicesBitfield, mockDeviceBitfield); EXPECT_EQ(properties.rootDeviceIndex, 0u); @@ -1344,7 +1344,7 @@ TEST(OsAgnosticMemoryManager, givenDefaultMemoryManagerWhenCreateGraphicsAllocat MemoryManagerCreate memoryManager(false, false, executionEnvironment); osHandle handle = 1; auto size = 4096u; - AllocationProperties properties(mockRootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, false, size, AllocationType::sharedBuffer, false, mockDeviceBitfield); auto sharedAllocation = memoryManager.createGraphicsAllocationFromSharedHandle(handle, properties, true, false, true, nullptr); EXPECT_NE(nullptr, sharedAllocation); EXPECT_TRUE(sharedAllocation->is32BitAllocation()); @@ -1359,7 +1359,7 @@ TEST(OsAgnosticMemoryManager, givenDefaultMemoryManagerWhenCreateGraphicsAllocat TEST(OsAgnosticMemoryManager, givenMemoryManagerWhenCreateAllocationFromNtHandleIsCalledThenReturnNullptr) { MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); OsAgnosticMemoryManager memoryManager(executionEnvironment); - auto graphicsAllocation = memoryManager.createGraphicsAllocationFromNTHandle((void *)1, 0, AllocationType::SHARED_IMAGE); + auto graphicsAllocation = memoryManager.createGraphicsAllocationFromNTHandle((void *)1, 0, AllocationType::sharedImage); EXPECT_EQ(nullptr, graphicsAllocation); } @@ -1443,7 +1443,7 @@ TEST(OsAgnosticMemoryManager, givenDebugModuleAreaTypeWhenCreatingAllocationThen const auto size = MemoryConstants::pageSize64k; NEO::AllocationProperties properties{0, true, size, - NEO::AllocationType::DEBUG_MODULE_AREA, + NEO::AllocationType::debugModuleArea, false, mockDeviceBitfield}; @@ -1481,7 +1481,7 @@ TEST(OsAgnosticMemoryManager, givenLocalMemoryAndDebugModuleAreaTypeWhenCreating const auto size = MemoryConstants::pageSize64k; NEO::AllocationProperties properties{0, true, size, - NEO::AllocationType::DEBUG_MODULE_AREA, + NEO::AllocationType::debugModuleArea, false, mockDeviceBitfield}; @@ -1507,7 +1507,7 @@ TEST(OsAgnosticMemoryManager, givenEnabledLocalMemoryWhenAllocatingGraphicsMemor MockMemoryManager memoryManager(false, true, executionEnvironment); AllocationData allocationData; - allocationData.type = AllocationType::KERNEL_ISA; + allocationData.type = AllocationType::kernelIsa; allocationData.flags.useSystemMemory = 1; allocationData.size = 4096; @@ -1524,7 +1524,7 @@ TEST(OsAgnosticMemoryManager, givenEnabledLocalMemoryWhenAllocatingGraphicsMemor TEST(OsAgnosticMemoryManager, givenForcedSystemMemoryForIsaAndEnabledLocalMemoryWhenAllocatingGraphicsMemoryThenBaseAddressIsEqualToInternalHeapBaseAddress) { DebugManagerStateRestore dbgRestore; - debugManager.flags.ForceSystemMemoryPlacement.set(1 << (static_cast(AllocationType::KERNEL_ISA) - 1)); + debugManager.flags.ForceSystemMemoryPlacement.set(1 << (static_cast(AllocationType::kernelIsa) - 1)); MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getMutableHardwareInfo(); hwInfo->featureTable.flags.ftrLocalMemory = true; @@ -1532,7 +1532,7 @@ TEST(OsAgnosticMemoryManager, givenForcedSystemMemoryForIsaAndEnabledLocalMemory MockMemoryManager memoryManager(false, true, executionEnvironment); size_t kernelIsaSize = 4096; - auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({0, kernelIsaSize, AllocationType::KERNEL_ISA, 1}); + auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({0, kernelIsaSize, AllocationType::kernelIsa, 1}); ASSERT_NE(nullptr, allocation); auto instructionHeapBaseAddress = memoryManager.getInternalHeapBaseAddress(0, false); @@ -1640,11 +1640,11 @@ TEST(OsAgnosticMemoryManager, GivenEnabled64kbPagesWhenHostMemoryAllocationIsCre GTEST_SKIP(); } - GraphicsAllocation *galloc = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize64k, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield}); + GraphicsAllocation *galloc = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize64k, AllocationType::bufferHostMemory, mockDeviceBitfield}); EXPECT_NE(nullptr, galloc); memoryManager.freeGraphicsMemory(galloc); - galloc = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize64k, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield}); + galloc = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize64k, AllocationType::bufferHostMemory, mockDeviceBitfield}); EXPECT_NE(nullptr, galloc); EXPECT_NE(nullptr, galloc->getUnderlyingBuffer()); size_t size = (executionEnvironment.rootDeviceEnvironments[0u]->getHardwareInfo()->capabilityTable.hostPtrTrackingEnabled) ? MemoryConstants::pageSize64k : MemoryConstants::pageSize; @@ -1660,7 +1660,7 @@ TEST(OsAgnosticMemoryManager, givenPointerAndSizeWhenCreateInternalAllocationIsC MockMemoryManager memoryManager(false, false, executionEnvironment); auto ptr = (void *)0x100000; size_t allocationSize = 4096; - auto graphicsAllocation = memoryManager.allocate32BitGraphicsMemory(mockRootDeviceIndex, allocationSize, ptr, AllocationType::INTERNAL_HEAP); + auto graphicsAllocation = memoryManager.allocate32BitGraphicsMemory(mockRootDeviceIndex, allocationSize, ptr, AllocationType::internalHeap); EXPECT_EQ(ptr, graphicsAllocation->getUnderlyingBuffer()); EXPECT_EQ(allocationSize, graphicsAllocation->getUnderlyingBufferSize()); memoryManager.freeGraphicsMemory(graphicsAllocation); @@ -1690,7 +1690,7 @@ TEST_P(OsAgnosticMemoryManagerWithParams, givenReducedGpuAddressSpaceWhenAllocat } OsAgnosticMemoryManager memoryManager(executionEnvironment); auto hostPtr = reinterpret_cast(0x5001); - AllocationProperties properties{0, false, 13, AllocationType::EXTERNAL_HOST_PTR, false, mockDeviceBitfield}; + AllocationProperties properties{0, false, 13, AllocationType::externalHostPtr, false, mockDeviceBitfield}; properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = requiresL3Flush; auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(properties, hostPtr); EXPECT_NE(nullptr, allocation); @@ -1709,13 +1709,13 @@ TEST_P(OsAgnosticMemoryManagerWithParams, givenFullGpuAddressSpaceWhenAllocateGr } OsAgnosticMemoryManager memoryManager(executionEnvironment); auto hostPtr = reinterpret_cast(0x5001); - AllocationProperties properties{0, false, 13, AllocationType::EXTERNAL_HOST_PTR, false, mockDeviceBitfield}; + AllocationProperties properties{0, false, 13, AllocationType::externalHostPtr, false, mockDeviceBitfield}; properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = requiresL3Flush; auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(properties, hostPtr); EXPECT_NE(nullptr, allocation); EXPECT_EQ(1u, allocation->fragmentsStorage.fragmentCount); EXPECT_EQ(requiresL3Flush, allocation->isFlushL3Required()); - EXPECT_EQ(AllocationType::EXTERNAL_HOST_PTR, allocation->getAllocationType()); + EXPECT_EQ(AllocationType::externalHostPtr, allocation->getAllocationType()); memoryManager.freeGraphicsMemory(allocation); } @@ -1736,7 +1736,7 @@ TEST_P(OsAgnosticMemoryManagerWithParams, givenDisabledHostPtrTrackingWhenAlloca OsAgnosticMemoryManager memoryManager(executionEnvironment); auto hostPtr = reinterpret_cast(0x5001); - AllocationProperties properties{0, false, 13, AllocationType::EXTERNAL_HOST_PTR, false, mockDeviceBitfield}; + AllocationProperties properties{0, false, 13, AllocationType::externalHostPtr, false, mockDeviceBitfield}; properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = requiresL3Flush; auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(properties, hostPtr); EXPECT_NE(nullptr, allocation); @@ -1781,7 +1781,7 @@ TEST(OsAgnosticMemoryManager, givenFreeMemoryEnabledAndNonExternalHostPtrAllocat { MockAllocationProperties properties{0, MemoryConstants::pageSize}; - properties.allocationType = AllocationType::EXTERNAL_HOST_PTR; + properties.allocationType = AllocationType::externalHostPtr; auto gfxAllocation = memoryManager.allocateGraphicsMemoryWithProperties(properties); EXPECT_FALSE(mockManager->freeMemoryCalled); @@ -1908,7 +1908,7 @@ TEST(MemoryManager, givenSharedResourceCopyWhenAllocatingGraphicsMemoryThenAlloc AllocationData allocationData; allocationData.imgInfo = &imgInfo; - allocationData.type = AllocationType::SHARED_RESOURCE_COPY; + allocationData.type = AllocationType::sharedResourceCopy; auto imageAllocation = memoryManager.allocateGraphicsMemory(allocationData); EXPECT_NE(nullptr, imageAllocation); @@ -1928,7 +1928,7 @@ TEST(MemoryManager, givenImageAndLimitedGPUWhenAllocatingGraphicsMemoryThenAlloc AllocationData allocationData; allocationData.imgInfo = &imgInfo; - allocationData.type = AllocationType::IMAGE; + allocationData.type = AllocationType::image; auto imageAllocation = memoryManager.allocateGraphicsMemory(allocationData); EXPECT_NE(nullptr, imageAllocation); @@ -1944,7 +1944,7 @@ TEST(MemoryManager, givenBufferAndLimitedGPUWhenAllocatingGraphicsMemoryThenAllo AllocationData allocationData; allocationData.size = 4096u; - allocationData.type = AllocationType::BUFFER; + allocationData.type = AllocationType::buffer; auto bufferAllocation = memoryManager.allocateGraphicsMemory(allocationData); EXPECT_NE(nullptr, bufferAllocation); @@ -1965,7 +1965,7 @@ TEST(MemoryManager, givenBufferHostMemoryAndHostPtrTrackingDisabledWhenAllocatin AllocationData allocationData{}; allocationData.hostPtr = bufferData; allocationData.size = 4096u; - allocationData.type = AllocationType::BUFFER_HOST_MEMORY; + allocationData.type = AllocationType::bufferHostMemory; auto bufferAllocation = memoryManager.allocateGraphicsMemory(allocationData); EXPECT_NE(nullptr, bufferAllocation); @@ -1989,7 +1989,7 @@ TEST(MemoryManager, givenBufferHostMemoryAndHostPtrTrackingDisabledAndForce32bit AllocationData allocationData{}; allocationData.hostPtr = bufferData; allocationData.size = 4096u; - allocationData.type = AllocationType::BUFFER_HOST_MEMORY; + allocationData.type = AllocationType::bufferHostMemory; auto bufferAllocation = memoryManager.allocateGraphicsMemory(allocationData); EXPECT_NE(nullptr, bufferAllocation); @@ -2003,7 +2003,7 @@ TEST(MemoryManager, givenShareableWhenAllocatingGraphicsMemoryThenAllocateSharea AllocationData allocationData; allocationData.size = 4096u; - allocationData.type = AllocationType::BUFFER; + allocationData.type = AllocationType::buffer; allocationData.flags.shareable = true; auto allocation = memoryManager.allocateGraphicsMemory(allocationData); @@ -2336,7 +2336,7 @@ TEST(GraphicsAllocation, givenSharedHandleBasedConstructorWhenGraphicsAllocation MockExecutionEnvironment executionEnvironment{}; auto gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(addressWithTrailingBitSet)); - GraphicsAllocation graphicsAllocation(0, AllocationType::UNKNOWN, addressWithTrailingBitSet, 1u, sharedHandle, MemoryPool::MemoryNull, 0u, canonizedGpuAddress); + GraphicsAllocation graphicsAllocation(0, AllocationType::unknown, addressWithTrailingBitSet, 1u, sharedHandle, MemoryPool::MemoryNull, 0u, canonizedGpuAddress); EXPECT_EQ(expectedGpuAddress, graphicsAllocation.getGpuAddress()); } @@ -2483,19 +2483,19 @@ TEST(MemoryManagerTest, givenExecutionEnvironmentWithCleanedRootDeviceExecutions TEST(MemoryManagerTest, givenAllocationTypesThatMayNeedL3FlushWhenCallingGetAllocationDataThenFlushL3FlagIsCorrectlySet) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 1, AllocationType::UNKNOWN, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 1, AllocationType::unknown, mockDeviceBitfield); properties.flags.flushL3RequiredForRead = 1; properties.flags.flushL3RequiredForWrite = 1; AllocationType allocationTypesThatMayNeedL3Flush[] = { - AllocationType::BUFFER, - AllocationType::BUFFER_HOST_MEMORY, AllocationType::EXTERNAL_HOST_PTR, - AllocationType::GLOBAL_SURFACE, AllocationType::IMAGE, - AllocationType::PIPE, AllocationType::SHARED_IMAGE, - AllocationType::SHARED_BUFFER, AllocationType::SHARED_RESOURCE_COPY, - AllocationType::SVM_ZERO_COPY, AllocationType::SVM_GPU, - AllocationType::SVM_CPU, AllocationType::WRITE_COMBINED, - AllocationType::MAP_ALLOCATION}; + AllocationType::buffer, + AllocationType::bufferHostMemory, AllocationType::externalHostPtr, + AllocationType::globalSurface, AllocationType::image, + AllocationType::pipe, AllocationType::sharedImage, + AllocationType::sharedBuffer, AllocationType::sharedResourceCopy, + AllocationType::svmZeroCopy, AllocationType::svmGpu, + AllocationType::svmCpu, AllocationType::writeCombined, + AllocationType::mapAllocation}; MockMemoryManager mockMemoryManager; for (auto allocationType : allocationTypesThatMayNeedL3Flush) { @@ -2535,43 +2535,43 @@ class HeapSelectorTest : public ::Test { }; TEST_F(HeapSelectorTest, given32bitInternalAllocationWhenSelectingHeapThenInternalHeapIsUsed) { - GraphicsAllocation allocation{0, AllocationType::KERNEL_ISA, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; + GraphicsAllocation allocation{0, AllocationType::kernelIsa, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; allocation.set32BitAllocation(true); EXPECT_EQ(MemoryManager::selectInternalHeap(allocation.isAllocatedInLocalMemoryPool()), memoryManager->selectHeap(&allocation, false, false, false)); - GraphicsAllocation allocation2{0, AllocationType::KERNEL_ISA_INTERNAL, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; + GraphicsAllocation allocation2{0, AllocationType::kernelIsaInternal, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; allocation2.set32BitAllocation(true); EXPECT_EQ(MemoryManager::selectInternalHeap(allocation2.isAllocatedInLocalMemoryPool()), memoryManager->selectHeap(&allocation2, false, false, false)); } TEST_F(HeapSelectorTest, givenNon32bitInternalAllocationWhenSelectingHeapThenInternalHeapIsUsed) { - GraphicsAllocation allocation{0, AllocationType::KERNEL_ISA, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; + GraphicsAllocation allocation{0, AllocationType::kernelIsa, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; allocation.set32BitAllocation(false); EXPECT_EQ(MemoryManager::selectInternalHeap(allocation.isAllocatedInLocalMemoryPool()), memoryManager->selectHeap(&allocation, false, false, false)); - GraphicsAllocation allocation2{0, AllocationType::KERNEL_ISA_INTERNAL, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; + GraphicsAllocation allocation2{0, AllocationType::kernelIsaInternal, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; allocation2.set32BitAllocation(false); EXPECT_EQ(MemoryManager::selectInternalHeap(allocation2.isAllocatedInLocalMemoryPool()), memoryManager->selectHeap(&allocation2, false, false, false)); } TEST_F(HeapSelectorTest, given32bitExternalAllocationWhenSelectingHeapThenExternalHeapIsUsed) { - GraphicsAllocation allocation{0, AllocationType::UNKNOWN, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; + GraphicsAllocation allocation{0, AllocationType::unknown, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; allocation.set32BitAllocation(true); EXPECT_EQ(MemoryManager::selectExternalHeap(allocation.isAllocatedInLocalMemoryPool()), memoryManager->selectHeap(&allocation, false, false, false)); } TEST_F(HeapSelectorTest, givenLimitedAddressSpaceWhenSelectingHeapForExternalAllocationThenStandardHeapIsUsed) { - GraphicsAllocation allocation{0, AllocationType::UNKNOWN, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; + GraphicsAllocation allocation{0, AllocationType::unknown, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; EXPECT_EQ(HeapIndex::HEAP_STANDARD, memoryManager->selectHeap(&allocation, true, false, false)); } TEST_F(HeapSelectorTest, givenFullAddressSpaceWhenSelectingHeapForExternalAllocationWithPtrThenSvmHeapIsUsed) { - GraphicsAllocation allocation{0, AllocationType::UNKNOWN, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; + GraphicsAllocation allocation{0, AllocationType::unknown, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; EXPECT_EQ(HeapIndex::HEAP_SVM, memoryManager->selectHeap(&allocation, true, true, false)); } TEST_F(HeapSelectorTest, givenFullAddressSpaceWhenSelectingHeapForExternalAllocationWithoutPtrAndResourceIs64KSuitableThenStandard64kHeapIsUsed) { - GraphicsAllocation allocation{0, AllocationType::UNKNOWN, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; + GraphicsAllocation allocation{0, AllocationType::unknown, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; auto rootDeviceEnvironment = executionEnvironment->rootDeviceEnvironments[0].get(); GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; @@ -2584,7 +2584,7 @@ TEST_F(HeapSelectorTest, givenFullAddressSpaceWhenSelectingHeapForExternalAlloca } TEST_F(HeapSelectorTest, givenFullAddressSpaceWhenSelectingHeapForExternalAllocationWithoutPtrAndResourceIsNot64KSuitableThenStandardHeapIsUsed) { - GraphicsAllocation allocation{0, AllocationType::UNKNOWN, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; + GraphicsAllocation allocation{0, AllocationType::unknown, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu}; auto rootDeviceEnvironment = executionEnvironment->rootDeviceEnvironments[0].get(); GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; @@ -2605,26 +2605,26 @@ TEST_F(HeapSelectorTest, givenLimitedAddressSpaceWhenSelectingHeapForNullAllocat } TEST_F(HeapSelectorTest, givenDebugModuleAreaAllocationAndUseFrontWindowWhenSelectingHeapThenInternalFrontWindowHeapIsReturned) { - GraphicsAllocation allocation{0, AllocationType::DEBUG_MODULE_AREA, nullptr, 0, 0, 0, MemoryPool::MemoryNull, 1}; + GraphicsAllocation allocation{0, AllocationType::debugModuleArea, nullptr, 0, 0, 0, MemoryPool::MemoryNull, 1}; allocation.set32BitAllocation(true); EXPECT_EQ(HeapIndex::HEAP_INTERNAL_FRONT_WINDOW, memoryManager->selectHeap(&allocation, false, false, true)); } TEST_F(HeapSelectorTest, givenDebugModuleAreaAllocationInLocalMemoryAndUseFrontWindowWhenSelectingHeapThenInternalDeviceFrontWindowHeapIsReturned) { - GraphicsAllocation allocation{0, AllocationType::DEBUG_MODULE_AREA, nullptr, 0, 0, 0, MemoryPool::LocalMemory, 1}; + GraphicsAllocation allocation{0, AllocationType::debugModuleArea, nullptr, 0, 0, 0, MemoryPool::LocalMemory, 1}; allocation.set32BitAllocation(true); EXPECT_TRUE(allocation.isAllocatedInLocalMemoryPool()); EXPECT_EQ(HeapIndex::HEAP_INTERNAL_DEVICE_FRONT_WINDOW, memoryManager->selectHeap(&allocation, false, false, true)); } TEST(MemoryAllocationTest, givenAllocationTypeWhenPassedToMemoryAllocationConstructorThenAllocationTypeIsStored) { - MemoryAllocation allocation{0, AllocationType::COMMAND_BUFFER, nullptr, nullptr, 0, 0, 0, + MemoryAllocation allocation{0, AllocationType::commandBuffer, nullptr, nullptr, 0, 0, 0, MemoryPool::MemoryNull, false, false, MemoryManager::maxOsContextCount}; - EXPECT_EQ(AllocationType::COMMAND_BUFFER, allocation.getAllocationType()); + EXPECT_EQ(AllocationType::commandBuffer, allocation.getAllocationType()); } TEST(MemoryAllocationTest, givenMemoryPoolWhenPassedToMemoryAllocationConstructorThenMemoryPoolIsStored) { - MemoryAllocation allocation{0, AllocationType::COMMAND_BUFFER, nullptr, nullptr, 0, 0, 0, + MemoryAllocation allocation{0, AllocationType::commandBuffer, nullptr, nullptr, 0, 0, 0, MemoryPool::System64KBPages, false, false, MemoryManager::maxOsContextCount}; EXPECT_EQ(MemoryPool::System64KBPages, allocation.getMemoryPool()); } @@ -2755,19 +2755,19 @@ HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhen64BitAndHostPtrTrackingDisab bool expectedValue = !is32bit; - auto result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::EXTERNAL_HOST_PTR, 0u); + auto result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::externalHostPtr, 0u); EXPECT_EQ(expectedValue, result); - result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::MAP_ALLOCATION, 0u); + result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::mapAllocation, 0u); EXPECT_EQ(expectedValue, result); } HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingModeThenNonSvmHostPtrUsageIsSet) { memoryManager->setForceNonSvmForExternalHostPtr(true); - auto result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::EXTERNAL_HOST_PTR, 0u); + auto result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::externalHostPtr, 0u); EXPECT_EQ(true, result); - result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::BUFFER_HOST_MEMORY, 0u); + result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::bufferHostMemory, 0u); EXPECT_EQ(false, result); } @@ -2776,8 +2776,8 @@ HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingModeThenNonSv hwInfoLocal.capabilityTable.hostPtrTrackingEnabled = true; memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[0u]->setHwInfoAndInitHelpers(&hwInfoLocal); int buffer = 0; - EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, AllocationType::EXTERNAL_HOST_PTR, 0u)); - EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, AllocationType::BUFFER_HOST_MEMORY, 0u)); + EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, AllocationType::externalHostPtr, 0u)); + EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, AllocationType::bufferHostMemory, 0u)); } HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingDisabledAnd64bitsThenNonSvmBufferIsSetForBufferHostMemory) { @@ -2785,18 +2785,18 @@ HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingDisabledAnd64 hwInfoLocal.capabilityTable.hostPtrTrackingEnabled = false; memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[0u]->setHwInfoAndInitHelpers(&hwInfoLocal); int buffer = 0; - EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, AllocationType::EXTERNAL_HOST_PTR, 0u)); - EXPECT_EQ(!is32bit, memoryManager->isNonSvmBuffer(&buffer, AllocationType::BUFFER_HOST_MEMORY, 0u)); + EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, AllocationType::externalHostPtr, 0u)); + EXPECT_EQ(!is32bit, memoryManager->isNonSvmBuffer(&buffer, AllocationType::bufferHostMemory, 0u)); } HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingEnabledThenNonSvmHostPtrUsageDependsOnFullRangeSvm) { DebugManagerStateRestore dbgRestore; debugManager.flags.EnableHostPtrTracking.set(1); - auto result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::EXTERNAL_HOST_PTR, 0u); + auto result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::externalHostPtr, 0u); EXPECT_EQ(!executionEnvironment->rootDeviceEnvironments[0]->isFullRangeSvm() && !is32bit, result); - result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::MAP_ALLOCATION, 0u); + result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::mapAllocation, 0u); EXPECT_EQ(!executionEnvironment->rootDeviceEnvironments[0]->isFullRangeSvm() && !is32bit, result); } @@ -2831,7 +2831,7 @@ HWTEST_F(PageTableManagerTest, givenPageTableManagerWhenMapAuxGpuVaThenForAllEng memoryManager->getRegisteredEngines(1)[0].commandStreamReceiver->pageTableManager.reset(mockMngr); memoryManager->getRegisteredEngines(1)[1].commandStreamReceiver->pageTableManager.reset(mockMngr2); - MockGraphicsAllocation allocation(1u, AllocationType::UNKNOWN, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); + MockGraphicsAllocation allocation(1u, AllocationType::unknown, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); MockGmm gmm(executionEnvironment.rootDeviceEnvironments[allocation.getRootDeviceIndex()]->getGmmHelper()); gmm.isCompressionEnabled = true; allocation.setDefaultGmm(&gmm); @@ -2875,7 +2875,7 @@ HWTEST_F(PageTableManagerTest, givenPageTableManagerWhenUpdateAuxTableGmmErrorTh memoryManager->getRegisteredEngines(1)[0].commandStreamReceiver->pageTableManager.reset(mockMngr); - MockGraphicsAllocation allocation(1u, AllocationType::UNKNOWN, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); + MockGraphicsAllocation allocation(1u, AllocationType::unknown, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); MockGmm gmm(executionEnvironment.rootDeviceEnvironments[allocation.getRootDeviceIndex()]->getGmmHelper()); gmm.isCompressionEnabled = true; allocation.setDefaultGmm(&gmm); @@ -2907,7 +2907,7 @@ HWTEST_F(PageTableManagerTest, givenNullPageTableManagerWhenMapAuxGpuVaThenNoThr memoryManager->getRegisteredEngines(1)[0].commandStreamReceiver->pageTableManager.reset(nullptr); - MockGraphicsAllocation allocation(1u, AllocationType::UNKNOWN, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); + MockGraphicsAllocation allocation(1u, AllocationType::unknown, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); MockGmm gmm(executionEnvironment.rootDeviceEnvironments[allocation.getRootDeviceIndex()]->getGmmHelper()); gmm.isCompressionEnabled = true; allocation.setDefaultGmm(&gmm); @@ -2936,7 +2936,7 @@ HWTEST_F(PageTableManagerTest, givenNullPageTableManagerWhenMapAuxGpuVaThenRetur engine.commandStreamReceiver->pageTableManager.reset(nullptr); } - MockGraphicsAllocation allocation(1u, AllocationType::UNKNOWN, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); + MockGraphicsAllocation allocation(1u, AllocationType::unknown, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); bool result = memoryManager->mapAuxGpuVA(&allocation); EXPECT_FALSE(result); @@ -2952,7 +2952,7 @@ HWTEST_F(PageTableManagerTest, givenMemoryManagerThatSupportsPageTableManagerWhe auto memoryManager = new MockMemoryManager(false, false, executionEnvironment); executionEnvironment.memoryManager.reset(memoryManager); - MockGraphicsAllocation allocation(1u, AllocationType::UNKNOWN, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); + MockGraphicsAllocation allocation(1u, AllocationType::unknown, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); MockGmm gmm(executionEnvironment.rootDeviceEnvironments[allocation.getRootDeviceIndex()]->getGmmHelper()); allocation.setDefaultGmm(&gmm); bool mapped = memoryManager->mapAuxGpuVA(&allocation); @@ -2963,7 +2963,7 @@ HWTEST_F(PageTableManagerTest, givenMemoryManagerThatSupportsPageTableManagerWhe TEST(MemoryManagerTest, givenDebugModuleAreaAllocationTypeWhenCallingGetAllocationDataThenUse32BitFrontWindowsIsSet) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 1, AllocationType::DEBUG_MODULE_AREA, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 1, AllocationType::debugModuleArea, mockDeviceBitfield); MockMemoryManager mockMemoryManager; @@ -2973,7 +2973,7 @@ TEST(MemoryManagerTest, givenDebugModuleAreaAllocationTypeWhenCallingGetAllocati TEST(MemoryManagerTest, givenStorageInfoWithParamsWhenGettingAllocDataForSystemMemoryThenSetSystemMemoryFlag) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 1, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 1, AllocationType::bufferHostMemory, mockDeviceBitfield); EXPECT_NE(0lu, mockDeviceBitfield.to_ulong()); @@ -2988,7 +2988,7 @@ TEST(MemoryManagerTest, givenStorageInfoWithParamsWhenGettingAllocDataForSystemM TEST(MemoryManagerTest, givenStorageInfoWithParamsWhenGettingAllocDataForLocalMemoryThenClearSystemMemoryFlag) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 1, AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 1, AllocationType::buffer, mockDeviceBitfield); EXPECT_NE(0lu, mockDeviceBitfield.to_ulong()); @@ -3009,7 +3009,7 @@ TEST(MemoryTransferHelperTest, WhenBlitterIsSelectedButBlitCopyFailsThenFallback srcData[i] = i; } MockGraphicsAllocation graphicsAllocation{destData, sizeof(destData)}; - graphicsAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + graphicsAllocation.setAllocationType(AllocationType::bufferHostMemory); auto hwInfo = *defaultHwInfo; hwInfo.capabilityTable.blitterOperationsSupported = false; @@ -3030,7 +3030,7 @@ TEST(MemoryTransferHelperTest, givenBlitOperationSupportedWhenBcsEngineNotAvaila MockGraphicsAllocation graphicsAllocation{destData, sizeof(destData)}; graphicsAllocation.storageInfo.memoryBanks = 1; - graphicsAllocation.setAllocationType(AllocationType::BUFFER); + graphicsAllocation.setAllocationType(AllocationType::buffer); auto hwInfo = *defaultHwInfo; hwInfo.capabilityTable.blitterOperationsSupported = true; @@ -3049,7 +3049,7 @@ TEST(MemoryManagerTest, givenMemoryManagerWithLocalMemoryWhenCreatingMultiGraphi executionEnvironment.initGmm(); MockMemoryManager memoryManager(true, true, executionEnvironment); - AllocationProperties allocationProperties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::SVM_GPU, systemMemoryBitfield}; + AllocationProperties allocationProperties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::svmGpu, systemMemoryBitfield}; auto localMemoryAllocation = memoryManager.allocateGraphicsMemoryWithProperties(allocationProperties); @@ -3078,7 +3078,7 @@ TEST(MemoryManagerTest, givenDuplicateRootDeviceIndicesWhenCreatingMultiGraphics executionEnvironment.initGmm(); MockMemoryManager memoryManager(true, true, executionEnvironment); - AllocationProperties allocationProperties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::SVM_GPU, systemMemoryBitfield}; + AllocationProperties allocationProperties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::svmGpu, systemMemoryBitfield}; RootDeviceIndicesContainer rootDeviceIndices; rootDeviceIndices.pushUnique(mockRootDeviceIndex); diff --git a/shared/test/unit_test/memory_manager/multi_graphics_allocation_tests.cpp b/shared/test/unit_test/memory_manager/multi_graphics_allocation_tests.cpp index 060eb9cb10..743d2c6fcc 100644 --- a/shared/test/unit_test/memory_manager/multi_graphics_allocation_tests.cpp +++ b/shared/test/unit_test/memory_manager/multi_graphics_allocation_tests.cpp @@ -20,7 +20,7 @@ using namespace NEO; TEST(MultiGraphicsAllocationTest, whenCreatingMultiGraphicsAllocationThenTheAllocationIsObtainableAsADefault) { GraphicsAllocation graphicsAllocation(1, // rootDeviceIndex - AllocationType::BUFFER, + AllocationType::buffer, nullptr, 0, 0, MemoryPool::System4KBPages, 0, 0llu); MockMultiGraphicsAllocation multiGraphicsAllocation(1); @@ -36,10 +36,10 @@ TEST(MultiGraphicsAllocationTest, whenCreatingMultiGraphicsAllocationThenTheAllo TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenAddingMultipleGraphicsAllocationsThenTheyAreObtainableByRootDeviceIndex) { GraphicsAllocation graphicsAllocation0(0, // rootDeviceIndex - AllocationType::BUFFER, + AllocationType::buffer, nullptr, 0, 0, MemoryPool::System4KBPages, 0, 0llu); GraphicsAllocation graphicsAllocation1(1, // rootDeviceIndex - AllocationType::BUFFER, + AllocationType::buffer, nullptr, 0, 0, MemoryPool::System4KBPages, 0, 0llu); MockMultiGraphicsAllocation multiGraphicsAllocation(1); @@ -53,7 +53,7 @@ TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenAddingMultiple } TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenGettingAllocationTypeThenReturnAllocationTypeFromDefaultAllocation) { - auto expectedAllocationType = AllocationType::BUFFER; + auto expectedAllocationType = AllocationType::buffer; GraphicsAllocation graphicsAllocation(1, // rootDeviceIndex expectedAllocationType, nullptr, 0, 0, MemoryPool::System4KBPages, 0, 0llu); @@ -66,7 +66,7 @@ TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenGettingAllocat } TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenGettingCoherencyStatusThenReturnCoherencyStatusFromDefaultAllocation) { - auto expectedAllocationType = AllocationType::BUFFER; + auto expectedAllocationType = AllocationType::buffer; GraphicsAllocation graphicsAllocation(1, // rootDeviceIndex expectedAllocationType, nullptr, 0, 0, MemoryPool::System4KBPages, 0, 0llu); @@ -89,7 +89,7 @@ TEST(MultiGraphicsAllocationTest, WhenCreatingMultiGraphicsAllocationWithoutGrap TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenRemovingGraphicsAllocationThenTheAllocationIsNoLongerAvailable) { uint32_t rootDeviceIndex = 1u; GraphicsAllocation graphicsAllocation(rootDeviceIndex, - AllocationType::BUFFER, + AllocationType::buffer, nullptr, 0, 0, MemoryPool::System4KBPages, 0, 0llu); MockMultiGraphicsAllocation multiGraphicsAllocation(rootDeviceIndex); @@ -126,7 +126,7 @@ TEST_F(MultiGraphicsAllocationTests, whenCreatingMultiGraphicsAllocationWithShar AllocationProperties allocationProperties{0u, true, // allocateMemory MemoryConstants::pageSize, - AllocationType::BUFFER_HOST_MEMORY, + AllocationType::bufferHostMemory, false, // multiOsContextCapable false, // isMultiStorageAllocationParam systemMemoryBitfield}; @@ -149,7 +149,7 @@ TEST_F(MultiGraphicsAllocationTests, whenCreatingMultiGraphicsAllocationWithExis AllocationProperties allocationProperties{0u, false, // allocateMemory MemoryConstants::pageSize, - AllocationType::BUFFER_HOST_MEMORY, + AllocationType::bufferHostMemory, false, // multiOsContextCapable false, // isMultiStorageAllocationParam systemMemoryBitfield}; @@ -170,7 +170,7 @@ TEST_F(MultiGraphicsAllocationTests, whenCreatingMultiGraphicsAllocationWithSepa AllocationProperties allocationProperties{0u, true, // allocateMemory MemoryConstants::pageSize, - AllocationType::BUFFER_HOST_MEMORY, + AllocationType::bufferHostMemory, false, // multiOsContextCapable false, // isMultiStorageAllocationParam systemMemoryBitfield}; @@ -190,7 +190,7 @@ TEST_F(MultiGraphicsAllocationTests, givenMultiGraphicsAllocationThatRequiresMig AllocationProperties allocationProperties{0u, true, // allocateMemory MemoryConstants::pageSize, - AllocationType::BUFFER_HOST_MEMORY, + AllocationType::bufferHostMemory, false, // multiOsContextCapable false, // isMultiStorageAllocationParam systemMemoryBitfield}; @@ -222,7 +222,7 @@ struct MigrationSyncDataTests : public MultiGraphicsAllocationTests { AllocationProperties allocationProperties{0u, true, // allocateMemory MemoryConstants::pageSize, - AllocationType::BUFFER_HOST_MEMORY, + AllocationType::bufferHostMemory, false, // multiOsContextCapable false, // isMultiStorageAllocationParam systemMemoryBitfield}; diff --git a/shared/test/unit_test/memory_manager/special_heap_pool_tests.cpp b/shared/test/unit_test/memory_manager/special_heap_pool_tests.cpp index fe4866d366..e6cf8ac325 100644 --- a/shared/test/unit_test/memory_manager/special_heap_pool_tests.cpp +++ b/shared/test/unit_test/memory_manager/special_heap_pool_tests.cpp @@ -76,7 +76,7 @@ TEST_F(FrontWindowAllocatorTests, givenInitializedHeapsWhenUseExternalAllocatorF } TEST_F(FrontWindowAllocatorTests, givenLinearStreamAllocWhenSelectingHeapWithFrontWindowThenCorrectIndexReturned) { - GraphicsAllocation allocation{0, AllocationType::LINEAR_STREAM, nullptr, 0, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount}; + GraphicsAllocation allocation{0, AllocationType::linearStream, nullptr, 0, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount}; EXPECT_EQ(HeapIndex::HEAP_EXTERNAL_FRONT_WINDOW, memManager->selectHeap(&allocation, true, true, true)); } diff --git a/shared/test/unit_test/memory_manager/storage_info_tests.cpp b/shared/test/unit_test/memory_manager/storage_info_tests.cpp index 2bf0d91904..6132c288a4 100644 --- a/shared/test/unit_test/memory_manager/storage_info_tests.cpp +++ b/shared/test/unit_test/memory_manager/storage_info_tests.cpp @@ -43,7 +43,7 @@ struct MultiDeviceStorageInfoTest : public ::testing::Test { TEST_F(MultiDeviceStorageInfoTest, givenEnabledFlagForForceMultiTileAllocPlacementWhenCreatingStorageInfoForAllocationThenAllMemoryBanksAreOnAndPageTableClonningIsNotRequired) { DebugManagerStateRestore restorer; - AllocationType allocTypes[] = {AllocationType::KERNEL_ISA, AllocationType::KERNEL_ISA_INTERNAL, AllocationType::CONSTANT_SURFACE}; + AllocationType allocTypes[] = {AllocationType::kernelIsa, AllocationType::kernelIsaInternal, AllocationType::constantSurface}; for (uint32_t i = 0; i < 2; i++) { debugManager.flags.ForceMultiTileAllocPlacement.set(1ull << (static_cast(allocTypes[i]) - 1)); @@ -65,7 +65,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenEnabledFlagForForceMultiTileAllocPlaceme TEST_F(MultiDeviceStorageInfoTest, givenDefaultFlagForForceMultiTileAllocPlacementWhenCreatingStorageInfoForAllocationThenSingleMemoryBanksIsOnAndPageTableClonningIsRequired) { - AllocationType allocTypes[] = {AllocationType::KERNEL_ISA, AllocationType::KERNEL_ISA_INTERNAL, AllocationType::CONSTANT_SURFACE}; + AllocationType allocTypes[] = {AllocationType::kernelIsa, AllocationType::kernelIsaInternal, AllocationType::constantSurface}; for (uint32_t i = 0; i < 2; i++) { AllocationProperties properties{mockRootDeviceIndex, false, 0u, allocTypes[i], false, false, singleTileMask}; @@ -88,7 +88,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenDefaultFlagForForceMultiTileAllocPlaceme TEST_F(MultiDeviceStorageInfoTest, givenEnabledFlagForForceSingleTileAllocPlacementWhenCreatingStorageInfoForAllocationThenSingleMemoryBanksIsOnAndPageTableClonningIsRequired) { DebugManagerStateRestore restorer; - AllocationType allocTypes[] = {AllocationType::KERNEL_ISA, AllocationType::KERNEL_ISA_INTERNAL, AllocationType::CONSTANT_SURFACE}; + AllocationType allocTypes[] = {AllocationType::kernelIsa, AllocationType::kernelIsaInternal, AllocationType::constantSurface}; for (uint32_t i = 0; i < 2; i++) { debugManager.flags.ForceSingleTileAllocPlacement.set(1ull << (static_cast(allocTypes[i]) - 1)); @@ -109,7 +109,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenEnabledFlagForForceSingleTileAllocPlacem } TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForPrivateSurfaceWithOneTileThenOnlySingleBankIsUsed) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::PRIVATE_SURFACE, false, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::privateSurface, false, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_FALSE(storageInfo.cloningOfPageTables); EXPECT_EQ(singleTileMask, storageInfo.memoryBanks); @@ -119,7 +119,7 @@ TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForPrivateSurfaceWithO } TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForPrivateSurfaceThenAllMemoryBanksAreOnAndPageTableClonningIsNotRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::PRIVATE_SURFACE, false, false, allTilesMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::privateSurface, false, false, allTilesMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_FALSE(storageInfo.cloningOfPageTables); EXPECT_EQ(allTilesMask, storageInfo.memoryBanks); @@ -129,7 +129,7 @@ TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForPrivateSurfaceThenA } TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForInternalHeapThenSingleMemoryBankIsOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::INTERNAL_HEAP, true, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::internalHeap, true, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); EXPECT_EQ(singleTileMask, storageInfo.memoryBanks); @@ -137,7 +137,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForIn } TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForInternalHeapThenSingleMemoryBankIsOnAndPageTableClonningIsNotRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::INTERNAL_HEAP, false, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::internalHeap, false, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_FALSE(storageInfo.cloningOfPageTables); EXPECT_EQ(singleTileMask, storageInfo.memoryBanks); @@ -146,7 +146,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForI } TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForLinearStreamThenSingleMemoryBankIsOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::LINEAR_STREAM, true, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::linearStream, true, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); EXPECT_EQ(singleTileMask, storageInfo.memoryBanks); @@ -154,7 +154,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForLi } TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForLinearStreamThenSingleMemoryBankIsOnAndPageTableClonningIsNotRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::LINEAR_STREAM, false, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::linearStream, false, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_FALSE(storageInfo.cloningOfPageTables); EXPECT_EQ(singleTileMask, storageInfo.memoryBanks); @@ -164,7 +164,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForL TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForCommandBufferThenFirstAvailableMemoryBankIsOnAndPageTableClonningIsRequired) { const DeviceBitfield firstTileMask{static_cast(1u)}; - AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::COMMAND_BUFFER, true, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::commandBuffer, true, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); EXPECT_EQ(firstTileMask, storageInfo.memoryBanks); @@ -172,7 +172,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForCo } TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForCommandBufferThenSingleMemoryBankIsOnAndPageTableClonningIsNotRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::COMMAND_BUFFER, false, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::commandBuffer, false, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_FALSE(storageInfo.cloningOfPageTables); EXPECT_FALSE(storageInfo.tileInstanced); @@ -181,7 +181,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForC } TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForScratchSpaceThenAllMemoryBankAreOnAndPageTableClonningIsNotRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::SCRATCH_SURFACE, true, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::scratchSurface, true, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_FALSE(storageInfo.cloningOfPageTables); EXPECT_TRUE(storageInfo.tileInstanced); @@ -190,7 +190,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForSc } TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForScratchSpaceThenSingleMemoryBankIsOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::SCRATCH_SURFACE, false, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::scratchSurface, false, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); EXPECT_EQ(singleTileMask, storageInfo.memoryBanks); @@ -198,7 +198,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForS } TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForPreemptionAllocationThenAllMemoryBankAreOnAndPageTableClonningIsNotRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::PREEMPTION, true, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::preemption, true, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_FALSE(storageInfo.cloningOfPageTables); EXPECT_TRUE(storageInfo.tileInstanced); @@ -207,7 +207,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForPr } TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForPreemptionAllocationThenSingleMemoryBankIsOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::PREEMPTION, false, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::preemption, false, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); EXPECT_EQ(singleTileMask, storageInfo.memoryBanks); @@ -215,7 +215,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForP } TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForDeferredTasksListAllocationThenAllMemoryBankAreOnAndPageTableClonningIsNotRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::DEFERRED_TASKS_LIST, true, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::deferredTasksList, true, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_FALSE(storageInfo.cloningOfPageTables); EXPECT_TRUE(storageInfo.tileInstanced); @@ -224,7 +224,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForDe } TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForDeferredTasksListAllocationThenSingleMemoryBankIsOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::DEFERRED_TASKS_LIST, false, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::deferredTasksList, false, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); EXPECT_EQ(singleTileMask, storageInfo.memoryBanks); @@ -232,7 +232,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForD } TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForWorkPartitionSurfaceThenAllMemoryBankAreOnAndPageTableClonningIsNotRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::WORK_PARTITION_SURFACE, true, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::workPartitionSurface, true, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_FALSE(storageInfo.cloningOfPageTables); EXPECT_TRUE(storageInfo.tileInstanced); @@ -245,20 +245,20 @@ HWTEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenAllocatingCsrSpecific auto &heap = commandStreamReceiver->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, MemoryConstants::pageSize64k); auto heapAllocation = heap.getGraphicsAllocation(); if (commandStreamReceiver->canUse4GbHeaps) { - EXPECT_EQ(AllocationType::INTERNAL_HEAP, heapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::internalHeap, heapAllocation->getAllocationType()); } else { - EXPECT_EQ(AllocationType::LINEAR_STREAM, heapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::linearStream, heapAllocation->getAllocationType()); } commandStreamReceiver->ensureCommandBufferAllocation(heap, heap.getAvailableSpace() + 1, 0u); auto commandBufferAllocation = heap.getGraphicsAllocation(); - EXPECT_EQ(AllocationType::COMMAND_BUFFER, commandBufferAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::commandBuffer, commandBufferAllocation->getAllocationType()); EXPECT_NE(heapAllocation, commandBufferAllocation); EXPECT_NE(commandBufferAllocation->getMemoryPool(), MemoryPool::LocalMemory); } TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForBufferCompressedThenAllMemoryBanksAreOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::BUFFER, true, allTilesMask}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::buffer, true, allTilesMask}; properties.flags.preferCompressed = true; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); @@ -270,7 +270,7 @@ TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForBufferCompressedThe } TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForBufferThenAllMemoryBanksAreOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::BUFFER, true, allTilesMask}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::buffer, true, allTilesMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); EXPECT_EQ(allTilesMask, storageInfo.memoryBanks); @@ -281,7 +281,7 @@ TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForBufferThenAllMemory } TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForSVMGPUThenAllMemoryBanksAreOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::SVM_GPU, true, allTilesMask}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::svmGpu, true, allTilesMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); EXPECT_EQ(allTilesMask, storageInfo.memoryBanks); @@ -296,7 +296,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiStorageGranularityWhenCreatingStora debugManager.flags.MultiStorageGranularity.set(128); debugManager.flags.MultiStoragePolicy.set(1); - AllocationProperties properties{mockRootDeviceIndex, false, 10 * MemoryConstants::pageSize64k, AllocationType::SVM_GPU, true, allTilesMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 10 * MemoryConstants::pageSize64k, AllocationType::svmGpu, true, allTilesMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); EXPECT_EQ(allTilesMask, storageInfo.memoryBanks); @@ -307,7 +307,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiStorageGranularityWhenCreatingStora } TEST_F(MultiDeviceStorageInfoTest, givenTwoPagesAllocationSizeWhenCreatingStorageInfoForBufferThenSingleMemoryBankIsOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 2 * MemoryConstants::pageSize64k, AllocationType::BUFFER, true, allTilesMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 2 * MemoryConstants::pageSize64k, AllocationType::buffer, true, allTilesMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); EXPECT_EQ(1lu, storageInfo.memoryBanks.to_ulong()); @@ -316,7 +316,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenTwoPagesAllocationSizeWhenCreatingStorag } TEST_F(MultiDeviceStorageInfoTest, givenSpecifiedDeviceIndexWhenCreatingStorageInfoForBufferThenSingleMemoryBankIsOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::BUFFER, true, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::buffer, true, false, singleTileMask}; properties.multiStorageResource = true; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); @@ -327,7 +327,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenSpecifiedDeviceIndexWhenCreatingStorageI TEST_F(MultiDeviceStorageInfoTest, givenResourceColouringNotSupportedWhenCreatingStorageInfoForBufferThenSingleMemoryBankIsOnAndPageTableClonningIsRequired) { memoryManager->supportsMultiStorageResources = false; - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::BUFFER, true, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::buffer, true, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); EXPECT_EQ(1lu, storageInfo.memoryBanks.count()); @@ -336,7 +336,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenResourceColouringNotSupportedWhenCreatin } TEST_F(MultiDeviceStorageInfoTest, givenNonMultiStorageResourceWhenCreatingStorageInfoForBufferThenSingleMemoryBankIsOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::BUFFER, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::buffer, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); EXPECT_EQ(1lu, storageInfo.memoryBanks.count()); @@ -345,26 +345,26 @@ TEST_F(MultiDeviceStorageInfoTest, givenNonMultiStorageResourceWhenCreatingStora } TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForBufferThenLocalOnlyFlagIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::BUFFER, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::buffer, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.localOnlyRequired); } TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForBufferCompressedThenLocalOnlyFlagIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::BUFFER, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::buffer, false, singleTileMask}; properties.flags.preferCompressed = true; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.localOnlyRequired); } TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForSvmGpuThenLocalOnlyFlagIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::SVM_GPU, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::svmGpu, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.localOnlyRequired); } TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForShareableSvmGpuThenLocalOnlyFlagIsRequiredAndIsNotLocable) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::SVM_GPU, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::svmGpu, false, singleTileMask}; properties.flags.shareable = 1u; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.localOnlyRequired); @@ -372,7 +372,7 @@ TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForShareableSvmGpuThen } TEST_F(MultiDeviceStorageInfoTest, givenReadOnlyBufferToBeCopiedAcrossTilesWhenCreatingStorageInfoThenCorrectValuesAreSet) { - AllocationProperties properties{mockRootDeviceIndex, false, 1u, AllocationType::BUFFER, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 1u, AllocationType::buffer, false, singleTileMask}; properties.flags.readOnlyMultiStorage = true; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_EQ(allTilesMask, storageInfo.memoryBanks); @@ -388,7 +388,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenReadOnlyBufferToBeCopiedAcrossTilesWhenD debugManager.flags.OverrideMultiStoragePlacement.set(proposedTiles.to_ulong()); - AllocationProperties properties{mockRootDeviceIndex, false, 64 * MemoryConstants::kiloByte * 40, AllocationType::BUFFER, true, allTilesMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 64 * MemoryConstants::kiloByte * 40, AllocationType::buffer, true, allTilesMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_EQ(proposedTiles, storageInfo.memoryBanks); @@ -404,7 +404,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenUnifiedSharedMemoryWhenMultiStoragePlace debugManager.flags.OverrideMultiStoragePlacement.set(proposedTiles.to_ulong()); - AllocationProperties properties{mockRootDeviceIndex, false, 512 * MemoryConstants::kiloByte, AllocationType::UNIFIED_SHARED_MEMORY, true, allTilesMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 512 * MemoryConstants::kiloByte, AllocationType::unifiedSharedMemory, true, allTilesMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); @@ -415,7 +415,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenUnifiedSharedMemoryOnMultiTileWhenKmdMig DebugManagerStateRestore restorer; debugManager.flags.UseKmdMigration.set(1); - AllocationProperties properties{mockRootDeviceIndex, false, 512 * MemoryConstants::kiloByte, AllocationType::UNIFIED_SHARED_MEMORY, true, allTilesMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 512 * MemoryConstants::kiloByte, AllocationType::unifiedSharedMemory, true, allTilesMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); @@ -425,7 +425,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenUnifiedSharedMemoryOnMultiTileWhenKmdMig } TEST_F(MultiDeviceStorageInfoTest, givenLeastOccupiedBankAndOtherBitsEnabledInSubDeviceBitfieldWhenCreateStorageInfoThenTakeLeastOccupiedBankAsMemoryBank) { - AllocationProperties properties{mockRootDeviceIndex, false, 1u, AllocationType::UNKNOWN, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 1u, AllocationType::unknown, false, singleTileMask}; auto leastOccupiedBank = memoryManager->getLocalMemoryUsageBankSelector(properties.allocationType, properties.rootDeviceIndex)->getLeastOccupiedBank(properties.subDevicesBitfield); properties.subDevicesBitfield.set(leastOccupiedBank); properties.subDevicesBitfield.set(leastOccupiedBank + 1); @@ -436,7 +436,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenLeastOccupiedBankAndOtherBitsEnabledInSu } TEST_F(MultiDeviceStorageInfoTest, givenNoSubdeviceBitfieldWhenCreateStorageInfoForNonLockableAllocationThenReturnEmptyStorageInfo) { - AllocationType allocationType = AllocationType::BUFFER; + AllocationType allocationType = AllocationType::buffer; EXPECT_FALSE(GraphicsAllocation::isLockable(allocationType)); AllocationProperties properties{mockRootDeviceIndex, false, 1u, allocationType, false, {}}; StorageInfo emptyInfo{}; @@ -446,7 +446,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenNoSubdeviceBitfieldWhenCreateStorageInfo } TEST_F(MultiDeviceStorageInfoTest, givenNoSubdeviceBitfieldWhenCreateStorageInfoForNonLockableAllocationThenReturnEmptyStorageInfoWithLockableFlag) { - AllocationType allocationType = AllocationType::BUFFER_HOST_MEMORY; + AllocationType allocationType = AllocationType::bufferHostMemory; EXPECT_TRUE(GraphicsAllocation::isLockable(allocationType)); AllocationProperties properties{mockRootDeviceIndex, false, 1u, allocationType, false, {}}; StorageInfo emptyInfo{}; @@ -456,8 +456,8 @@ TEST_F(MultiDeviceStorageInfoTest, givenNoSubdeviceBitfieldWhenCreateStorageInfo } TEST_F(MultiDeviceStorageInfoTest, givenGraphicsAllocationWithCpuAccessRequiredWhenCreatingStorageInfoThenSetCpuVisibleSegmentIsRequiredAndIsLockableFlagIsEnabled) { - auto firstAllocationIdx = static_cast(AllocationType::UNKNOWN); - auto lastAllocationIdx = static_cast(AllocationType::COUNT); + auto firstAllocationIdx = static_cast(AllocationType::unknown); + auto lastAllocationIdx = static_cast(AllocationType::count); for (int allocationIdx = firstAllocationIdx; allocationIdx != lastAllocationIdx; allocationIdx++) { auto allocationType = static_cast(allocationIdx); @@ -473,8 +473,8 @@ TEST_F(MultiDeviceStorageInfoTest, givenGraphicsAllocationWithCpuAccessRequiredW } TEST_F(MultiDeviceStorageInfoTest, givenGraphicsAllocationThatIsLockableWhenCreatingStorageInfoThenIsLockableFlagIsEnabled) { - auto firstAllocationIdx = static_cast(AllocationType::UNKNOWN); - auto lastAllocationIdx = static_cast(AllocationType::COUNT); + auto firstAllocationIdx = static_cast(AllocationType::unknown); + auto lastAllocationIdx = static_cast(AllocationType::count); for (int allocationIdx = firstAllocationIdx; allocationIdx != lastAllocationIdx; allocationIdx++) { auto allocationType = static_cast(allocationIdx); @@ -489,7 +489,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenGraphicsAllocationThatIsLockableWhenCrea } TEST_F(MultiDeviceStorageInfoTest, givenAllocationTypeBufferWhenCreatingStorageInfoThenIsLockableFlagIsSetCorrectly) { - AllocationProperties properties{mockRootDeviceIndex, false, 1u, AllocationType::BUFFER, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 1u, AllocationType::buffer, false, singleTileMask}; { properties.makeDeviceBufferLockable = false; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); @@ -501,7 +501,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenAllocationTypeBufferWhenCreatingStorageI EXPECT_TRUE(storageInfo.isLockable); } { - properties.allocationType = AllocationType::IMAGE; + properties.allocationType = AllocationType::image; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_FALSE(storageInfo.isLockable); } @@ -511,7 +511,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenGpuTimestampAllocationWhenUsingSingleTil AllocationProperties properties{mockRootDeviceIndex, false, 1u, - AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, + AllocationType::gpuTimestampDeviceBuffer, singleTileMask.count() > 1u, false, singleTileMask}; @@ -527,7 +527,7 @@ TEST_F(MultiDeviceStorageInfoTest, AllocationProperties properties{mockRootDeviceIndex, false, 1u, - AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, + AllocationType::gpuTimestampDeviceBuffer, allTilesMask.count() > 1u, false, allTilesMask}; @@ -544,21 +544,21 @@ TEST_F(MultiDeviceStorageInfoTest, } TEST_F(MultiDeviceStorageInfoTest, givenSingleTileWhenCreatingStorageInfoForSemaphoreBufferThenProvidedMemoryBankIsSelected) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::SEMAPHORE_BUFFER, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::semaphoreBuffer, false, singleTileMask}; properties.flags.multiOsContextCapable = false; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_EQ(singleTileMask, storageInfo.memoryBanks); } TEST_F(MultiDeviceStorageInfoTest, givenSingleTileWhenCreatingStorageInfoForCommandBufferThenProvidedMemoryBankIsSelected) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::COMMAND_BUFFER, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::commandBuffer, false, singleTileMask}; properties.flags.multiOsContextCapable = false; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_EQ(singleTileMask, storageInfo.memoryBanks); } TEST_F(MultiDeviceStorageInfoTest, givenSingleTileWhenCreatingStorageInfoForRingBufferThenProvidedMemoryBankIsSelected) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::RING_BUFFER, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::ringBuffer, false, singleTileMask}; properties.flags.multiOsContextCapable = false; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_EQ(singleTileMask, storageInfo.memoryBanks); @@ -577,7 +577,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiTileWhenCreatingStorageInfoForSemap memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[mockRootDeviceIndex]->deviceAffinityMask = affinityMaskHelper; - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::SEMAPHORE_BUFFER, false, affinityMaskHelper.getGenericSubDevicesMask()}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::semaphoreBuffer, false, affinityMaskHelper.getGenericSubDevicesMask()}; properties.flags.multiOsContextCapable = true; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_EQ(DeviceBitfield{firstAvailableTileMask}, storageInfo.memoryBanks); @@ -596,7 +596,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiTileWhenCreatingStorageInfoForComma memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[mockRootDeviceIndex]->deviceAffinityMask = affinityMaskHelper; - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::COMMAND_BUFFER, false, affinityMaskHelper.getGenericSubDevicesMask()}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::commandBuffer, false, affinityMaskHelper.getGenericSubDevicesMask()}; properties.flags.multiOsContextCapable = true; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_EQ(DeviceBitfield{firstAvailableTileMask}, storageInfo.memoryBanks); @@ -615,7 +615,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiTileWhenCreatingStorageInfoForRingB memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[mockRootDeviceIndex]->deviceAffinityMask = affinityMaskHelper; - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::RING_BUFFER, false, affinityMaskHelper.getGenericSubDevicesMask()}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::ringBuffer, false, affinityMaskHelper.getGenericSubDevicesMask()}; properties.flags.multiOsContextCapable = true; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_EQ(DeviceBitfield{firstAvailableTileMask}, storageInfo.memoryBanks); @@ -637,7 +637,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenDirectSubmissionForceLocalMemoryStorageD memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[mockRootDeviceIndex]->deviceAffinityMask = affinityMaskHelper; for (auto &multiTile : ::testing::Bool()) { - for (auto &allocationType : {AllocationType::COMMAND_BUFFER, AllocationType::RING_BUFFER, AllocationType::SEMAPHORE_BUFFER}) { + for (auto &allocationType : {AllocationType::commandBuffer, AllocationType::ringBuffer, AllocationType::semaphoreBuffer}) { AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, allocationType, false, affinityMaskHelper.getGenericSubDevicesMask()}; properties.flags.multiOsContextCapable = multiTile; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); @@ -662,7 +662,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenDirectSubmissionForceLocalMemoryStorageE memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[mockRootDeviceIndex]->deviceAffinityMask = affinityMaskHelper; for (auto &multiTile : ::testing::Bool()) { - for (auto &allocationType : {AllocationType::COMMAND_BUFFER, AllocationType::RING_BUFFER, AllocationType::SEMAPHORE_BUFFER}) { + for (auto &allocationType : {AllocationType::commandBuffer, AllocationType::ringBuffer, AllocationType::semaphoreBuffer}) { AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, allocationType, false, affinityMaskHelper.getGenericSubDevicesMask()}; properties.flags.multiOsContextCapable = multiTile; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); @@ -692,7 +692,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenDirectSubmissionForceLocalMemoryStorageE memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[mockRootDeviceIndex]->deviceAffinityMask = affinityMaskHelper; for (auto &multiTile : ::testing::Bool()) { - for (auto &allocationType : {AllocationType::COMMAND_BUFFER, AllocationType::RING_BUFFER, AllocationType::SEMAPHORE_BUFFER}) { + for (auto &allocationType : {AllocationType::commandBuffer, AllocationType::ringBuffer, AllocationType::semaphoreBuffer}) { AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, allocationType, false, affinityMaskHelper.getGenericSubDevicesMask()}; properties.flags.multiOsContextCapable = multiTile; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); diff --git a/shared/test/unit_test/os_interface/aub_memory_operations_handler_tests.cpp b/shared/test/unit_test/os_interface/aub_memory_operations_handler_tests.cpp index f19d5dd716..59ee5af28c 100644 --- a/shared/test/unit_test/os_interface/aub_memory_operations_handler_tests.cpp +++ b/shared/test/unit_test/os_interface/aub_memory_operations_handler_tests.cpp @@ -45,8 +45,8 @@ TEST_F(AubMemoryOperationsHandlerTests, givenAubManagerWhenMakeResidentCalledThe } TEST_F(AubMemoryOperationsHandlerTests, givenAubManagerAndAllocationOfOneTimeAubWritableAllocationTypeWhenMakeResidentCalledTwoTimesThenWriteMemoryOnce) { - ASSERT_TRUE(AubHelper::isOneTimeAubWritableAllocationType(AllocationType::BUFFER)); - allocPtr->setAllocationType(AllocationType::BUFFER); + ASSERT_TRUE(AubHelper::isOneTimeAubWritableAllocationType(AllocationType::buffer)); + allocPtr->setAllocationType(AllocationType::buffer); MockAubManager aubManager; getMemoryOperationsHandler()->setAubManager(&aubManager); @@ -96,7 +96,7 @@ TEST_F(AubMemoryOperationsHandlerTests, givenAubManagerWhenMakeResidentCalledOnW } TEST_F(AubMemoryOperationsHandlerTests, givenAubManagerAndAllocationInLocalMemoryPoolWithoutPageTablesCloningWhenMakeResidentCalledThenWriteMemoryAubIsCalled) { - MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, + MemoryAllocation allocation(0, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000u, MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); allocPtr = &allocation; allocPtr->storageInfo.cloningOfPageTables = false; @@ -212,7 +212,7 @@ TEST_F(AubMemoryOperationsHandlerTests, givenLocalMemoryAndNonLocalMemoryAllocat executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hardwareInfo); executionEnvironment->initializeMemoryManager(); - MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, + MemoryAllocation allocation(0, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000u, MemoryConstants::pageSize, 0, MemoryPool::System64KBPages, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x3u; @@ -242,7 +242,7 @@ TEST_F(AubMemoryOperationsHandlerTests, givenLocalMemoryNoncloneableAllocationWi executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hardwareInfo); executionEnvironment->initializeMemoryManager(); - MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, + MemoryAllocation allocation(0, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000u, MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x3u; allocation.storageInfo.cloningOfPageTables = false; @@ -275,7 +275,7 @@ TEST_F(AubMemoryOperationsHandlerTests, givenLocalMemoryCloneableAllocationWithM executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hardwareInfo); executionEnvironment->initializeMemoryManager(); - MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, + MemoryAllocation allocation(0, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000u, MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x3u; allocation.storageInfo.cloningOfPageTables = true; @@ -308,7 +308,7 @@ TEST_F(AubMemoryOperationsHandlerTests, givenLocalMemoryNoncloneableAllocationWi executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hardwareInfo); executionEnvironment->initializeMemoryManager(); - MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, + MemoryAllocation allocation(0, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000u, MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x3u; allocation.storageInfo.cloningOfPageTables = false; @@ -341,7 +341,7 @@ TEST_F(AubMemoryOperationsHandlerTests, givenGfxAllocationAndNoDeviceWhenSetAubW getMemoryOperationsHandler()->setAubManager(&aubManager); auto memoryOperationsInterface = getMemoryOperationsHandler(); - MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, + MemoryAllocation allocation(0, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000u, MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); memoryOperationsInterface->setAubWritable(true, allocation, device.get()); @@ -356,7 +356,7 @@ TEST_F(AubMemoryOperationsHandlerTests, givenGfxAllocationAndNoDeviceWhenIsAubWr getMemoryOperationsHandler()->setAubManager(&aubManager); auto memoryOperationsInterface = getMemoryOperationsHandler(); - MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, + MemoryAllocation allocation(0, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000u, MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); memoryOperationsInterface->setAubWritable(true, allocation, device.get()); @@ -369,7 +369,7 @@ TEST_F(AubMemoryOperationsHandlerTests, givenGfxAllocationWhenSetAubWritableToTr getMemoryOperationsHandler()->setAubManager(&aubManager); auto memoryOperationsInterface = getMemoryOperationsHandler(); - MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, + MemoryAllocation allocation(0, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000u, MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); memoryOperationsInterface->setAubWritable(true, allocation, device.get()); @@ -384,7 +384,7 @@ TEST_F(AubMemoryOperationsHandlerTests, givenGfxAllocationWhenSetAubWritableForN getMemoryOperationsHandler()->setAubManager(&aubManager); auto memoryOperationsInterface = getMemoryOperationsHandler(); - MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, + MemoryAllocation allocation(0, AllocationType::unknown, nullptr, reinterpret_cast(0x1000), 0x1000u, MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.cloningOfPageTables = false; diff --git a/shared/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp index bd8d45ce82..a0460fe2f2 100644 --- a/shared/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp @@ -105,7 +105,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamMemExecTest, GivenDrmSupportsVmBindAndComplet mock->isVmBindAvailableCall.returnValue = true; TestedBufferObject bo(rootDeviceIndex, mock, 128); - MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::commandBuffer, MemoryPool::System4KBPages); cmdBuffer.bufferObjects[0] = &bo; uint8_t buff[128]; @@ -139,7 +139,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamMemExecTest, GivenDrmSupportsVmBindAndNotComp mock->isVmBindAvailableCall.returnValue = true; TestedBufferObject bo(rootDeviceIndex, mock, 128); - MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::commandBuffer, MemoryPool::System4KBPages); cmdBuffer.bufferObjects[0] = &bo; uint8_t buff[128]; @@ -174,7 +174,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamMemExecTest, GivenDrmSupportsCompletionFenceA mock->isVmBindAvailableCall.returnValue = false; TestedBufferObject bo(rootDeviceIndex, mock, 128); - MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::commandBuffer, MemoryPool::System4KBPages); cmdBuffer.bufferObjects[0] = &bo; uint8_t buff[128]; diff --git a/shared/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp index 2cb91f05f3..fb4553b963 100644 --- a/shared/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp @@ -89,7 +89,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenExecBufferErrorWhenFlushInternalTh mock->errnoRetVal = EWOULDBLOCK; auto rootDeviceIndex = csr->getRootDeviceIndex(); TestedBufferObject bo(rootDeviceIndex, mock, 128); - MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::commandBuffer, MemoryPool::System4KBPages); cmdBuffer.bufferObjects[0] = &bo; uint8_t buff[128]{}; @@ -272,7 +272,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDrmCsrCreatedWithInactiveG HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDrmAllocationWhenGetBufferObjectToModifyIsCalledForAGivenHandleIdThenTheCorrespondingBufferObjectGetsModified) { auto size = 1024u; - auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, size, static_cast(0u), MemoryPool::MemoryNull); + auto allocation = new DrmAllocation(0, AllocationType::unknown, nullptr, nullptr, size, static_cast(0u), MemoryPool::MemoryNull); auto &bos = allocation->getBOs(); for (auto handleId = 0u; handleId < EngineLimits::maxHandleCount; handleId++) { @@ -292,7 +292,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDrmAllocationWhenGetBuffer HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, WhenMakingResidentThenSucceeds) { auto buffer = this->createBO(1024); - auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, buffer, nullptr, buffer->peekSize(), static_cast(0u), MemoryPool::MemoryNull); + auto allocation = new DrmAllocation(0, AllocationType::unknown, buffer, nullptr, buffer->peekSize(), static_cast(0u), MemoryPool::MemoryNull); EXPECT_EQ(nullptr, allocation->getUnderlyingBuffer()); csr->makeResident(*allocation); @@ -310,8 +310,8 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, WhenMakingResidentThenSucceeds) HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenMultipleAllocationsWhenMakingResidentThenEachSucceeds) { BufferObject *buffer1 = this->createBO(4096); BufferObject *buffer2 = this->createBO(4096); - auto allocation1 = new DrmAllocation(0, AllocationType::UNKNOWN, buffer1, nullptr, buffer1->peekSize(), static_cast(0u), MemoryPool::MemoryNull); - auto allocation2 = new DrmAllocation(0, AllocationType::UNKNOWN, buffer2, nullptr, buffer2->peekSize(), static_cast(0u), MemoryPool::MemoryNull); + auto allocation1 = new DrmAllocation(0, AllocationType::unknown, buffer1, nullptr, buffer1->peekSize(), static_cast(0u), MemoryPool::MemoryNull); + auto allocation2 = new DrmAllocation(0, AllocationType::unknown, buffer2, nullptr, buffer2->peekSize(), static_cast(0u), MemoryPool::MemoryNull); EXPECT_EQ(nullptr, allocation1->getUnderlyingBuffer()); EXPECT_EQ(nullptr, allocation2->getUnderlyingBuffer()); @@ -334,7 +334,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenMultipleAllocationsWhenMak HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, WhenMakingResidentTwiceThenRefCountIsOne) { auto buffer = this->createBO(1024); - auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, buffer, nullptr, buffer->peekSize(), static_cast(0u), MemoryPool::MemoryNull); + auto allocation = new DrmAllocation(0, AllocationType::unknown, buffer, nullptr, buffer->peekSize(), static_cast(0u), MemoryPool::MemoryNull); csr->makeResident(*allocation); csr->processResidency(csr->getResidencyAllocations(), 0u); @@ -852,7 +852,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenBindBOsFailsThenMakeBOsRes auto bo = this->createBO(size); BufferObjects bos{bo}; - auto allocation = new MockDrmAllocationBindBOs(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory); + auto allocation = new MockDrmAllocationBindBOs(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory); allocation->bindBOsResult = -1; auto res = allocation->makeBOsResident(&csr->getOsContext(), 0, nullptr, true); @@ -868,7 +868,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenFragmentStorageAndBindBOFa auto bo = this->createBO(size); BufferObjects bos{bo}; - auto allocation = new MockDrmAllocationBindBO(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory); + auto allocation = new MockDrmAllocationBindBO(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory); allocation->bindBOResult = -1; OsHandleStorage prevStorage; @@ -899,7 +899,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenBindBOFailsThenBindBOsRetu auto bo = this->createBO(size); BufferObjects bos{bo}; - auto allocation = new MockDrmAllocationBindBO(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory); + auto allocation = new MockDrmAllocationBindBO(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory); allocation->bindBOResult = -1; auto res = allocation->bindBOs(&csr->getOsContext(), 0u, &static_cast *>(csr)->residency, false); @@ -915,7 +915,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenBindBOFailsWithMultipleMem auto bo2 = this->createBO(size); BufferObjects bos{bo, bo2}; - auto allocation = new MockDrmAllocationBindBO(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory); + auto allocation = new MockDrmAllocationBindBO(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory); allocation->bindBOResult = -1; allocation->storageInfo.memoryBanks = 0b11; EXPECT_EQ(allocation->storageInfo.getNumBanks(), 2u); @@ -933,7 +933,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenBindBOFailsWithMultipleMem auto bo2 = this->createBO(size); BufferObjects bos{bo, bo2}; - auto allocation = new MockDrmAllocationBindBO(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory); + auto allocation = new MockDrmAllocationBindBO(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory); allocation->bindBOResult = -1; allocation->storageInfo.tileInstanced = true; allocation->storageInfo.memoryBanks = 0b11; @@ -950,7 +950,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenAllocationWithSingleBuffer auto size = 1024u; auto bo = this->createBO(size); BufferObjects bos{bo}; - auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory); + auto allocation = new DrmAllocation(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory); EXPECT_EQ(bo, allocation->getBO()); makeResidentBufferObjects(&csr->getOsContext(), allocation); diff --git a/shared/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp b/shared/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp index 1e0cfccefa..813632c08d 100644 --- a/shared/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp @@ -125,7 +125,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenDebugFlagSetWhenSubmittingThenCall } HWTEST_TEMPLATED_F(DrmCommandStreamTest, WhenMakingResidentThenSucceeds) { - DrmAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 1024, static_cast(1u), MemoryPool::MemoryNull); + DrmAllocation graphicsAllocation(0, AllocationType::unknown, nullptr, nullptr, 1024, static_cast(1u), MemoryPool::MemoryNull); csr->makeResident(graphicsAllocation); EXPECT_EQ(0, mock->ioctlCount.gemUserptr); @@ -137,7 +137,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, WhenMakingResidentThenSucceeds) { } HWTEST_TEMPLATED_F(DrmCommandStreamTest, WhenMakingResidentTwiceThenSucceeds) { - DrmAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 1024, static_cast(1u), MemoryPool::MemoryNull); + DrmAllocation graphicsAllocation(0, AllocationType::unknown, nullptr, nullptr, 1024, static_cast(1u), MemoryPool::MemoryNull); csr->makeResident(graphicsAllocation); csr->makeResident(graphicsAllocation); @@ -151,7 +151,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, WhenMakingResidentTwiceThenSucceeds) { } HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenSizeZeroWhenMakingResidentTwiceThenSucceeds) { - DrmAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 0, static_cast(1u), MemoryPool::MemoryNull); + DrmAllocation graphicsAllocation(0, AllocationType::unknown, nullptr, nullptr, 0, static_cast(1u), MemoryPool::MemoryNull); csr->makeResident(graphicsAllocation); @@ -164,8 +164,8 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenSizeZeroWhenMakingResidentTwiceThe } HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenResizedWhenMakingResidentTwiceThenSucceeds) { - DrmAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 1024, static_cast(1u), MemoryPool::MemoryNull); - DrmAllocation graphicsAllocation2(0, AllocationType::UNKNOWN, nullptr, nullptr, 8192, static_cast(1u), MemoryPool::MemoryNull); + DrmAllocation graphicsAllocation(0, AllocationType::unknown, nullptr, nullptr, 1024, static_cast(1u), MemoryPool::MemoryNull); + DrmAllocation graphicsAllocation2(0, AllocationType::unknown, nullptr, nullptr, 8192, static_cast(1u), MemoryPool::MemoryNull); csr->makeResident(graphicsAllocation); csr->makeResident(graphicsAllocation2); @@ -302,7 +302,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenInvalidAddressWhenFlushingThenSucc ASSERT_NE(nullptr, commandBuffer); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(commandBuffer)); - DrmAllocation commandBufferAllocation(0, AllocationType::COMMAND_BUFFER, nullptr, commandBuffer, 1024, static_cast(1u), MemoryPool::MemoryNull, canonizedGpuAddress); + DrmAllocation commandBufferAllocation(0, AllocationType::commandBuffer, nullptr, commandBuffer, 1024, static_cast(1u), MemoryPool::MemoryNull, canonizedGpuAddress); LinearStream cs(&commandBufferAllocation); CommandStreamReceiverHw::addBatchBufferEnd(cs, nullptr); @@ -395,8 +395,8 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenNotAlignedWhenFlushingThenSucceeds HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenCheckFlagsWhenFlushingThenSucceeds) { auto &cs = csr->getCS(); - DrmAllocation allocation(0, AllocationType::UNKNOWN, nullptr, (void *)0x7FFFFFFF, 1024, static_cast(0u), MemoryPool::MemoryNull); - DrmAllocation allocation2(0, AllocationType::UNKNOWN, nullptr, (void *)0x307FFFFFFF, 1024, static_cast(0u), MemoryPool::MemoryNull); + DrmAllocation allocation(0, AllocationType::unknown, nullptr, (void *)0x7FFFFFFF, 1024, static_cast(0u), MemoryPool::MemoryNull); + DrmAllocation allocation2(0, AllocationType::unknown, nullptr, (void *)0x307FFFFFFF, 1024, static_cast(0u), MemoryPool::MemoryNull); csr->makeResident(allocation); csr->makeResident(allocation2); CommandStreamReceiverHw::addBatchBufferEnd(cs, nullptr); @@ -420,7 +420,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenCheckDrmFreeWhenFlushingThenSuccee auto expectedBatchStartOffset = (reinterpret_cast(commandBuffer->getUnderlyingBuffer()) + 4) & (this->alignment - 1); auto expectedSize = alignUp(8u, MemoryConstants::cacheLineSize); // bbEnd - DrmAllocation allocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 1024, static_cast(0u), MemoryPool::MemoryNull); + DrmAllocation allocation(0, AllocationType::unknown, nullptr, nullptr, 1024, static_cast(0u), MemoryPool::MemoryNull); csr->makeResident(allocation); CommandStreamReceiverHw::addBatchBufferEnd(cs, nullptr); @@ -463,7 +463,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenCheckDrmFreeCloseFailedWhenFlushin mock->storedRetValForGemClose = -1; - DrmAllocation allocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 1024, static_cast(0u), MemoryPool::MemoryNull); + DrmAllocation allocation(0, AllocationType::unknown, nullptr, nullptr, 1024, static_cast(0u), MemoryPool::MemoryNull); csr->makeResident(allocation); CommandStreamReceiverHw::addBatchBufferEnd(cs, nullptr); @@ -1068,9 +1068,9 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenPrintBOsForSubmitWhenPrint DebugManagerStateRestore restorer; debugManager.flags.PrintBOsForSubmit.set(true); - MockDrmAllocation allocation1(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::System4KBPages); - MockDrmAllocation allocation2(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::System4KBPages); - MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation allocation1(rootDeviceIndex, AllocationType::buffer, MemoryPool::System4KBPages); + MockDrmAllocation allocation2(rootDeviceIndex, AllocationType::buffer, MemoryPool::System4KBPages); + MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::commandBuffer, MemoryPool::System4KBPages); csr->makeResident(allocation1); csr->makeResident(allocation2); @@ -1104,9 +1104,9 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenPrintBOsForSubmitAndFailur DebugManagerStateRestore restorer; debugManager.flags.PrintBOsForSubmit.set(true); - MockDrmAllocation allocation1(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::System4KBPages); - MockDrmAllocation allocation2(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::System4KBPages); - MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation allocation1(rootDeviceIndex, AllocationType::buffer, MemoryPool::System4KBPages); + MockDrmAllocation allocation2(rootDeviceIndex, AllocationType::buffer, MemoryPool::System4KBPages); + MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::commandBuffer, MemoryPool::System4KBPages); cmdBuffer.makeBOsResidentResult = ENOSPC; @@ -1129,9 +1129,9 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenPrintBOsForSubmitAndFailur DebugManagerStateRestore restorer; debugManager.flags.PrintBOsForSubmit.set(true); - MockDrmAllocation allocation1(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::System4KBPages); - MockDrmAllocation allocation2(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::System4KBPages); - MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation allocation1(rootDeviceIndex, AllocationType::buffer, MemoryPool::System4KBPages); + MockDrmAllocation allocation2(rootDeviceIndex, AllocationType::buffer, MemoryPool::System4KBPages); + MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::commandBuffer, MemoryPool::System4KBPages); allocation1.makeBOsResidentResult = ENOSPC; diff --git a/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_prelim_tests.cpp index 27a9103c95..e80c24c836 100644 --- a/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_prelim_tests.cpp @@ -32,7 +32,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenAllocationWithMultipleBuff auto bo2 = this->createBO(size); auto bo3 = this->createBO(size); BufferObjects bos{bo0, bo1, bo2, bo3}; - auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory); + auto allocation = new DrmAllocation(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory); allocation->storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3)); csr->CommandStreamReceiver::makeResident(*allocation); @@ -258,7 +258,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenAllocationWithMultipleBuff auto bo2 = this->createBO(size); auto bo3 = this->createBO(size); BufferObjects bos{bo0, bo1, bo2, bo3}; - auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory); + auto allocation = new DrmAllocation(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory); allocation->storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3)); allocation->storageInfo.tileInstanced = true; @@ -466,14 +466,14 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, givenTwoTilesW auto multiStorageBo0 = new BufferObject(0u, drm, 3, 30, 0, 1); auto multiStorageBo1 = new BufferObject(0u, drm, 3, 31, 0, 1); BufferObjects multiStorageBos{multiStorageBo0, multiStorageBo1}; - auto multiStorageAllocation = new DrmAllocation(0, AllocationType::UNKNOWN, multiStorageBos, nullptr, 0u, size, MemoryPool::LocalMemory); + auto multiStorageAllocation = new DrmAllocation(0, AllocationType::unknown, multiStorageBos, nullptr, 0u, size, MemoryPool::LocalMemory); multiStorageAllocation->storageInfo.memoryBanks = 0b11; csr->CommandStreamReceiver::makeResident(*multiStorageAllocation); auto tileInstancedBo0 = new BufferObject(0u, drm, 3, 40, 0, 1); auto tileInstancedBo1 = new BufferObject(0u, drm, 3, 41, 0, 1); BufferObjects tileInstancedBos{tileInstancedBo0, tileInstancedBo1}; - auto tileInstancedAllocation = new DrmAllocation(0, AllocationType::UNKNOWN, tileInstancedBos, nullptr, 0u, size, MemoryPool::LocalMemory); + auto tileInstancedAllocation = new DrmAllocation(0, AllocationType::unknown, tileInstancedBos, nullptr, 0u, size, MemoryPool::LocalMemory); tileInstancedAllocation->storageInfo.memoryBanks = 0b11; tileInstancedAllocation->storageInfo.tileInstanced = true; csr->CommandStreamReceiver::makeResident(*tileInstancedAllocation); @@ -540,7 +540,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, whenForceExecu auto tileInstancedBo2 = new BufferObject(0u, drm, 3, 42, 0, 1); auto tileInstancedBo3 = new BufferObject(0u, drm, 3, 43, 0, 1); BufferObjects tileInstancedBos{tileInstancedBo0, tileInstancedBo1, tileInstancedBo2, tileInstancedBo3}; - auto tileInstancedAllocation = new DrmAllocation(0, AllocationType::UNKNOWN, tileInstancedBos, nullptr, 0u, 1024u, MemoryPool::LocalMemory); + auto tileInstancedAllocation = new DrmAllocation(0, AllocationType::unknown, tileInstancedBos, nullptr, 0u, 1024u, MemoryPool::LocalMemory); tileInstancedAllocation->storageInfo.memoryBanks = 0b11; tileInstancedAllocation->storageInfo.tileInstanced = true; csr->CommandStreamReceiver::makeResident(*tileInstancedAllocation); @@ -583,7 +583,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, whenForceExecu auto tileInstancedBo2 = new BufferObject(0u, drm, 3, 42, 0, 1); auto tileInstancedBo3 = new BufferObject(0u, drm, 3, 43, 0, 1); BufferObjects tileInstancedBos{tileInstancedBo0, tileInstancedBo1, tileInstancedBo2, tileInstancedBo3}; - auto tileInstancedAllocation = new DrmAllocation(0, AllocationType::UNKNOWN, tileInstancedBos, nullptr, 0u, 1024u, MemoryPool::LocalMemory); + auto tileInstancedAllocation = new DrmAllocation(0, AllocationType::unknown, tileInstancedBos, nullptr, 0u, 1024u, MemoryPool::LocalMemory); tileInstancedAllocation->storageInfo.memoryBanks = 0b11; tileInstancedAllocation->storageInfo.tileInstanced = true; csr->CommandStreamReceiver::makeResident(*tileInstancedAllocation); @@ -629,7 +629,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, givenDisabledI const auto size = 1024u; BufferObject *bufferObject = new BufferObject(0u, drm, 3, 30, 0, 1); BufferObjects bufferObjects{bufferObject}; - auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, bufferObjects, nullptr, 0u, size, MemoryPool::LocalMemory); + auto allocation = new DrmAllocation(0, AllocationType::unknown, bufferObjects, nullptr, 0u, size, MemoryPool::LocalMemory); csr->CommandStreamReceiver::makeResident(*allocation); auto &cs = csr->getCS(); @@ -663,7 +663,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, givenMultiTile const auto size = 1024u; BufferObject *bufferObject = new BufferObject(0u, drm, 3, 30, 0, 1); BufferObjects bufferObjects{bufferObject}; - auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, bufferObjects, nullptr, 0u, size, MemoryPool::LocalMemory); + auto allocation = new DrmAllocation(0, AllocationType::unknown, bufferObjects, nullptr, 0u, size, MemoryPool::LocalMemory); csr->CommandStreamReceiver::makeResident(*allocation); auto &cs = csr->getCS(); diff --git a/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_tests.cpp index b1c36dd49e..88db1aa78f 100644 --- a/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_tests.cpp @@ -83,7 +83,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmCommandStreamMultiTileMemExecTest, GivenDrmSuppo mock->isVmBindAvailableCall.returnValue = true; TestedBufferObject bo(0, mock, 128); - MockDrmAllocation cmdBuffer(0u, AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation cmdBuffer(0u, AllocationType::commandBuffer, MemoryPool::System4KBPages); cmdBuffer.bufferObjects[0] = &bo; uint8_t buff[128]; @@ -124,7 +124,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmCommandStreamMultiTileMemExecTest, GivenDrmSuppo mock->isVmBindAvailableCall.callParent = false; mock->isVmBindAvailableCall.returnValue = true; - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{0, 1024, AllocationType::COMMAND_BUFFER}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{0, 1024, AllocationType::commandBuffer}); allocation->updateTaskCount(2, defaultEngine.osContext->getContextId()); volatile TagAddressType *completionAddress = defaultEngine.commandStreamReceiver->getTagAddress(); @@ -158,7 +158,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmCommandStreamMultiTileMemExecTest, GivenDrmSuppo mock->isVmBindAvailableCall.callParent = false; mock->isVmBindAvailableCall.returnValue = true; - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{0, 1024, AllocationType::COMMAND_BUFFER}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{0, 1024, AllocationType::commandBuffer}); allocation->updateTaskCount(2, defaultEngine.osContext->getContextId()); volatile TagAddressType *completionAddress = defaultEngine.commandStreamReceiver->getTagAddress(); diff --git a/shared/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp index b8f8be6065..9e646aeccd 100644 --- a/shared/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp @@ -90,7 +90,7 @@ class DrmGemCloseWorkerFixture { class DrmAllocationWrapper : public DrmAllocation { public: DrmAllocationWrapper(BufferObject *bo) - : DrmAllocation(0, AllocationType::UNKNOWN, bo, nullptr, 0, static_cast(0u), MemoryPool::MemoryNull) { + : DrmAllocation(0, AllocationType::unknown, bo, nullptr, 0, static_cast(0u), MemoryPool::MemoryNull) { } }; MockExecutionEnvironment executionEnvironment; diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_bindless_heap_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_bindless_heap_tests.cpp index e6a105634f..3d3cd189dc 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_bindless_heap_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_bindless_heap_tests.cpp @@ -35,7 +35,7 @@ struct GlobalBindlessDrmMemManagerFixture : public DrmMemoryManagerFixtureWithou using DrmGlobalBindlessAllocatorTests = Test; TEST_F(DrmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSurfaceStatesAllocationCreatedThenGpuBaseAddressIsSetToCorrectBaseAddress) { - MockAllocationProperties properties(rootDeviceIndex, true, MemoryConstants::pageSize64k, AllocationType::LINEAR_STREAM); + MockAllocationProperties properties(rootDeviceIndex, true, MemoryConstants::pageSize64k, AllocationType::linearStream); executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->createBindlessHeapsHelper(memoryManager.get(), false, rootDeviceIndex, 1); auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(properties, nullptr); ASSERT_NE(nullptr, allocation); @@ -52,7 +52,7 @@ TEST_F(DrmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSurfaceStatesAllocat TEST_F(DrmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSurfaceStatesAllocationCreatedInDevicePoolThenGpuBaseAddressIsSetToBindlessBaseAddress) { debugManager.flags.ForceLocalMemoryAccessMode.set(0); AllocationData allocData = {}; - allocData.type = AllocationType::LINEAR_STREAM; + allocData.type = AllocationType::linearStream; allocData.size = MemoryConstants::pageSize64k; executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->createBindlessHeapsHelper(memoryManager.get(), false, rootDeviceIndex, 1); @@ -72,7 +72,7 @@ TEST_F(DrmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSurfaceStatesAllocat TEST_F(DrmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSpecialSshHeapCreatedInDevicePoolThenGpuAddressIsSetToBindlessBaseAddress) { debugManager.flags.ForceLocalMemoryAccessMode.set(0); AllocationData allocData = {}; - allocData.type = AllocationType::LINEAR_STREAM; + allocData.type = AllocationType::linearStream; allocData.size = MemoryConstants::pageSize64k; executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->createBindlessHeapsHelper(memoryManager.get(), false, rootDeviceIndex, 1); @@ -89,12 +89,12 @@ TEST_F(DrmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSpecialSshHeapCreate TEST_F(DrmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSurfaceStatesAllocationCreatedInPreferredPoolThenGpuBaseAddressIsSetToCorrectBaseAddress) { AllocationData allocData = {}; - allocData.type = AllocationType::LINEAR_STREAM; + allocData.type = AllocationType::linearStream; allocData.size = MemoryConstants::pageSize64k; executionEnvironment->rootDeviceEnvironments[0]->createBindlessHeapsHelper(memoryManager.get(), false, rootDeviceIndex, 1); - AllocationProperties properties = {rootDeviceIndex, MemoryConstants::pageSize64k, AllocationType::LINEAR_STREAM, {}}; + AllocationProperties properties = {rootDeviceIndex, MemoryConstants::pageSize64k, AllocationType::linearStream, {}}; auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(properties, nullptr); ASSERT_NE(nullptr, allocation); auto gmmHelper = memoryManager->getGmmHelper(rootDeviceIndex); diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_debug_surface_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_debug_surface_prelim_tests.cpp index cb6c0b4ee1..b64b66773f 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_debug_surface_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_debug_surface_prelim_tests.cpp @@ -22,13 +22,13 @@ #include "gtest/gtest.h" TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCreateDebugSurfaceWithUnalignedSizeCalledThenNullptrReturned) { - AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize + 101, NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, 0b1011}; + AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize + 101, NEO::AllocationType::debugContextSaveArea, false, false, 0b1011}; auto debugSurface = memoryManager->allocateGraphicsMemoryWithProperties(debugSurfaceProperties); EXPECT_EQ(nullptr, debugSurface); } TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCreateDebugSurfaceAndAlignedMallocFailedThenNullptrReturned) { - AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, 0b1011}; + AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::debugContextSaveArea, false, false, 0b1011}; memoryManager->alignedMallocShouldFail = true; auto debugSurface = memoryManager->allocateGraphicsMemoryWithProperties(debugSurfaceProperties); memoryManager->alignedMallocShouldFail = false; @@ -37,7 +37,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCreateDebugSurfaceAndAlignedM TEST_F(DrmMemoryManagerLocalMemoryWithCustomPrelimMockTest, givenCreateDebugSurfaceAndAllocUserptrFailedThenNullptrReturned) { mock->ioctlRes = -1; - AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, 0b1011}; + AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::debugContextSaveArea, false, false, 0b1011}; auto debugSurface = memoryManager->allocateGraphicsMemoryWithProperties(debugSurfaceProperties); mock->ioctlRes = 0; EXPECT_EQ(1, mock->ioctlCnt.gemUserptr); @@ -45,7 +45,7 @@ TEST_F(DrmMemoryManagerLocalMemoryWithCustomPrelimMockTest, givenCreateDebugSurf } TEST_F(DrmMemoryManagerLocalMemoryWithCustomPrelimMockTest, givenCreateDebugSurfaceSuccessThenCorrectMultiHostAllocationReturned) { - AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, 0b1011}; + AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::debugContextSaveArea, false, false, 0b1011}; auto debugSurface = static_cast(memoryManager->allocateGraphicsMemoryWithProperties(debugSurfaceProperties)); EXPECT_NE(nullptr, debugSurface); diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp index 7ea0e8a805..3eaef6c55e 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp @@ -31,7 +31,7 @@ TEST_F(DrmMemoryManagerLocalMemoryWithCustomPrelimMockTest, givenDrmMemoryManagerWithLocalMemoryWhenLockResourceIsCalledOnBufferObjectThenReturnPtr) { BufferObject bo(0, mock, 3, 1, 1024, 1); - DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(0, AllocationType::unknown, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); EXPECT_EQ(&bo, drmAllocation.getBO()); auto ptr = memoryManager->lockBufferObject(&bo); @@ -56,7 +56,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenDrmMemoryManagerWithPrelimSup auto bo = std::unique_ptr(memoryManager->createBufferObjectInMemoryRegion(0u, nullptr, - AllocationType::BUFFER, + AllocationType::buffer, gpuAddress, size, (1 << (MemoryBanks::getBankForLocalMemory(0) - 1)), @@ -115,7 +115,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenMultiRootDeviceEnvironmentAnd executionEnvironment->memoryManager.reset(memoryManager); size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {}); static_cast(executionEnvironment->rootDeviceEnvironments[0]->osInterface->getDriverModel()->as())->outputFd = 7; @@ -165,7 +165,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenMultiRootDeviceEnvironmentAnd executionEnvironment->memoryManager.reset(memoryManager); size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {}); memoryManager->failOnObtainFdFromHandle = true; auto ptr = memoryManager->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, properties, multiGraphics); @@ -204,7 +204,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenMultiRootDeviceEnvironmentAnd auto memoryManager = std::make_unique(true, false, false, *executionEnvironment); size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {}); auto ptr = memoryManager->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, properties, multiGraphics); @@ -241,7 +241,7 @@ TEST_F(DrmMemoryManagerUsmSharedHandlePrelimTest, givenMultiRootDeviceEnvironmen auto memoryManager = std::make_unique(true, false, false, *executionEnvironment); size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {}); auto ptr = memoryManager->createUSMHostAllocationFromSharedHandle(1, properties, false, true); EXPECT_EQ(ptr, nullptr); @@ -275,7 +275,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenMultiRootDeviceEnvironmentAnd auto memoryManager = std::make_unique(true, false, false, *executionEnvironment); size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {}); auto ptr = memoryManager->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, properties, multiGraphics); @@ -301,7 +301,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, whenCreateUnifiedMemoryAllocationT AllocationProperties gpuProperties{0u, MemoryConstants::pageSize64k, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, 1u}; gpuProperties.alignment = 2 * MemoryConstants::megaByte; gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::CPU; @@ -342,7 +342,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, AllocationProperties gpuProperties{0u, MemoryConstants::chunkThreshold, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, 1u}; gpuProperties.alignment = 2 * MemoryConstants::megaByte; gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::CPU; @@ -383,7 +383,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, AllocationProperties gpuProperties{0u, MemoryConstants::chunkThreshold, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, 1u}; gpuProperties.alignment = 2 * MemoryConstants::megaByte; gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::CPU; @@ -425,7 +425,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, AllocationProperties gpuProperties{0u, mock->minimalChunkingSize / 2, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, 1u}; gpuProperties.alignment = 2 * MemoryConstants::megaByte; gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::CPU; @@ -467,7 +467,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, AllocationProperties gpuProperties{0u, mock->minimalChunkingSize * 2, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, 1u}; gpuProperties.alignment = 2 * MemoryConstants::megaByte; gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::CPU; @@ -511,7 +511,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, AllocationProperties gpuProperties{0u, mock->minimalChunkingSize * 2, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, 1u}; gpuProperties.alignment = 2 * MemoryConstants::megaByte; gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::CPU; @@ -551,7 +551,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, AllocationProperties gpuProperties{0u, MemoryConstants::chunkThreshold, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, 1u}; gpuProperties.alignment = 2 * MemoryConstants::megaByte; gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::CPU; @@ -593,7 +593,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, whenCreateUnifiedMemoryAllocationW 0u, true, MemoryConstants::megaByte, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, false, devices}; gpuProperties.alignment = MemoryConstants::pageSize64k; @@ -640,7 +640,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenKMDSupportForCrossTileMigrati 0u, true, MemoryConstants::pageSize64k, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, false, devices}; gpuProperties.alignment = 2 * MemoryConstants::megaByte; @@ -1123,7 +1123,7 @@ TEST_F(DrmMemoryManagerWithSingleSubDevicePrelimTest, givenUnifiedMemoryAllocati DeviceBitfield subDevices = 0b01; AllocationProperties gpuProperties{0u, MemoryConstants::pageSize64k, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, subDevices}; gpuProperties.alignment = 2 * MemoryConstants::megaByte; gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::GPU; @@ -1146,7 +1146,7 @@ TEST_F(DrmMemoryManagerWithMultipleSubDevicesPrelimTest, givenUnifiedMemoryAlloc DeviceBitfield subDevices = 0b10; AllocationProperties gpuProperties{0u, MemoryConstants::pageSize64k, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, subDevices}; gpuProperties.alignment = 2 * MemoryConstants::megaByte; gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::GPU; @@ -1168,7 +1168,7 @@ TEST_F(DrmMemoryManagerWithMultipleSubDevicesPrelimTest, givenUnifiedMemoryAlloc DeviceBitfield subDevices = 0b11; AllocationProperties gpuProperties{0u, 2 * MemoryConstants::pageSize64k, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, subDevices}; gpuProperties.alignment = 2 * MemoryConstants::megaByte; gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::GPU; @@ -1199,7 +1199,7 @@ TEST_F(DrmMemoryManagerWithMultipleSubDevicesPrelimTest, givenCreateKmdMigratedS DeviceBitfield subDevices = 0b11; AllocationProperties gpuProperties{0u, MemoryConstants::pageSize64k, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, subDevices}; gpuProperties.alignment = 2 * MemoryConstants::megaByte; gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::GPU; @@ -1358,7 +1358,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenNoMemoryInfoWhenCreateUnified AllocationProperties gpuProperties{0u, MemoryConstants::pageSize64k, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, 1u}; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(gpuProperties); @@ -1376,7 +1376,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenMmapFailWhenCreateUnifiedMemo AllocationProperties gpuProperties{0u, MemoryConstants::pageSize64k, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, 1u}; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(gpuProperties); @@ -1394,7 +1394,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenGemCreateExtFailWhenCreateUni AllocationProperties gpuProperties{0u, MemoryConstants::pageSize64k, - AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::unifiedSharedMemory, 1u}; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(gpuProperties); @@ -1645,7 +1645,7 @@ HWTEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenNotSetUseSystemMemoryWhenGr debugManager.flags.RenderCompressedBuffersEnabled.set(1); DeviceBitfield deviceBitfield{0x0}; AllocationProperties properties(0, MemoryConstants::pageSize, - AllocationType::BUFFER, + AllocationType::buffer, deviceBitfield); AllocationData allocData; @@ -1682,7 +1682,7 @@ HWTEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenEnableStatelessCompressionW MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success; - for (auto allocationType : {AllocationType::GLOBAL_SURFACE, AllocationType::CONSTANT_SURFACE}) { + for (auto allocationType : {AllocationType::globalSurface, AllocationType::constantSurface}) { DeviceBitfield deviceBitfield{0x0}; AllocationProperties properties(0, MemoryConstants::pageSize, allocationType, deviceBitfield); @@ -1701,7 +1701,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenChunkSizeBasedColouringPolicy allocData.allFlags = 0; allocData.size = 18 * MemoryConstants::pageSize64k; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3)); allocData.storageInfo.multiStorage = true; allocData.rootDeviceIndex = rootDeviceIndex; @@ -1741,7 +1741,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenMappingBasedColouringPolicyWh allocData.allFlags = 0; allocData.size = 18 * MemoryConstants::pageSize64k; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3)); allocData.storageInfo.multiStorage = true; allocData.rootDeviceIndex = rootDeviceIndex; @@ -1791,7 +1791,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCpuAccessRequiredWhenAllocati allocData.size = MemoryConstants::pageSize; allocData.flags.requiresCpuAccess = true; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -1813,7 +1813,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCpuAccessRequiredWhenAllocati allocData.size = MemoryConstants::pageSize; allocData.flags.requiresCpuAccess = true; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; memoryManager->mmapFunction = [](void *addr, size_t len, int prot, @@ -1830,7 +1830,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCpuAccessRequiredWhenAllocati allocData.size = MemoryConstants::pageSize; allocData.flags.requiresCpuAccess = true; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::WRITE_COMBINED; + allocData.type = AllocationType::writeCombined; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation2 = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -1842,7 +1842,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenWriteCombinedAllocationWhenAl MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success; AllocationData allocData{}; allocData.size = MemoryConstants::pageSize; - allocData.type = AllocationType::WRITE_COMBINED; + allocData.type = AllocationType::writeCombined; allocData.rootDeviceIndex = rootDeviceIndex; auto sizeAligned = alignUp(allocData.size + MemoryConstants::pageSize64k, 2 * MemoryConstants::megaByte) + 2 * MemoryConstants::megaByte; @@ -1887,29 +1887,29 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSupportedTypeWhenAllocatingIn auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr); bool resource48Bit[] = {true, false}; - AllocationType supportedTypes[] = {AllocationType::BUFFER, - AllocationType::IMAGE, - AllocationType::COMMAND_BUFFER, - AllocationType::LINEAR_STREAM, - AllocationType::INDIRECT_OBJECT_HEAP, - AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, - AllocationType::INTERNAL_HEAP, - AllocationType::KERNEL_ISA, - AllocationType::KERNEL_ISA_INTERNAL, - AllocationType::DEBUG_MODULE_AREA, - AllocationType::SVM_GPU}; + AllocationType supportedTypes[] = {AllocationType::buffer, + AllocationType::image, + AllocationType::commandBuffer, + AllocationType::linearStream, + AllocationType::indirectObjectHeap, + AllocationType::timestampPacketTagBuffer, + AllocationType::internalHeap, + AllocationType::kernelIsa, + AllocationType::kernelIsaInternal, + AllocationType::debugModuleArea, + AllocationType::svmGpu}; for (auto res48bit : resource48Bit) { for (auto supportedType : supportedTypes) { allocData.type = supportedType; - allocData.imgInfo = (AllocationType::IMAGE == supportedType) ? &imgInfo : nullptr; - allocData.hostPtr = (AllocationType::SVM_GPU == supportedType) ? ::alignedMalloc(allocData.size, 4096) : nullptr; + allocData.imgInfo = (AllocationType::image == supportedType) ? &imgInfo : nullptr; + allocData.hostPtr = (AllocationType::svmGpu == supportedType) ? ::alignedMalloc(allocData.size, 4096) : nullptr; switch (supportedType) { - case AllocationType::IMAGE: - case AllocationType::INDIRECT_OBJECT_HEAP: - case AllocationType::INTERNAL_HEAP: - case AllocationType::KERNEL_ISA: - case AllocationType::KERNEL_ISA_INTERNAL: + case AllocationType::image: + case AllocationType::indirectObjectHeap: + case AllocationType::internalHeap: + case AllocationType::kernelIsa: + case AllocationType::kernelIsaInternal: allocData.flags.resource48Bit = true; break; default: @@ -1922,7 +1922,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSupportedTypeWhenAllocatingIn auto gpuAddress = allocation->getGpuAddress(); auto gmmHelper = device->getGmmHelper(); - if (allocation->getAllocationType() == AllocationType::SVM_GPU) { + if (allocation->getAllocationType() == AllocationType::svmGpu) { if (!memoryManager->isLimitedRange(0)) { EXPECT_LT(gmmHelper->canonize(memoryManager->getGfxPartition(0)->getHeapBase(HeapIndex::HEAP_SVM)), gpuAddress); EXPECT_GT(gmmHelper->canonize(memoryManager->getGfxPartition(0)->getHeapLimit(HeapIndex::HEAP_SVM)), gpuAddress); @@ -1946,7 +1946,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSupportedTypeWhenAllocatingIn } memoryManager->freeGraphicsMemory(allocation); - if (AllocationType::SVM_GPU == supportedType) { + if (AllocationType::svmGpu == supportedType) { ::alignedFree(const_cast(allocData.hostPtr)); } } @@ -1976,7 +1976,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenPrintBOCreateDestroyResultFla testing::internal::CaptureStdout(); auto bo = std::unique_ptr(memoryManager->createBufferObjectInMemoryRegion(0u, nullptr, - AllocationType::BUFFER, + AllocationType::buffer, gpuAddress, size, (1 << (MemoryBanks::getBankForLocalMemory(0) - 1)), @@ -2034,7 +2034,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenDebugModuleAreaTypeWhenAlloca memoryManager->gfxPartitions[rootDeviceIndex].reset(gfxPartitionDrm); NEO::AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize64k, - NEO::AllocationType::DEBUG_MODULE_AREA, + NEO::AllocationType::debugModuleArea, false, device->getDeviceBitfield()}; @@ -2065,7 +2065,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSipKernelTypeWhenAllocatingBy memoryManager->gfxPartitions[rootDeviceIndex].reset(gfxPartitionDrm); - AllocationProperties properties = {rootDeviceIndex, 0x1000, NEO::AllocationType::KERNEL_ISA_INTERNAL, device->getDeviceBitfield()}; + AllocationProperties properties = {rootDeviceIndex, 0x1000, NEO::AllocationType::kernelIsaInternal, device->getDeviceBitfield()}; properties.flags.use32BitFrontWindow = true; auto sipKernel = memoryManager->allocateGraphicsMemoryWithProperties(properties); @@ -2088,7 +2088,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSipKernelTypeWhenAllocatingBy TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenDebugModuleAreaTypeWhenAllocatingThenBothUseFrontWindowInternalDeviceHeaps) { NEO::AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize64k, - NEO::AllocationType::DEBUG_MODULE_AREA, + NEO::AllocationType::debugModuleArea, false, device->getDeviceBitfield()}; auto moduleDebugArea = memoryManager->allocateGraphicsMemoryWithProperties(properties); @@ -2105,7 +2105,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenDebugModuleAreaTypeWhenAlloca } TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSipKernelTypeWhenAllocatingThenFrontWindowInternalDeviceHeapIsUsed) { - const auto allocType = AllocationType::KERNEL_ISA_INTERNAL; + const auto allocType = AllocationType::kernelIsaInternal; AllocationProperties properties = {rootDeviceIndex, 0x1000, allocType, device->getDeviceBitfield()}; properties.flags.use32BitFrontWindow = true; @@ -2125,7 +2125,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSipKernelTypeWhenAllocatingTh TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenDebugVariableSetWhenAllocatingThenForceHeapAlignment) { debugManager.flags.ExperimentalEnableCustomLocalMemoryAlignment.set(static_cast(MemoryConstants::megaByte * 2)); - const auto allocType = AllocationType::KERNEL_ISA_INTERNAL; + const auto allocType = AllocationType::kernelIsaInternal; AllocationProperties properties = {rootDeviceIndex, 0x1000, allocType, device->getDeviceBitfield()}; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); @@ -2167,7 +2167,7 @@ TEST_F(DrmMemoryManagerFailInjectionPrelimTest, givenEnabledLocalMemoryWhenNewFa allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = testedMemoryManager.allocateGraphicsMemoryInDevicePool(allocData, status); @@ -2236,7 +2236,7 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationPrelimTest, givenDrmMemoryManagerWh allocData.allFlags = 0; allocData.size = dataToCopy.size(); allocData.flags.allocateMemory = true; - allocData.type = AllocationType::KERNEL_ISA; + allocData.type = AllocationType::kernelIsa; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks.set(0, true); @@ -2263,7 +2263,7 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationPrelimTest, givenDrmMemoryManagerWh allocData.allFlags = 0; allocData.size = dataToCopy.size(); allocData.flags.allocateMemory = true; - allocData.type = AllocationType::CONSTANT_SURFACE; + allocData.type = AllocationType::constantSurface; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b11; @@ -2286,7 +2286,7 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationPrelimTest, givenDrmMemoryManagerWh DrmMemoryManagerToTestCopyMemoryToAllocation drmMemoryManager(*executionEnvironment, true, destinationAllocationSize); std::vector dataToCopy(sourceAllocationSize, 1u); - AllocationType debugSurfaces[] = {AllocationType::DEBUG_CONTEXT_SAVE_AREA, AllocationType::DEBUG_SBA_TRACKING_BUFFER}; + AllocationType debugSurfaces[] = {AllocationType::debugContextSaveArea, AllocationType::debugSbaTrackingBuffer}; for (auto type : debugSurfaces) { AllocationProperties debugSurfaceProperties{0, true, sourceAllocationSize, type, false, false, 0b11}; @@ -2308,7 +2308,7 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationPrelimTest, givenDrmMemoryManagerWh allocData.allFlags = 0; allocData.size = dataToCopy.size(); allocData.flags.allocateMemory = true; - allocData.type = AllocationType::KERNEL_ISA; + allocData.type = AllocationType::kernelIsa; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks.set(0, true); MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success; @@ -2329,7 +2329,7 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationPrelimTest, givenDrmMemoryManagerWh DrmMemoryManagerToTestCopyMemoryToAllocation drmMemoryManager(*executionEnvironment, false, 0); std::vector dataToCopy(sourceAllocationSize, 1u); - auto allocation = drmMemoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, destinationAllocationSize, AllocationType::KERNEL_ISA, mockDeviceBitfield}); + auto allocation = drmMemoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, destinationAllocationSize, AllocationType::kernelIsa, mockDeviceBitfield}); ASSERT_NE(nullptr, allocation); auto ret = drmMemoryManager.copyMemoryToAllocation(allocation, offset, dataToCopy.data(), dataToCopy.size()); @@ -2352,7 +2352,7 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationPrelimTest, givenDrmMemoryManagerWh allocData.allFlags = 0; allocData.size = dataToCopy.size(); allocData.flags.allocateMemory = true; - allocData.type = AllocationType::KERNEL_ISA; + allocData.type = AllocationType::kernelIsa; allocData.storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3)); allocData.rootDeviceIndex = rootDeviceIndex; MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success; @@ -2378,7 +2378,7 @@ TEST_F(DrmMemoryManagerTestPrelim, whenSettingNumHandlesThenTheyAreRetrievedCorr std::vector handles{6, 7}; size_t size = 65536u * 2; - AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, device->getDeviceBitfield()); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, device->getDeviceBitfield()); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromMultipleSharedHandles(handles, properties, false, false, true, nullptr); ASSERT_NE(nullptr, graphicsAllocation); @@ -2399,7 +2399,7 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl std::vector handles{6, 7}; size_t size = 65536u * 2; - AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, device->getDeviceBitfield()); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, device->getDeviceBitfield()); memoryManager->failOnfindAndReferenceSharedBufferObject = false; @@ -2432,7 +2432,7 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl std::vector handles{6, 7}; size_t size = 65536u * 2; - AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, device->getDeviceBitfield()); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, device->getDeviceBitfield()); memoryManager->failOnfindAndReferenceSharedBufferObject = false; @@ -2466,7 +2466,7 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl std::vector handles{6, 7}; size_t size = 65536u * 2; - AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, device->getDeviceBitfield()); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, device->getDeviceBitfield()); memoryManager->failOnfindAndReferenceSharedBufferObject = false; @@ -2499,7 +2499,7 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl std::vector handles{6, 7}; size_t size = 65536u * 2; - AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, device->getDeviceBitfield()); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, device->getDeviceBitfield()); memoryManager->failOnfindAndReferenceSharedBufferObject = false; auto graphicsAllocation = memoryManager->createGraphicsAllocationFromMultipleSharedHandles(handles, properties, false, false, true, nullptr); @@ -2529,7 +2529,7 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl std::vector handles{6}; size_t size = 65536u * 2; - AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, device->getDeviceBitfield()); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, device->getDeviceBitfield()); memoryManager->failOnfindAndReferenceSharedBufferObject = false; auto graphicsAllocation = memoryManager->createGraphicsAllocationFromMultipleSharedHandles(handles, properties, false, false, true, nullptr); @@ -2561,7 +2561,7 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl std::vector handles{6, 7}; size_t size = 65536u * 2; - AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, device->getDeviceBitfield()); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, device->getDeviceBitfield()); memoryManager->failOnfindAndReferenceSharedBufferObject = false; auto graphicsAllocation = memoryManager->createGraphicsAllocationFromMultipleSharedHandles(handles, properties, false, false, true, nullptr); @@ -2575,7 +2575,7 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl std::vector handles{6, 7}; size_t size = 65536u * 2; - AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, device->getDeviceBitfield()); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, device->getDeviceBitfield()); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromMultipleSharedHandles(handles, properties, false, false, true, nullptr); ASSERT_NE(nullptr, graphicsAllocation); @@ -2595,7 +2595,7 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerWhenLockUnlockIsCalledOn mock->ioctlResExt = &ioctlResExt; BufferObject bo(0, mock, 3, 1, 0, 1); - DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(0, AllocationType::unknown, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); EXPECT_NE(nullptr, drmAllocation.getBO()); auto ptr = memoryManager->lockResource(&drmAllocation); @@ -2610,7 +2610,7 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerWhenLockUnlockIsCalledOn mock->failOnMmapOffset = true; BufferObject bo(0, mock, 3, 1, 0, 1); - DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(0, AllocationType::unknown, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); EXPECT_NE(nullptr, drmAllocation.getBO()); auto ptr = memoryManager->lockResource(&drmAllocation); @@ -2628,7 +2628,7 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndOsHandleWhenCreateIsC osHandle handle = 1u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, true, true, nullptr); ASSERT_NE(nullptr, graphicsAllocation); @@ -2659,7 +2659,7 @@ TEST_F(DrmMemoryManagerTestPrelim, osHandle handle = 1u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {}); testing::internal::CaptureStdout(); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, true, true, nullptr); @@ -2700,7 +2700,7 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndOsHandleWhenCreateIsC osHandle handle = 1u; this->mock->outputHandle = 2u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, true, true, nullptr); ASSERT_NE(nullptr, graphicsAllocation); @@ -2729,7 +2729,7 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndOsHandleWhenCreateIsC osHandle handle = 1u; this->mock->outputHandle = 2u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, true, true, nullptr); ASSERT_NE(nullptr, graphicsAllocation); @@ -2769,7 +2769,7 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndOsHandleWhenCreateIsC osHandle handle = 1u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {}); mock->returnIoctlExtraErrorValue = true; mock->failOnMmapOffset = true; @@ -2788,7 +2788,7 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndUseMmapObjectSetToFal this->mock->outputHandle = handle; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {}); properties.useMmapObject = false; auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, true, true, nullptr); @@ -2808,7 +2808,7 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerWithoutMemoryInfoThenDrm this->mock->outputHandle = handle; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, true, true, nullptr); EXPECT_EQ(static_cast(handle), static_cast(graphicsAllocation)->getBO()->peekHandle()); @@ -2821,7 +2821,7 @@ TEST_F(DrmMemoryManagerTestPrelim, MmapFailWhenUSMHostAllocationFromSharedHandle osHandle handle = 1u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {}); memoryManager->mmapFunction = [](void *addr, size_t len, int prot, int flags, int fd, off_t offset) throw() { @@ -2834,7 +2834,7 @@ TEST_F(DrmMemoryManagerTestPrelim, MmapFailWhenUSMHostAllocationFromSharedHandle } TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationInLocalMemoryButBufferObjectIsNullThenReturnNullPtr) { - DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(0, AllocationType::unknown, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory); auto ptr = memoryManager->lockResource(&drmAllocation); EXPECT_EQ(nullptr, ptr); @@ -2915,7 +2915,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenGraphicsAllocationInDevicePoo AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = AllocationType::IMAGE; + allocData.type = AllocationType::image; allocData.flags.resource48Bit = true; allocData.imgInfo = &imgInfo; allocData.rootDeviceIndex = rootDeviceIndex; @@ -2953,7 +2953,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenAllocationWithUnifiedMemoryAl allocData.allFlags = 0; allocData.size = 18 * MemoryConstants::pageSize64k; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::UNIFIED_SHARED_MEMORY; + allocData.type = AllocationType::unifiedSharedMemory; allocData.rootDeviceIndex = rootDeviceIndex; allocData.useMmapObject = false; @@ -2968,7 +2968,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenAllocationWithUnifiedMemoryAl allocData.allFlags = 0; allocData.size = 18 * MemoryConstants::pageSize64k; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::UNIFIED_SHARED_MEMORY; + allocData.type = AllocationType::unifiedSharedMemory; allocData.rootDeviceIndex = rootDeviceIndex; allocData.useMmapObject = true; @@ -2991,7 +2991,7 @@ TEST(AllocationInfoLogging, givenDrmGraphicsAllocationWithMultipleBOsWhenGetting BufferObject bo0(0, &drm, 3, 0, 0, 1), bo1(0, &drm, 3, 1, 0, 1), bo2(0, &drm, 3, 2, 0, 1), bo3(0, &drm, 3, 3, 0, 1); BufferObjects bos{&bo0, &bo1, &bo2, &bo3}; - DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, bos, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(0, AllocationType::unknown, bos, nullptr, 0u, 0u, MemoryPool::LocalMemory); EXPECT_STREQ(drmAllocation.getAllocationInfoString().c_str(), " Handle: 0 Handle: 1 Handle: 2 Handle: 3"); } @@ -3020,13 +3020,13 @@ TEST_P(DrmMemoryManagerAllocation57BitTest, givenAllocationTypeHaveToBeAllocated } static const AllocationType allocation57Bit[] = { - AllocationType::BUFFER, - AllocationType::CONSTANT_SURFACE, - AllocationType::GLOBAL_SURFACE, - AllocationType::PIPE, - AllocationType::PRINTF_SURFACE, - AllocationType::PRIVATE_SURFACE, - AllocationType::SHARED_BUFFER, + AllocationType::buffer, + AllocationType::constantSurface, + AllocationType::globalSurface, + AllocationType::pipe, + AllocationType::printfSurface, + AllocationType::privateSurface, + AllocationType::sharedBuffer, }; INSTANTIATE_TEST_CASE_P(Drm57Bit, diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_upstream_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_upstream_tests.cpp index 09ca436ebf..90e40f73b5 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_upstream_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_upstream_tests.cpp @@ -121,7 +121,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenDrmMemoryManagerWhenCreateBuffer auto bo = std::unique_ptr(memoryManager->createBufferObjectInMemoryRegion(rootDeviceIndex, nullptr, - AllocationType::BUFFER, + AllocationType::buffer, gpuAddress, size, (1 << (MemoryBanks::getBankForLocalMemory(0) - 1)), @@ -169,7 +169,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenMultiRootDeviceEnvironmentAndMem auto memoryManager = std::make_unique(true, false, false, *executionEnvironment); size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {}); static_cast(executionEnvironment->rootDeviceEnvironments[0]->osInterface->getDriverModel()->as())->outputFd = 7; @@ -216,7 +216,7 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenMultiRootDeviceEnvironmentAndMemory auto memoryManager = std::make_unique(true, false, false, *executionEnvironment); size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {}); auto ptr = memoryManager->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, properties, multiGraphics); @@ -231,7 +231,7 @@ TEST_F(DrmMemoryManagerUsmSharedHandleTest, givenDrmMemoryManagerAndOsHandleWhen osHandle handle = 1u; this->mock->outputHandle = 2u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, true, true, nullptr); ASSERT_NE(nullptr, graphicsAllocation); @@ -275,7 +275,7 @@ TEST_F(DrmMemoryManagerUsmSharedHandleTest, givenMultiRootDeviceEnvironmentAndMe auto memoryManager = std::make_unique(true, false, false, *executionEnvironment); size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {}); auto ptr = memoryManager->createUSMHostAllocationFromSharedHandle(1, properties, false, true); @@ -308,7 +308,7 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenMultiRootDeviceEnvironmentAndNoMemo auto memoryManager = std::make_unique(true, false, false, *executionEnvironment); size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {}); auto ptr = memoryManager->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, properties, multiGraphics); @@ -494,7 +494,7 @@ TEST_F(DrmMemoryManagerLocalMemoryMemoryBankTest, givenDeviceMemoryWhenGraphicsA allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.useSystemMemory = false; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 1u; memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -508,7 +508,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenCpuAccessRequiredWhenAllocatingI allocData.size = MemoryConstants::pageSize; allocData.flags.requiresCpuAccess = true; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -527,7 +527,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenWriteCombinedAllocationWhenAlloc MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success; AllocationData allocData{}; allocData.size = MemoryConstants::pageSize; - allocData.type = AllocationType::WRITE_COMBINED; + allocData.type = AllocationType::writeCombined; allocData.rootDeviceIndex = rootDeviceIndex; auto sizeAligned = alignUp(allocData.size + MemoryConstants::pageSize64k, 2 * MemoryConstants::megaByte) + 2 * MemoryConstants::megaByte; @@ -572,26 +572,26 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenSupportedTypeWhenAllocatingInDev auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr); bool resource48Bit[] = {true, false}; - AllocationType supportedTypes[] = {AllocationType::BUFFER, - AllocationType::IMAGE, - AllocationType::COMMAND_BUFFER, - AllocationType::LINEAR_STREAM, - AllocationType::INDIRECT_OBJECT_HEAP, - AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, - AllocationType::INTERNAL_HEAP, - AllocationType::KERNEL_ISA, - AllocationType::SVM_GPU}; + AllocationType supportedTypes[] = {AllocationType::buffer, + AllocationType::image, + AllocationType::commandBuffer, + AllocationType::linearStream, + AllocationType::indirectObjectHeap, + AllocationType::timestampPacketTagBuffer, + AllocationType::internalHeap, + AllocationType::kernelIsa, + AllocationType::svmGpu}; for (auto res48bit : resource48Bit) { for (auto supportedType : supportedTypes) { allocData.type = supportedType; - allocData.imgInfo = (AllocationType::IMAGE == supportedType) ? &imgInfo : nullptr; - allocData.hostPtr = (AllocationType::SVM_GPU == supportedType) ? ::alignedMalloc(allocData.size, 4096) : nullptr; + allocData.imgInfo = (AllocationType::image == supportedType) ? &imgInfo : nullptr; + allocData.hostPtr = (AllocationType::svmGpu == supportedType) ? ::alignedMalloc(allocData.size, 4096) : nullptr; switch (supportedType) { - case AllocationType::IMAGE: - case AllocationType::INDIRECT_OBJECT_HEAP: - case AllocationType::INTERNAL_HEAP: - case AllocationType::KERNEL_ISA: + case AllocationType::image: + case AllocationType::indirectObjectHeap: + case AllocationType::internalHeap: + case AllocationType::kernelIsa: allocData.flags.resource48Bit = true; break; default: @@ -604,7 +604,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenSupportedTypeWhenAllocatingInDev auto gpuAddress = allocation->getGpuAddress(); auto gmmHelper = device->getGmmHelper(); - if (allocation->getAllocationType() == AllocationType::SVM_GPU) { + if (allocation->getAllocationType() == AllocationType::svmGpu) { if (!memoryManager->isLimitedRange(0)) { EXPECT_LT(gmmHelper->canonize(memoryManager->getGfxPartition(0)->getHeapBase(HeapIndex::HEAP_SVM)), gpuAddress); EXPECT_GT(gmmHelper->canonize(memoryManager->getGfxPartition(0)->getHeapLimit(HeapIndex::HEAP_SVM)), gpuAddress); @@ -627,7 +627,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenSupportedTypeWhenAllocatingInDev } memoryManager->freeGraphicsMemory(allocation); - if (AllocationType::SVM_GPU == supportedType) { + if (AllocationType::svmGpu == supportedType) { ::alignedFree(const_cast(allocData.hostPtr)); } } @@ -644,7 +644,7 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenDrmMemoryManagerWithLocalMemoryWhen TEST_F(DrmMemoryManagerLocalMemoryWithCustomMockTest, givenDrmMemoryManagerWithLocalMemoryWhenLockResourceIsCalledOnBufferObjectThenReturnPtr) { BufferObject bo(0, mock, 3, 1, 1024, 0); - DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(0, AllocationType::unknown, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); EXPECT_EQ(&bo, drmAllocation.getBO()); auto ptr = memoryManager->lockBufferObject(&bo); @@ -686,7 +686,7 @@ HWTEST2_F(DrmMemoryManagerFailInjectionTest, givenEnabledLocalMemoryWhenNewFails allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = testedMemoryManager.allocateGraphicsMemoryInDevicePool(allocData, status); @@ -748,7 +748,7 @@ HWTEST2_F(DrmMemoryManagerCopyMemoryToAllocationTest, givenDrmMemoryManagerWhenC allocData.allFlags = 0; allocData.size = destinationAllocationSize; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::KERNEL_ISA; + allocData.type = AllocationType::kernelIsa; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks.set(0, true); MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success; @@ -771,7 +771,7 @@ HWTEST2_F(DrmMemoryManagerCopyMemoryToAllocationTest, givenDrmMemoryManagerWhenC allocData.allFlags = 0; allocData.size = dataToCopy.size(); allocData.flags.allocateMemory = true; - allocData.type = AllocationType::KERNEL_ISA; + allocData.type = AllocationType::kernelIsa; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks.set(0, true); MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success; @@ -792,7 +792,7 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationTest, givenDrmMemoryManagerWhenCopy DrmMemoryManagerToTestCopyMemoryToAllocation drmMemoryManger(*executionEnvironment, false, 0); std::vector dataToCopy(sourceAllocationSize, 1u); - auto allocation = drmMemoryManger.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, destinationAllocationSize, AllocationType::KERNEL_ISA, mockDeviceBitfield}); + auto allocation = drmMemoryManger.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, destinationAllocationSize, AllocationType::kernelIsa, mockDeviceBitfield}); ASSERT_NE(nullptr, allocation); auto ret = drmMemoryManger.copyMemoryToAllocation(allocation, offset, dataToCopy.data(), dataToCopy.size()); @@ -816,7 +816,7 @@ HWTEST2_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledO allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::INTERNAL_HEAP; + allocData.type = AllocationType::internalHeap; allocData.rootDeviceIndex = rootDeviceIndex; MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -847,7 +847,7 @@ TEST_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAl mockExp->ioctlResExt = &ioctlResExt; BufferObject bo(0, mockExp, 3, 1, 0, 0); - DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(0, AllocationType::unknown, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); EXPECT_NE(nullptr, drmAllocation.getBO()); auto ptr = memoryManager->lockResource(&drmAllocation); @@ -863,7 +863,7 @@ TEST_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAl mockExp->failOnMmapOffset = true; BufferObject bo(0, mockExp, 3, 1, 0, 0); - DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(0, AllocationType::unknown, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); EXPECT_NE(nullptr, drmAllocation.getBO()); auto ptr = memoryManager->lockResource(&drmAllocation); @@ -874,7 +874,7 @@ TEST_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAl } TEST_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationInLocalMemoryButBufferObjectIsNullThenReturnNullPtr) { - DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(0, AllocationType::unknown, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory); auto ptr = memoryManager->lockResource(&drmAllocation); EXPECT_EQ(nullptr, ptr); @@ -928,7 +928,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenGraphicsAllocationInDevicePoolIs AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = AllocationType::IMAGE; + allocData.type = AllocationType::image; allocData.flags.resource48Bit = true; allocData.imgInfo = &imgInfo; allocData.rootDeviceIndex = rootDeviceIndex; @@ -1044,7 +1044,7 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenAllocationWithInvalidCacheRegionWhe allocData.allFlags = 0; allocData.size = 18 * MemoryConstants::pageSize64k; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3)); allocData.storageInfo.multiStorage = true; allocData.rootDeviceIndex = rootDeviceIndex; @@ -1062,7 +1062,7 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenAllocationWithUnifiedMemoryAllocati allocData.allFlags = 0; allocData.size = 18 * MemoryConstants::pageSize64k; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::UNIFIED_SHARED_MEMORY; + allocData.type = AllocationType::unifiedSharedMemory; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp index 108e7cdb59..0d291927a8 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp @@ -62,14 +62,14 @@ AllocationProperties createAllocationProperties(uint32_t rootDeviceIndex, size_t TEST_P(MemoryManagerMultiDeviceSharedHandleTest, whenCreatingAllocationFromSharedHandleWithSameHandleAndSameRootDeviceThenSameBOIsUsed) { uint32_t handle0 = 0; uint32_t rootDeviceIndex0 = 0; - AllocationProperties properties0{rootDeviceIndex0, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties0{rootDeviceIndex0, true, MemoryConstants::pageSize, AllocationType::buffer, false, false, mockDeviceBitfield}; auto gfxAllocation0 = memoryManager->createGraphicsAllocationFromSharedHandle(handle0, properties0, false, false, true, nullptr); ASSERT_NE(gfxAllocation0, nullptr); EXPECT_EQ(rootDeviceIndex0, gfxAllocation0->getRootDeviceIndex()); uint32_t handle1 = 0; uint32_t rootDeviceIndex1 = 0; - AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, AllocationType::buffer, false, false, mockDeviceBitfield}; auto gfxAllocation1 = memoryManager->createGraphicsAllocationFromSharedHandle(handle1, properties1, false, false, true, nullptr); ASSERT_NE(gfxAllocation1, nullptr); EXPECT_EQ(rootDeviceIndex1, gfxAllocation1->getRootDeviceIndex()); @@ -86,14 +86,14 @@ TEST_P(MemoryManagerMultiDeviceSharedHandleTest, whenCreatingAllocationFromShare TEST_P(MemoryManagerMultiDeviceSharedHandleTest, whenCreatingAllocationFromSharedHandleWithSameHandleAndDifferentRootDeviceThenDifferentBOIsUsed) { uint32_t handle0 = 0; uint32_t rootDeviceIndex0 = 0; - AllocationProperties properties0{rootDeviceIndex0, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties0{rootDeviceIndex0, true, MemoryConstants::pageSize, AllocationType::buffer, false, false, mockDeviceBitfield}; auto gfxAllocation0 = memoryManager->createGraphicsAllocationFromSharedHandle(handle0, properties0, false, false, true, nullptr); ASSERT_NE(gfxAllocation0, nullptr); EXPECT_EQ(rootDeviceIndex0, gfxAllocation0->getRootDeviceIndex()); uint32_t handle1 = 0; uint32_t rootDeviceIndex1 = 1; - AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, AllocationType::buffer, false, false, mockDeviceBitfield}; auto gfxAllocation1 = memoryManager->createGraphicsAllocationFromSharedHandle(handle1, properties1, false, false, true, nullptr); ASSERT_NE(gfxAllocation1, nullptr); EXPECT_EQ(rootDeviceIndex1, gfxAllocation1->getRootDeviceIndex()); @@ -110,14 +110,14 @@ TEST_P(MemoryManagerMultiDeviceSharedHandleTest, whenCreatingAllocationFromShare TEST_P(MemoryManagerMultiDeviceSharedHandleTest, whenCreatingAllocationFromSharedHandleWithSameHandleAndDifferentRootDeviceWithBasePointerOnSecondDeviceThenSamePointerIsUsed) { uint32_t handle0 = 0; uint32_t rootDeviceIndex0 = 0; - AllocationProperties properties0{rootDeviceIndex0, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties0{rootDeviceIndex0, true, MemoryConstants::pageSize, AllocationType::buffer, false, false, mockDeviceBitfield}; auto gfxAllocation0 = memoryManager->createGraphicsAllocationFromSharedHandle(handle0, properties0, false, false, true, nullptr); ASSERT_NE(gfxAllocation0, nullptr); EXPECT_EQ(rootDeviceIndex0, gfxAllocation0->getRootDeviceIndex()); uint32_t handle1 = 0; uint32_t rootDeviceIndex1 = 1; - AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, AllocationType::buffer, false, false, mockDeviceBitfield}; auto gfxAllocation1 = memoryManager->createGraphicsAllocationFromSharedHandle(handle1, properties1, false, false, true, reinterpret_cast(gfxAllocation0->getUnderlyingBuffer())); ASSERT_NE(gfxAllocation1, nullptr); EXPECT_EQ(rootDeviceIndex1, gfxAllocation1->getRootDeviceIndex()); @@ -135,14 +135,14 @@ TEST_P(MemoryManagerMultiDeviceSharedHandleTest, whenCreatingAllocationFromShare TEST_P(MemoryManagerMultiDeviceSharedHandleTest, whenCreatingAllocationFromSharedHandleWithDifferentHandleAndSameRootDeviceThenDifferentBOIsUsed) { uint32_t handle0 = 0; uint32_t rootDeviceIndex0 = 0; - AllocationProperties properties0{rootDeviceIndex0, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties0{rootDeviceIndex0, true, MemoryConstants::pageSize, AllocationType::buffer, false, false, mockDeviceBitfield}; auto gfxAllocation0 = memoryManager->createGraphicsAllocationFromSharedHandle(handle0, properties0, false, false, true, nullptr); ASSERT_NE(gfxAllocation0, nullptr); EXPECT_EQ(rootDeviceIndex0, gfxAllocation0->getRootDeviceIndex()); uint32_t handle1 = 1; uint32_t rootDeviceIndex1 = 0; - AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, AllocationType::buffer, false, false, mockDeviceBitfield}; auto gfxAllocation1 = memoryManager->createGraphicsAllocationFromSharedHandle(handle1, properties1, false, false, true, nullptr); ASSERT_NE(gfxAllocation1, nullptr); EXPECT_EQ(rootDeviceIndex1, gfxAllocation1->getRootDeviceIndex()); @@ -159,14 +159,14 @@ TEST_P(MemoryManagerMultiDeviceSharedHandleTest, whenCreatingAllocationFromShare TEST_P(MemoryManagerMultiDeviceSharedHandleTest, whenCreatingAllocationFromSharedHandleWithDifferentHandleAndDifferentRootDeviceThenDifferentBOIsUsed) { uint32_t handle0 = 0; uint32_t rootDeviceIndex0 = 0; - AllocationProperties properties0{rootDeviceIndex0, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties0{rootDeviceIndex0, true, MemoryConstants::pageSize, AllocationType::buffer, false, false, mockDeviceBitfield}; auto gfxAllocation0 = memoryManager->createGraphicsAllocationFromSharedHandle(handle0, properties0, false, false, true, nullptr); ASSERT_NE(gfxAllocation0, nullptr); EXPECT_EQ(rootDeviceIndex0, gfxAllocation0->getRootDeviceIndex()); uint32_t handle1 = 1; uint32_t rootDeviceIndex1 = 1; - AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, AllocationType::buffer, false, false, mockDeviceBitfield}; auto gfxAllocation1 = memoryManager->createGraphicsAllocationFromSharedHandle(handle1, properties1, false, false, true, nullptr); ASSERT_NE(gfxAllocation1, nullptr); EXPECT_EQ(rootDeviceIndex1, gfxAllocation1->getRootDeviceIndex()); @@ -247,7 +247,7 @@ TEST_F(DrmMemoryManagerTest, GivenGraphicsAllocationWhenAddAndRemoveAllocationTo size_t size = 0x1000; const uint32_t rootDeviceIndex = 0u; - DrmAllocation gfxAllocation(rootDeviceIndex, AllocationType::UNKNOWN, nullptr, cpuPtr, size, static_cast(1u), MemoryPool::MemoryNull); + DrmAllocation gfxAllocation(rootDeviceIndex, AllocationType::unknown, nullptr, cpuPtr, size, static_cast(1u), MemoryPool::MemoryNull); memoryManager->addAllocationToHostPtrManager(&gfxAllocation); auto fragment = memoryManager->getHostPtrManager()->getFragment({gfxAllocation.getUnderlyingBuffer(), rootDeviceIndex}); EXPECT_NE(fragment, nullptr); @@ -1064,7 +1064,7 @@ TEST_F(DrmMemoryManagerTest, GivenAllocationWhenClosingSharedHandleThenSucceeds) osHandle handle = 1u; this->mock->outputHandle = 2u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::sharedBuffer, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); EXPECT_EQ(handle, graphicsAllocation->peekSharedHandle()); @@ -1085,7 +1085,7 @@ TEST_F(DrmMemoryManagerTest, GivenAllocationWhenClosingInternalHandleThenSucceed uint64_t handleVal = 1u; this->mock->outputHandle = 2u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::sharedBuffer, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); EXPECT_EQ(0, graphicsAllocation->createInternalHandle(this->memoryManager, 0u, handleVal)); @@ -1105,7 +1105,7 @@ TEST_F(DrmMemoryManagerTest, GivenNoAllocationWhenClosingInternalHandleThenSucce uint64_t handleVal = 1u; this->mock->outputHandle = 2u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::sharedBuffer, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); EXPECT_EQ(0, graphicsAllocation->createInternalHandle(this->memoryManager, 0u, handleVal)); @@ -1189,7 +1189,7 @@ TEST_F(DrmMemoryManagerTest, GivenDeviceSharedAllocationWhichRequiresHostMapThen this->mock->memoryInfo.reset(new MemoryInfo(regionInfo, *mock)); this->mock->queryEngineInfo(); - AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::gpuTimestampDeviceBuffer, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, true, false, nullptr); DrmAllocation *drmAlloc = (DrmAllocation *)graphicsAllocation; @@ -1215,7 +1215,7 @@ TEST_F(DrmMemoryManagerTest, GivenDeviceSharedAllocationWhenSetCacheRegionFailsT this->mock->memoryInfo.reset(new MemoryInfo(regionInfo, *mock)); this->mock->queryEngineInfo(); - AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::gpuTimestampDeviceBuffer, false, {}); properties.cacheRegion = std::numeric_limits::max(); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, true, false, nullptr); @@ -1829,7 +1829,7 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationThen32 auto size = 10u; memoryManager->setForce32BitAllocations(true); - auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, nullptr, AllocationType::BUFFER); + auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, nullptr, AllocationType::buffer); EXPECT_NE(nullptr, allocation); EXPECT_NE(nullptr, allocation->getUnderlyingBuffer()); EXPECT_GE(allocation->getUnderlyingBufferSize(), size); @@ -1853,7 +1853,7 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationWhenLi auto size = 10u; memoryManager->setForce32BitAllocations(true); - auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, nullptr, AllocationType::BUFFER); + auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, nullptr, AllocationType::buffer); EXPECT_NE(nullptr, allocation); EXPECT_NE(nullptr, allocation->getUnderlyingBuffer()); EXPECT_GE(allocation->getUnderlyingBufferSize(), size); @@ -1902,7 +1902,7 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationWithHo auto size = 10u; void *hostPtr = reinterpret_cast(0x1000); memoryManager->setForce32BitAllocations(true); - auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, hostPtr, AllocationType::BUFFER); + auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, hostPtr, AllocationType::buffer); EXPECT_EQ(nullptr, allocation); mock->ioctlResExt = &mock->none; @@ -1916,7 +1916,7 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationAndAll auto size = 10u; memoryManager->setForce32BitAllocations(true); - auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, nullptr, AllocationType::BUFFER); + auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, nullptr, AllocationType::buffer); EXPECT_EQ(nullptr, allocation); mock->ioctlResExt = &mock->none; @@ -1930,7 +1930,7 @@ TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenAskedForInternal32Bit auto size = 10u; memoryManager->forceLimitedRangeAllocator(0xFFFFFFFFF); - auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, nullptr, AllocationType::INTERNAL_HEAP); + auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, nullptr, AllocationType::internalHeap); EXPECT_EQ(nullptr, allocation); mock->ioctlResExt = &mock->none; @@ -1946,7 +1946,7 @@ TEST_F(DrmMemoryManagerTest, GivenExhaustedInternalHeapWhenAllocate32BitIsCalled EXPECT_NE(0llu, alloc); size_t allocationSize = 4 * MemoryConstants::gigaByte; - auto graphicsAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, allocationSize, nullptr, AllocationType::INTERNAL_HEAP); + auto graphicsAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, allocationSize, nullptr, AllocationType::internalHeap); EXPECT_EQ(nullptr, graphicsAllocation); } @@ -2007,7 +2007,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndOsHandleWhenCreateIsCalledT osHandle handle = 1u; this->mock->outputHandle = 2u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::sharedBuffer, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); ASSERT_NE(nullptr, graphicsAllocation); @@ -2037,7 +2037,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryTest, givenDrmMemoryManagerWithLocalMemory osHandle handle = 1u; this->mock->outputHandle = 2u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::sharedBuffer, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); ASSERT_NE(nullptr, graphicsAllocation); @@ -2077,7 +2077,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndOsHandleWhenCreateIsCalledA osHandle handle = 1u; this->mock->outputHandle = 2u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, false, 0u); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::sharedBuffer, false, false, 0u); ASSERT_TRUE(properties.subDevicesBitfield.none()); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); @@ -2105,7 +2105,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndOsHandleWhenAllocationFails osHandle handle = 1u; InjectedFunction method = [this, &handle](size_t failureIndex) { - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, mockDeviceBitfield); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); if (MemoryManagement::nonfailingAllocation == failureIndex) { @@ -2139,7 +2139,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndThreeOsHandlesWhenReuseCrea if (i == 2) this->mock->outputHandle = 3u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, mockDeviceBitfield); graphicsAllocations[i] = memoryManager->createGraphicsAllocationFromSharedHandle(handles[i], properties, false, false, true, nullptr); // Clang-tidy false positive WA @@ -2181,7 +2181,7 @@ TEST_F(DrmMemoryManagerTest, given32BitAddressingWhenBufferFromSharedHandleAndBi osHandle handle = 1u; this->mock->outputHandle = 2u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, mockDeviceBitfield); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, true, false, true, nullptr); auto drmAllocation = static_cast(graphicsAllocation); @@ -2201,7 +2201,7 @@ TEST_F(DrmMemoryManagerTest, given32BitAddressingWhenBufferFromSharedHandleIsCre memoryManager->setForce32BitAllocations(true); osHandle handle = 1u; this->mock->outputHandle = 2u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, mockDeviceBitfield); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); auto drmAllocation = static_cast(graphicsAllocation); @@ -2222,7 +2222,7 @@ TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenBufferFromSharedHandl memoryManager->forceLimitedRangeAllocator(0xFFFFFFFFF); osHandle handle = 1u; this->mock->outputHandle = 2u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, mockDeviceBitfield); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); EXPECT_FALSE(graphicsAllocation->is32BitAllocation()); auto drmAllocation = static_cast(graphicsAllocation); @@ -2241,7 +2241,7 @@ TEST_F(DrmMemoryManagerTest, givenNon32BitAddressingWhenBufferFromSharedHandleIs memoryManager->setForce32BitAllocations(false); osHandle handle = 1u; this->mock->outputHandle = 2u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, mockDeviceBitfield); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, true, false, true, nullptr); auto drmAllocation = static_cast(graphicsAllocation); EXPECT_FALSE(graphicsAllocation->is32BitAllocation()); @@ -2257,7 +2257,7 @@ TEST_F(DrmMemoryManagerTest, givenSharedHandleWhenAllocationIsCreatedAndIoctlPri osHandle handle = 1u; this->mock->outputHandle = 2u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, mockDeviceBitfield); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); EXPECT_EQ(nullptr, graphicsAllocation); memoryManager->freeGraphicsMemory(graphicsAllocation); @@ -2270,7 +2270,7 @@ TEST_F(DrmMemoryManagerTest, givenTwoGraphicsAllocationsThatShareTheSameBufferOb mock->ioctlExpected.gemWait = 2; osHandle sharedHandle = 1u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, mockDeviceBitfield); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, properties, false, false, true, nullptr); auto graphicsAllocation2 = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, properties, false, false, true, nullptr); @@ -2296,7 +2296,7 @@ TEST_F(DrmMemoryManagerTest, givenTwoGraphicsAllocationsThatDoesnShareTheSameBuf mock->ioctlExpected.gemWait = 2; osHandle sharedHandle = 1u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, properties, false, false, true, nullptr); mock->outputHandle++; auto graphicsAllocation2 = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, properties, false, false, true, nullptr); @@ -2316,7 +2316,7 @@ TEST_F(DrmMemoryManagerTest, givenTwoGraphicsAllocationsThatDoesnShareTheSameBuf } TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenDrmMemoryManagerWhenCreateAllocationFromNtHandleIsCalledThenReturnNullptr) { - auto graphicsAllocation = memoryManager->createGraphicsAllocationFromNTHandle(reinterpret_cast(1), 0, AllocationType::SHARED_IMAGE); + auto graphicsAllocation = memoryManager->createGraphicsAllocationFromNTHandle(reinterpret_cast(1), 0, AllocationType::sharedImage); EXPECT_EQ(nullptr, graphicsAllocation); } @@ -2411,7 +2411,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledOnNullAl } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationWithoutBufferObjectThenReturnNullPtr) { - DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::UNKNOWN, nullptr, nullptr, 0, static_cast(0u), MemoryPool::MemoryNull); + DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::unknown, nullptr, nullptr, 0, static_cast(0u), MemoryPool::MemoryNull); EXPECT_EQ(nullptr, drmAllocation.getBO()); auto ptr = memoryManager->lockResource(&drmAllocation); @@ -2426,7 +2426,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledButFails mock->ioctlResExt = &ioctlResExt; BufferObject bo(rootDeviceIndex, mock, 3, 1, 0, 1); - DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::UNKNOWN, &bo, nullptr, 0u, static_cast(0u), MemoryPool::MemoryNull); + DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::unknown, &bo, nullptr, 0u, static_cast(0u), MemoryPool::MemoryNull); EXPECT_NE(nullptr, drmAllocation.getBO()); auto ptr = memoryManager->lockResource(&drmAllocation); @@ -2456,7 +2456,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenUnlockResourceIsCalledOnAl DrmMockCustom drmMock(*executionEnvironment->rootDeviceEnvironments[1]); auto bo = new BufferObject(rootDeviceIndex, &drmMock, 3, 1, 0, 1); - auto drmAllocation = new DrmAllocation(rootDeviceIndex, AllocationType::UNKNOWN, bo, nullptr, 0u, static_cast(0u), MemoryPool::LocalMemory); + auto drmAllocation = new DrmAllocation(rootDeviceIndex, AllocationType::unknown, bo, nullptr, 0u, static_cast(0u), MemoryPool::LocalMemory); drmMemoryManager.unlockResourceImpl(*drmAllocation); EXPECT_TRUE(drmMemoryManager.unlockResourceInLocalMemoryImplParam.called); @@ -2466,7 +2466,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenUnlockResourceIsCalledOnAl } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetDomainCpuIsCalledOnAllocationWithoutBufferObjectThenReturnFalse) { - DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::UNKNOWN, nullptr, nullptr, 0, static_cast(0u), MemoryPool::MemoryNull); + DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::unknown, nullptr, nullptr, 0, static_cast(0u), MemoryPool::MemoryNull); EXPECT_EQ(nullptr, drmAllocation.getBO()); auto success = memoryManager->setDomainCpu(drmAllocation, false); @@ -2480,7 +2480,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetDomainCpuIsCalledButFai DrmMockCustom drmMock(*executionEnvironment->rootDeviceEnvironments[0]); BufferObject bo(0u, &drmMock, 3, 1, 0, 1); - DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::UNKNOWN, &bo, nullptr, 0u, static_cast(0u), MemoryPool::MemoryNull); + DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::unknown, &bo, nullptr, 0u, static_cast(0u), MemoryPool::MemoryNull); EXPECT_NE(nullptr, drmAllocation.getBO()); auto success = memoryManager->setDomainCpu(drmAllocation, false); @@ -2493,7 +2493,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetDomainCpuIsCalledOnAllo DrmMockCustom drmMock(*executionEnvironment->rootDeviceEnvironments[0]); BufferObject bo(rootDeviceIndex, &drmMock, 3, 1, 0, 1); - DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::UNKNOWN, &bo, nullptr, 0u, static_cast(0u), MemoryPool::MemoryNull); + DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::unknown, &bo, nullptr, 0u, static_cast(0u), MemoryPool::MemoryNull); EXPECT_NE(nullptr, drmAllocation.getBO()); auto success = memoryManager->setDomainCpu(drmAllocation, true); @@ -2545,7 +2545,7 @@ TEST_F(DrmMemoryManagerTest, given32BitAllocatorWithHeapAllocatorWhenLargerFragm size_t pages3size = 3 * MemoryConstants::pageSize; void *hostPtr = reinterpret_cast(0x1000); - DrmAllocation *graphicsAlloaction = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, pages3size, hostPtr, AllocationType::BUFFER); + DrmAllocation *graphicsAlloaction = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, pages3size, hostPtr, AllocationType::buffer); auto bo = graphicsAlloaction->getBO(); EXPECT_EQ(pages3size, bo->peekSize()); @@ -2564,7 +2564,7 @@ TEST_F(DrmMemoryManagerTest, givenSharedAllocationWithSmallerThenRealSizeWhenCre mock->ioctlExpected.gemWait = 1; mock->ioctlExpected.gemClose = 1; osHandle sharedHandle = 1u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, properties, false, false, true, nullptr); @@ -2589,7 +2589,7 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedForInternalAllocationWit auto bufferSize = MemoryConstants::pageSize; void *ptr = nullptr; - auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, AllocationType::INTERNAL_HEAP)); + auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, AllocationType::internalHeap)); ASSERT_NE(nullptr, drmAllocation); EXPECT_NE(nullptr, drmAllocation->getUnderlyingBuffer()); @@ -2619,7 +2619,7 @@ TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenAskedForInternalAlloc auto bufferSize = MemoryConstants::pageSize; void *ptr = nullptr; - auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, AllocationType::INTERNAL_HEAP)); + auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, AllocationType::internalHeap)); ASSERT_NE(nullptr, drmAllocation); EXPECT_NE(nullptr, drmAllocation->getUnderlyingBuffer()); @@ -2653,7 +2653,7 @@ TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenAskedForExternalAlloc auto bufferSize = MemoryConstants::pageSize; void *ptr = nullptr; - auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, AllocationType::BUFFER)); + auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, AllocationType::buffer)); ASSERT_NE(nullptr, drmAllocation); EXPECT_NE(nullptr, drmAllocation->getUnderlyingBuffer()); @@ -2667,7 +2667,7 @@ TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenAskedForInternalAlloc auto bufferSize = 128 * MemoryConstants::megaByte + 4 * MemoryConstants::pageSize; void *ptr = nullptr; - auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, AllocationType::INTERNAL_HEAP)); + auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, AllocationType::internalHeap)); ASSERT_EQ(nullptr, drmAllocation); } @@ -2678,7 +2678,7 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedForInternalAllocationWit auto bufferSize = MemoryConstants::pageSize; void *ptr = reinterpret_cast(0x100000); - auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, AllocationType::INTERNAL_HEAP)); + auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, AllocationType::internalHeap)); ASSERT_NE(nullptr, drmAllocation); EXPECT_NE(nullptr, drmAllocation->getUnderlyingBuffer()); @@ -2722,7 +2722,7 @@ TEST_F(DrmMemoryManagerUSMHostAllocationTests, givenCallToAllocateGraphicsMemory allocationData.size = 16384; allocationData.rootDeviceIndex = rootDeviceIndex; allocationData.flags.isUSMHostAllocation = true; - allocationData.type = AllocationType::SVM_CPU; + allocationData.type = AllocationType::svmCpu; auto alloc = memoryManager->allocateGraphicsMemoryWithAlignment(allocationData); EXPECT_NE(nullptr, alloc); @@ -2919,7 +2919,7 @@ TEST_F(DrmMemoryManagerBasic, givenMemoryManagerWhenAllocate32BitGraphicsMemoryW void *ptr = reinterpret_cast(0x1001); auto size = MemoryConstants::pageSize; - auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, ptr, AllocationType::BUFFER); + auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, ptr, AllocationType::buffer); ASSERT_NE(nullptr, allocation); EXPECT_EQ(MemoryPool::System4KBPagesWith32BitGpuAddressing, allocation->getMemoryPool()); @@ -2933,7 +2933,7 @@ TEST_F(DrmMemoryManagerBasic, givenMemoryManagerWhenCreateAllocationFromHandleIs true, executionEnvironment)); auto osHandle = 1u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, {}); auto allocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, false, false, true, nullptr); EXPECT_NE(nullptr, allocation); EXPECT_EQ(MemoryPool::SystemCpuInaccessible, allocation->getMemoryPool()); @@ -3551,8 +3551,8 @@ TEST_F(DrmMemoryManagerBasic, givenImageOrSharedResourceCopyWhenGraphicsAllocati allocData.flags.allocateMemory = true; allocData.rootDeviceIndex = rootDeviceIndex; - AllocationType types[] = {AllocationType::IMAGE, - AllocationType::SHARED_RESOURCE_COPY}; + AllocationType types[] = {AllocationType::image, + AllocationType::sharedResourceCopy}; for (auto type : types) { allocData.type = type; @@ -3585,7 +3585,7 @@ TEST_F(DrmMemoryManagerTest, givenDebugModuleAreaTypeWhenCreatingAllocationThen3 const auto size = MemoryConstants::pageSize64k; NEO::AllocationProperties properties{device->getRootDeviceIndex(), true, size, - NEO::AllocationType::DEBUG_MODULE_AREA, + NEO::AllocationType::debugModuleArea, false, device->getDeviceBitfield()}; @@ -3625,18 +3625,18 @@ struct DrmAllocationTests : public ::testing::Test { }; TEST_F(DrmAllocationTests, givenAllocationTypeWhenPassedToDrmAllocationConstructorThenAllocationTypeIsStored) { - DrmAllocation allocation{0, AllocationType::COMMAND_BUFFER, nullptr, nullptr, static_cast(0), 0u, MemoryPool::MemoryNull}; - EXPECT_EQ(AllocationType::COMMAND_BUFFER, allocation.getAllocationType()); + DrmAllocation allocation{0, AllocationType::commandBuffer, nullptr, nullptr, static_cast(0), 0u, MemoryPool::MemoryNull}; + EXPECT_EQ(AllocationType::commandBuffer, allocation.getAllocationType()); - DrmAllocation allocation2{0, AllocationType::UNKNOWN, nullptr, nullptr, 0ULL, static_cast(0), MemoryPool::MemoryNull}; - EXPECT_EQ(AllocationType::UNKNOWN, allocation2.getAllocationType()); + DrmAllocation allocation2{0, AllocationType::unknown, nullptr, nullptr, 0ULL, static_cast(0), MemoryPool::MemoryNull}; + EXPECT_EQ(AllocationType::unknown, allocation2.getAllocationType()); } TEST_F(DrmAllocationTests, givenMemoryPoolWhenPassedToDrmAllocationConstructorThenMemoryPoolIsStored) { - DrmAllocation allocation{0, AllocationType::COMMAND_BUFFER, nullptr, nullptr, static_cast(0), 0u, MemoryPool::System64KBPages}; + DrmAllocation allocation{0, AllocationType::commandBuffer, nullptr, nullptr, static_cast(0), 0u, MemoryPool::System64KBPages}; EXPECT_EQ(MemoryPool::System64KBPages, allocation.getMemoryPool()); - DrmAllocation allocation2{0, AllocationType::UNKNOWN, nullptr, nullptr, 0ULL, static_cast(0), MemoryPool::SystemCpuInaccessible}; + DrmAllocation allocation2{0, AllocationType::unknown, nullptr, nullptr, 0ULL, static_cast(0), MemoryPool::SystemCpuInaccessible}; EXPECT_EQ(MemoryPool::SystemCpuInaccessible, allocation2.getMemoryPool()); } @@ -3707,13 +3707,13 @@ TEST_F(DrmMemoryManagerTest, givenSvmCpuAllocationWhenSizeAndAlignmentProvidedTh AllocationData allocationData; allocationData.size = 2 * MemoryConstants::megaByte; allocationData.alignment = 2 * MemoryConstants::megaByte; - allocationData.type = AllocationType::SVM_CPU; + allocationData.type = AllocationType::svmCpu; allocationData.rootDeviceIndex = rootDeviceIndex; auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithAlignment(allocationData)); ASSERT_NE(nullptr, allocation); - EXPECT_EQ(AllocationType::SVM_CPU, allocation->getAllocationType()); + EXPECT_EQ(AllocationType::svmCpu, allocation->getAllocationType()); EXPECT_EQ(allocationData.size, allocation->getUnderlyingBufferSize()); EXPECT_NE(nullptr, allocation->getUnderlyingBuffer()); @@ -3749,7 +3749,7 @@ TEST_F(DrmMemoryManagerTest, givenSvmCpuAllocationWhenSizeAndAlignmentProvidedBu AllocationData allocationData; allocationData.size = 2 * MemoryConstants::megaByte; allocationData.alignment = 2 * MemoryConstants::megaByte; - allocationData.type = AllocationType::SVM_CPU; + allocationData.type = AllocationType::svmCpu; allocationData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryWithAlignment(allocationData); @@ -3783,7 +3783,7 @@ TEST(DrmMemoryManagerFreeGraphicsMemoryCallSequenceTest, givenDrmMemoryManagerAn executionEnvironment.rootDeviceEnvironments[0]->initGmm(); TestedDrmMemoryManager memoryManger(executionEnvironment); - AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield}; auto allocation = memoryManger.allocateGraphicsMemoryWithProperties(properties); ASSERT_NE(allocation, nullptr); @@ -3809,7 +3809,7 @@ TEST(DrmMemoryManagerFreeGraphicsMemoryUnreferenceTest, TestedDrmMemoryManager memoryManger(executionEnvironment); osHandle handle = 1u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, {}); auto allocation = memoryManger.createGraphicsAllocationFromSharedHandle(handle, properties, false, false, false, nullptr); ASSERT_NE(nullptr, allocation); @@ -3836,7 +3836,7 @@ TEST(DrmMemoryManagerFreeGraphicsMemoryUnreferenceTest, TestedDrmMemoryManager memoryManger(executionEnvironment); osHandle handle = 1u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, {}); debugManager.flags.PrintBOCreateDestroyResult.set(true); testing::internal::CaptureStdout(); @@ -3869,7 +3869,7 @@ TEST(DrmMemoryManagerFreeGraphicsMemoryUnreferenceTest, TestedDrmMemoryManager memoryManger(executionEnvironment); osHandle handle = 1u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, {}); auto allocation = memoryManger.createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); ASSERT_NE(nullptr, allocation); @@ -3893,7 +3893,7 @@ TEST(DrmMemoryManagerFreeGraphicsMemoryUnreferenceTest, givenDrmMemoryManagerAnd TestedDrmMemoryManager memoryManger(executionEnvironment); osHandle handle = 1u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, {}); auto allocation = memoryManger.createGraphicsAllocationFromSharedHandle(handle, properties, false, false, true, nullptr); ASSERT_NE(nullptr, allocation); @@ -3915,7 +3915,7 @@ TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledWhenAllocationTypeSho { MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::DEBUG_CONTEXT_SAVE_AREA, MemoryPool::System4KBPages); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::debugContextSaveArea, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); EXPECT_EQ(DrmMockResources::registerResourceReturnHandle, bo.bindExtHandles[0]); @@ -3925,7 +3925,7 @@ TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledWhenAllocationTypeSho { MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::DEBUG_SBA_TRACKING_BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::debugSbaTrackingBuffer, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); EXPECT_EQ(DrmMockResources::registerResourceReturnHandle, bo.bindExtHandles[0]); @@ -3935,7 +3935,7 @@ TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledWhenAllocationTypeSho { MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::kernelIsa, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); EXPECT_EQ(DrmMockResources::registerResourceReturnHandle, bo.bindExtHandles[0]); @@ -3945,7 +3945,7 @@ TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledWhenAllocationTypeSho { MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::DEBUG_MODULE_AREA, MemoryPool::System4KBPages); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::debugModuleArea, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); EXPECT_EQ(DrmMockResources::registerResourceReturnHandle, bo.bindExtHandles[0]); @@ -3956,7 +3956,7 @@ TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledWhenAllocationTypeSho { MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::BUFFER_HOST_MEMORY, MemoryPool::System4KBPages); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::bufferHostMemory, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); EXPECT_EQ(0u, bo.bindExtHandles.size()); @@ -3976,7 +3976,7 @@ TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledWhenAllocationTypeSho { MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::KERNEL_ISA_INTERNAL, MemoryPool::System4KBPages); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::kernelIsaInternal, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); EXPECT_EQ(0u, bo.bindExtHandles.size()); @@ -3990,7 +3990,7 @@ TEST_F(DrmAllocationTests, givenResourceRegistrationNotEnabledWhenRegisteringBin EXPECT_EQ(0u, drm.classHandles.size()); MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::DEBUG_CONTEXT_SAVE_AREA, MemoryPool::System4KBPages); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::debugContextSaveArea, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); EXPECT_EQ(0u, bo.bindExtHandles.size()); @@ -4011,7 +4011,7 @@ TEST(DrmMemoryManager, givenTrackedAllocationTypeAndDisabledRegistrationInDrmWhe mockDrm->registeredDataSize = 0; - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::DEBUG_CONTEXT_SAVE_AREA, MemoryPool::System4KBPages); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::debugContextSaveArea, MemoryPool::System4KBPages); memoryManager->registerAllocationInOs(&allocation); @@ -4033,13 +4033,13 @@ TEST(DrmMemoryManager, givenResourceRegistrationEnabledAndAllocTypeToCaptureWhen mockDrm->classHandles.push_back(1); MockBufferObject bo(rootDeviceIndex, mockDrm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::SCRATCH_SURFACE, MemoryPool::System4KBPages); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::scratchSurface, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; memoryManager->registerAllocationInOs(&allocation); EXPECT_TRUE(allocation.markedForCapture); - MockDrmAllocation allocation2(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation allocation2(rootDeviceIndex, AllocationType::buffer, MemoryPool::System4KBPages); allocation2.bufferObjects[0] = &bo; memoryManager->registerAllocationInOs(&allocation2); @@ -4063,7 +4063,7 @@ TEST(DrmMemoryManager, givenTrackedAllocationTypeWhenAllocatingThenAllocationIsR EXPECT_TRUE(mockDrm->resourceRegistrationEnabled()); NEO::AllocationProperties properties{0, true, MemoryConstants::pageSize, - NEO::AllocationType::DEBUG_SBA_TRACKING_BUFFER, + NEO::AllocationType::debugSbaTrackingBuffer, false, 1}; properties.gpuAddress = 0x20000; @@ -4093,7 +4093,7 @@ TEST(DrmMemoryManager, givenTrackedAllocationTypeWhenFreeingThenRegisteredHandle EXPECT_TRUE(mockDrm->resourceRegistrationEnabled()); NEO::AllocationProperties properties{0, true, MemoryConstants::pageSize, - NEO::AllocationType::DEBUG_SBA_TRACKING_BUFFER, + NEO::AllocationType::debugSbaTrackingBuffer, false, 1}; properties.gpuAddress = 0x20000; @@ -4147,7 +4147,7 @@ TEST(DrmMemoryManager, givenNullBoWhenRegisteringBindExtHandleThenEarlyReturn) { EXPECT_TRUE(mockDrm->resourceRegistrationEnabled()); - MockDrmAllocation gfxAllocation(rootDeviceIndex, AllocationType::DEBUG_SBA_TRACKING_BUFFER, MemoryPool::MemoryNull); + MockDrmAllocation gfxAllocation(rootDeviceIndex, AllocationType::debugSbaTrackingBuffer, MemoryPool::MemoryNull); gfxAllocation.registerBOBindExtHandle(mockDrm.get()); EXPECT_EQ(1u, gfxAllocation.registeredBoBindHandles.size()); @@ -4161,7 +4161,7 @@ TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledWhenAllocationIsRegis drm.classHandles.push_back(1); MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::DEBUG_CONTEXT_SAVE_AREA, MemoryPool::System4KBPages); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::debugContextSaveArea, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); @@ -4180,7 +4180,7 @@ TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledAndTileInstancedIsaWh drm.registeredClass = DrmResourceClass::MaxSize; MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::KERNEL_ISA, MemoryPool::LocalMemory); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::kernelIsa, MemoryPool::LocalMemory); allocation.storageInfo.tileInstanced = true; allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); @@ -4204,7 +4204,7 @@ TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledAndSingleInstanceIsaW drm.registeredClass = DrmResourceClass::MaxSize; MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::kernelIsa, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); EXPECT_EQ(1u, bo.bindExtHandles.size()); @@ -4226,7 +4226,7 @@ TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledWhenIsaIsRegisteredTh drm.registeredClass = DrmResourceClass::MaxSize; MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::KERNEL_ISA, MemoryPool::LocalMemory); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::kernelIsa, MemoryPool::LocalMemory); allocation.storageInfo.subDeviceBitfield = 1 << 3; allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); @@ -4250,7 +4250,7 @@ TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledAndSubDeviceBitfieldS drm.registeredClass = DrmResourceClass::MaxSize; MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::DEBUG_SBA_TRACKING_BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::debugSbaTrackingBuffer, MemoryPool::LocalMemory); allocation.storageInfo.tileInstanced = false; allocation.storageInfo.subDeviceBitfield = 0b0010; allocation.bufferObjects[0] = &bo; @@ -4288,7 +4288,7 @@ TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledAndSubDeviceBitfieldN drm.registeredClass = DrmResourceClass::MaxSize; MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::DEBUG_SBA_TRACKING_BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::debugSbaTrackingBuffer, MemoryPool::LocalMemory); allocation.storageInfo.tileInstanced = false; allocation.bufferObjects[0] = &bo; @@ -4327,7 +4327,7 @@ TEST_F(DrmAllocationTests, givenTwoBufferObjectsAndTileInstancedSbaAndSubDeviceB MockBufferObject bo0(rootDeviceIndex, &drm, 3, 0, 0, 1); MockBufferObject bo1(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::DEBUG_SBA_TRACKING_BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::debugSbaTrackingBuffer, MemoryPool::LocalMemory); allocation.storageInfo.subDeviceBitfield = 0b0011; allocation.storageInfo.tileInstanced = true; allocation.bufferObjects[0] = &bo0; @@ -4368,7 +4368,7 @@ TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledWhenSbaTrackingBuffer drm.registeredClass = DrmResourceClass::MaxSize; MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::DEBUG_SBA_TRACKING_BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::debugSbaTrackingBuffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); @@ -4384,7 +4384,7 @@ TEST_F(DrmAllocationTests, givenDrmAllocationWhenSetCacheRegionIsCalledForDefaul const uint32_t rootDeviceIndex = 0u; DrmMock drm(*executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::buffer, MemoryPool::LocalMemory); EXPECT_TRUE(allocation.setCacheRegion(&drm, CacheRegion::defaultRegion)); } @@ -4393,7 +4393,7 @@ TEST_F(DrmAllocationTests, givenDrmAllocationWhenCacheInfoIsNotAvailableThenCach const uint32_t rootDeviceIndex = 0u; DrmMock drm(*executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::buffer, MemoryPool::LocalMemory); EXPECT_FALSE(allocation.setCacheRegion(&drm, CacheRegion::region1)); } @@ -4403,7 +4403,7 @@ TEST_F(DrmAllocationTests, givenDrmAllocationWhenDefaultCacheInfoIsAvailableThen DrmMock drm(*executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]); drm.setupCacheInfo(*defaultHwInfo.get()); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::buffer, MemoryPool::LocalMemory); EXPECT_FALSE(allocation.setCacheRegion(&drm, CacheRegion::region1)); } @@ -4413,7 +4413,7 @@ TEST_F(DrmAllocationTests, givenDrmAllocationWhenCacheRegionIsNotSetThenReturnFa DrmMock drm(*executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]); drm.cacheInfo.reset(new MockCacheInfo(drm, 32 * MemoryConstants::kiloByte, 2, 32)); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::buffer, MemoryPool::LocalMemory); EXPECT_FALSE(allocation.setCacheAdvice(&drm, 1024, CacheRegion::none, false)); } @@ -4424,7 +4424,7 @@ TEST_F(DrmAllocationTests, givenDrmAllocationWhenCacheRegionIsSetSuccessfullyThe drm.queryAndSetVmBindPatIndexProgrammingSupport(); drm.cacheInfo.reset(new MockCacheInfo(drm, 32 * MemoryConstants::kiloByte, 2, 32)); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::buffer, MemoryPool::LocalMemory); auto &gfxCoreHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); @@ -4443,7 +4443,7 @@ TEST_F(DrmAllocationTests, givenDrmAllocationWhenCacheRegionIsSetSuccessfullyThe drm.cacheInfo.reset(new MockCacheInfo(drm, 32 * MemoryConstants::kiloByte, 2, 32)); MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; auto &gfxCoreHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); @@ -4468,7 +4468,7 @@ TEST_F(DrmAllocationTests, givenDrmAllocationWhenBufferObjectIsCreatedThenApplyD DrmMock drm(*executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]); MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; for (auto bo : allocation.bufferObjects) { @@ -4483,7 +4483,7 @@ TEST_F(DrmAllocationTests, givenDrmAllocationWhenSetCachePolicyIsCalledThenUpdat DrmMock drm(*executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]); MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; allocation.setCachePolicy(CachePolicy::uncached); @@ -4500,7 +4500,7 @@ TEST_F(DrmAllocationTests, givenDrmAllocationWhenSetMemAdviseWithCachePolicyIsCa DrmMock drm(*executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]); MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; EXPECT_EQ(CachePolicy::writeBack, bo.peekCachePolicy()); @@ -4524,7 +4524,7 @@ TEST_F(DrmAllocationTests, givenBoWhenMarkingForCaptureThenBosAreMarked) { DrmMock drm(*executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]); MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::SCRATCH_SURFACE, MemoryPool::System4KBPages); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::scratchSurface, MemoryPool::System4KBPages); allocation.markForCapture(); allocation.bufferObjects[0] = &bo; @@ -4553,7 +4553,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmAllocationWithHostPtrWhenItIsCreatedWithCac memoryManager->populateOsHandles(storage, rootDeviceIndex); - auto allocation = std::make_unique(rootDeviceIndex, AllocationType::BUFFER_HOST_MEMORY, + auto allocation = std::make_unique(rootDeviceIndex, AllocationType::bufferHostMemory, nullptr, ptr, castToUint64(ptr), size, MemoryPool::System4KBPages); allocation->fragmentsStorage = storage; @@ -4598,7 +4598,7 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmAllocationWithWithAlignmentFromUserptrWhe } TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenAllocateGraphicsMemoryWithPropertiesCalledWithDebugSurfaceTypeThenDebugSurfaceIsCreated) { - AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, 0b1011}; + AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::debugContextSaveArea, false, false, 0b1011}; auto debugSurface = static_cast(memoryManager->allocateGraphicsMemoryWithProperties(debugSurfaceProperties)); EXPECT_NE(nullptr, debugSurface); @@ -4637,7 +4637,7 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenAffinityMaskDeviceWith affinityMask.enableGenericSubDevice(1); executionEnvironment->rootDeviceEnvironments[0]->deviceAffinityMask = affinityMask; - AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, 0b0010}; + AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::debugContextSaveArea, false, false, 0b0010}; auto debugSurface = static_cast(memoryManager->allocateGraphicsMemoryWithProperties(debugSurfaceProperties)); EXPECT_NE(nullptr, debugSurface); @@ -4684,7 +4684,7 @@ TEST_F(DrmMemoryManagerTest, whenDebugFlagToNotFreeResourcesIsSpecifiedThenFreeI TestedDrmMemoryManager memoryManager(false, false, false, *executionEnvironment); size_t sizeIn = 1024llu; uint64_t gpuAddress = 0x1337llu; - DrmAllocation stackDrmAllocation(0u, AllocationType::BUFFER, nullptr, nullptr, gpuAddress, sizeIn, MemoryPool::System64KBPages); + DrmAllocation stackDrmAllocation(0u, AllocationType::buffer, nullptr, nullptr, gpuAddress, sizeIn, MemoryPool::System64KBPages); memoryManager.freeGraphicsMemoryImpl(&stackDrmAllocation); } @@ -4754,7 +4754,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmManagerWithLocalMemoryWhenLockResourceIsCal DrmMemoryManagerToTestLockInLocalMemory memoryManager(*executionEnvironment); BufferObject bo(rootDeviceIndex, mock, 3, 1, 1024, 0); - DrmAllocation drmAllocation(0, AllocationType::WRITE_COMBINED, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(0, AllocationType::writeCombined, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); EXPECT_EQ(&bo, drmAllocation.getBO()); auto ptr = memoryManager.lockResourceImpl(drmAllocation); @@ -4774,7 +4774,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWithoutLocalMemoryWhenCopyMemo std::vector dataToCopy(MemoryConstants::pageSize, 1u); - auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({rootDeviceIndex, dataToCopy.size(), AllocationType::BUFFER, device->getDeviceBitfield()}); + auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({rootDeviceIndex, dataToCopy.size(), AllocationType::buffer, device->getDeviceBitfield()}); ASSERT_NE(nullptr, allocation); auto ret = memoryManager.copyMemoryToAllocation(allocation, 0, dataToCopy.data(), dataToCopy.size()); @@ -4793,7 +4793,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWithoutLocalMemoryAndCpuPtrWhe std::vector dataToCopy(MemoryConstants::pageSize, 1u); - auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({rootDeviceIndex, dataToCopy.size(), AllocationType::BUFFER, device->getDeviceBitfield()}); + auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({rootDeviceIndex, dataToCopy.size(), AllocationType::buffer, device->getDeviceBitfield()}); ASSERT_NE(nullptr, allocation); allocation->setCpuPtrAndGpuAddress(nullptr, 0u); auto ret = memoryManager.copyMemoryToAllocation(allocation, 0, dataToCopy.data(), dataToCopy.size()); @@ -4851,7 +4851,7 @@ TEST(DrmMemoryManagerSimpleTest, givenDrmMemoryManagerWhenDeviceHeapIsDepletedTh allocData.size = MemoryConstants::pageSize + mockGfxPartition->heapGetLimit(NEO::HeapIndex::HEAP_INTERNAL_DEVICE_MEMORY); allocData.flags.useSystemMemory = false; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::KERNEL_ISA; + allocData.type = AllocationType::kernelIsa; auto memoryManager = TestedDrmMemoryManager{true, false, false, executionEnvironment}; memoryManager.overrideGfxPartition(mockGfxPartition.release()); @@ -4886,7 +4886,7 @@ TEST(DrmMemoryManagerSimpleTest, givenDrmMemoryManagerWhenLockResourceIsCalledOn executionEnvironment.rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(drm)); executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*drm, 0u, false); TestedDrmMemoryManager memoryManager(executionEnvironment); - DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(0, AllocationType::unknown, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory); auto ptr = memoryManager.lockBufferObject(drmAllocation.getBO()); EXPECT_EQ(nullptr, ptr); @@ -4902,7 +4902,7 @@ TEST(DrmMemoryManagerSimpleTest, givenDrmMemoryManagerWhenFreeGraphicsMemoryIsCa executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*drm, 0u, false); TestedDrmMemoryManager memoryManager(executionEnvironment); - auto drmAllocation = new DrmAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory); + auto drmAllocation = new DrmAllocation(0, AllocationType::unknown, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory); EXPECT_NE(nullptr, drmAllocation); memoryManager.freeGraphicsMemoryImpl(drmAllocation); @@ -4919,7 +4919,7 @@ TEST(DrmMemoryManagerSimpleTest, WhenDrmIsCreatedThenQueryPageFaultSupportIsCall using DrmMemoryManagerWithLocalMemoryTest = Test; TEST_F(DrmMemoryManagerWithLocalMemoryTest, givenDrmMemoryManagerWithLocalMemoryWhenLockResourceIsCalledOnAllocationInLocalMemoryThenReturnNullPtr) { - DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::UNKNOWN, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::unknown, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory); auto ptr = memoryManager->lockResource(&drmAllocation); EXPECT_EQ(nullptr, ptr); @@ -4936,7 +4936,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenCopyMemoryToAllocationThen std::vector dataToCopy(MemoryConstants::pageSize, 1u); - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({rootDeviceIndex, dataToCopy.size(), AllocationType::BUFFER, device->getDeviceBitfield()}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({rootDeviceIndex, dataToCopy.size(), AllocationType::buffer, device->getDeviceBitfield()}); ASSERT_NE(nullptr, allocation); auto ret = memoryManager->copyMemoryToAllocation(allocation, 0, dataToCopy.data(), dataToCopy.size()); @@ -4954,7 +4954,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenFreeingImportedMemoryThenC std::vector dataToCopy(MemoryConstants::pageSize, 1u); - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({rootDeviceIndex, dataToCopy.size(), AllocationType::BUFFER, device->getDeviceBitfield()}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({rootDeviceIndex, dataToCopy.size(), AllocationType::buffer, device->getDeviceBitfield()}); ASSERT_NE(nullptr, allocation); memoryManager->freeGraphicsMemory(allocation, true); @@ -4969,7 +4969,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenFreeingNonImportedMemoryTh std::vector dataToCopy(MemoryConstants::pageSize, 1u); - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({rootDeviceIndex, dataToCopy.size(), AllocationType::BUFFER, device->getDeviceBitfield()}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({rootDeviceIndex, dataToCopy.size(), AllocationType::buffer, device->getDeviceBitfield()}); ASSERT_NE(nullptr, allocation); memoryManager->freeGraphicsMemory(allocation); @@ -4985,7 +4985,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetMemAdviseIsCalledThenUp TestedDrmMemoryManager memoryManager(false, false, false, *executionEnvironment); BufferObject bo(rootDeviceIndex, mock, 3, 1, 1024, 0); - DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::UNIFIED_SHARED_MEMORY, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::unifiedSharedMemory, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); EXPECT_EQ(&bo, drmAllocation.getBO()); for (auto isCached : {false, true}) { @@ -5001,7 +5001,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetAtomicAccessIsCalledThe TestedDrmMemoryManager memoryManager(false, false, false, *executionEnvironment); BufferObject bo(rootDeviceIndex, mock, 3, 1, 1024, 0); - DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::UNIFIED_SHARED_MEMORY, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::unifiedSharedMemory, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); EXPECT_EQ(&bo, drmAllocation.getBO()); size_t size = 16; @@ -5025,7 +5025,7 @@ TEST_F(DrmMemoryManagerTest, givenKmdMigratedSharedAllocationWithMultipleBOsWhen BufferObject bo1(rootDeviceIndex, mock, 3, 2, 1024, 0); BufferObjects bos{&bo0, &bo1}; - MockDrmAllocation drmAllocation(AllocationType::UNIFIED_SHARED_MEMORY, MemoryPool::LocalMemory, bos); + MockDrmAllocation drmAllocation(AllocationType::unifiedSharedMemory, MemoryPool::LocalMemory, bos); drmAllocation.storageInfo.memoryBanks = 0x3; drmAllocation.setNumHandles(2); @@ -5062,7 +5062,7 @@ TEST_F(DrmMemoryManagerTest, givenKmdMigratedSharedAllocationWithMultipleBOsWhen BufferObject bo1(rootDeviceIndex, mock, 3, 2, 1024, 0); BufferObjects bos{&bo0, &bo1}; - MockDrmAllocation drmAllocation(AllocationType::UNIFIED_SHARED_MEMORY, MemoryPool::LocalMemory, bos); + MockDrmAllocation drmAllocation(AllocationType::unifiedSharedMemory, MemoryPool::LocalMemory, bos); drmAllocation.storageInfo.memoryBanks = 0x3; drmAllocation.setNumHandles(2); @@ -5096,7 +5096,7 @@ TEST_F(DrmMemoryManagerTest, givenKMDSupportForCrossTileMigrationPolicyAndKmdMig BufferObject bo1(rootDeviceIndex, mock, 3, 2, 1024, 0); BufferObjects bos{&bo0, &bo1}; - MockDrmAllocation drmAllocation(AllocationType::UNIFIED_SHARED_MEMORY, MemoryPool::LocalMemory, bos); + MockDrmAllocation drmAllocation(AllocationType::unifiedSharedMemory, MemoryPool::LocalMemory, bos); drmAllocation.storageInfo.memoryBanks = 0x3; drmAllocation.setNumHandles(2); @@ -5130,7 +5130,7 @@ TEST_F(DrmMemoryManagerTest, givenKMDSupportForCrossTileMigrationPolicyAndKmdMig BufferObject bo1(rootDeviceIndex, mock, 3, 2, 1024, 0); BufferObjects bos{&bo0, &bo1}; - MockDrmAllocation drmAllocation(AllocationType::UNIFIED_SHARED_MEMORY, MemoryPool::LocalMemory, bos); + MockDrmAllocation drmAllocation(AllocationType::unifiedSharedMemory, MemoryPool::LocalMemory, bos); drmAllocation.storageInfo.memoryBanks = 0x3; drmAllocation.setNumHandles(2); @@ -5166,7 +5166,7 @@ TEST_F(DrmMemoryManagerTest, givenKmdMigratedSharedAllocationWithSingleBOWhenSet SubDeviceIdsVec subDeviceIds{0}; BufferObject bo(rootDeviceIndex, mock, 3, 1, 1024, 0); - MockDrmAllocation drmAllocation(rootDeviceIndex, AllocationType::UNIFIED_SHARED_MEMORY, MemoryPool::LocalMemory); + MockDrmAllocation drmAllocation(rootDeviceIndex, AllocationType::unifiedSharedMemory, MemoryPool::LocalMemory); drmAllocation.bufferObjects[0] = &bo; drmAllocation.setNumHandles(1); @@ -5192,7 +5192,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetMemPrefetchFailsToBindB SubDeviceIdsVec subDeviceIds{0}; BufferObject bo(rootDeviceIndex, mock, 3, 1, 1024, 0); - MockDrmAllocation drmAllocation(rootDeviceIndex, AllocationType::UNIFIED_SHARED_MEMORY, MemoryPool::LocalMemory); + MockDrmAllocation drmAllocation(rootDeviceIndex, AllocationType::unifiedSharedMemory, MemoryPool::LocalMemory); drmAllocation.bufferObjects[0] = &bo; memoryManager.allRegisteredEngines[this->device->getRootDeviceIndex()] = EngineControlContainer{this->device->allEngines}; @@ -5221,7 +5221,7 @@ TEST_F(DrmMemoryManagerTest, givenPageFaultIsUnSupportedWhenCallingBindBoOnBuffe uint32_t vmHandleId = 0; MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; std::vector bufferObjects; @@ -5247,7 +5247,7 @@ TEST_F(DrmMemoryManagerTest, givenPageFaultIsSupportedAndKmdMigrationEnabledForB uint32_t vmHandleId = 0; MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; for (auto useKmdMigrationForBuffers : {-1, 0, 1}) { @@ -5279,7 +5279,7 @@ TEST_F(DrmMemoryManagerTest, givenPageFaultIsSupportedWhenCallingBindBoOnAllocat uint32_t vmHandleId = 0; struct MockDrmAllocationToTestPageFault : MockDrmAllocation { - MockDrmAllocationToTestPageFault() : MockDrmAllocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory){}; + MockDrmAllocationToTestPageFault() : MockDrmAllocation(0u, AllocationType::buffer, MemoryPool::LocalMemory){}; bool shouldAllocationPageFault(const Drm *drm) override { return shouldPageFault; } @@ -5450,7 +5450,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenDrmMemor auto gpuAddress = 0x1234u; auto size = MemoryConstants::pageSize; - auto bo = std::unique_ptr(memoryManager->createBufferObjectInMemoryRegion(rootDeviceIndex, nullptr, AllocationType::BUFFER, gpuAddress, size, MemoryBanks::mainBank, 1, -1, false)); + auto bo = std::unique_ptr(memoryManager->createBufferObjectInMemoryRegion(rootDeviceIndex, nullptr, AllocationType::buffer, gpuAddress, size, MemoryBanks::mainBank, 1, -1, false)); EXPECT_EQ(nullptr, bo); } @@ -5458,7 +5458,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenDrmMemor auto gpuAddress = 0x1234u; auto size = 0u; - auto bo = std::unique_ptr(memoryManager->createBufferObjectInMemoryRegion(rootDeviceIndex, nullptr, AllocationType::BUFFER, gpuAddress, size, MemoryBanks::mainBank, 1, -1, false)); + auto bo = std::unique_ptr(memoryManager->createBufferObjectInMemoryRegion(rootDeviceIndex, nullptr, AllocationType::buffer, gpuAddress, size, MemoryBanks::mainBank, 1, -1, false)); EXPECT_EQ(nullptr, bo); } @@ -5469,7 +5469,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenUseKmdMi AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b11; @@ -5489,7 +5489,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenUseKmdMi AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b11; @@ -5510,7 +5510,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenUAllocat AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b11; allocData.cacheRegion = 0xFFFF; @@ -5531,7 +5531,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenMemoryAl AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = AllocationType::COMMAND_BUFFER; + allocData.type = AllocationType::commandBuffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b01; @@ -5549,7 +5549,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenPhysical AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = AllocationType::COMMAND_BUFFER; + allocData.type = AllocationType::commandBuffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b01; @@ -5570,7 +5570,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenMemoryAl AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b01; @@ -5591,7 +5591,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenMemoryAl AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b11; @@ -5613,7 +5613,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::chunkThreshold / 4; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b11; @@ -5637,7 +5637,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize2M; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b11; allocData.storageInfo.subDeviceBitfield = 0b11; @@ -5662,7 +5662,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize2M; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b11; @@ -5684,7 +5684,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize2M; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b11; allocData.storageInfo.subDeviceBitfield = 0b01; @@ -5707,7 +5707,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize2M; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b11; allocData.storageInfo.subDeviceBitfield = 0b11; @@ -5733,7 +5733,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize2M; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b11; @@ -5755,7 +5755,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b11; @@ -5777,7 +5777,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize2M; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b11; @@ -5803,7 +5803,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize2M; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b11; allocData.storageInfo.subDeviceBitfield = 0b11; @@ -5821,7 +5821,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenMemoryAl AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 0b11; @@ -5840,7 +5840,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenUseSyste allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.useSystemMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -5850,7 +5850,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenUseSyste TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenSvmGpuAllocationWhenHostPtrProvidedThenUseHostPtrAsGpuVa) { size_t size = 2 * MemoryConstants::megaByte; - AllocationProperties properties{rootDeviceIndex, false, size, AllocationType::SVM_GPU, false, mockDeviceBitfield}; + AllocationProperties properties{rootDeviceIndex, false, size, AllocationType::svmGpu, false, mockDeviceBitfield}; properties.alignment = size; void *svmPtr = reinterpret_cast(2 * size); @@ -5877,7 +5877,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenAllowed3 allocData.size = MemoryConstants::pageSize; allocData.flags.allow32Bit = true; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -5894,7 +5894,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenAllowed3 allocData.size = MemoryConstants::pageSize; allocData.flags.allow32Bit = true; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -5915,7 +5915,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenAllocati allocData.storageInfo.multiStorage = false; allocData.rootDeviceIndex = rootDeviceIndex; - AllocationType isaTypes[] = {AllocationType::KERNEL_ISA, AllocationType::KERNEL_ISA_INTERNAL}; + AllocationType isaTypes[] = {AllocationType::kernelIsa, AllocationType::kernelIsaInternal}; for (uint32_t i = 0; i < 2; i++) { allocData.type = isaTypes[i]; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -5948,7 +5948,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenAllocati allocData.allFlags = 0; allocData.size = 18 * MemoryConstants::pageSize64k; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3)); allocData.storageInfo.multiStorage = true; allocData.rootDeviceIndex = rootDeviceIndex; @@ -5986,7 +5986,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenAllocati allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::KERNEL_ISA; + allocData.type = AllocationType::kernelIsa; allocData.storageInfo.memoryBanks = 0b1011; allocData.storageInfo.multiStorage = false; allocData.rootDeviceIndex = rootDeviceIndex; @@ -6027,7 +6027,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenAllocati allocData.allFlags = 0; allocData.size = 18 * MemoryConstants::pageSize64k; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3)); allocData.storageInfo.multiStorage = true; allocData.rootDeviceIndex = rootDeviceIndex; @@ -6071,7 +6071,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenAllocati allocData.allFlags = 0; allocData.size = 18 * MemoryConstants::pageSize64k; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3)); allocData.storageInfo.multiStorage = true; allocData.rootDeviceIndex = rootDeviceIndex; @@ -6104,7 +6104,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenMultiple allocData.allFlags = 0; allocData.size = 18 * MemoryConstants::pageSize64k; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3)); allocData.storageInfo.multiStorage = true; allocData.rootDeviceIndex = rootDeviceIndex; @@ -6136,7 +6136,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenAllocati allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::KERNEL_ISA; + allocData.type = AllocationType::kernelIsa; allocData.storageInfo.memoryBanks = 0b1011; allocData.storageInfo.multiStorage = false; allocData.rootDeviceIndex = rootDeviceIndex; @@ -6188,7 +6188,7 @@ TEST_F(DrmMemoryManagerLocalMemoryAlignmentTest, given2MbAlignmentAllowedWhenAll allocationData.size = MemoryConstants::pageSize; allocationData.flags.allocateMemory = true; allocationData.rootDeviceIndex = rootDeviceIndex; - allocationData.type = AllocationType::BUFFER; + allocationData.type = AllocationType::buffer; allocationData.flags.resource48Bit = true; MemoryManager::AllocationStatus allocationStatus; @@ -6227,7 +6227,7 @@ TEST_F(DrmMemoryManagerLocalMemoryAlignmentTest, given2MbAlignmentAllowedWhenAll allocationData.size = 2 * MemoryConstants::megaByte; allocationData.flags.allocateMemory = true; allocationData.rootDeviceIndex = rootDeviceIndex; - allocationData.type = AllocationType::BUFFER; + allocationData.type = AllocationType::buffer; allocationData.flags.resource48Bit = true; MemoryManager::AllocationStatus allocationStatus; @@ -6271,7 +6271,7 @@ TEST_F(DrmMemoryManagerLocalMemoryAlignmentTest, givenExtendedHeapPreferredAnd2M allocationData.size = 2 * MemoryConstants::megaByte; allocationData.flags.allocateMemory = true; allocationData.rootDeviceIndex = rootDeviceIndex; - allocationData.type = AllocationType::BUFFER; + allocationData.type = AllocationType::buffer; allocationData.flags.resource48Bit = false; MemoryManager::AllocationStatus allocationStatus; @@ -6311,7 +6311,7 @@ TEST_F(DrmMemoryManagerLocalMemoryAlignmentTest, givenCustomAlignmentWhenAllocat allocationData.allFlags = 0; allocationData.flags.allocateMemory = true; allocationData.rootDeviceIndex = rootDeviceIndex; - allocationData.type = AllocationType::BUFFER; + allocationData.type = AllocationType::buffer; allocationData.flags.resource48Bit = true; MemoryManager::AllocationStatus allocationStatus; @@ -6361,7 +6361,7 @@ TEST_F(DrmMemoryManagerLocalMemoryAlignmentTest, givenCustomAlignmentWhenAllocat allocationData.size = 3 * MemoryConstants::megaByte; allocationData.flags.allocateMemory = true; allocationData.rootDeviceIndex = rootDeviceIndex; - allocationData.type = AllocationType::BUFFER; + allocationData.type = AllocationType::buffer; allocationData.flags.resource48Bit = true; MemoryManager::AllocationStatus allocationStatus; @@ -6396,7 +6396,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenNotSetUs allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; auto sizeAligned = alignUp(allocData.size, MemoryConstants::pageSize64k); @@ -6452,7 +6452,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenPatIndex allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -6483,7 +6483,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenCompress allocData.allFlags = 0; allocData.size = 1; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -6533,7 +6533,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenNotSetUs AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = AllocationType::IMAGE; + allocData.type = AllocationType::image; allocData.flags.resource48Bit = true; allocData.imgInfo = &imgInfo; allocData.rootDeviceIndex = rootDeviceIndex; @@ -6586,7 +6586,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenNotSetUs allocData.rootDeviceIndex = rootDeviceIndex; auto sizeAligned = alignUp(allocData.size, MemoryConstants::pageSize64k); - AllocationType isaTypes[] = {AllocationType::KERNEL_ISA, AllocationType::KERNEL_ISA_INTERNAL}; + AllocationType isaTypes[] = {AllocationType::kernelIsa, AllocationType::kernelIsaInternal}; for (uint32_t i = 0; i < 2; i++) { allocData.type = isaTypes[i]; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -6621,7 +6621,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenUnsuppor allocData.flags.allocateMemory = true; allocData.rootDeviceIndex = rootDeviceIndex; - AllocationType unsupportedTypes[] = {AllocationType::SHARED_RESOURCE_COPY}; + AllocationType unsupportedTypes[] = {AllocationType::sharedResourceCopy}; for (auto unsupportedType : unsupportedTypes) { allocData.type = unsupportedType; @@ -6655,7 +6655,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenOversize auto status = MemoryManager::AllocationStatus::Error; AllocationData allocData; allocData.size = 5 * MemoryConstants::megaByte; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); memoryManager->getGfxPartition(rootDeviceIndex)->heapFree(heap, gpuAddress2, largerSize); @@ -6677,7 +6677,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenAllocati auto status = MemoryManager::AllocationStatus::Error; AllocationData allocData; allocData.size = size; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); EXPECT_EQ(MemoryManager::AllocationStatus::Success, status); @@ -6711,7 +6711,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenDebugVar auto status = MemoryManager::AllocationStatus::Error; AllocationData allocData; allocData.size = size; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); EXPECT_EQ(MemoryManager::AllocationStatus::Success, status); @@ -6765,7 +6765,7 @@ TEST(DrmMemoryManagerCopyMemoryToAllocationBanksTest, givenDrmMemoryManagerWhenC DrmMemoryManagerToTestCopyMemoryToAllocationBanks drmMemoryManger(executionEnvironment, destinationAllocationSize); std::vector dataToCopy(sourceAllocationSize, 1u); - MockDrmAllocation mockAllocation(0u, AllocationType::WORK_PARTITION_SURFACE, MemoryPool::LocalMemory); + MockDrmAllocation mockAllocation(0u, AllocationType::workPartitionSurface, MemoryPool::LocalMemory); mockAllocation.storageInfo.memoryBanks = 0b1111; DeviceBitfield memoryBanksToCopy = 0b1010; @@ -6862,11 +6862,11 @@ TEST_F(DrmMemoryManagerTest, GivenEligbleAllocationTypeWhenCheckingAllocationEli constexpr size_t arraySize = 5; AllocationType validAllocations[arraySize] = { - AllocationType::COMMAND_BUFFER, - AllocationType::RING_BUFFER, - AllocationType::DEFERRED_TASKS_LIST, - AllocationType::SEMAPHORE_BUFFER, - AllocationType::TAG_BUFFER}; + AllocationType::commandBuffer, + AllocationType::ringBuffer, + AllocationType::deferredTasksList, + AllocationType::semaphoreBuffer, + AllocationType::tagBuffer}; for (size_t i = 0; i < arraySize; i++) { EXPECT_TRUE(memoryManager->allocationTypeForCompletionFence(validAllocations[i])); @@ -6875,10 +6875,10 @@ TEST_F(DrmMemoryManagerTest, GivenEligbleAllocationTypeWhenCheckingAllocationEli TEST_F(DrmMemoryManagerTest, GivenNotEligbleAllocationTypeWhenCheckingAllocationEligbleForCompletionFenceThenReturnFalse) { AllocationType invalidAllocations[] = { - AllocationType::BUFFER_HOST_MEMORY, - AllocationType::CONSTANT_SURFACE, - AllocationType::FILL_PATTERN, - AllocationType::GLOBAL_SURFACE}; + AllocationType::bufferHostMemory, + AllocationType::constantSurface, + AllocationType::fillPattern, + AllocationType::globalSurface}; for (size_t i = 0; i < 4; i++) { EXPECT_FALSE(memoryManager->allocationTypeForCompletionFence(invalidAllocations[i])); @@ -6890,10 +6890,10 @@ TEST_F(DrmMemoryManagerTest, GivenNotEligbleAllocationTypeAndDebugFlagOverriding debugManager.flags.UseDrmCompletionFenceForAllAllocations.set(1); AllocationType invalidAllocations[] = { - AllocationType::BUFFER_HOST_MEMORY, - AllocationType::CONSTANT_SURFACE, - AllocationType::FILL_PATTERN, - AllocationType::GLOBAL_SURFACE}; + AllocationType::bufferHostMemory, + AllocationType::constantSurface, + AllocationType::fillPattern, + AllocationType::globalSurface}; for (size_t i = 0; i < 4; i++) { EXPECT_TRUE(memoryManager->allocationTypeForCompletionFence(invalidAllocations[i])); @@ -6907,7 +6907,7 @@ TEST_F(DrmMemoryManagerTest, givenCompletionFenceEnabledWhenHandlingCompletionOf VariableBackup backupVmBindCallParent{&mock->isVmBindAvailableCall.callParent, false}; VariableBackup backupVmBindReturnValue{&mock->isVmBindAvailableCall.returnValue, true}; - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 1024, AllocationType::COMMAND_BUFFER}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 1024, AllocationType::commandBuffer}); auto engine = memoryManager->getRegisteredEngines(rootDeviceIndex)[0]; allocation->updateTaskCount(2, engine.osContext->getContextId()); @@ -6930,7 +6930,7 @@ TEST_F(DrmMemoryManagerTest, givenCompletionFenceEnabledWhenHandlingCompletionOf VariableBackup backupVmBindCallParent{&mock->isVmBindAvailableCall.callParent, false}; VariableBackup backupVmBindReturnValue{&mock->isVmBindAvailableCall.returnValue, true}; - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 1024, AllocationType::COMMAND_BUFFER}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 1024, AllocationType::commandBuffer}); memoryManager->handleFenceCompletion(allocation); @@ -6946,7 +6946,7 @@ TEST_F(DrmMemoryManagerTest, givenCompletionFenceEnabledWhenHandlingCompletionOf VariableBackup backupVmBindCallParent{&mock->isVmBindAvailableCall.callParent, false}; VariableBackup backupVmBindReturnValue{&mock->isVmBindAvailableCall.returnValue, true}; - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 1024, AllocationType::GLOBAL_SURFACE}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 1024, AllocationType::globalSurface}); auto engine = memoryManager->getRegisteredEngines(rootDeviceIndex)[0]; allocation->updateTaskCount(2, engine.osContext->getContextId()); @@ -6964,7 +6964,7 @@ HWTEST_F(DrmMemoryManagerTest, givenCompletionFenceEnabledWhenHandlingCompletion VariableBackup backupVmBindCallParent{&mock->isVmBindAvailableCall.callParent, false}; VariableBackup backupVmBindReturnValue{&mock->isVmBindAvailableCall.returnValue, true}; - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 1024, AllocationType::COMMAND_BUFFER}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 1024, AllocationType::commandBuffer}); auto engine = memoryManager->getRegisteredEngines(rootDeviceIndex)[0]; allocation->updateTaskCount(2, engine.osContext->getContextId()); @@ -6984,7 +6984,7 @@ TEST_F(DrmMemoryManagerTest, givenMultiSubDevicesBitfieldWhenAllocatingSbaTracki mock->ioctlExpected.total = -1; NEO::AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize, - NEO::AllocationType::DEBUG_SBA_TRACKING_BUFFER, + NEO::AllocationType::debugSbaTrackingBuffer, false, false, 0b0011}; @@ -7031,7 +7031,7 @@ TEST_F(DrmMemoryManagerTest, givenSingleSubDevicesBitfieldWhenAllocatingSbaTrack mock->ioctlExpected.total = -1; NEO::AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize, - NEO::AllocationType::DEBUG_SBA_TRACKING_BUFFER, + NEO::AllocationType::debugSbaTrackingBuffer, false, false, 0b0001}; @@ -7074,7 +7074,7 @@ TEST_F(DrmMemoryManagerTest, givenMakeBosResidentErrorWhenRegisteringMemoryAlloc auto &drm = static_cast(memoryManager->getDrm(rootDeviceIndex)); drm.vmIdToCreate = 1; drm.createVirtualMemoryAddressSpace(1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::buffer, MemoryPool::System4KBPages); allocation.makeBOsResidentResult = ENOSPC; EXPECT_EQ(MemoryManager::AllocationStatus::Error, memoryManager->registerSysMemAlloc(&allocation)); @@ -7088,7 +7088,7 @@ TEST_F(DrmMemoryManagerTest, givenMakeBosResidentSuccessWhenRegisteringMemoryAll auto &drm = static_cast(memoryManager->getDrm(0)); drm.vmIdToCreate = 1; drm.createVirtualMemoryAddressSpace(1); - MockDrmAllocation allocation(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation allocation(rootDeviceIndex, AllocationType::buffer, MemoryPool::System4KBPages); allocation.makeBOsResidentResult = 0; EXPECT_EQ(MemoryManager::AllocationStatus::Success, memoryManager->registerSysMemAlloc(&allocation)); @@ -7148,7 +7148,7 @@ TEST_F(DrmMemoryManagerTest, given57bAddressSpaceCpuAndGpuWhenAllocatingHostUSMT auto &drm = static_cast(memoryManager->getDrm(mockRootDeviceIndex)); drm.memoryInfo.reset(new MemoryInfo(regionInfo, drm)); - AllocationProperties allocationProperties(mockRootDeviceIndex, MemoryConstants::cacheLineSize, AllocationType::SVM_CPU, {}); + AllocationProperties allocationProperties(mockRootDeviceIndex, MemoryConstants::cacheLineSize, AllocationType::svmCpu, {}); allocationProperties.flags.isUSMHostAllocation = true; auto hostUSM = memoryManager->allocateGraphicsMemoryInPreferredPool(allocationProperties, nullptr); EXPECT_NE(nullptr, hostUSM); @@ -7180,7 +7180,7 @@ TEST_F(DrmMemoryManagerTest, given48bAddressSpaceCpuAnd57bGpuWhenAllocatingHostU auto &drm = static_cast(memoryManager->getDrm(mockRootDeviceIndex)); drm.memoryInfo.reset(new MemoryInfo(regionInfo, drm)); - AllocationProperties allocationProperties(mockRootDeviceIndex, MemoryConstants::cacheLineSize, AllocationType::SVM_CPU, {}); + AllocationProperties allocationProperties(mockRootDeviceIndex, MemoryConstants::cacheLineSize, AllocationType::svmCpu, {}); allocationProperties.flags.isUSMHostAllocation = true; auto hostUSM = memoryManager->allocateGraphicsMemoryInPreferredPool(allocationProperties, nullptr); EXPECT_NE(nullptr, hostUSM); @@ -7214,7 +7214,7 @@ TEST_F(DrmMemoryManagerTest, given57bAddressSpaceCpuAndGpuAndDisabledHeapExtende auto &drm = static_cast(memoryManager->getDrm(mockRootDeviceIndex)); drm.memoryInfo.reset(new MemoryInfo(regionInfo, drm)); - AllocationProperties allocationProperties(mockRootDeviceIndex, MemoryConstants::cacheLineSize, AllocationType::SVM_CPU, {}); + AllocationProperties allocationProperties(mockRootDeviceIndex, MemoryConstants::cacheLineSize, AllocationType::svmCpu, {}); allocationProperties.flags.isUSMHostAllocation = true; auto hostUSM = memoryManager->allocateGraphicsMemoryInPreferredPool(allocationProperties, nullptr); EXPECT_NE(nullptr, hostUSM); diff --git a/shared/test/unit_test/os_interface/linux/drm_query_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_query_tests.cpp index 24a3e8f767..3ee6446daa 100644 --- a/shared/test/unit_test/os_interface/linux/drm_query_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_query_tests.cpp @@ -72,6 +72,6 @@ TEST(DrmQueryTest, givenDrmAllocationWhenShouldAllocationFaultIsCalledThenReturn auto executionEnvironment = std::make_unique(); DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]}; - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::MemoryNull); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::MemoryNull); EXPECT_FALSE(allocation.shouldAllocationPageFault(&drm)); } diff --git a/shared/test/unit_test/os_interface/linux/drm_query_topology_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_query_topology_prelim_tests.cpp index fdd2a6d10d..4412b83866 100644 --- a/shared/test/unit_test/os_interface/linux/drm_query_topology_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_query_topology_prelim_tests.cpp @@ -361,14 +361,14 @@ TEST(DrmQueryTest, givenUseKmdMigrationWhenShouldAllocationFaultIsCalledOnFaulta drm.pageFaultSupported = true; AllocationType allocationTypesThatShouldFault[] = { - AllocationType::UNIFIED_SHARED_MEMORY}; + AllocationType::unifiedSharedMemory}; for (auto allocationType : allocationTypesThatShouldFault) { MockDrmAllocation allocation(0u, allocationType, MemoryPool::MemoryNull); EXPECT_TRUE(allocation.shouldAllocationPageFault(&drm)); } - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::MemoryNull); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::MemoryNull); EXPECT_FALSE(allocation.shouldAllocationPageFault(&drm)); } @@ -388,7 +388,7 @@ TEST(DrmQueryTest, givenDrmAllocationWhenShouldAllocationFaultIsCalledOnNonFault DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]}; drm.pageFaultSupported = false; - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::MemoryNull); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::MemoryNull); EXPECT_FALSE(allocation.shouldAllocationPageFault(&drm)); } @@ -400,7 +400,7 @@ TEST(DrmQueryTest, givenEnableImplicitMigrationOnFaultableHardwareWhenShouldAllo DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]}; drm.pageFaultSupported = true; - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::MemoryNull); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::MemoryNull); EXPECT_TRUE(allocation.shouldAllocationPageFault(&drm)); } @@ -434,7 +434,7 @@ TEST(DrmQueryTest, givenKmdMigrationSupportedWhenShouldAllocationPageFaultIsCall drm.pageFaultSupported = true; MockBufferObject bo(0u, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(0u, AllocationType::UNIFIED_SHARED_MEMORY, MemoryPool::LocalMemory); + MockDrmAllocation allocation(0u, AllocationType::unifiedSharedMemory, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; EXPECT_EQ(drm.hasKmdMigrationSupport(), allocation.shouldAllocationPageFault(&drm)); diff --git a/shared/test/unit_test/os_interface/linux/drm_residency_handler_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_residency_handler_prelim_tests.cpp index a1400a8f60..3061594bca 100644 --- a/shared/test/unit_test/os_interface/linux/drm_residency_handler_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_residency_handler_prelim_tests.cpp @@ -549,7 +549,7 @@ TEST_F(DrmMemoryOperationsHandlerBindTest, givenMakeBOsResidentFailsThenMakeResi BufferObject mockBo(device->getRootDeviceIndex(), mock, 3, 1, 0, 1); bos.push_back(&mockBo); - auto allocation = new MockDrmAllocationBOsResident(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory); + auto allocation = new MockDrmAllocationBOsResident(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory); auto graphicsAllocation = static_cast(allocation); EXPECT_EQ(operationHandler->makeResidentWithinOsContext(device->getDefaultEngine().osContext, ArrayRef(&graphicsAllocation, 1), false), MemoryOperationsStatus::OUT_OF_MEMORY); @@ -574,7 +574,7 @@ TEST_F(DrmMemoryOperationsHandlerBindTest, mockBo.setSize(1024); bos.push_back(&mockBo); - auto allocation = new MockDrmAllocationBOsResident(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory); + auto allocation = new MockDrmAllocationBOsResident(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory); allocation->setNumHandles(1); allocation->storageInfo.isChunked = 1; allocation->storageInfo.numOfChunks = 4; @@ -1098,7 +1098,7 @@ HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenPatIndexProgrammingEnabledWhen uint64_t gpuAddress = 0x123000; size_t size = 1; BufferObject bo(0, mock, static_cast(MockGmmClientContextBase::MockPatIndex::cached), 0, 1, 1); - DrmAllocation allocation(0, 1, AllocationType::BUFFER, &bo, nullptr, gpuAddress, size, MemoryPool::System4KBPages); + DrmAllocation allocation(0, 1, AllocationType::buffer, &bo, nullptr, gpuAddress, size, MemoryPool::System4KBPages); auto allocationPtr = static_cast(&allocation); @@ -1161,7 +1161,7 @@ HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenPatIndexErrorAndUncachedDebugF uint64_t gpuAddress = 0x123000; size_t size = 1; BufferObject bo(0, mock, static_cast(MockGmmClientContextBase::MockPatIndex::cached), 0, 1, 1); - DrmAllocation allocation(0, 1, AllocationType::BUFFER, &bo, nullptr, gpuAddress, size, MemoryPool::System4KBPages); + DrmAllocation allocation(0, 1, AllocationType::buffer, &bo, nullptr, gpuAddress, size, MemoryPool::System4KBPages); EXPECT_ANY_THROW(mock->getPatIndex(allocation.getDefaultGmm(), allocation.getAllocationType(), CacheRegion::defaultRegion, CachePolicy::writeBack, false, false)); } @@ -1238,11 +1238,11 @@ HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenDebugFlagSetWhenVmBindCalledTh auto osContext = memoryManager->createAndRegisterOsContext(csr.get(), EngineDescriptorHelper::getDefaultDescriptor()); csr->setupContext(*osContext); - auto patIndex = mock->getPatIndex(nullptr, AllocationType::BUFFER, CacheRegion::defaultRegion, CachePolicy::writeBack, false, false); + auto patIndex = mock->getPatIndex(nullptr, AllocationType::buffer, CacheRegion::defaultRegion, CachePolicy::writeBack, false, false); EXPECT_EQ(2u, patIndex); MockBufferObject bo(0, mock, patIndex, 0, 0, 1); - DrmAllocation allocation(0, AllocationType::BUFFER, &bo, nullptr, 0x1234000, 1, MemoryPool::LocalMemory); + DrmAllocation allocation(0, AllocationType::buffer, &bo, nullptr, 0x1234000, 1, MemoryPool::LocalMemory); GraphicsAllocation *allocPtr = &allocation; @@ -1269,11 +1269,11 @@ HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenDebugFlagSetWhenVmBindCalledTh auto osContext = memoryManager->createAndRegisterOsContext(csr.get(), EngineDescriptorHelper::getDefaultDescriptor()); csr->setupContext(*osContext); - auto patIndex = mock->getPatIndex(nullptr, AllocationType::BUFFER, CacheRegion::defaultRegion, CachePolicy::writeBack, false, true); + auto patIndex = mock->getPatIndex(nullptr, AllocationType::buffer, CacheRegion::defaultRegion, CachePolicy::writeBack, false, true); EXPECT_EQ(3u, patIndex); MockBufferObject bo(0, mock, patIndex, 0, 0, 1); - DrmAllocation allocation(0, AllocationType::BUFFER, &bo, nullptr, 0x1234000, 1, MemoryPool::System4KBPages); + DrmAllocation allocation(0, AllocationType::buffer, &bo, nullptr, 0x1234000, 1, MemoryPool::System4KBPages); GraphicsAllocation *allocPtr = &allocation; diff --git a/shared/test/unit_test/os_interface/linux/drm_vm_bind_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_vm_bind_prelim_tests.cpp index 4cd52c5ee3..09648a20f8 100644 --- a/shared/test/unit_test/os_interface/linux/drm_vm_bind_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_vm_bind_prelim_tests.cpp @@ -172,7 +172,7 @@ TEST(DrmVmBindTest, givenUseKmdMigrationWhenCallingBindBoOnUnifiedSharedMemoryTh uint32_t vmHandleId = 0; MockBufferObject bo(0u, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(0u, AllocationType::UNIFIED_SHARED_MEMORY, MemoryPool::LocalMemory); + MockDrmAllocation allocation(0u, AllocationType::unifiedSharedMemory, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; allocation.bindBO(&bo, &osContext, vmHandleId, nullptr, true); @@ -195,7 +195,7 @@ TEST(DrmVmBindTest, givenDrmWithPageFaultSupportWhenCallingBindBoOnUnifiedShared uint32_t vmHandleId = 0; MockBufferObject bo(0u, &drm, 3, 0, 0, 1); - MockDrmAllocation allocation(0u, AllocationType::UNIFIED_SHARED_MEMORY, MemoryPool::LocalMemory); + MockDrmAllocation allocation(0u, AllocationType::unifiedSharedMemory, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; allocation.bindBO(&bo, &osContext, vmHandleId, nullptr, true); diff --git a/shared/test/unit_test/os_interface/linux/drm_with_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_with_prelim_tests.cpp index 1b69057533..96098053df 100644 --- a/shared/test/unit_test/os_interface/linux/drm_with_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_with_prelim_tests.cpp @@ -279,7 +279,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseFailsThenDont drm->ioctlRetVal = -1; MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1); - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; MemAdviseFlags memAdviseFlags{}; @@ -300,7 +300,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseForChunkingFa drm->ioctlRetVal = -1; MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1); - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; MemAdviseFlags memAdviseFlags{}; @@ -316,7 +316,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseForChunkingFa TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithNonAtomicIsCalledThenUpdateTheCorrespondingVmAdviceForBufferObject) { MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1); drm->ioctlCallsCount = 0; - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; MemAdviseFlags memAdviseFlags{}; @@ -333,7 +333,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithNonAtomic TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithDevicePreferredLocationIsCalledThenUpdateTheCorrespondingVmAdviceForBufferObject) { drm->ioctlCallsCount = 0; MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1); - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; allocation.storageInfo.memoryBanks = 0x1; allocation.setNumHandles(1); @@ -352,7 +352,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithDevicePre TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithSystemPreferredLocationIsCalledThenUpdateTheCorrespondingVmAdviceForBufferObject) { drm->ioctlCallsCount = 0; MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1); - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; allocation.storageInfo.memoryBanks = 0x1; allocation.setNumHandles(1); @@ -382,7 +382,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithChunkingP drm->ioctlCallsCount = 0; MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1); - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; allocation.storageInfo.memoryBanks = 0x1; allocation.setNumHandles(1); @@ -414,7 +414,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithChunkingB drm->ioctlCallsCount = 0; MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1); - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; allocation.storageInfo.memoryBanks = 0x1; allocation.setNumHandles(1); @@ -448,7 +448,7 @@ TEST_F(IoctlHelperPrelimFixture, drm->ioctlCallsCount = 0; MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1); - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; allocation.storageInfo.memoryBanks = 0x5; allocation.setNumHandles(1); @@ -467,7 +467,7 @@ TEST_F(IoctlHelperPrelimFixture, TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetAtomicAccessWithModeCalledThenIoctlCalled) { drm->ioctlCallsCount = 0; MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1); - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; allocation.storageInfo.memoryBanks = 0x1; allocation.setNumHandles(1); @@ -493,7 +493,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetAtomicAccessWithModeCa TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetAtomicAccessWithNullBufferObjectThenIoctlNotCalled) { drm->ioctlCallsCount = 0; - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = nullptr; allocation.storageInfo.memoryBanks = 0x1; allocation.setNumHandles(1); @@ -507,7 +507,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetAtomicAccessWithNullBu TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemPrefetchSucceedsThenReturnTrue) { SubDeviceIdsVec subDeviceIds{0}; MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1); - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; drm->ioctlRetVal = 0; @@ -517,7 +517,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemPrefetchSucceedsThe TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemPrefetchFailsThenReturnFalse) { SubDeviceIdsVec subDeviceIds{0}; MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1); - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; allocation.setNumHandles(1); @@ -544,7 +544,7 @@ TEST_F(IoctlHelperPrelimFixture, MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1); bo.isChunked = 1; bo.setSize(1024); - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; allocation.storageInfo.memoryBanks = 0x5; allocation.setNumHandles(1); @@ -573,7 +573,7 @@ TEST_F(IoctlHelperPrelimFixture, MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1); bo.isChunked = 1; bo.setSize(1024); - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; allocation.storageInfo.memoryBanks = 0x5; allocation.setNumHandles(1); diff --git a/shared/test/unit_test/os_interface/linux/file_logger_linux_tests.cpp b/shared/test/unit_test/os_interface/linux/file_logger_linux_tests.cpp index 1f8a04c3ba..e8fe467bfe 100644 --- a/shared/test/unit_test/os_interface/linux/file_logger_linux_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/file_logger_linux_tests.cpp @@ -27,7 +27,7 @@ TEST(FileLogger, GivenLogAllocationMemoryPoolFlagThenLogsCorrectInfo) { auto executionEnvironment = std::make_unique(); DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]); - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::System64KBPages); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::System64KBPages); auto gmmHelper = executionEnvironment->rootDeviceEnvironments[0]->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(0x12345); @@ -78,7 +78,7 @@ TEST(FileLogger, givenLogAllocationStdoutWhenLogAllocationThenLogToStdoutInstead auto executionEnvironment = std::make_unique(); DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]); - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::System64KBPages); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::System64KBPages); auto gmmHelper = executionEnvironment->rootDeviceEnvironments[0]->getGmmHelper(); auto canonizedGpuAddress = gmmHelper->canonize(0x12345); @@ -128,7 +128,7 @@ TEST(FileLogger, GivenDrmAllocationWithoutBOThenNoHandleLogged) { // Log file not created bool logFileCreated = fileExists(fileLogger.getLogFileName()); EXPECT_FALSE(logFileCreated); - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::System64KBPages); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::System64KBPages); fileLogger.logAllocation(&allocation); @@ -159,7 +159,7 @@ TEST(FileLogger, GivenLogAllocationMemoryPoolFlagSetFalseThenAllocationIsNotLogg bool logFileCreated = fileExists(fileLogger.getLogFileName()); EXPECT_FALSE(logFileCreated); - MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::System64KBPages); + MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::System64KBPages); fileLogger.logAllocation(&allocation); diff --git a/shared/test/unit_test/os_interface/product_helper_tests.cpp b/shared/test/unit_test/os_interface/product_helper_tests.cpp index d0fc10b3b0..079c93aa38 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -476,7 +476,7 @@ HWTEST_F(ProductHelperTest, givenLockableAllocationWhenGettingIsBlitCopyRequired pInHwInfo.capabilityTable.blitterOperationsSupported = true; MockGraphicsAllocation graphicsAllocation; - graphicsAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + graphicsAllocation.setAllocationType(AllocationType::bufferHostMemory); EXPECT_TRUE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType())); graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); @@ -508,7 +508,7 @@ HWTEST_F(ProductHelperTest, givenNotLockableAllocationWhenGettingIsBlitCopyRequi hwInfo.capabilityTable.blitterOperationsSupported = true; MockGraphicsAllocation graphicsAllocation; - graphicsAllocation.setAllocationType(AllocationType::SVM_GPU); + graphicsAllocation.setAllocationType(AllocationType::svmGpu); EXPECT_FALSE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType())); graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); @@ -548,7 +548,7 @@ HWTEST2_F(ProductHelperTest, givenProductHelperWhenGettingIsBlitCopyRequiredForL MockGraphicsAllocation graphicsAllocation; graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); - graphicsAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + graphicsAllocation.setAllocationType(AllocationType::bufferHostMemory); EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); } diff --git a/shared/test/unit_test/os_interface/windows/device_command_stream_tests.cpp b/shared/test/unit_test/os_interface/windows/device_command_stream_tests.cpp index 35ec32abe6..ecff205e21 100644 --- a/shared/test/unit_test/os_interface/windows/device_command_stream_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/device_command_stream_tests.cpp @@ -499,7 +499,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafDisabledWhenFlushIsCalledWithAll LinearStream cs(commandBuffer); BatchBuffer batchBuffer = BatchBufferHelper::createDefaultBatchBuffer(cs.getGraphicsAllocation(), &cs, cs.getUsed()); - auto linearStreamAllocation = memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::LINEAR_STREAM, device->getDeviceBitfield()}); + auto linearStreamAllocation = memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::linearStream, device->getDeviceBitfield()}); ASSERT_NE(nullptr, linearStreamAllocation); ResidencyContainer allocationsForResidency = {linearStreamAllocation}; @@ -538,7 +538,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithResi LinearStream cs(commandBuffer); BatchBuffer batchBuffer = BatchBufferHelper::createDefaultBatchBuffer(cs.getGraphicsAllocation(), &cs, cs.getUsed()); - auto linearStreamAllocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::LINEAR_STREAM, device->getDeviceBitfield()})); + auto linearStreamAllocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::linearStream, device->getDeviceBitfield()})); ASSERT_NE(nullptr, linearStreamAllocation); csr->makeResident(*linearStreamAllocation); @@ -564,7 +564,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo LinearStream cs(commandBuffer); BatchBuffer batchBuffer = BatchBufferHelper::createDefaultBatchBuffer(cs.getGraphicsAllocation(), &cs, cs.getUsed()); - auto linearStreamAllocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::LINEAR_STREAM, device->getDeviceBitfield()})); + auto linearStreamAllocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::linearStream, device->getDeviceBitfield()})); ASSERT_NE(nullptr, linearStreamAllocation); ResidencyContainer allocationsForResidency = {linearStreamAllocation}; @@ -587,7 +587,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo LinearStream cs(commandBuffer); BatchBuffer batchBuffer = BatchBufferHelper::createDefaultBatchBuffer(cs.getGraphicsAllocation(), &cs, cs.getUsed()); - auto fillPatternAllocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::FILL_PATTERN, device->getDeviceBitfield()})); + auto fillPatternAllocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::fillPattern, device->getDeviceBitfield()})); ASSERT_NE(nullptr, fillPatternAllocation); ResidencyContainer allocationsForResidency = {fillPatternAllocation}; @@ -610,7 +610,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo LinearStream cs(commandBuffer); BatchBuffer batchBuffer = BatchBufferHelper::createDefaultBatchBuffer(cs.getGraphicsAllocation(), &cs, cs.getUsed()); - auto commandBufferAllocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto commandBufferAllocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::commandBuffer, device->getDeviceBitfield()})); ASSERT_NE(nullptr, commandBufferAllocation); ResidencyContainer allocationsForResidency = {commandBufferAllocation}; diff --git a/shared/test/unit_test/os_interface/windows/file_logger_win_tests.cpp b/shared/test/unit_test/os_interface/windows/file_logger_win_tests.cpp index a1b56f1308..2bd07c6363 100644 --- a/shared/test/unit_test/os_interface/windows/file_logger_win_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/file_logger_win_tests.cpp @@ -29,7 +29,7 @@ TEST_F(FileLoggerTests, GivenLogAllocationMemoryPoolFlagThenLogsCorrectInfo) { MockWddmAllocation allocation(getGmmHelper()); allocation.handle = 4; - allocation.setAllocationType(AllocationType::BUFFER); + allocation.setAllocationType(AllocationType::buffer); allocation.memoryPool = MemoryPool::System64KBPages; allocation.getDefaultGmm()->resourceParams.Flags.Info.NonLocalOnly = 0; allocation.setGpuAddress(0x12345); @@ -75,7 +75,7 @@ TEST_F(FileLoggerTests, GivenLogAllocationMemoryPoolFlagSetFalseThenAllocationIs executionEnvironment->rootDeviceEnvironments[0]->initGmm(); MockWddmAllocation allocation(executionEnvironment->rootDeviceEnvironments[0]->getGmmHelper()); allocation.handle = 4; - allocation.setAllocationType(AllocationType::BUFFER); + allocation.setAllocationType(AllocationType::buffer); allocation.memoryPool = MemoryPool::System64KBPages; allocation.getDefaultGmm()->resourceParams.Flags.Info.NonLocalOnly = 0; diff --git a/shared/test/unit_test/os_interface/windows/wddm20_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm20_tests.cpp index f625301a1b..52332e10b8 100644 --- a/shared/test/unit_test/os_interface/windows/wddm20_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm20_tests.cpp @@ -83,7 +83,7 @@ TEST_F(Wddm20Tests, givenNullPageTableManagerAndCompressedResourceWhenMappingGpu void *fakePtr = reinterpret_cast(0x100); auto gmmHelper = getGmmHelper(); auto canonizedAddress = gmmHelper->canonize(castToUint64(const_cast(fakePtr))); - WddmAllocation allocation(0, AllocationType::UNKNOWN, fakePtr, canonizedAddress, 0x2100, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::unknown, fakePtr, canonizedAddress, 0x2100, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocation.setDefaultGmm(gmm.get()); allocation.getHandleToModify(0u) = ALLOCATION_HANDLE; @@ -207,7 +207,7 @@ TEST_F(Wddm20Tests, WhenCreatingAllocationAndDestroyingAllocationThenCorrectResu auto gmmHelper = getGmmHelper(); auto ptr = mm.allocateSystemMemory(100, 0); auto canonizedAddress = gmmHelper->canonize(castToUint64(const_cast(ptr))); - WddmAllocation allocation(0, AllocationType::UNKNOWN, ptr, canonizedAddress, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::unknown, ptr, canonizedAddress, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); Gmm *gmm = GmmHelperFunctions::getGmm(allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize(), getGmmHelper()); allocation.setDefaultGmm(gmm); @@ -233,7 +233,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenAllocationSmallerUnderlyingThanAlignedSiz auto gmmHelper = getGmmHelper(); auto canonizedAddress = gmmHelper->canonize(castToUint64(const_cast(ptr))); - WddmAllocation allocation(0, AllocationType::UNKNOWN, ptr, canonizedAddress, 0x2100, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::unknown, ptr, canonizedAddress, 0x2100, nullptr, MemoryPool::MemoryNull, 0u, 1u); Gmm *gmm = GmmHelperFunctions::getGmm(allocation.getAlignedCpuPtr(), allocation.getAlignedSize(), getGmmHelper()); allocation.setDefaultGmm(gmm); @@ -316,7 +316,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenWddmAllocationWhenMappingGpuVaThenUseGmmS void *fakePtr = reinterpret_cast(0x123); auto gmmHelper = getGmmHelper(); auto canonizedAddress = gmmHelper->canonize(castToUint64(const_cast(fakePtr))); - WddmAllocation allocation(0, AllocationType::UNKNOWN, fakePtr, canonizedAddress, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::unknown, fakePtr, canonizedAddress, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); std::unique_ptr gmm(GmmHelperFunctions::getGmm(allocation.getAlignedCpuPtr(), allocation.getAlignedSize(), getGmmHelper())); allocation.setDefaultGmm(gmm.get()); @@ -391,7 +391,7 @@ TEST_F(Wddm20Tests, WhenMappingAndFreeingGpuVaThenReturnIsCorrect) { auto gmmHelper = getGmmHelper(); auto ptr = mm.allocateSystemMemory(100, 0); auto canonizedAddress = gmmHelper->canonize(castToUint64(const_cast(ptr))); - WddmAllocation allocation(0, AllocationType::UNKNOWN, ptr, canonizedAddress, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::unknown, ptr, canonizedAddress, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); Gmm *gmm = GmmHelperFunctions::getGmm(allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize(), getGmmHelper()); allocation.setDefaultGmm(gmm); @@ -415,7 +415,7 @@ TEST_F(Wddm20Tests, WhenMappingAndFreeingGpuVaThenReturnIsCorrect) { } TEST_F(Wddm20Tests, givenNullAllocationWhenCreateThenAllocateAndMap) { - WddmAllocation allocation(0, AllocationType::UNKNOWN, nullptr, 0, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::unknown, nullptr, 0, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); auto gmm = std::unique_ptr(GmmHelperFunctions::getGmm(allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize(), getGmmHelper())); allocation.setDefaultGmm(gmm.get()); @@ -434,7 +434,7 @@ TEST_F(Wddm20Tests, givenNullAllocationWhenCreateThenAllocateAndMap) { TEST_F(WddmTestWithMockGdiDll, givenShareableAllocationWhenCreateThenCreateResourceFlagIsEnabled) { init(); - WddmAllocation allocation(0, AllocationType::UNKNOWN, nullptr, 0, MemoryConstants::pageSize, nullptr, MemoryPool::MemoryNull, true, 1u); + WddmAllocation allocation(0, AllocationType::unknown, nullptr, 0, MemoryConstants::pageSize, nullptr, MemoryPool::MemoryNull, true, 1u); auto gmm = std::unique_ptr(GmmHelperFunctions::getGmm(nullptr, MemoryConstants::pageSize, getGmmHelper())); allocation.setDefaultGmm(gmm.get()); auto status = wddm->createAllocation(&allocation); @@ -452,7 +452,7 @@ TEST_F(WddmTestWithMockGdiDll, givenShareableAllocationWhenCreateThenSharedHandl using WddmMemoryManager::WddmMemoryManager; }; MemoryManagerCreate memoryManager(false, false, *executionEnvironment); - WddmAllocation allocation(0, AllocationType::UNKNOWN, nullptr, 0, MemoryConstants::pageSize, nullptr, MemoryPool::MemoryNull, true, 1u); + WddmAllocation allocation(0, AllocationType::unknown, nullptr, 0, MemoryConstants::pageSize, nullptr, MemoryPool::MemoryNull, true, 1u); auto gmm = std::unique_ptr(GmmHelperFunctions::getGmm(nullptr, MemoryConstants::pageSize, getGmmHelper())); allocation.setDefaultGmm(gmm.get()); auto status = memoryManager.createGpuAllocationsWithRetry(&allocation); @@ -467,7 +467,7 @@ TEST_F(Wddm20Tests, WhenMakingResidentAndEvictingThenReturnIsCorrect) { auto gmmHelper = getGmmHelper(); auto ptr = mm.allocateSystemMemory(100, 0); auto canonizedAddress = gmmHelper->canonize(castToUint64(const_cast(ptr))); - WddmAllocation allocation(0, AllocationType::UNKNOWN, ptr, canonizedAddress, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::unknown, ptr, canonizedAddress, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); Gmm *gmm = GmmHelperFunctions::getGmm(allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize(), getGmmHelper()); allocation.setDefaultGmm(gmm); @@ -509,7 +509,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenSharedHandleWhenCreateGraphicsAllocationF EXPECT_EQ(0u, static_cast(status)); MemoryManagerCreate mm(false, false, *executionEnvironment); - AllocationProperties properties(0, false, 4096u, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(0, false, 4096u, AllocationType::sharedBuffer, false, {}); auto graphicsAllocation = mm.createGraphicsAllocationFromSharedHandle(ALLOCATION_HANDLE, properties, false, false, true, nullptr); auto wddmAllocation = (WddmAllocation *)graphicsAllocation; @@ -553,7 +553,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenSharedHandleWhenCreateGraphicsAllocationF EXPECT_EQ(0u, static_cast(status)); MemoryManagerCreate mm(false, false, *executionEnvironment); - AllocationProperties properties(0, false, sizeAlignedTo64Kb, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(0, false, sizeAlignedTo64Kb, AllocationType::sharedBuffer, false, {}); auto graphicsAllocation = mm.createGraphicsAllocationFromSharedHandle(ALLOCATION_HANDLE, properties, false, false, true, reservedAddress); auto wddmAllocation = (WddmAllocation *)graphicsAllocation; @@ -593,7 +593,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenSharedHandleWhenCreateGraphicsAllocationF EXPECT_EQ(0u, static_cast(status)); MemoryManagerCreate mm(false, false, *executionEnvironment); - AllocationProperties properties(0, false, 4096u, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(0, false, 4096u, AllocationType::sharedBuffer, false, {}); std::vector handles{ALLOCATION_HANDLE}; auto graphicsAllocation = mm.createGraphicsAllocationFromMultipleSharedHandles(handles, properties, false, false, true, nullptr); @@ -610,7 +610,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenSharedHandleWhenCreateGraphicsAllocationF EXPECT_EQ(0u, static_cast(status)); MemoryManagerCreate mm(false, false, *executionEnvironment); - AllocationProperties properties(0, false, 4096, AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(0, false, 4096, AllocationType::sharedBuffer, false, {}); auto graphicsAllocation = mm.createGraphicsAllocationFromSharedHandle(ALLOCATION_HANDLE, properties, false, false, true, nullptr); auto wddmAllocation = (WddmAllocation *)graphicsAllocation; @@ -970,7 +970,7 @@ TEST_F(Wddm20Tests, whenCreateAllocation64kFailsThenReturnFalse) { gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = false; auto gmm = std::make_unique(rootDeviceEnvironment->getGmmHelper(), fakePtr, 100, 0, GMM_RESOURCE_USAGE_OCL_BUFFER, StorageInfo{}, gmmRequirements); - WddmAllocation allocation(0, AllocationType::UNKNOWN, fakePtr, canonizedAddress, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::unknown, fakePtr, canonizedAddress, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocation.setDefaultGmm(gmm.get()); EXPECT_FALSE(wddm->createAllocation64k(&allocation)); diff --git a/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp index bab1adb952..e046ad863c 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp @@ -108,7 +108,7 @@ class WddmMemoryManagerTests : public ::testing::Test { }; TEST_F(WddmMemoryManagerTests, GivenAllocDataWithSVMCPUSetWhenAllocateGraphicsMemoryWithAlignmentThenProperFunctionIsUsed) { - AllocationProperties allocationProperties{0u, 0u, NEO::AllocationType::SVM_CPU, {}}; + AllocationProperties allocationProperties{0u, 0u, NEO::AllocationType::svmCpu, {}}; NEO::AllocationData allocData = {}; allocData.rootDeviceIndex = allocationProperties.rootDeviceIndex; allocData.type = allocationProperties.allocationType; @@ -126,7 +126,7 @@ TEST_F(WddmMemoryManagerTests, GivenAllocDataWithSVMCPUSetWhenAllocateGraphicsMe TEST_F(WddmMemoryManagerTests, GivenNotCompressedAndNotLockableAllocationTypeWhenAllocateUsingKmdAndMapToCpuVaThenSetResourceLockable) { NEO::AllocationData allocData = {}; - allocData.type = NEO::AllocationType::BUFFER; + allocData.type = NEO::AllocationType::buffer; EXPECT_FALSE(GraphicsAllocation::isLockable(allocData.type)); allocData.forceKMDAllocation = true; @@ -144,7 +144,7 @@ TEST_F(WddmMemoryManagerTests, GivenNotCompressedAndNotLockableAllocationTypeWhe TEST_F(WddmMemoryManagerTests, GivenOverrideAllocationCacheableWhenAllocateUsingKmdAndMapToCpuVaThenOverrideAllocationCacheable) { NEO::AllocationData allocData = {}; - allocData.type = NEO::AllocationType::COMMAND_BUFFER; + allocData.type = NEO::AllocationType::commandBuffer; auto mockProductHelper = std::make_unique(); mockProductHelper->overrideAllocationCacheableResult = true; executionEnvironment->rootDeviceEnvironments[0]->productHelper.reset(mockProductHelper.release()); @@ -161,7 +161,7 @@ TEST_F(WddmMemoryManagerTests, GivenOverrideAllocationCacheableWhenAllocateUsing TEST_F(WddmMemoryManagerTests, GivenCompressedAndNotLockableAllocationTypeWhenAllocateUsingKmdAndMapToCpuVaThenSetResourceNotLockable) { NEO::AllocationData allocData = {}; - allocData.type = NEO::AllocationType::BUFFER; + allocData.type = NEO::AllocationType::buffer; EXPECT_FALSE(GraphicsAllocation::isLockable(allocData.type)); allocData.forceKMDAllocation = true; @@ -181,7 +181,7 @@ TEST_F(WddmMemoryManagerTests, GivenCompressedAndNotLockableAllocationTypeWhenAl TEST_F(WddmMemoryManagerTests, givenPageSize64kAlignmentWhenAllocateUsingKmdAndMapToCpuVaWithLargePagesThenAllocationIsAlignedTo64Kb) { AllocationData allocationData; allocationData.size = 5; - allocationData.type = AllocationType::FILL_PATTERN; + allocationData.type = AllocationType::fillPattern; allocationData.alignment = MemoryConstants::pageSize64k; const size_t expectedAllignedAllocSize = alignUp(allocationData.size, MemoryConstants::pageSize64k); @@ -196,7 +196,7 @@ TEST_F(WddmMemoryManagerTests, givenPageSize64kAlignmentWhenAllocateUsingKmdAndM TEST_F(WddmMemoryManagerTests, givenPageSize64kAlignmentWhenAllocateUsingKmdAndMapToCpuVaWithoutLargePagesThenAllocationIsAlignedTo4Kb) { AllocationData allocationData; allocationData.size = 5; - allocationData.type = AllocationType::FILL_PATTERN; + allocationData.type = AllocationType::fillPattern; allocationData.alignment = MemoryConstants::pageSize64k; const size_t expectedAllignedAllocSize = alignUp(allocationData.size, MemoryConstants::pageSize); @@ -211,7 +211,7 @@ TEST_F(WddmMemoryManagerTests, givenPageSize64kAlignmentWhenAllocateUsingKmdAndM TEST_F(WddmMemoryManagerTests, givenPageSizeAlignmentWhenAllocateUsingKmdAndMapToCpuVaWithLargePagesThenAllocationIsAlignedTo4Kb) { AllocationData allocationData; allocationData.size = 5; - allocationData.type = AllocationType::FILL_PATTERN; + allocationData.type = AllocationType::fillPattern; allocationData.alignment = MemoryConstants::pageSize; const size_t expectedAllignedAllocSize = alignUp(allocationData.size, MemoryConstants::pageSize); @@ -303,7 +303,7 @@ class WddmMemoryManagerAllocPathTests : public ::testing::Test { TEST_F(WddmMemoryManagerAllocPathTests, givenAllocateGraphicsMemoryUsingKmdAndMapItToCpuVAWhenPreferedAllocationMethodThenProperArgumentsAreSet) { { - AllocationProperties allocationProperties{0u, 0u, NEO::AllocationType::SVM_CPU, {}}; + AllocationProperties allocationProperties{0u, 0u, NEO::AllocationType::svmCpu, {}}; NEO::AllocationData allocData = {}; allocData.rootDeviceIndex = allocationProperties.rootDeviceIndex; allocData.type = allocationProperties.allocationType; @@ -322,7 +322,7 @@ TEST_F(WddmMemoryManagerAllocPathTests, givenAllocateGraphicsMemoryUsingKmdAndMa } { NEO::AllocationData allocData = {}; - allocData.type = NEO::AllocationType::EXTERNAL_HOST_PTR; + allocData.type = NEO::AllocationType::externalHostPtr; auto graphicsAllocation = memoryManager->allocateGraphicsMemoryUsingKmdAndMapItToCpuVA(allocData, false); if (executionEnvironment->rootDeviceEnvironments[allocData.rootDeviceIndex]->getHardwareInfo()->capabilityTable.gpuAddressSpace >= MemoryConstants::max64BitAppAddress) { @@ -337,7 +337,7 @@ TEST_F(WddmMemoryManagerAllocPathTests, givenAllocateGraphicsMemoryUsingKmdAndMa TEST_F(WddmMemoryManagerAllocPathTests, GivenValidAllocationThenCreateInternalHandleSucceeds) { NEO::AllocationData allocData = {}; - allocData.type = NEO::AllocationType::SVM_CPU; + allocData.type = NEO::AllocationType::svmCpu; allocData.forceKMDAllocation = true; allocData.makeGPUVaDifferentThanCPUPtr = true; auto graphicsAllocation = memoryManager->allocateGraphicsMemoryUsingKmdAndMapItToCpuVA(allocData, false); @@ -354,7 +354,7 @@ TEST_F(WddmMemoryManagerAllocPathTests, GivenValidAllocationThenCreateInternalHa TEST_F(WddmMemoryManagerAllocPathTests, GivenNoAllocationThenCreateInternalHandleSucceeds) { NEO::AllocationData allocData = {}; - allocData.type = NEO::AllocationType::SVM_CPU; + allocData.type = NEO::AllocationType::svmCpu; allocData.forceKMDAllocation = true; allocData.makeGPUVaDifferentThanCPUPtr = true; auto graphicsAllocation = memoryManager->allocateGraphicsMemoryUsingKmdAndMapItToCpuVA(allocData, false); @@ -369,7 +369,7 @@ TEST_F(WddmMemoryManagerAllocPathTests, GivenNoAllocationThenCreateInternalHandl TEST_F(WddmMemoryManagerAllocPathTests, GivenValidAllocationThenCreateInternalHandleSucceedsAfterMultipleCallsToCreate) { NEO::AllocationData allocData = {}; - allocData.type = NEO::AllocationType::SVM_CPU; + allocData.type = NEO::AllocationType::svmCpu; allocData.forceKMDAllocation = true; allocData.makeGPUVaDifferentThanCPUPtr = true; auto graphicsAllocation = memoryManager->allocateGraphicsMemoryUsingKmdAndMapItToCpuVA(allocData, false); @@ -386,7 +386,7 @@ TEST_F(WddmMemoryManagerAllocPathTests, GivenValidAllocationThenCreateInternalHa TEST_F(WddmMemoryManagerAllocPathTests, GivenValidAllocationWithFailingCreateInternalHandleThenErrorReturned) { NEO::AllocationData allocData = {}; - allocData.type = NEO::AllocationType::SVM_CPU; + allocData.type = NEO::AllocationType::svmCpu; allocData.forceKMDAllocation = true; allocData.makeGPUVaDifferentThanCPUPtr = true; auto graphicsAllocation = memoryManager->allocateGraphicsMemoryUsingKmdAndMapItToCpuVA(allocData, false); @@ -404,7 +404,7 @@ TEST_F(WddmMemoryManagerAllocPathTests, GivenValidAllocationWithFailingCreateInt TEST_F(WddmMemoryManagerTests, GivenAllocationWhenAllocationIsFreeThenFreeToGmmClientContextCalled) { NEO::AllocationData allocData = {}; - allocData.type = NEO::AllocationType::BUFFER; + allocData.type = NEO::AllocationType::buffer; allocData.forceKMDAllocation = true; allocData.makeGPUVaDifferentThanCPUPtr = true; @@ -420,7 +420,7 @@ TEST_F(WddmMemoryManagerTests, GivenAllocationWhenAllocationIsFreeThenFreeToGmmC TEST_F(WddmMemoryManagerTests, givenAllocateGraphicsMemoryUsingKmdAndMapItToCpuVAWhenCreatingHostAllocationThenGpuAndCpuAddressesAreEqual) { memoryManager->hugeGfxMemoryChunkSize = MemoryConstants::pageSize64k; NEO::AllocationData allocData = {}; - allocData.type = NEO::AllocationType::BUFFER_HOST_MEMORY; + allocData.type = NEO::AllocationType::bufferHostMemory; allocData.size = 2ULL * MemoryConstants::pageSize64k; allocData.forceKMDAllocation = false; allocData.makeGPUVaDifferentThanCPUPtr = false; @@ -438,7 +438,7 @@ TEST_F(WddmMemoryManagerAllocPathTests, givenAllocateGraphicsMemoryUsingKmdAndMa GTEST_SKIP(); } NEO::AllocationData allocData = {}; - allocData.type = NEO::AllocationType::BUFFER; + allocData.type = NEO::AllocationType::buffer; auto graphicsAllocation = memoryManager->allocateGraphicsMemoryUsingKmdAndMapItToCpuVA(allocData, false); @@ -453,7 +453,7 @@ TEST_F(WddmMemoryManagerAllocPathTests, givenAllocateMemoryByKMDWhen32bitAndIsSt GTEST_SKIP(); } NEO::AllocationData allocData = {}; - allocData.type = NEO::AllocationType::CONSTANT_SURFACE; + allocData.type = NEO::AllocationType::constantSurface; auto graphicsAllocation = memoryManager->allocateMemoryByKMD(allocData); @@ -486,7 +486,7 @@ TEST_F(WddmMemoryManagerAllocPathTests, givenLocalMemoryWhen32bitAndCallAdjustGp auto wddmAllocation = std::make_unique(rootDeviceIndex, 1u, // numGmms - NEO::AllocationType::BUFFER, nullptr, 0, + NEO::AllocationType::buffer, nullptr, 0, size, nullptr, MemoryPool::LocalMemory, 0u, // shareable 0u); @@ -512,7 +512,7 @@ TEST_F(WddmMemoryManagerAllocPathTests, givenSystemMemoryWhen32bitAndCallAdjustG auto wddmAllocation = std::make_unique(rootDeviceIndex, 1u, // numGmms - NEO::AllocationType::BUFFER, nullptr, 0, + NEO::AllocationType::buffer, nullptr, 0, size, nullptr, MemoryPool::System64KBPages, 0u, // shareable 0u); @@ -529,61 +529,61 @@ TEST_F(WddmMemoryManagerTests, givenTypeWhenCallIsStatelessAccessRequiredThenPro auto wddmMemoryManager = std::make_unique(*executionEnvironment); - for (auto type : {AllocationType::BUFFER, - AllocationType::SHARED_BUFFER, - AllocationType::SCRATCH_SURFACE, - AllocationType::LINEAR_STREAM, - AllocationType::PRIVATE_SURFACE, - AllocationType::CONSTANT_SURFACE, - AllocationType::GLOBAL_SURFACE, - AllocationType::PRINTF_SURFACE}) { + for (auto type : {AllocationType::buffer, + AllocationType::sharedBuffer, + AllocationType::scratchSurface, + AllocationType::linearStream, + AllocationType::privateSurface, + AllocationType::constantSurface, + AllocationType::globalSurface, + AllocationType::printfSurface}) { EXPECT_TRUE(wddmMemoryManager->isStatelessAccessRequired(type)); } - for (auto type : {AllocationType::BUFFER_HOST_MEMORY, - AllocationType::COMMAND_BUFFER, - AllocationType::EXTERNAL_HOST_PTR, - AllocationType::FILL_PATTERN, - AllocationType::IMAGE, - AllocationType::INDIRECT_OBJECT_HEAP, - AllocationType::INSTRUCTION_HEAP, - AllocationType::INTERNAL_HEAP, - AllocationType::INTERNAL_HOST_MEMORY, - AllocationType::KERNEL_ARGS_BUFFER, - AllocationType::KERNEL_ISA, - AllocationType::KERNEL_ISA_INTERNAL, - AllocationType::MAP_ALLOCATION, - AllocationType::MCS, - AllocationType::PIPE, - AllocationType::PREEMPTION, - AllocationType::PROFILING_TAG_BUFFER, - AllocationType::SHARED_IMAGE, - AllocationType::SHARED_RESOURCE_COPY, - AllocationType::SURFACE_STATE_HEAP, - AllocationType::SVM_CPU, - AllocationType::SVM_GPU, - AllocationType::SVM_ZERO_COPY, - AllocationType::TAG_BUFFER, - AllocationType::GLOBAL_FENCE, - AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, - AllocationType::WRITE_COMBINED, - AllocationType::RING_BUFFER, - AllocationType::SEMAPHORE_BUFFER, - AllocationType::DEBUG_CONTEXT_SAVE_AREA, - AllocationType::DEBUG_SBA_TRACKING_BUFFER, - AllocationType::DEBUG_MODULE_AREA, - AllocationType::UNIFIED_SHARED_MEMORY, - AllocationType::WORK_PARTITION_SURFACE, - AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, - AllocationType::SW_TAG_BUFFER, - AllocationType::DEFERRED_TASKS_LIST, - AllocationType::ASSERT_BUFFER}) { + for (auto type : {AllocationType::bufferHostMemory, + AllocationType::commandBuffer, + AllocationType::externalHostPtr, + AllocationType::fillPattern, + AllocationType::image, + AllocationType::indirectObjectHeap, + AllocationType::instructionHeap, + AllocationType::internalHeap, + AllocationType::internalHostMemory, + AllocationType::kernelArgsBuffer, + AllocationType::kernelIsa, + AllocationType::kernelIsaInternal, + AllocationType::mapAllocation, + AllocationType::mcs, + AllocationType::pipe, + AllocationType::preemption, + AllocationType::profilingTagBuffer, + AllocationType::sharedImage, + AllocationType::sharedResourceCopy, + AllocationType::surfaceStateHeap, + AllocationType::svmCpu, + AllocationType::svmGpu, + AllocationType::svmZeroCopy, + AllocationType::tagBuffer, + AllocationType::globalFence, + AllocationType::timestampPacketTagBuffer, + AllocationType::writeCombined, + AllocationType::ringBuffer, + AllocationType::semaphoreBuffer, + AllocationType::debugContextSaveArea, + AllocationType::debugSbaTrackingBuffer, + AllocationType::debugModuleArea, + AllocationType::unifiedSharedMemory, + AllocationType::workPartitionSurface, + AllocationType::gpuTimestampDeviceBuffer, + AllocationType::swTagBuffer, + AllocationType::deferredTasksList, + AllocationType::assertBuffer}) { EXPECT_FALSE(wddmMemoryManager->isStatelessAccessRequired(type)); } } TEST_F(WddmMemoryManagerTests, givenForcePreferredAllocationMethodFlagSetWhenGettingPreferredAllocationMethodThenValueFlagIsReturned) { auto releaseHelper = executionEnvironment->rootDeviceEnvironments[0]->releaseHelper.get(); - for (auto i = 0; i < static_cast(AllocationType::COUNT); i++) { + for (auto i = 0; i < static_cast(AllocationType::count); i++) { AllocationProperties allocationProperties{0u, 0u, static_cast(i), {}}; if (releaseHelper && releaseHelper->getPreferredAllocationMethod(allocationProperties.allocationType)) { EXPECT_EQ(*releaseHelper->getPreferredAllocationMethod(allocationProperties.allocationType), memoryManager->getPreferredAllocationMethod(allocationProperties)); @@ -716,7 +716,7 @@ class WddmMemoryManagerSimpleTest : public ::testing::Test { TEST_F(WddmMemoryManagerSimpleTest, givenAllocateGraphicsMemoryWithPropertiesCalledWithDebugSurfaceTypeThenDebugSurfaceIsCreatedAndZerod) { DebugManagerStateRestore restorer; debugManager.flags.ForcePreferredAllocationMethod.set(static_cast(GfxMemoryAllocationMethod::UseUmdSystemPtr)); - AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, 0b1011}; + AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, AllocationType::debugContextSaveArea, false, false, 0b1011}; auto debugSurface = static_cast(memoryManager->allocateGraphicsMemoryWithProperties(debugSurfaceProperties)); EXPECT_NE(nullptr, debugSurface); @@ -817,7 +817,7 @@ auto compareStorageInfo = [](const StorageInfo &left, const StorageInfo &right) TEST_F(WddmMemoryManagerSimpleTest, givenAllocationDataWithStorageInfoWhenAllocateGraphicsMemory64kbThenStorageInfoInAllocationIsSetCorrectly) { memoryManager.reset(new MockWddmMemoryManager(false, false, executionEnvironment)); AllocationData allocationData{}; - allocationData.type = AllocationType::BUFFER; + allocationData.type = AllocationType::buffer; allocationData.storageInfo = {}; allocationData.storageInfo.isLockable = true; @@ -864,7 +864,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMemoryManagerWhenAllocate32BitGraphicsM void *ptr = reinterpret_cast(0x1001); auto size = MemoryConstants::pageSize; - auto allocation = memoryManager->allocate32BitGraphicsMemory(csr->getRootDeviceIndex(), size, ptr, AllocationType::BUFFER); + auto allocation = memoryManager->allocate32BitGraphicsMemory(csr->getRootDeviceIndex(), size, ptr, AllocationType::buffer); ASSERT_NE(nullptr, allocation); EXPECT_EQ(MemoryPool::System4KBPagesWith32BitGpuAddressing, allocation->getMemoryPool()); @@ -883,7 +883,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMemoryManagerWith64KBPagesDisabledWhenA } auto size = MemoryConstants::pageSize; - auto svmAllocation = memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), size, AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}); + auto svmAllocation = memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), size, AllocationType::svmZeroCopy, mockDeviceBitfield}); EXPECT_NE(nullptr, svmAllocation); EXPECT_EQ(MemoryPool::System4KBPages, svmAllocation->getMemoryPool()); EXPECT_EQ(executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo()->featureTable.flags.ftrLocalMemory, @@ -898,7 +898,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMemoryManagerWith64KBPagesEnabledWhenAl } auto size = MemoryConstants::pageSize; - auto svmAllocation = memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), size, AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}); + auto svmAllocation = memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), size, AllocationType::svmZeroCopy, mockDeviceBitfield}); EXPECT_NE(nullptr, svmAllocation); EXPECT_EQ(MemoryPool::System64KBPages, svmAllocation->getMemoryPool()); memoryManager->freeGraphicsMemory(svmAllocation); @@ -920,7 +920,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMemoryManagerWhenCreateAllocationFromHa VariableBackup openResourceBackup(&gdi->getOpenResourceArgOut().pOpenAllocationInfo, &allocationInfo); - AllocationProperties properties(0, false, 0, AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties properties(0, false, 0, AllocationType::sharedBuffer, false, false, 0); auto allocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, false, false, true, nullptr); EXPECT_NE(nullptr, allocation); EXPECT_EQ(MemoryPool::SystemCpuInaccessible, allocation->getMemoryPool()); @@ -943,7 +943,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenSharedHandleWhenCreateGraphicsAllocatio VariableBackup openResourceBackup(&gdi->getOpenResourceArgOut().pOpenAllocationInfo, &allocationInfo); - AllocationProperties properties(0, false, 0, AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties properties(0, false, 0, AllocationType::sharedBuffer, false, false, 0); std::vector handles{handle}; auto allocation = memoryManager->createGraphicsAllocationFromMultipleSharedHandles(handles, properties, false, false, true, nullptr); EXPECT_EQ(nullptr, allocation); @@ -965,8 +965,8 @@ TEST_F(WddmMemoryManagerSimpleTest, givenAllocationPropertiesWhenCreateAllocatio VariableBackup openResourceBackup(&gdi->getOpenResourceArgOut().pOpenAllocationInfo, &allocationInfo); - AllocationProperties propertiesBuffer(0, false, 0, AllocationType::SHARED_BUFFER, false, false, 0); - AllocationProperties propertiesImage(0, false, 0, AllocationType::SHARED_IMAGE, false, false, 0); + AllocationProperties propertiesBuffer(0, false, 0, AllocationType::sharedBuffer, false, false, 0); + AllocationProperties propertiesImage(0, false, 0, AllocationType::sharedImage, false, false, 0); AllocationProperties *propertiesArray[2] = {&propertiesBuffer, &propertiesImage}; @@ -997,7 +997,7 @@ TEST_F(WddmMemoryManagerSimpleTest, whenCreateAllocationFromHandleAndMapCallFail VariableBackup openResourceBackup(&gdi->getOpenResourceArgOut().pOpenAllocationInfo, &allocationInfo); EXPECT_EQ(0u, memoryManager->freeGraphicsMemoryImplCalled); - AllocationProperties properties(0, false, 0, AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties properties(0, false, 0, AllocationType::sharedBuffer, false, false, 0); auto allocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, false, false, true, nullptr); EXPECT_EQ(nullptr, allocation); @@ -1102,7 +1102,7 @@ TEST_F(WddmMemoryManagerSimpleTest, GivenPhysicalMemoryAndVirtualMemoryThenMapSu TEST_F(WddmMemoryManagerSimpleTest, givenZeroFenceValueOnSingleEngineRegisteredWhenHandleFenceCompletionIsCalledThenDoNotWaitOnCpu) { ASSERT_EQ(1u, memoryManager->getRegisteredEngines(0).size()); - auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0, 32, AllocationType::BUFFER, mockDeviceBitfield})); + auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0, 32, AllocationType::buffer, mockDeviceBitfield})); allocation->getResidencyData().updateCompletionData(0u, 0u); memoryManager->handleFenceCompletion(allocation); @@ -1114,7 +1114,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenZeroFenceValueOnSingleEngineRegisteredW TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValueOnSingleEngineRegisteredWhenHandleFenceCompletionIsCalledThenWaitOnCpuOnce) { ASSERT_EQ(1u, memoryManager->getRegisteredEngines(0).size()); - auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0, 32, AllocationType::BUFFER, mockDeviceBitfield})); + auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0, 32, AllocationType::buffer, mockDeviceBitfield})); auto fence = &static_cast(memoryManager->getRegisteredEngines(0)[0].osContext)->getResidencyController().getMonitoredFence(); allocation->getResidencyData().updateCompletionData(129u, 0u); @@ -1143,7 +1143,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValuesOnMultipleEnginesRegi osContext->ensureContextInitialized(); ASSERT_EQ(1u, memoryManager->getRegisteredEngines(rootDeviceIndex).size()); - auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0u, 32, AllocationType::BUFFER, mockDeviceBitfield})); + auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0u, 32, AllocationType::buffer, mockDeviceBitfield})); auto lastEngineFence = &static_cast(memoryManager->getRegisteredEngines(0)[0].osContext)->getResidencyController().getMonitoredFence(); allocation->getResidencyData().updateCompletionData(129u, 0u); allocation->getResidencyData().updateCompletionData(152u, 1u); @@ -1175,7 +1175,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValueOnSomeOfMultipleEngine PreemptionHelper::getDefaultPreemptionMode(*hwInfo), deviceBitfield)); ASSERT_EQ(2u, memoryManager->getRegisteredEngines(rootDeviceIndex).size()); - auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({1u, 32, AllocationType::BUFFER, mockDeviceBitfield})); + auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({1u, 32, AllocationType::buffer, mockDeviceBitfield})); auto lastEngineFence = &static_cast(memoryManager->getRegisteredEngines(1)[0].osContext)->getResidencyController().getMonitoredFence(); allocation->getResidencyData().updateCompletionData(129u, 1u); allocation->getResidencyData().updateCompletionData(0, 2u); @@ -1244,7 +1244,7 @@ TEST_F(WddmMemoryManagerSimpleTest, whenAllocationCreatedFromSharedHandleIsDestr VariableBackup openResourceBackup(&gdi->getOpenResourceArgOut().pOpenAllocationInfo, &allocationInfo); - AllocationProperties properties(0, false, 0, AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties properties(0, false, 0, AllocationType::sharedBuffer, false, false, 0); auto allocation = memoryManager->createGraphicsAllocationFromSharedHandle(1, properties, false, false, true, nullptr); EXPECT_NE(nullptr, allocation); @@ -1310,7 +1310,7 @@ TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingAllocationWithReservedGpuVirtu TEST_F(WddmMemoryManagerSimpleTest, givenAllocationWithReservedGpuVirtualAddressWhenMapCallFailsDuringCreateWddmAllocationThenReleasePreferredAddress) { MockWddmAllocation allocation(rootDeviceEnvironment->getGmmHelper(), 1); - allocation.setAllocationType(AllocationType::KERNEL_ISA); + allocation.setAllocationType(AllocationType::kernelIsa); uint64_t gpuAddress = 0x123; uint64_t sizeForFree = 0x1234; allocation.reservedGpuVirtualAddress = gpuAddress; @@ -1332,7 +1332,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMultiHandleAllocationAndPreferredGpuVaI uint32_t numGmms = 10; MockWddmAllocation allocation(rootDeviceEnvironment->getGmmHelper(), numGmms); - allocation.setAllocationType(AllocationType::BUFFER); + allocation.setAllocationType(AllocationType::buffer); allocation.storageInfo.multiStorage = true; wddm->callBaseMapGpuVa = true; @@ -1359,7 +1359,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMultiHandleAllocationWhenCreatePhysical uint32_t numGmms = 10; MockWddmAllocation allocation(rootDeviceEnvironment->getGmmHelper(), numGmms); - allocation.setAllocationType(AllocationType::BUFFER); + allocation.setAllocationType(AllocationType::buffer); allocation.storageInfo.multiStorage = true; wddm->callBaseMapGpuVa = true; @@ -1377,7 +1377,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMultiHandleAllocationWhenCreatePhysical uint32_t numGmms = 10; MockWddmAllocation allocation(rootDeviceEnvironment->getGmmHelper(), numGmms); - allocation.setAllocationType(AllocationType::BUFFER); + allocation.setAllocationType(AllocationType::buffer); allocation.storageInfo.multiStorage = true; wddm->callBaseMapGpuVa = true; @@ -1393,7 +1393,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenSvmCpuAllocationWhenSizeAndAlignmentPro } size_t size = 2 * MemoryConstants::megaByte; - MockAllocationProperties properties{csr->getRootDeviceIndex(), true, size, AllocationType::SVM_CPU, mockDeviceBitfield}; + MockAllocationProperties properties{csr->getRootDeviceIndex(), true, size, AllocationType::svmCpu, mockDeviceBitfield}; properties.alignment = size; auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties(properties)); ASSERT_NE(nullptr, allocation); @@ -1415,7 +1415,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenWriteCombinedAllocationThenCpuAddressIs } memoryManager.reset(new MockWddmMemoryManager(true, true, executionEnvironment)); size_t size = 2 * MemoryConstants::megaByte; - auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0, size, AllocationType::WRITE_COMBINED, mockDeviceBitfield})); + auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0, size, AllocationType::writeCombined, mockDeviceBitfield})); ASSERT_NE(nullptr, allocation); EXPECT_EQ(size, allocation->getUnderlyingBufferSize()); EXPECT_NE(nullptr, allocation->getUnderlyingBuffer()); @@ -1452,7 +1452,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenBufferHostMemoryAllocationAndLimitedRan memoryManager.reset(new MockWddmMemoryManager(true, true, executionEnvironment)); size_t size = 2 * MemoryConstants::megaByte; - auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0, size, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield})); + auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0, size, AllocationType::bufferHostMemory, mockDeviceBitfield})); ASSERT_NE(nullptr, allocation); EXPECT_EQ(size, allocation->getUnderlyingBufferSize()); EXPECT_NE(nullptr, allocation->getUnderlyingBuffer()); @@ -1474,7 +1474,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenIsaTypeAnd32BitFrontWindowWhenFrontWind gfxPartition->callHeapAllocate = false; memoryManager->gfxPartitions[0].reset(gfxPartition); - AllocationProperties props{0, size, AllocationType::KERNEL_ISA, mockDeviceBitfield}; + AllocationProperties props{0, size, AllocationType::kernelIsa, mockDeviceBitfield}; props.flags.use32BitFrontWindow = 1; auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties(props)); @@ -1511,7 +1511,7 @@ HWTEST2_F(WddmMemoryManagerSimpleTest, givenLocalMemoryIsaTypeAnd32BitFrontWindo gfxPartition->callHeapAllocate = false; memoryManager->gfxPartitions[0].reset(gfxPartition); - AllocationProperties props{0, size, AllocationType::KERNEL_ISA, mockDeviceBitfield}; + AllocationProperties props{0, size, AllocationType::kernelIsa, mockDeviceBitfield}; props.flags.use32BitFrontWindow = 1; auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties(props)); @@ -1533,7 +1533,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenDebugModuleAreaTypeWhenCreatingAllocati const auto size = MemoryConstants::pageSize64k; NEO::AllocationProperties properties{0, true, size, - NEO::AllocationType::DEBUG_MODULE_AREA, + NEO::AllocationType::debugModuleArea, false, mockDeviceBitfield}; @@ -1568,7 +1568,7 @@ HWTEST2_F(WddmMemoryManagerSimpleTest, givenEnabledLocalMemoryWhenAllocatingDebu memoryManager = std::make_unique(false, localMemoryEnabled, executionEnvironment); NEO::AllocationProperties properties{0, true, size, - NEO::AllocationType::DEBUG_MODULE_AREA, + NEO::AllocationType::debugModuleArea, false, mockDeviceBitfield}; @@ -1603,7 +1603,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenEnabledLocalMemoryWhenAllocatingMemoryI memoryManager = std::make_unique(false, localMemoryEnabled, executionEnvironment); NEO::AllocationProperties properties{0, true, size, - NEO::AllocationType::BUFFER, + NEO::AllocationType::buffer, false, mockDeviceBitfield}; properties.flags.use32BitFrontWindow = true; @@ -1702,7 +1702,7 @@ TEST_F(WddmMemoryManagerSimpleTest, whenAlignmentRequirementExceedsPageSizeThenA MockWddmMemoryManagerAllocateWithAlignment memoryManager(true, true, executionEnvironment); - AllocationProperties allocationProperties{0u, 1024, NEO::AllocationType::BUFFER, {}}; + AllocationProperties allocationProperties{0u, 1024, NEO::AllocationType::buffer, {}}; NEO::AllocationData allocData = {}; allocData.rootDeviceIndex = allocationProperties.rootDeviceIndex; allocData.type = allocationProperties.allocationType; @@ -1772,7 +1772,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenShareableAllocationWhenAllocateInDevice MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Error; AllocationData allocData; allocData.allFlags = 0; - allocData.type = AllocationType::SVM_GPU; + allocData.type = AllocationType::svmGpu; allocData.storageInfo.localOnlyRequired = true; allocData.size = MemoryConstants::pageSize; allocData.flags.allocateMemory = true; @@ -1804,7 +1804,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenShareableAllocationWhenAllocateGraphics executionEnvironment.rootDeviceEnvironments[0]->initGmm(); memoryManager = std::make_unique(false, localMemoryEnabled, executionEnvironment); - AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::SVM_GPU, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::svmGpu, mockDeviceBitfield}; properties.allFlags = 0; properties.size = MemoryConstants::pageSize; properties.flags.allocateMemory = true; @@ -1918,7 +1918,7 @@ HWTEST_F(WddmMemoryManagerSimpleTest, givenLinearStreamWhenItIsAllocatedThenItIs } memoryManager = std::make_unique(false, true, executionEnvironment); - auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, 4096u, AllocationType::LINEAR_STREAM, mockDeviceBitfield}); + auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, 4096u, AllocationType::linearStream, mockDeviceBitfield}); ASSERT_NE(nullptr, graphicsAllocation); EXPECT_EQ(MemoryPool::LocalMemory, graphicsAllocation->getMemoryPool()); @@ -1947,7 +1947,7 @@ HWTEST_F(WddmMemoryManagerSimpleTest, givenLinearStreamWhenItIsAllocatedThenItIs } } - EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::LINEAR_STREAM); + EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::linearStream); memoryManager->freeGraphicsMemory(graphicsAllocation); } @@ -2162,11 +2162,11 @@ TEST_F(WddmMemoryManagerSimpleTest, givenAllocationWithHighPriorityWhenMemoryIsA memoryManager = std::make_unique(false, localMemoryEnabled, executionEnvironment); AllocationType highPriorityTypes[] = { - AllocationType::KERNEL_ISA, - AllocationType::KERNEL_ISA_INTERNAL, - AllocationType::COMMAND_BUFFER, - AllocationType::INTERNAL_HEAP, - AllocationType::LINEAR_STREAM + AllocationType::kernelIsa, + AllocationType::kernelIsaInternal, + AllocationType::commandBuffer, + AllocationType::internalHeap, + AllocationType::linearStream }; for (auto &allocationType : highPriorityTypes) { @@ -2198,7 +2198,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenAllocationWithoutHighPriorityWhenMemory allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.allocateMemory = true; - allocData.type = AllocationType::BUFFER; + allocData.type = AllocationType::buffer; auto allocation = static_cast(memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status)); ASSERT_NE(nullptr, allocation); @@ -2247,7 +2247,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenSetAllocationPriorityFailureWhenMemoryI TEST_F(WddmMemoryManagerSimpleTest, givenSvmGpuAllocationWhenHostPtrProvidedThenUseHostPtrAsGpuVa) { size_t size = 2 * MemoryConstants::megaByte; - AllocationProperties properties{mockRootDeviceIndex, false, size, AllocationType::SVM_GPU, false, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, false, size, AllocationType::svmGpu, false, mockDeviceBitfield}; properties.alignment = size; void *svmPtr = reinterpret_cast(2 * size); memoryManager->localMemorySupported[properties.rootDeviceIndex] = true; @@ -2270,10 +2270,10 @@ TEST_F(WddmMemoryManagerSimpleTest, given32BitAllocationOfBufferWhenItIsAllocate GTEST_SKIP(); } REQUIRE_SVM_OR_SKIP(defaultHwInfo); - AllocationType allocationTypes[] = {AllocationType::BUFFER, - AllocationType::SHARED_BUFFER, - AllocationType::SCRATCH_SURFACE, - AllocationType::PRIVATE_SURFACE}; + AllocationType allocationTypes[] = {AllocationType::buffer, + AllocationType::sharedBuffer, + AllocationType::scratchSurface, + AllocationType::privateSurface}; for (auto &allocationType : allocationTypes) { size_t size = 2 * MemoryConstants::kiloByte; @@ -2309,7 +2309,7 @@ HWTEST_F(WddmMemoryManagerSimpleTest, givenWddmMemoryManagerWhenCopyDebugSurface std::vector dataToCopy(sourceAllocationSize, 1u); - AllocationType debugSurfaces[] = {AllocationType::DEBUG_CONTEXT_SAVE_AREA, AllocationType::DEBUG_SBA_TRACKING_BUFFER}; + AllocationType debugSurfaces[] = {AllocationType::debugContextSaveArea, AllocationType::debugSbaTrackingBuffer}; for (auto type : debugSurfaces) { AllocationProperties debugSurfaceProperties{0, true, sourceAllocationSize, type, false, false, 0b11}; @@ -2327,7 +2327,7 @@ HWTEST_F(WddmMemoryManagerSimpleTest, givenWddmMemoryManagerWhenCopyNotDebugSurf size_t sourceAllocationSize = MemoryConstants::pageSize; std::vector dataToCopy(sourceAllocationSize, 1u); - AllocationProperties props{0, true, sourceAllocationSize, AllocationType::KERNEL_ISA, false, false, 0}; + AllocationProperties props{0, true, sourceAllocationSize, AllocationType::kernelIsa, false, false, 0}; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(props); ASSERT_NE(nullptr, allocation); allocation->storageInfo.memoryBanks = 0b11; @@ -2343,10 +2343,10 @@ HWTEST_F(WddmMemoryManagerSimpleTest, givenPreferCompressionFlagWhenAllocating64 if (memoryManager->isLimitedGPU(0)) { GTEST_SKIP(); } - auto nonCompressedAllocation = memoryManager->allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, 1u, AllocationType::BUFFER, mockDeviceBitfield}); + auto nonCompressedAllocation = memoryManager->allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, 1u, AllocationType::buffer, mockDeviceBitfield}); EXPECT_EQ(0u, nonCompressedAllocation->getDefaultGmm()->resourceParams.Flags.Info.RenderCompressed); - AllocationProperties properties = {mockRootDeviceIndex, 1u, AllocationType::BUFFER, mockDeviceBitfield}; + AllocationProperties properties = {mockRootDeviceIndex, 1u, AllocationType::buffer, mockDeviceBitfield}; properties.flags.preferCompressed = true; auto compressedAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); EXPECT_EQ(1u, compressedAllocation->getDefaultGmm()->resourceParams.Flags.Info.RenderCompressed); @@ -2537,7 +2537,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromSharedHandleIs std::unique_ptr gmm(new Gmm(rootDeviceEnvironment->getGmmHelper(), pSysMem, 4096u, 0, GMM_RESOURCE_USAGE_OCL_BUFFER, {}, gmmRequirements)); setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); - AllocationProperties properties(0, false, 4096u, AllocationType::SHARED_BUFFER, false, false, mockDeviceBitfield); + AllocationProperties properties(0, false, 4096u, AllocationType::sharedBuffer, false, false, mockDeviceBitfield); auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, false, false, true, nullptr); auto wddmAlloc = static_cast(gpuAllocation); @@ -2556,12 +2556,12 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromNTHandleIsCall std::unique_ptr gmm(new Gmm(rootDeviceEnvironment->getGmmHelper(), pSysMem, 4096u, 0, GMM_RESOURCE_USAGE_OCL_BUFFER, {}, gmmRequirements)); setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); - auto *gpuAllocation = memoryManager->createGraphicsAllocationFromNTHandle(reinterpret_cast(1), 0, AllocationType::SHARED_IMAGE); + auto *gpuAllocation = memoryManager->createGraphicsAllocationFromNTHandle(reinterpret_cast(1), 0, AllocationType::sharedImage); auto wddmAlloc = static_cast(gpuAllocation); ASSERT_NE(nullptr, gpuAllocation); EXPECT_EQ(NT_RESOURCE_HANDLE, wddmAlloc->resourceHandle); EXPECT_EQ(NT_ALLOCATION_HANDLE, wddmAlloc->getDefaultHandle()); - EXPECT_EQ(AllocationType::SHARED_IMAGE, wddmAlloc->getAllocationType()); + EXPECT_EQ(AllocationType::sharedImage, wddmAlloc->getAllocationType()); memoryManager->freeGraphicsMemory(gpuAllocation); } @@ -2587,12 +2587,12 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromNTHandleIsCall std::unique_ptr gmm(new Gmm(rootDeviceEnvironment->getGmmHelper(), pSysMem, 4096u, 0, GMM_RESOURCE_USAGE_OCL_BUFFER, {}, gmmRequirements)); setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); - auto *gpuAllocation = memoryManager->createGraphicsAllocationFromNTHandle(reinterpret_cast(1), 0, AllocationType::SHARED_IMAGE); + auto *gpuAllocation = memoryManager->createGraphicsAllocationFromNTHandle(reinterpret_cast(1), 0, AllocationType::sharedImage); auto wddmAlloc = static_cast(gpuAllocation); ASSERT_NE(nullptr, gpuAllocation); EXPECT_EQ(NT_RESOURCE_HANDLE, wddmAlloc->resourceHandle); EXPECT_EQ(NT_ALLOCATION_HANDLE, wddmAlloc->getDefaultHandle()); - EXPECT_EQ(AllocationType::SHARED_IMAGE, wddmAlloc->getAllocationType()); + EXPECT_EQ(AllocationType::sharedImage, wddmAlloc->getAllocationType()); memoryManager->freeGraphicsMemory(gpuAllocation); } @@ -2623,7 +2623,7 @@ TEST_F(WddmMemoryManagerTest, GivenForce32bitAddressingAndRequireSpecificBitness memoryManager->setForce32BitAllocations(true); - AllocationProperties properties(0, false, 4096u, AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties properties(0, false, 4096u, AllocationType::sharedBuffer, false, false, 0); auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, true, false, true, nullptr); ASSERT_NE(nullptr, gpuAllocation); @@ -2650,7 +2650,7 @@ TEST_F(WddmMemoryManagerTest, GivenForce32bitAddressingAndNotRequiredSpecificBit memoryManager->setForce32BitAllocations(true); - AllocationProperties properties(0, false, 4096u, AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties properties(0, false, 4096u, AllocationType::sharedBuffer, false, false, 0); auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, false, false, true, nullptr); ASSERT_NE(nullptr, gpuAllocation); @@ -2672,7 +2672,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenFreeAllocFromSharedHandl std::unique_ptr gmm(new Gmm(rootDeviceEnvironment->getGmmHelper(), pSysMem, 4096u, 0, GMM_RESOURCE_USAGE_OCL_BUFFER, {}, gmmRequirements)); setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); - AllocationProperties properties(0, false, 4096u, AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties properties(0, false, 4096u, AllocationType::sharedBuffer, false, false, 0); auto gpuAllocation = (WddmAllocation *)memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, false, false, true, nullptr); EXPECT_NE(nullptr, gpuAllocation); auto expectedDestroyHandle = gpuAllocation->resourceHandle; @@ -2709,7 +2709,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerSizeZeroWhenCreateFromShared std::unique_ptr gmm(new Gmm(rootDeviceEnvironment->getGmmHelper(), pSysMem, size, 0, GMM_RESOURCE_USAGE_OCL_BUFFER, {}, gmmRequirements)); setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); - AllocationProperties properties(0, false, size, AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties properties(0, false, size, AllocationType::sharedBuffer, false, false, 0); auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, false, false, true, nullptr); ASSERT_NE(nullptr, gpuAllocation); EXPECT_EQ(size, gpuAllocation->getUnderlyingBufferSize()); @@ -2730,7 +2730,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenAllocateGraphicsMemory rootDeviceEnvironment->executionEnvironment.initializeMemoryManager(); memoryManager->allocateGraphicsMemoryInNonDevicePool = true; - MockAllocationProperties properties = {mockRootDeviceIndex, true, size, AllocationType::BUFFER, mockDeviceBitfield}; + MockAllocationProperties properties = {mockRootDeviceIndex, true, size, AllocationType::buffer, mockDeviceBitfield}; properties.flags.preferCompressed = true; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, ptr); @@ -2754,7 +2754,7 @@ HWTEST_F(WddmMemoryManagerTest, givenInternalHeapOrLinearStreamTypeWhenAllocatin rootDeviceEnvironment->executionEnvironment.initializeMemoryManager(); { - MockAllocationProperties properties = {mockRootDeviceIndex, true, 1, AllocationType::INTERNAL_HEAP, mockDeviceBitfield}; + MockAllocationProperties properties = {mockRootDeviceIndex, true, 1, AllocationType::internalHeap, mockDeviceBitfield}; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, nullptr); @@ -2766,7 +2766,7 @@ HWTEST_F(WddmMemoryManagerTest, givenInternalHeapOrLinearStreamTypeWhenAllocatin } { - MockAllocationProperties properties = {mockRootDeviceIndex, true, 1, AllocationType::LINEAR_STREAM, mockDeviceBitfield}; + MockAllocationProperties properties = {mockRootDeviceIndex, true, 1, AllocationType::linearStream, mockDeviceBitfield}; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, nullptr); @@ -2790,7 +2790,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenAllocateGraphicsMemory auto memoryManager = std::make_unique(false, false, executionEnvironment); memoryManager->allocateGraphicsMemoryInNonDevicePool = true; - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{mockRootDeviceIndex, true, size, AllocationType::BUFFER, mockDeviceBitfield}, ptr); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{mockRootDeviceIndex, true, size, AllocationType::buffer, mockDeviceBitfield}, ptr); auto gfxPartition = memoryManager->getGfxPartition(mockRootDeviceIndex); D3DGPU_VIRTUAL_ADDRESS svmRangeMinimumAddress = gfxPartition->getHeapMinimalAddress(HeapIndex::HEAP_SVM); @@ -2820,7 +2820,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromSharedHandleFa wddm->failOpenSharedHandle = true; - AllocationProperties properties(0, false, size, AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties properties(0, false, size, AllocationType::sharedBuffer, false, false, 0); auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, false, false, true, nullptr); EXPECT_EQ(nullptr, gpuAllocation); } @@ -2902,7 +2902,7 @@ TEST_F(WddmMemoryManagerTest, GivenAlignedPointerWhenAllocate32BitMemoryThenGmmC MockWddmAllocation allocation(rootDeviceEnvironment->getGmmHelper()); uint32_t size = 4096; void *ptr = reinterpret_cast(4096); - auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, ptr, AllocationType::BUFFER); + auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, ptr, AllocationType::buffer); EXPECT_EQ(ptr, reinterpret_cast(gpuAllocation->getDefaultGmm()->resourceParams.pExistingSysMem)); EXPECT_EQ(size, gpuAllocation->getDefaultGmm()->resourceParams.ExistingSysMemSize); memoryManager->freeGraphicsMemory(gpuAllocation); @@ -2912,7 +2912,7 @@ TEST_F(WddmMemoryManagerTest, GivenUnAlignedPointerAndSizeWhenAllocate32BitMemor MockWddmAllocation allocation(rootDeviceEnvironment->getGmmHelper()); uint32_t size = 0x1001; void *ptr = reinterpret_cast(0x1001); - auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, ptr, AllocationType::BUFFER); + auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, ptr, AllocationType::buffer); EXPECT_EQ(reinterpret_cast(0x1000), reinterpret_cast(gpuAllocation->getDefaultGmm()->resourceParams.pExistingSysMem)); EXPECT_EQ(0x2000u, gpuAllocation->getDefaultGmm()->resourceParams.ExistingSysMemSize); memoryManager->freeGraphicsMemory(gpuAllocation); @@ -2940,7 +2940,7 @@ TEST_F(WddmMemoryManagerTest, GivenBitnessWhenGettingMaxAddressThenCorrectAddres } TEST_F(WddmMemoryManagerTest, GivenNullptrWhenAllocating32BitMemoryThenAddressIsCorrect) { - auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, 3 * MemoryConstants::pageSize, nullptr, AllocationType::BUFFER); + auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, 3 * MemoryConstants::pageSize, nullptr, AllocationType::buffer); ASSERT_NE(nullptr, gpuAllocation); @@ -2953,7 +2953,7 @@ TEST_F(WddmMemoryManagerTest, GivenNullptrWhenAllocating32BitMemoryThenAddressIs } TEST_F(WddmMemoryManagerTest, given32BitAllocationWhenItIsCreatedThenItHasNonZeroGpuAddressToPatch) { - auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, 3 * MemoryConstants::pageSize, nullptr, AllocationType::BUFFER); + auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, 3 * MemoryConstants::pageSize, nullptr, AllocationType::buffer); ASSERT_NE(nullptr, gpuAllocation); EXPECT_NE(0llu, gpuAllocation->getGpuAddressToPatch()); @@ -2968,7 +2968,7 @@ TEST_F(WddmMemoryManagerTest, GivenMisalignedHostPtrWhenAllocating32BitMemoryThe size_t misalignedSize = 0x2500; void *misalignedPtr = reinterpret_cast(0x12500); - auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, misalignedSize, misalignedPtr, AllocationType::BUFFER); + auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, misalignedSize, misalignedPtr, AllocationType::buffer); ASSERT_NE(nullptr, gpuAllocation); @@ -2988,7 +2988,7 @@ TEST_F(WddmMemoryManagerTest, GivenMisalignedHostPtrWhenAllocating32BitMemoryThe } TEST_F(WddmMemoryManagerTest, WhenAllocating32BitMemoryThenGpuBaseAddressIsCannonized) { - auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, 3 * MemoryConstants::pageSize, nullptr, AllocationType::BUFFER); + auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, 3 * MemoryConstants::pageSize, nullptr, AllocationType::buffer); ASSERT_NE(nullptr, gpuAllocation); @@ -3084,7 +3084,7 @@ TEST_F(WddmMemoryManagerTest, givenManagerWithDisabledDeferredDeleterWhenMapGpuV auto gmmHelper = rootDeviceEnvironment->getGmmHelper(); auto canonizedAddress = gmmHelper->canonize(castToUint64(const_cast(ptr))); - WddmAllocation allocation(0, AllocationType::BUFFER, ptr, canonizedAddress, size, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::buffer, ptr, canonizedAddress, size, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocation.setDefaultGmm(gmm.get()); bool ret = memoryManager->createWddmAllocation(&allocation, allocation.getAlignedCpuPtr()); EXPECT_FALSE(ret); @@ -3105,7 +3105,7 @@ TEST_F(WddmMemoryManagerTest, givenManagerWithEnabledDeferredDeleterWhenFirstMap auto gmmHelper = rootDeviceEnvironment->getGmmHelper(); auto canonizedAddress = gmmHelper->canonize(castToUint64(const_cast(ptr))); - WddmAllocation allocation(0, AllocationType::BUFFER, ptr, canonizedAddress, size, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::buffer, ptr, canonizedAddress, size, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocation.setDefaultGmm(gmm.get()); bool ret = memoryManager->createWddmAllocation(&allocation, allocation.getAlignedCpuPtr()); EXPECT_TRUE(ret); @@ -3127,7 +3127,7 @@ TEST_F(WddmMemoryManagerTest, givenManagerWithEnabledDeferredDeleterWhenFirstAnd auto gmmHelper = rootDeviceEnvironment->getGmmHelper(); auto canonizedAddress = gmmHelper->canonize(castToUint64(const_cast(ptr))); - WddmAllocation allocation(0, AllocationType::BUFFER, ptr, canonizedAddress, size, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::buffer, ptr, canonizedAddress, size, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocation.setDefaultGmm(gmm.get()); bool ret = memoryManager->createWddmAllocation(&allocation, allocation.getAlignedCpuPtr()); EXPECT_FALSE(ret); @@ -3139,7 +3139,7 @@ TEST_F(WddmMemoryManagerTest, givenNullPtrAndSizePassedToCreateInternalAllocatio } DebugManagerStateRestore restorer; debugManager.flags.ForcePreferredAllocationMethod.set(static_cast(GfxMemoryAllocationMethod::UseUmdSystemPtr)); - auto wddmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, MemoryConstants::pageSize, nullptr, AllocationType::INTERNAL_HEAP)); + auto wddmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, MemoryConstants::pageSize, nullptr, AllocationType::internalHeap)); ASSERT_NE(nullptr, wddmAllocation); auto gmmHelper = memoryManager->getGmmHelper(wddmAllocation->getRootDeviceIndex()); EXPECT_EQ(wddmAllocation->getGpuBaseAddress(), gmmHelper->canonize(memoryManager->getInternalHeapBaseAddress(wddmAllocation->getRootDeviceIndex(), wddmAllocation->isAllocatedInLocalMemoryPool()))); @@ -3164,7 +3164,7 @@ TEST_F(WddmMemoryManagerTest, givenPtrAndSizePassedToCreateInternalAllocationWhe DebugManagerStateRestore restorer; debugManager.flags.ForcePreferredAllocationMethod.set(static_cast(GfxMemoryAllocationMethod::UseUmdSystemPtr)); auto ptr = reinterpret_cast(0x1000000); - auto wddmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, MemoryConstants::pageSize, ptr, AllocationType::INTERNAL_HEAP)); + auto wddmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, MemoryConstants::pageSize, ptr, AllocationType::internalHeap)); ASSERT_NE(nullptr, wddmAllocation); auto gmmHelper = memoryManager->getGmmHelper(wddmAllocation->getRootDeviceIndex()); EXPECT_EQ(wddmAllocation->getGpuBaseAddress(), gmmHelper->canonize(memoryManager->getInternalHeapBaseAddress(rootDeviceIndex, wddmAllocation->isAllocatedInLocalMemoryPool()))); @@ -3252,7 +3252,7 @@ TEST_F(WddmMemoryManagerTest, givenLocalMemoryAllocationWhenCpuPointerNotMeetRes void *cpuPtr = reinterpret_cast(memoryManager->getAlignedMallocRestrictions()->minAddress - 0x1000); size_t size = 0x1000; - auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, size, AllocationType::BUFFER, mockDeviceBitfield}, cpuPtr)); + auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, size, AllocationType::buffer, mockDeviceBitfield}, cpuPtr)); ASSERT_NE(nullptr, allocation); EXPECT_FALSE(MemoryPoolHelper::isSystemMemoryPool(allocation->getMemoryPool())); @@ -3293,8 +3293,8 @@ TEST_F(WddmMemoryManagerSimpleTestWithLocalMemory, givenLocalMemoryAndImageOrSha imgDesc.imageType = ImageType::Image2D; auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr); - AllocationType types[] = {AllocationType::IMAGE, - AllocationType::SHARED_RESOURCE_COPY}; + AllocationType types[] = {AllocationType::image, + AllocationType::sharedResourceCopy}; AllocationData allocData; allocData.allFlags = 0; @@ -3390,7 +3390,7 @@ TEST_F(MockWddmMemoryManagerTest, givenEnabled64kbpagesWhenCreatingGraphicsMemor } EXPECT_EQ(0U, wddm->createAllocationResult.called); - GraphicsAllocation *galloc = memoryManager64k.allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize64k, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield}); + GraphicsAllocation *galloc = memoryManager64k.allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize64k, AllocationType::bufferHostMemory, mockDeviceBitfield}); EXPECT_NE(0U, wddm->createAllocationResult.called); EXPECT_NE(nullptr, galloc); EXPECT_EQ(true, galloc->isLocked()); @@ -3466,7 +3466,7 @@ TEST_F(MockWddmMemoryManagerTest, givenAllocateGraphicsMemoryForBufferAndRequest memoryManager.hugeGfxMemoryChunkSize = MemoryConstants::pageSize64k - MemoryConstants::pageSize; - WddmAllocation *wddmAlloc = static_cast(memoryManager.allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize64k * 3, AllocationType::BUFFER, mockDeviceBitfield})); + WddmAllocation *wddmAlloc = static_cast(memoryManager.allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize64k * 3, AllocationType::buffer, mockDeviceBitfield})); EXPECT_NE(nullptr, wddmAlloc); EXPECT_EQ(4u, wddmAlloc->getNumGmms()); EXPECT_EQ(4u, wddm->createAllocationResult.called); @@ -3501,7 +3501,7 @@ TEST_F(MockWddmMemoryManagerTest, givenAllocateGraphicsMemoryForHostBufferAndReq memoryManager.hugeGfxMemoryChunkSize = MemoryConstants::pageSize64k - MemoryConstants::pageSize; std::vector hostPtr(MemoryConstants::pageSize64k * 3); - AllocationProperties allocProps{rootDeviceIndex, MemoryConstants::pageSize64k * 3, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield}; + AllocationProperties allocProps{rootDeviceIndex, MemoryConstants::pageSize64k * 3, AllocationType::bufferHostMemory, mockDeviceBitfield}; allocProps.flags.allocateMemory = false; WddmAllocation *wddmAlloc = static_cast(memoryManager.allocateGraphicsMemoryWithProperties(allocProps, hostPtr.data())); @@ -3562,7 +3562,7 @@ TEST_F(MockWddmMemoryManagerTest, givenPageTableManagerWhenMapAuxGpuVaCalledThen engine.commandStreamReceiver->pageTableManager.reset(mockMngr); } - auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(AllocationProperties(1, MemoryConstants::pageSize, AllocationType::INTERNAL_HOST_MEMORY, mockDeviceBitfield)); + auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(AllocationProperties(1, MemoryConstants::pageSize, AllocationType::internalHostMemory, mockDeviceBitfield)); GMM_DDI_UPDATEAUXTABLE expectedDdiUpdateAuxTable = {}; expectedDdiUpdateAuxTable.BaseGpuVA = allocation->getGpuAddress(); @@ -3683,7 +3683,7 @@ TEST_F(MockWddmMemoryManagerTest, givenCompressedAllocationAndPageTableSupported engine.commandStreamReceiver->pageTableManager.reset(mockMngr); } - auto wddmAlloc = static_cast(memoryManager.allocateGraphicsMemoryWithProperties(AllocationProperties(1, MemoryConstants::pageSize, AllocationType::INTERNAL_HOST_MEMORY, mockDeviceBitfield))); + auto wddmAlloc = static_cast(memoryManager.allocateGraphicsMemoryWithProperties(AllocationProperties(1, MemoryConstants::pageSize, AllocationType::internalHostMemory, mockDeviceBitfield))); wddmAlloc->setGpuAddress(gpuVa); wddmAlloc->getDefaultGmm()->isCompressionEnabled = true; @@ -4163,15 +4163,15 @@ TEST(WddmMemoryManagerTest3, givenRequestedContextIdTooLargeWhenGettingTrimCandi } TEST(WddmMemoryManagerTest3, givenAllocationTypeWhenPassedToWddmAllocationConstructorThenAllocationTypeIsStored) { - WddmAllocation allocation{0, AllocationType::COMMAND_BUFFER, nullptr, 0, 0, nullptr, MemoryPool::MemoryNull, 0u, 1u}; - EXPECT_EQ(AllocationType::COMMAND_BUFFER, allocation.getAllocationType()); + WddmAllocation allocation{0, AllocationType::commandBuffer, nullptr, 0, 0, nullptr, MemoryPool::MemoryNull, 0u, 1u}; + EXPECT_EQ(AllocationType::commandBuffer, allocation.getAllocationType()); } TEST(WddmMemoryManagerTest3, givenMemoryPoolWhenPassedToWddmAllocationConstructorThenMemoryPoolIsStored) { - WddmAllocation allocation{0, AllocationType::COMMAND_BUFFER, nullptr, 0, 0, nullptr, MemoryPool::System64KBPages, 0u, 1u}; + WddmAllocation allocation{0, AllocationType::commandBuffer, nullptr, 0, 0, nullptr, MemoryPool::System64KBPages, 0u, 1u}; EXPECT_EQ(MemoryPool::System64KBPages, allocation.getMemoryPool()); - WddmAllocation allocation2{0, AllocationType::COMMAND_BUFFER, nullptr, 0, 0, 0u, MemoryPool::SystemCpuInaccessible, 0u, 1u}; + WddmAllocation allocation2{0, AllocationType::commandBuffer, nullptr, 0, 0, 0u, MemoryPool::SystemCpuInaccessible, 0u, 1u}; EXPECT_EQ(MemoryPool::SystemCpuInaccessible, allocation2.getMemoryPool()); } diff --git a/shared/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp index 7b5370348e..faa4a0967d 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp @@ -724,9 +724,9 @@ TEST_F(WddmResidencyControllerWithGdiTest, GivenNumBytesToTrimIsZeroWhenTrimming auto ptr = reinterpret_cast(0x1000); auto gmmHelper = rootDeviceEnvironment->getGmmHelper(); auto canonizedAddress = gmmHelper->canonize(castToUint64(const_cast(ptr))); - WddmAllocation allocation1(0, AllocationType::UNKNOWN, ptr, canonizedAddress, 0x1000, nullptr, MemoryPool::MemoryNull, 0u, 1u); - WddmAllocation allocation2(0, AllocationType::UNKNOWN, ptr, canonizedAddress, 0x3000, nullptr, MemoryPool::MemoryNull, 0u, 1u); - WddmAllocation allocation3(0, AllocationType::UNKNOWN, ptr, canonizedAddress, 0x1000, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation1(0, AllocationType::unknown, ptr, canonizedAddress, 0x1000, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation2(0, AllocationType::unknown, ptr, canonizedAddress, 0x3000, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation3(0, AllocationType::unknown, ptr, canonizedAddress, 0x1000, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocation1.getResidencyData().resident[osContextId] = true; allocation1.getResidencyData().updateCompletionData(0, osContextId); @@ -826,8 +826,8 @@ TEST_F(WddmResidencyControllerWithGdiAndMemoryManagerTest, WhenTrimmingToBudgetT void *ptr = reinterpret_cast(wddm->virtualAllocAddress + 0x1000); auto gmmHelper = memoryManager->getGmmHelper(0); auto canonizedAddress = gmmHelper->canonize(castToUint64(const_cast(ptr))); - WddmAllocation allocation1(0, AllocationType::UNKNOWN, ptr, canonizedAddress, 0x1000, nullptr, MemoryPool::MemoryNull, 0u, 1u); - WddmAllocation allocation2(0, AllocationType::UNKNOWN, ptr, canonizedAddress, 0x1000, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation1(0, AllocationType::unknown, ptr, canonizedAddress, 0x1000, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation2(0, AllocationType::unknown, ptr, canonizedAddress, 0x1000, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocation1.getResidencyData().resident[osContextId] = true; allocation1.getResidencyData().updateCompletionData(0, osContextId); @@ -886,9 +886,9 @@ TEST_F(WddmResidencyControllerWithGdiTest, givenThreeAllocationsAlignedSizeBigge void *ptr3 = reinterpret_cast(wddm->virtualAllocAddress + 0x5000); auto gmmHelper = rootDeviceEnvironment->getGmmHelper(); - WddmAllocation allocation1(0, AllocationType::UNKNOWN, ptr1, gmmHelper->canonize(castToUint64(const_cast(ptr1))), underlyingSize, nullptr, MemoryPool::MemoryNull, 0u, 1u); - WddmAllocation allocation2(0, AllocationType::UNKNOWN, ptr2, gmmHelper->canonize(castToUint64(const_cast(ptr2))), underlyingSize, nullptr, MemoryPool::MemoryNull, 0u, 1u); - WddmAllocation allocation3(0, AllocationType::UNKNOWN, ptr3, gmmHelper->canonize(castToUint64(const_cast(ptr3))), underlyingSize, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation1(0, AllocationType::unknown, ptr1, gmmHelper->canonize(castToUint64(const_cast(ptr1))), underlyingSize, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation2(0, AllocationType::unknown, ptr2, gmmHelper->canonize(castToUint64(const_cast(ptr2))), underlyingSize, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation3(0, AllocationType::unknown, ptr3, gmmHelper->canonize(castToUint64(const_cast(ptr3))), underlyingSize, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocation1.getResidencyData().resident[osContextId] = true; allocation1.getResidencyData().updateCompletionData(0, osContextId); @@ -1100,7 +1100,7 @@ TEST_F(WddmResidencyControllerWithMockWddmTest, givenMakeResidentFailsAndTrimToB void *cpuPtr = reinterpret_cast(wddm->getWddmMinAddress() + 0x1000); size_t allocationSize = 0x1000; auto canonizedAddress = gmmHelper->canonize(castToUint64(const_cast(cpuPtr))); - WddmAllocation allocationToTrim(0, AllocationType::UNKNOWN, cpuPtr, canonizedAddress, allocationSize, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocationToTrim(0, AllocationType::unknown, cpuPtr, canonizedAddress, allocationSize, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocationToTrim.getResidencyData().updateCompletionData(residencyController->getMonitoredFence().lastSubmittedFence, osContext->getContextId()); diff --git a/shared/test/unit_test/os_interface/windows/wddm_special_heap_test.cpp b/shared/test/unit_test/os_interface/windows/wddm_special_heap_test.cpp index 3c99054acc..442e48f3f1 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_special_heap_test.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_special_heap_test.cpp @@ -53,7 +53,7 @@ class GlobalBindlessWddmMemManagerFixture { using WddmGlobalBindlessAllocatorTests = Test; TEST_F(WddmGlobalBindlessAllocatorTests, givenAllocateInFrontWindowPoolFlagWhenWddmAllocate32BitGraphicsMemoryThenAllocateAtHeapBegining) { - AllocationProperties allocationProperties{0u, MemoryConstants::kiloByte, NEO::AllocationType::BUFFER, {}}; + AllocationProperties allocationProperties{0u, MemoryConstants::kiloByte, NEO::AllocationType::buffer, {}}; NEO::AllocationData allocData = {}; allocData.rootDeviceIndex = allocationProperties.rootDeviceIndex; allocData.type = allocationProperties.allocationType; @@ -74,7 +74,7 @@ TEST_F(WddmGlobalBindlessAllocatorTests, givenAllocateInFrontWindowPoolFlagWhenW } TEST_F(WddmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSurfaceStatesAllocationCreatedThenGpuBaseAddressIsSetToCorrectBaseAddress) { - MockAllocationProperties properties(0, true, MemoryConstants::pageSize64k, AllocationType::LINEAR_STREAM); + MockAllocationProperties properties(0, true, MemoryConstants::pageSize64k, AllocationType::linearStream); properties.flags.use32BitFrontWindow = true; memManager.reset(new FrontWindowMemManagerMock(true, true, *executionEnvironment)); @@ -96,7 +96,7 @@ TEST_F(WddmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSurfaceStatesAlloca TEST_F(WddmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSurfaceStatesAllocationCreatedInDevicePoolThenGpuBaseAddressIsSetToBindlessBaseAddress) { debugManager.flags.ForceLocalMemoryAccessMode.set(0); AllocationData allocData = {}; - allocData.type = AllocationType::LINEAR_STREAM; + allocData.type = AllocationType::linearStream; allocData.size = MemoryConstants::pageSize64k; auto wddm = static_cast(executionEnvironment->rootDeviceEnvironments[0]->osInterface->getDriverModel()->as()); @@ -122,7 +122,7 @@ TEST_F(WddmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSurfaceStatesAlloca TEST_F(WddmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSpecialSshHeapCreatedInDevicePoolThenGpuAddressIsSetToBindlessBaseAddress) { debugManager.flags.ForceLocalMemoryAccessMode.set(0); AllocationData allocData = {}; - allocData.type = AllocationType::LINEAR_STREAM; + allocData.type = AllocationType::linearStream; allocData.size = MemoryConstants::pageSize64k; auto wddm = static_cast(executionEnvironment->rootDeviceEnvironments[0]->osInterface->getDriverModel()->as()); @@ -144,14 +144,14 @@ TEST_F(WddmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSpecialSshHeapCreat TEST_F(WddmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSurfaceStatesAllocationCreatedInPreferredPoolThenGpuBaseAddressIsSetToCorrectBaseAddress) { AllocationData allocData = {}; - allocData.type = AllocationType::LINEAR_STREAM; + allocData.type = AllocationType::linearStream; allocData.size = MemoryConstants::pageSize64k; memManager.reset(new FrontWindowMemManagerMock(true, true, *executionEnvironment)); executionEnvironment->rootDeviceEnvironments[0]->createBindlessHeapsHelper(memManager.get(), false, 0, 1); - AllocationProperties properties = {0, MemoryConstants::pageSize64k, AllocationType::LINEAR_STREAM, {}}; + AllocationProperties properties = {0, MemoryConstants::pageSize64k, AllocationType::linearStream, {}}; auto allocation = memManager->allocateGraphicsMemoryInPreferredPool(properties, nullptr); ASSERT_NE(nullptr, allocation); auto gmmHelper = memManager->getGmmHelper(0); diff --git a/shared/test/unit_test/os_interface/windows/wddm_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm_tests.cpp index 5efcb6367a..609c26e138 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_tests.cpp @@ -460,7 +460,7 @@ TEST_F(WddmTests, GivenPlatformNotSupportEvictIfNecessaryWhenAdjustingEvictNeede TEST_F(WddmTests, GivenWddmWhenMapGpuVaCalledThenGmmClientCallsMapGpuVa) { NEO::AllocationData allocData = {}; - allocData.type = NEO::AllocationType::BUFFER; + allocData.type = NEO::AllocationType::buffer; wddm->callBaseDestroyAllocations = false; wddm->pagingQueue = PAGINGQUEUE_HANDLE; auto memoryManager = std::make_unique(*executionEnvironment); @@ -851,7 +851,7 @@ TEST_F(WddmSkipResourceCleanupFixtureTests, givenWaitForSynchronizationObjectFro } TEST(WddmAllocationTest, whenAllocationIsShareableThenSharedHandleToModifyIsSharedHandleOfAllocation) { - WddmAllocation allocation(0, AllocationType::UNKNOWN, nullptr, 0, MemoryConstants::pageSize, nullptr, MemoryPool::MemoryNull, true, 1u); + WddmAllocation allocation(0, AllocationType::unknown, nullptr, 0, MemoryConstants::pageSize, nullptr, MemoryPool::MemoryNull, true, 1u); auto sharedHandleToModify = allocation.getSharedHandleToModify(); EXPECT_NE(nullptr, sharedHandleToModify); *sharedHandleToModify = 1234u; @@ -862,7 +862,7 @@ TEST(WddmAllocationTest, whenAllocationIsShareableThenSharedHandleToModifyIsShar } TEST(WddmAllocationTest, whenAllocationIsNotShareableThenItDoesntReturnSharedHandleToModifyAndCantPeekInternalHandle) { - WddmAllocation allocation(0, AllocationType::UNKNOWN, nullptr, 0, MemoryConstants::pageSize, nullptr, MemoryPool::MemoryNull, false, 1u); + WddmAllocation allocation(0, AllocationType::unknown, nullptr, 0, MemoryConstants::pageSize, nullptr, MemoryPool::MemoryNull, false, 1u); auto sharedHandleToModify = allocation.getSharedHandleToModify(); EXPECT_EQ(nullptr, sharedHandleToModify); uint64_t handle = 0; diff --git a/shared/test/unit_test/program/program_initialization_tests.cpp b/shared/test/unit_test/program/program_initialization_tests.cpp index 60b54ada45..372675abbc 100644 --- a/shared/test/unit_test/program/program_initialization_tests.cpp +++ b/shared/test/unit_test/program/program_initialization_tests.cpp @@ -38,7 +38,7 @@ TEST(AllocateGlobalSurfaceTest, GivenSvmAllocsManagerWhenGlobalsAreNotExportedTh ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize()); EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size())); EXPECT_EQ(nullptr, svmAllocsManager.getSVMAlloc(reinterpret_cast(static_cast(alloc->getGpuAddress())))); - EXPECT_EQ(AllocationType::CONSTANT_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::constantSurface, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); alloc = allocateGlobalsSurface(&svmAllocsManager, device, initData.size(), 0u, false /* constant */, nullptr /* linker input */, initData.data()); @@ -46,7 +46,7 @@ TEST(AllocateGlobalSurfaceTest, GivenSvmAllocsManagerWhenGlobalsAreNotExportedTh ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize()); EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size())); EXPECT_EQ(nullptr, svmAllocsManager.getSVMAlloc(reinterpret_cast(static_cast(alloc->getGpuAddress())))); - EXPECT_EQ(AllocationType::GLOBAL_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::globalSurface, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); alloc = allocateGlobalsSurface(&svmAllocsManager, device, initData.size(), 0u, true /* constant */, &emptyLinkerInput, initData.data()); @@ -54,7 +54,7 @@ TEST(AllocateGlobalSurfaceTest, GivenSvmAllocsManagerWhenGlobalsAreNotExportedTh ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize()); EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size())); EXPECT_EQ(nullptr, svmAllocsManager.getSVMAlloc(reinterpret_cast(static_cast(alloc->getGpuAddress())))); - EXPECT_EQ(AllocationType::CONSTANT_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::constantSurface, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); alloc = allocateGlobalsSurface(&svmAllocsManager, device, initData.size(), 0u, false /* constant */, &emptyLinkerInput, initData.data()); @@ -62,7 +62,7 @@ TEST(AllocateGlobalSurfaceTest, GivenSvmAllocsManagerWhenGlobalsAreNotExportedTh ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize()); EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size())); EXPECT_EQ(nullptr, svmAllocsManager.getSVMAlloc(reinterpret_cast(static_cast(alloc->getGpuAddress())))); - EXPECT_EQ(AllocationType::GLOBAL_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::globalSurface, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); } @@ -88,7 +88,7 @@ TEST(AllocateGlobalSurfaceTest, GivenSvmAllocsManagerWhenGlobalsAreExportedThenM ASSERT_NE(nullptr, svmAllocsManager.getSVMAlloc(reinterpret_cast(static_cast(alloc->getGpuAddress())))); EXPECT_TRUE(alloc->isMemObjectsAllocationWithWritableFlags()); EXPECT_EQ(DEVICE_UNIFIED_MEMORY, svmAllocsManager.getSVMAlloc(reinterpret_cast(alloc->getGpuAddress()))->memoryType); - EXPECT_EQ(AllocationType::CONSTANT_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::constantSurface, alloc->getAllocationType()); EXPECT_FALSE(alloc->getDefaultGmm()->resourceParams.Flags.Info.NotLockable); svmAllocsManager.freeSVMAlloc(reinterpret_cast(static_cast(alloc->getGpuAddress()))); @@ -97,7 +97,7 @@ TEST(AllocateGlobalSurfaceTest, GivenSvmAllocsManagerWhenGlobalsAreExportedThenM ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize()); EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size())); EXPECT_EQ(nullptr, svmAllocsManager.getSVMAlloc(reinterpret_cast(static_cast(alloc->getGpuAddress())))); - EXPECT_EQ(AllocationType::CONSTANT_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::constantSurface, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); alloc = allocateGlobalsSurface(&svmAllocsManager, device, initData.size(), 0u, false /* constant */, &linkerInputExportGlobalConstants, initData.data()); @@ -105,7 +105,7 @@ TEST(AllocateGlobalSurfaceTest, GivenSvmAllocsManagerWhenGlobalsAreExportedThenM ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize()); EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size())); EXPECT_EQ(nullptr, svmAllocsManager.getSVMAlloc(reinterpret_cast(static_cast(alloc->getGpuAddress())))); - EXPECT_EQ(AllocationType::GLOBAL_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::globalSurface, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); alloc = allocateGlobalsSurface(&svmAllocsManager, device, initData.size(), 0u, false /* constant */, &linkerInputExportGlobalVariables, initData.data()); @@ -115,7 +115,7 @@ TEST(AllocateGlobalSurfaceTest, GivenSvmAllocsManagerWhenGlobalsAreExportedThenM EXPECT_NE(nullptr, svmAllocsManager.getSVMAlloc(reinterpret_cast(static_cast(alloc->getGpuAddress())))); EXPECT_TRUE(alloc->isMemObjectsAllocationWithWritableFlags()); EXPECT_EQ(DEVICE_UNIFIED_MEMORY, svmAllocsManager.getSVMAlloc(reinterpret_cast(alloc->getGpuAddress()))->memoryType); - EXPECT_EQ(AllocationType::GLOBAL_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::globalSurface, alloc->getAllocationType()); EXPECT_FALSE(alloc->getDefaultGmm()->resourceParams.Flags.Info.NotLockable); svmAllocsManager.freeSVMAlloc(reinterpret_cast(static_cast(alloc->getGpuAddress()))); } @@ -135,28 +135,28 @@ TEST(AllocateGlobalSurfaceTest, GivenNullSvmAllocsManagerWhenGlobalsAreExportedT ASSERT_NE(nullptr, alloc); ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize()); EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size())); - EXPECT_EQ(AllocationType::CONSTANT_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::constantSurface, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); alloc = allocateGlobalsSurface(nullptr, device, initData.size(), 0u, true /* constant */, &linkerInputExportGlobalVariables, initData.data()); ASSERT_NE(nullptr, alloc); ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize()); EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size())); - EXPECT_EQ(AllocationType::CONSTANT_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::constantSurface, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); alloc = allocateGlobalsSurface(nullptr, device, initData.size(), 0u, false /* constant */, &linkerInputExportGlobalConstants, initData.data()); ASSERT_NE(nullptr, alloc); ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize()); EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size())); - EXPECT_EQ(AllocationType::GLOBAL_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::globalSurface, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); alloc = allocateGlobalsSurface(nullptr, device, initData.size(), 0u, false /* constant */, &linkerInputExportGlobalVariables, initData.data()); ASSERT_NE(nullptr, alloc); ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize()); EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size())); - EXPECT_EQ(AllocationType::GLOBAL_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::globalSurface, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); } @@ -230,7 +230,7 @@ TEST(AllocateGlobalSurfaceTest, GivenAllocationInLocalMemoryWhichRequiresBlitter nullptr /* linker input */, initData.data()); ASSERT_NE(nullptr, pAllocation); EXPECT_EQ(nullptr, svmAllocsManager.getSVMAlloc(reinterpret_cast(static_cast(pAllocation->getGpuAddress())))); - EXPECT_EQ(AllocationType::CONSTANT_SURFACE, pAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::constantSurface, pAllocation->getAllocationType()); if (pAllocation->isAllocatedInLocalMemoryPool() && (localMemoryAccessMode == LocalMemoryAccessMode::CpuAccessDisallowed)) { expectedBlitsCount++; diff --git a/shared/test/unit_test/release_helper/release_helper_tests_base.cpp b/shared/test/unit_test/release_helper/release_helper_tests_base.cpp index 0b4f69e3f5..1ea9c79908 100644 --- a/shared/test/unit_test/release_helper/release_helper_tests_base.cpp +++ b/shared/test/unit_test/release_helper/release_helper_tests_base.cpp @@ -47,7 +47,7 @@ void ReleaseHelperTestsBase::whenGettingPreferredAllocationMethodThenNoPreferenc ipVersion.revision = revision; releaseHelper = ReleaseHelper::create(ipVersion); ASSERT_NE(nullptr, releaseHelper); - for (auto i = 0; i < static_cast(AllocationType::COUNT); i++) { + for (auto i = 0; i < static_cast(AllocationType::count); i++) { auto allocationType = static_cast(i); auto preferredAllocationMethod = releaseHelper->getPreferredAllocationMethod(allocationType); EXPECT_FALSE(preferredAllocationMethod.has_value()); @@ -73,11 +73,11 @@ void ReleaseHelperTestsBase::whenCheckPreferredAllocationMethodThenAllocateByKmd ipVersion.revision = revision; releaseHelper = ReleaseHelper::create(ipVersion); ASSERT_NE(nullptr, releaseHelper); - for (auto i = 0; i < static_cast(AllocationType::COUNT); i++) { + for (auto i = 0; i < static_cast(AllocationType::count); i++) { auto allocationType = static_cast(i); auto preferredAllocationMethod = releaseHelper->getPreferredAllocationMethod(allocationType); - if (allocationType == AllocationType::TAG_BUFFER || - allocationType == AllocationType::TIMESTAMP_PACKET_TAG_BUFFER) { + if (allocationType == AllocationType::tagBuffer || + allocationType == AllocationType::timestampPacketTagBuffer) { EXPECT_FALSE(preferredAllocationMethod.has_value()); } else { EXPECT_TRUE(preferredAllocationMethod.has_value()); diff --git a/shared/test/unit_test/utilities/logger_tests.cpp b/shared/test/unit_test/utilities/logger_tests.cpp index bb62b982cf..36a967f758 100644 --- a/shared/test/unit_test/utilities/logger_tests.cpp +++ b/shared/test/unit_test/utilities/logger_tests.cpp @@ -433,46 +433,46 @@ TEST(AllocationTypeLogging, givenGraphicsAllocationTypeWhenConvertingToStringThe FullyEnabledFileLogger fileLogger(testFile, flags); std::array, 40> allocationTypeValues = { - {{AllocationType::BUFFER, "BUFFER"}, - {AllocationType::BUFFER_HOST_MEMORY, "BUFFER_HOST_MEMORY"}, - {AllocationType::COMMAND_BUFFER, "COMMAND_BUFFER"}, - {AllocationType::CONSTANT_SURFACE, "CONSTANT_SURFACE"}, - {AllocationType::EXTERNAL_HOST_PTR, "EXTERNAL_HOST_PTR"}, - {AllocationType::FILL_PATTERN, "FILL_PATTERN"}, - {AllocationType::GLOBAL_SURFACE, "GLOBAL_SURFACE"}, - {AllocationType::IMAGE, "IMAGE"}, - {AllocationType::INDIRECT_OBJECT_HEAP, "INDIRECT_OBJECT_HEAP"}, - {AllocationType::INSTRUCTION_HEAP, "INSTRUCTION_HEAP"}, - {AllocationType::INTERNAL_HEAP, "INTERNAL_HEAP"}, - {AllocationType::INTERNAL_HOST_MEMORY, "INTERNAL_HOST_MEMORY"}, - {AllocationType::KERNEL_ISA, "KERNEL_ISA"}, - {AllocationType::KERNEL_ISA_INTERNAL, "KERNEL_ISA_INTERNAL"}, - {AllocationType::LINEAR_STREAM, "LINEAR_STREAM"}, - {AllocationType::MAP_ALLOCATION, "MAP_ALLOCATION"}, - {AllocationType::MCS, "MCS"}, - {AllocationType::PIPE, "PIPE"}, - {AllocationType::PREEMPTION, "PREEMPTION"}, - {AllocationType::PRINTF_SURFACE, "PRINTF_SURFACE"}, - {AllocationType::PRIVATE_SURFACE, "PRIVATE_SURFACE"}, - {AllocationType::PROFILING_TAG_BUFFER, "PROFILING_TAG_BUFFER"}, - {AllocationType::SCRATCH_SURFACE, "SCRATCH_SURFACE"}, - {AllocationType::WORK_PARTITION_SURFACE, "WORK_PARTITION_SURFACE"}, - {AllocationType::SHARED_BUFFER, "SHARED_BUFFER"}, - {AllocationType::SHARED_IMAGE, "SHARED_IMAGE"}, - {AllocationType::SHARED_RESOURCE_COPY, "SHARED_RESOURCE_COPY"}, - {AllocationType::SURFACE_STATE_HEAP, "SURFACE_STATE_HEAP"}, - {AllocationType::SVM_CPU, "SVM_CPU"}, - {AllocationType::SVM_GPU, "SVM_GPU"}, - {AllocationType::SVM_ZERO_COPY, "SVM_ZERO_COPY"}, - {AllocationType::TAG_BUFFER, "TAG_BUFFER"}, - {AllocationType::GLOBAL_FENCE, "GLOBAL_FENCE"}, - {AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, "TIMESTAMP_PACKET_TAG_BUFFER"}, - {AllocationType::UNKNOWN, "UNKNOWN"}, - {AllocationType::WRITE_COMBINED, "WRITE_COMBINED"}, - {AllocationType::DEBUG_CONTEXT_SAVE_AREA, "DEBUG_CONTEXT_SAVE_AREA"}, - {AllocationType::DEBUG_SBA_TRACKING_BUFFER, "DEBUG_SBA_TRACKING_BUFFER"}, - {AllocationType::DEBUG_MODULE_AREA, "DEBUG_MODULE_AREA"}, - {AllocationType::SW_TAG_BUFFER, "SW_TAG_BUFFER"}}}; + {{AllocationType::buffer, "BUFFER"}, + {AllocationType::bufferHostMemory, "BUFFER_HOST_MEMORY"}, + {AllocationType::commandBuffer, "COMMAND_BUFFER"}, + {AllocationType::constantSurface, "CONSTANT_SURFACE"}, + {AllocationType::externalHostPtr, "EXTERNAL_HOST_PTR"}, + {AllocationType::fillPattern, "FILL_PATTERN"}, + {AllocationType::globalSurface, "GLOBAL_SURFACE"}, + {AllocationType::image, "IMAGE"}, + {AllocationType::indirectObjectHeap, "INDIRECT_OBJECT_HEAP"}, + {AllocationType::instructionHeap, "INSTRUCTION_HEAP"}, + {AllocationType::internalHeap, "INTERNAL_HEAP"}, + {AllocationType::internalHostMemory, "INTERNAL_HOST_MEMORY"}, + {AllocationType::kernelIsa, "KERNEL_ISA"}, + {AllocationType::kernelIsaInternal, "KERNEL_ISA_INTERNAL"}, + {AllocationType::linearStream, "LINEAR_STREAM"}, + {AllocationType::mapAllocation, "MAP_ALLOCATION"}, + {AllocationType::mcs, "MCS"}, + {AllocationType::pipe, "PIPE"}, + {AllocationType::preemption, "PREEMPTION"}, + {AllocationType::printfSurface, "PRINTF_SURFACE"}, + {AllocationType::privateSurface, "PRIVATE_SURFACE"}, + {AllocationType::profilingTagBuffer, "PROFILING_TAG_BUFFER"}, + {AllocationType::scratchSurface, "SCRATCH_SURFACE"}, + {AllocationType::workPartitionSurface, "WORK_PARTITION_SURFACE"}, + {AllocationType::sharedBuffer, "SHARED_BUFFER"}, + {AllocationType::sharedImage, "SHARED_IMAGE"}, + {AllocationType::sharedResourceCopy, "SHARED_RESOURCE_COPY"}, + {AllocationType::surfaceStateHeap, "SURFACE_STATE_HEAP"}, + {AllocationType::svmCpu, "SVM_CPU"}, + {AllocationType::svmGpu, "SVM_GPU"}, + {AllocationType::svmZeroCopy, "SVM_ZERO_COPY"}, + {AllocationType::tagBuffer, "TAG_BUFFER"}, + {AllocationType::globalFence, "GLOBAL_FENCE"}, + {AllocationType::timestampPacketTagBuffer, "TIMESTAMP_PACKET_TAG_BUFFER"}, + {AllocationType::unknown, "UNKNOWN"}, + {AllocationType::writeCombined, "WRITE_COMBINED"}, + {AllocationType::debugContextSaveArea, "DEBUG_CONTEXT_SAVE_AREA"}, + {AllocationType::debugSbaTrackingBuffer, "DEBUG_SBA_TRACKING_BUFFER"}, + {AllocationType::debugModuleArea, "DEBUG_MODULE_AREA"}, + {AllocationType::swTagBuffer, "SW_TAG_BUFFER"}}}; for (const auto &[type, str] : allocationTypeValues) { GraphicsAllocation graphicsAllocation(0, type, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); @@ -499,9 +499,9 @@ TEST(AllocationTypeLoggingSingle, givenAllocationTypeWhenConvertingToStringThenS DebugVariables flags; FullyEnabledFileLogger fileLogger(testFile, flags); - GraphicsAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); + GraphicsAllocation graphicsAllocation(0, AllocationType::unknown, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); - for (uint32_t i = 0; i < static_cast(AllocationType::COUNT); i++) { + for (uint32_t i = 0; i < static_cast(AllocationType::count); i++) { graphicsAllocation.setAllocationType(static_cast(i)); auto result = getAllocationTypeString(&graphicsAllocation); @@ -517,7 +517,7 @@ TEST(AllocationTypeLoggingSingle, givenDebugVariableToCaptureAllocationTypeWhenF FullyEnabledFileLogger fileLogger(testFile, flags); - GraphicsAllocation graphicsAllocation(0, AllocationType::COMMAND_BUFFER, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); + GraphicsAllocation graphicsAllocation(0, AllocationType::commandBuffer, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); testing::internal::CaptureStdout(); fileLogger.logAllocation(&graphicsAllocation); @@ -535,7 +535,7 @@ TEST(AllocationTypeLoggingSingle, givenLogAllocationTypeWhenLoggingAllocationThe FullyEnabledFileLogger fileLogger(testFile, flags); - GraphicsAllocation graphicsAllocation(0, AllocationType::COMMAND_BUFFER, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); + GraphicsAllocation graphicsAllocation(0, AllocationType::commandBuffer, nullptr, 0, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, 0llu); // Log file not created bool logFileCreated = fileExists(fileLogger.getLogFileName()); @@ -572,7 +572,7 @@ TEST(MemoryPoolLogging, givenGraphicsMemoryPoolWhenConvertingToStringThenCorrect {MemoryPool::SystemCpuInaccessible, "SystemCpuInaccessible"}}}; for (const auto &[pool, str] : memoryPoolValues) { - GraphicsAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, 0, 0, pool, MemoryManager::maxOsContextCount, 0llu); + GraphicsAllocation graphicsAllocation(0, AllocationType::unknown, nullptr, 0, 0, pool, MemoryManager::maxOsContextCount, 0llu); auto result = getMemoryPoolString(&graphicsAllocation); EXPECT_STREQ(result, str); diff --git a/shared/test/unit_test/utilities/software_tags_manager_tests.cpp b/shared/test/unit_test/utilities/software_tags_manager_tests.cpp index 6e07e1b1a1..816c86fce4 100644 --- a/shared/test/unit_test/utilities/software_tags_manager_tests.cpp +++ b/shared/test/unit_test/utilities/software_tags_manager_tests.cpp @@ -55,7 +55,7 @@ struct SoftwareTagsManagerTests : public DeviceFixture, public ::testing::Test { const AllocationProperties properties{ pDevice->getRootDeviceIndex(), SWTagsManager::estimateSpaceForSWTags(), - AllocationType::LINEAR_STREAM, + AllocationType::linearStream, pDevice->getDeviceBitfield()}; GraphicsAllocation *allocation = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); diff --git a/shared/test/unit_test/utilities/tag_allocator_tests.cpp b/shared/test/unit_test/utilities/tag_allocator_tests.cpp index 2708048267..7cb7c0fb52 100644 --- a/shared/test/unit_test/utilities/tag_allocator_tests.cpp +++ b/shared/test/unit_test/utilities/tag_allocator_tests.cpp @@ -40,7 +40,7 @@ struct TimeStamps { end = 2; } static constexpr AllocationType getAllocationType() { - return AllocationType::PROFILING_TAG_BUFFER; + return AllocationType::profilingTagBuffer; } static constexpr TagNodeType getTagNodeType() { return TagNodeType::hwTimeStamps; } @@ -448,9 +448,9 @@ TEST_F(TagAllocatorTest, givenTagAllocatorWhenGraphicsAllocationIsCreatedThenSet auto hwTimeStampsTag = hwTimeStampsAllocator.getTag(); auto hwPerfCounterTag = hwPerfCounterAllocator.getTag(); - EXPECT_EQ(AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, timestampPacketTag->getBaseGraphicsAllocation()->getAllocationType()); - EXPECT_EQ(AllocationType::PROFILING_TAG_BUFFER, hwTimeStampsTag->getBaseGraphicsAllocation()->getAllocationType()); - EXPECT_EQ(AllocationType::PROFILING_TAG_BUFFER, hwPerfCounterTag->getBaseGraphicsAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::timestampPacketTagBuffer, timestampPacketTag->getBaseGraphicsAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::profilingTagBuffer, hwTimeStampsTag->getBaseGraphicsAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::profilingTagBuffer, hwPerfCounterTag->getBaseGraphicsAllocation()->getAllocationType()); } TEST_F(TagAllocatorTest, givenMultipleRootDevicesWhenPopulatingTagsThenCreateMultiGraphicsAllocation) { diff --git a/shared/test/unit_test/xe_hpc_core/aub_command_stream_receiver_2_tests_xe_hpc_core.cpp b/shared/test/unit_test/xe_hpc_core/aub_command_stream_receiver_2_tests_xe_hpc_core.cpp index 6811d2bdf0..2cf8f31df6 100644 --- a/shared/test/unit_test/xe_hpc_core/aub_command_stream_receiver_2_tests_xe_hpc_core.cpp +++ b/shared/test/unit_test/xe_hpc_core/aub_command_stream_receiver_2_tests_xe_hpc_core.cpp @@ -28,7 +28,7 @@ XE_HPC_CORETEST_F(AubCommandStreamReceiverXeHpcCoreTests, givenLinkBcsEngineWhen auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(defaultHwInfo.get())); auto memoryManager = device->getMemoryManager(); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, device->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::buffer, device->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); diff --git a/shared/test/unit_test/xe_hpc_core/pvc/device_tests_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/device_tests_pvc.cpp index 2bf0d1576e..c5a9e7f4d8 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/device_tests_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/device_tests_pvc.cpp @@ -53,7 +53,7 @@ struct MemoryManagerDirectSubmissionImplicitScalingPvcTest : public ::testing::T executionEnvironment = std::make_unique(defaultHwInfo.get()); auto allTilesMask = executionEnvironment->rootDeviceEnvironments[mockRootDeviceIndex]->deviceAffinityMask.getGenericSubDevicesMask(); - allocationProperties = std::make_unique(mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::UNKNOWN, allTilesMask); + allocationProperties = std::make_unique(mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::unknown, allTilesMask); allocationProperties->flags.multiOsContextCapable = true; constexpr auto enableLocalMemory = true; @@ -93,7 +93,7 @@ PVCTEST_F(MemoryManagerDirectSubmissionImplicitScalingPvcTest, givenDirectSubmis expectedPlacement = static_cast(firstTileMask.to_ulong()); } - for (auto &allocationType : {AllocationType::COMMAND_BUFFER, AllocationType::RING_BUFFER, AllocationType::SEMAPHORE_BUFFER}) { + for (auto &allocationType : {AllocationType::commandBuffer, AllocationType::ringBuffer, AllocationType::semaphoreBuffer}) { allocationProperties->allocationType = allocationType; allocationProperties->flags.multiOsContextCapable = multiTile; auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(*allocationProperties, nullptr); @@ -130,7 +130,7 @@ PVCTEST_F(MemoryManagerDirectSubmissionImplicitScalingPvcTest, givenDirectSubmis expectedPlacement = static_cast(firstTileMask.to_ulong()); } - for (auto &allocationType : {AllocationType::COMMAND_BUFFER, AllocationType::RING_BUFFER, AllocationType::SEMAPHORE_BUFFER}) { + for (auto &allocationType : {AllocationType::commandBuffer, AllocationType::ringBuffer, AllocationType::semaphoreBuffer}) { allocationProperties->allocationType = allocationType; allocationProperties->flags.multiOsContextCapable = multiTile; auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(*allocationProperties, nullptr); diff --git a/shared/test/unit_test/xe_hpc_core/pvc/engine_node_helper_tests_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/engine_node_helper_tests_pvc.cpp index a75fbff79a..43e16a33d0 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/engine_node_helper_tests_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/engine_node_helper_tests_pvc.cpp @@ -590,7 +590,7 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenNonTile0AccessWhenGettingIsBlitCopyRequ auto &productHelper = getHelper(); hwInfo.capabilityTable.blitterOperationsSupported = true; MockGraphicsAllocation graphicsAllocation; - graphicsAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + graphicsAllocation.setAllocationType(AllocationType::bufferHostMemory); EXPECT_TRUE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType())); graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); hwInfo.platform.usRevId = 0u; diff --git a/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp b/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp index 70394cb22f..92cbfde863 100644 --- a/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp +++ b/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp @@ -58,7 +58,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenOffsetWhenProgrammingStatePre constexpr uint64_t gpuVa = 0x100000; constexpr uint32_t gpuVaOffset = 0x10000; - const GraphicsAllocation allocation(0, AllocationType::BUFFER, nullptr, gpuVa, 0, 4096, MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); + const GraphicsAllocation allocation(0, AllocationType::buffer, nullptr, gpuVa, 0, 4096, MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); memset(buffer, 0, sizeof(buffer)); LinearStream linearStream(buffer, sizeof(buffer)); @@ -89,7 +89,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenDebugVariableSetwhenProgramin constexpr uint32_t mocsIndexForL3 = (2 << 1); constexpr size_t numCachelines = 3; - const GraphicsAllocation allocation(0, AllocationType::BUFFER, nullptr, gpuVa, 0, 4096, MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); + const GraphicsAllocation allocation(0, AllocationType::buffer, nullptr, gpuVa, 0, 4096, MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); constexpr std::array expectedSizes = {{ MemoryConstants::cacheLineSize - 1, @@ -145,7 +145,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenIsaAllocationWhenProgrammingP EXPECT_EQ(sizeof(STATE_PREFETCH), EncodeMemoryPrefetch::getSizeForMemoryPrefetch(1, *mockExecutionEnvironment.rootDeviceEnvironments[0])); - AllocationType isaTypes[] = {AllocationType::KERNEL_ISA, AllocationType::KERNEL_ISA_INTERNAL}; + AllocationType isaTypes[] = {AllocationType::kernelIsa, AllocationType::kernelIsaInternal}; for (auto &isaType : isaTypes) { memset(buffer, 0, sizeof(STATE_PREFETCH)); @@ -171,7 +171,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenDebugFlagSetWhenProgramPrefet uint8_t buffer[sizeof(STATE_PREFETCH)] = {}; - AllocationType isaTypes[] = {AllocationType::KERNEL_ISA, AllocationType::KERNEL_ISA_INTERNAL}; + AllocationType isaTypes[] = {AllocationType::kernelIsa, AllocationType::kernelIsaInternal}; for (auto &isaType : isaTypes) { memset(buffer, 0, sizeof(STATE_PREFETCH)); @@ -203,7 +203,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenDebugFlagSetWhenProgrammingPr auto &hwInfo = *mockExecutionEnvironment.rootDeviceEnvironments[0]->getMutableHardwareInfo(); hwInfo.platform.usRevId = 0b0010'1000; // [3:5] - BaseDie != A0 - const GraphicsAllocation allocation(0, AllocationType::BUFFER, + const GraphicsAllocation allocation(0, AllocationType::buffer, nullptr, 1234, 0, 4096, MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); uint8_t buffer[sizeof(STATE_PREFETCH)] = {}; diff --git a/shared/test/unit_test/xe_hpg_core/dg2/gfx_core_helper_tests_dg2.cpp b/shared/test/unit_test/xe_hpg_core/dg2/gfx_core_helper_tests_dg2.cpp index 5ae2937770..322c0fd86c 100644 --- a/shared/test/unit_test/xe_hpg_core/dg2/gfx_core_helper_tests_dg2.cpp +++ b/shared/test/unit_test/xe_hpg_core/dg2/gfx_core_helper_tests_dg2.cpp @@ -101,7 +101,7 @@ DG2TEST_F(GfxCoreHelperTests, givenAllocationTypeInternalHeapWhenSetExtraAllocat constexpr DeviceBitfield singleTileBitfield = 0b0100; - const AllocationProperties singleTileAllocProperties(0, 1, AllocationType::INTERNAL_HEAP, singleTileBitfield); + const AllocationProperties singleTileAllocProperties(0, 1, AllocationType::internalHeap, singleTileBitfield); AllocationData allocData; allocData.flags.useSystemMemory = false; diff --git a/shared/test/unit_test/xe_hpg_core/dg2/memory_manager_tests_dg2.cpp b/shared/test/unit_test/xe_hpg_core/dg2/memory_manager_tests_dg2.cpp index a64aa9a670..f076c51264 100644 --- a/shared/test/unit_test/xe_hpg_core/dg2/memory_manager_tests_dg2.cpp +++ b/shared/test/unit_test/xe_hpg_core/dg2/memory_manager_tests_dg2.cpp @@ -34,7 +34,7 @@ DG2TEST_F(MemoryManagerTestsDg2, givenEnabledLocalMemoryWhenLinearStreamIsAlloca MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::LINEAR_STREAM, mockDeviceBitfield}, nullptr); + auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::linearStream, mockDeviceBitfield}, nullptr); EXPECT_NE(MemoryPool::LocalMemory, allocation->getMemoryPool()); EXPECT_FALSE(memoryManager.allocationInDevicePoolCreated); @@ -44,7 +44,7 @@ DG2TEST_F(MemoryManagerTestsDg2, givenEnabledLocalMemoryWhenLinearStreamIsAlloca DG2TEST_F(MemoryManagerTestsDg2, givenLinearStreamTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::LINEAR_STREAM, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::linearStream, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -53,7 +53,7 @@ DG2TEST_F(MemoryManagerTestsDg2, givenLinearStreamTypeWhenGetAllocationDataIsCal DG2TEST_F(MemoryManagerTestsDg2, givenLinearStreamWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::LINEAR_STREAM, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::linearStream, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -63,7 +63,7 @@ DG2TEST_F(MemoryManagerTestsDg2, givenEnabledLocalMemoryWhenAllocateInternalHeap MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::KERNEL_ISA, mockDeviceBitfield}, nullptr); + auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::kernelIsa, mockDeviceBitfield}, nullptr); EXPECT_NE(MemoryPool::LocalMemory, allocation->getMemoryPool()); EXPECT_FALSE(memoryManager.allocationInDevicePoolCreated); @@ -73,7 +73,7 @@ DG2TEST_F(MemoryManagerTestsDg2, givenEnabledLocalMemoryWhenAllocateInternalHeap DG2TEST_F(MemoryManagerTestsDg2, givenKernelIsaTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::KERNEL_ISA, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::kernelIsa, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); } @@ -81,7 +81,7 @@ DG2TEST_F(MemoryManagerTestsDg2, givenKernelIsaTypeWhenGetAllocationDataIsCalled DG2TEST_F(MemoryManagerTestsDg2, givenRingBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{0, 0x10000u, AllocationType::RING_BUFFER, 1}; + AllocationProperties properties{0, 0x10000u, AllocationType::ringBuffer, 1}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.allocateMemory); @@ -95,7 +95,7 @@ DG2TEST_F(MemoryManagerTestsDg2, givenRingBufferAllocationWhenGetAllocationDataI DG2TEST_F(MemoryManagerTestsDg2, givenSemaphoreBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{0, 0x1000u, AllocationType::SEMAPHORE_BUFFER, 1}; + AllocationProperties properties{0, 0x1000u, AllocationType::semaphoreBuffer, 1}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.allocateMemory); @@ -109,7 +109,7 @@ DG2TEST_F(MemoryManagerTestsDg2, givenSemaphoreBufferAllocationWhenGetAllocation DG2TEST_F(MemoryManagerTestsDg2, givenConstantSurfaceTypeWhenGetAllocationDataIsCalledThenLocalMemoryIsRequestedWithoutCpuAccess) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::CONSTANT_SURFACE, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::constantSurface, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_FALSE(allocData.flags.requiresCpuAccess); @@ -118,7 +118,7 @@ DG2TEST_F(MemoryManagerTestsDg2, givenConstantSurfaceTypeWhenGetAllocationDataIs DG2TEST_F(MemoryManagerTestsDg2, givenPrintfAllocationWhenGetAllocationDataIsCalledThenUseSystemMemoryAndRequireCpuAccess) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::PRINTF_SURFACE, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::printfSurface, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -127,7 +127,7 @@ DG2TEST_F(MemoryManagerTestsDg2, givenPrintfAllocationWhenGetAllocationDataIsCal DG2TEST_F(MemoryManagerTestsDg2, givenGpuTimestampTagBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::gpuTimestampDeviceBuffer, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); } diff --git a/shared/test/unit_test/xe_hpg_core/dg2/windows/wddm_memory_manager_tests_dg2.cpp b/shared/test/unit_test/xe_hpg_core/dg2/windows/wddm_memory_manager_tests_dg2.cpp index 884fd984ff..eaed79bc16 100644 --- a/shared/test/unit_test/xe_hpg_core/dg2/windows/wddm_memory_manager_tests_dg2.cpp +++ b/shared/test/unit_test/xe_hpg_core/dg2/windows/wddm_memory_manager_tests_dg2.cpp @@ -39,11 +39,11 @@ DG2TEST_F(Dg2WddmTest, givenG10A0WhenGettingLocalMemoryAccessModeThenCorrectValu MockWddmMemoryManager memoryManager = MockWddmMemoryManager(false, true, executionEnvironment); - auto graphicsAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, 4096u, AllocationType::LINEAR_STREAM, mockDeviceBitfield}); + auto graphicsAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, 4096u, AllocationType::linearStream, mockDeviceBitfield}); ASSERT_NE(nullptr, graphicsAllocation); EXPECT_NE(nullptr, graphicsAllocation->getUnderlyingBuffer()); - EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::LINEAR_STREAM); + EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::linearStream); auto gpuAddress = graphicsAllocation->getGpuAddress(); auto gpuAddressEnd = gpuAddress + 4096u; auto gmmHelper = memoryManager.getGmmHelper(graphicsAllocation->getRootDeviceIndex()); @@ -73,11 +73,11 @@ DG2TEST_F(Dg2WddmTest, givenG10B0WhenGettingLocalMemoryAccessModeThenCorrectValu rootDeviceEnvironment->getMutableHardwareInfo()->platform.usDeviceID = dg2G10DeviceIds[0]; MockWddmMemoryManager memoryManager = MockWddmMemoryManager(false, true, executionEnvironment); - auto graphicsAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, 4096u, AllocationType::LINEAR_STREAM, mockDeviceBitfield}); + auto graphicsAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, 4096u, AllocationType::linearStream, mockDeviceBitfield}); ASSERT_NE(nullptr, graphicsAllocation); EXPECT_NE(nullptr, graphicsAllocation->getUnderlyingBuffer()); - EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::LINEAR_STREAM); + EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::linearStream); auto gpuAddress = graphicsAllocation->getGpuAddress(); auto gpuAddressEnd = gpuAddress + 4096u; auto gmmHelper = memoryManager.getGmmHelper(graphicsAllocation->getRootDeviceIndex()); @@ -112,11 +112,11 @@ DG2TEST_F(Dg2WddmTest, givenG11WhenGettingLocalMemoryAccessModeThenCorrectValueI rootDeviceEnvironment->getMutableHardwareInfo()->platform.usDeviceID = dg2G11DeviceIds[0]; MockWddmMemoryManager memoryManager = MockWddmMemoryManager(false, true, executionEnvironment); - auto graphicsAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, 4096u, AllocationType::LINEAR_STREAM, mockDeviceBitfield}); + auto graphicsAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, 4096u, AllocationType::linearStream, mockDeviceBitfield}); ASSERT_NE(nullptr, graphicsAllocation); EXPECT_NE(nullptr, graphicsAllocation->getUnderlyingBuffer()); - EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::LINEAR_STREAM); + EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::linearStream); auto gpuAddress = graphicsAllocation->getGpuAddress(); auto gpuAddressEnd = gpuAddress + 4096u; auto gmmHelper = memoryManager.getGmmHelper(graphicsAllocation->getRootDeviceIndex()); @@ -151,11 +151,11 @@ DG2TEST_F(Dg2WddmTest, givenG12WhenGettingLocalMemoryAccessModeThenCorrectValueI rootDeviceEnvironment->getMutableHardwareInfo()->platform.usDeviceID = dg2G12DeviceIds[0]; MockWddmMemoryManager memoryManager = MockWddmMemoryManager(false, true, executionEnvironment); - auto graphicsAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, 4096u, AllocationType::LINEAR_STREAM, mockDeviceBitfield}); + auto graphicsAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, 4096u, AllocationType::linearStream, mockDeviceBitfield}); ASSERT_NE(nullptr, graphicsAllocation); EXPECT_NE(nullptr, graphicsAllocation->getUnderlyingBuffer()); - EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::LINEAR_STREAM); + EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::linearStream); auto gpuAddress = graphicsAllocation->getGpuAddress(); auto gpuAddressEnd = gpuAddress + 4096u; auto gmmHelper = memoryManager.getGmmHelper(graphicsAllocation->getRootDeviceIndex()); diff --git a/shared/test/unit_test/xe_hpg_core/gfx_core_helper_tests_xe_hpg_core.cpp b/shared/test/unit_test/xe_hpg_core/gfx_core_helper_tests_xe_hpg_core.cpp index 0036f8e8e0..1f291e327a 100644 --- a/shared/test/unit_test/xe_hpg_core/gfx_core_helper_tests_xe_hpg_core.cpp +++ b/shared/test/unit_test/xe_hpg_core/gfx_core_helper_tests_xe_hpg_core.cpp @@ -101,7 +101,7 @@ XE_HPG_CORETEST_F(LriHelperTestsXeHpgCore, whenProgrammingLriCommandThenExpectMm XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, givenAllocDataWhenSetExtraAllocationDataThenSetLocalMemForProperTypes) { auto &gfxCoreHelper = getHelper(); - for (int type = 0; type < static_cast(AllocationType::COUNT); type++) { + for (int type = 0; type < static_cast(AllocationType::count); type++) { AllocationProperties allocProperties(0, 1, static_cast(type), {}); AllocationData allocData{}; allocData.flags.useSystemMemory = true; @@ -110,9 +110,9 @@ XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, givenAllocDataWhenSetExtraAllocati gfxCoreHelper.setExtraAllocationData(allocData, allocProperties, pDevice->getRootDeviceEnvironment()); if (defaultHwInfo->featureTable.flags.ftrLocalMemory && - (allocProperties.allocationType == AllocationType::COMMAND_BUFFER || - allocProperties.allocationType == AllocationType::RING_BUFFER || - allocProperties.allocationType == AllocationType::SEMAPHORE_BUFFER)) { + (allocProperties.allocationType == AllocationType::commandBuffer || + allocProperties.allocationType == AllocationType::ringBuffer || + allocProperties.allocationType == AllocationType::semaphoreBuffer)) { EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); } else { diff --git a/shared/test/unit_test/xe_hpg_core/mtl/product_helper_tests_mtl.cpp b/shared/test/unit_test/xe_hpg_core/mtl/product_helper_tests_mtl.cpp index f870d0fec5..6cf431c414 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/product_helper_tests_mtl.cpp +++ b/shared/test/unit_test/xe_hpg_core/mtl/product_helper_tests_mtl.cpp @@ -87,9 +87,9 @@ MTLTEST_F(MtlProductHelper, givenMtlWithoutHwIpVersionInHwInfoWhenGettingIpVersi MTLTEST_F(MtlProductHelper, givenProductHelperWhenCheckOverrideAllocationCacheableThenTrueIsReturnedForCommandBuffer) { AllocationData allocationData{}; - allocationData.type = AllocationType::COMMAND_BUFFER; + allocationData.type = AllocationType::commandBuffer; EXPECT_TRUE(productHelper->overrideAllocationCacheable(allocationData)); - allocationData.type = AllocationType::BUFFER; + allocationData.type = AllocationType::buffer; EXPECT_FALSE(productHelper->overrideAllocationCacheable(allocationData)); } diff --git a/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp b/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp index d2c1e1ccb9..a5a3f9fbd2 100644 --- a/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp +++ b/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp @@ -302,7 +302,7 @@ HWTEST2_F(XeLpgProductHelperTests, whenCheckFp64SupportThenReturnTrue, IsXeLpg) } HWTEST2_F(XeLpgProductHelperTests, givenAllocationThenCheckResourceCompatibilityReturnsTrue, IsXeLpg) { - auto allocation = std::make_unique(0, AllocationType::BUFFER, nullptr, 0u, 0, MemoryPool::MemoryNull, 3u, 0llu); + auto allocation = std::make_unique(0, AllocationType::buffer, nullptr, 0u, 0, MemoryPool::MemoryNull, 3u, 0llu); EXPECT_TRUE(gfxCoreHelper->checkResourceCompatibility(*allocation)); }