From 4b0d9868767b784ae3671b44a21f5316ec9707ee Mon Sep 17 00:00:00 2001 From: Bartosz Dunajski Date: Fri, 4 Feb 2022 13:59:01 +0000 Subject: [PATCH] Move AllocationType enum out of GraphicsAllocation class Signed-off-by: Bartosz Dunajski --- level_zero/core/source/cmdlist/cmdlist.cpp | 10 +- level_zero/core/source/cmdlist/cmdlist_hw.inl | 6 +- level_zero/core/source/cmdqueue/cmdqueue.cpp | 6 +- .../core/source/context/context_imp.cpp | 2 +- .../core/source/debugger/debugger_l0.cpp | 4 +- level_zero/core/source/device/device.h | 2 +- level_zero/core/source/device/device_imp.cpp | 8 +- level_zero/core/source/device/device_imp.h | 2 +- .../core/source/driver/driver_handle_imp.cpp | 4 +- .../source/driver/host_pointer_manager.cpp | 4 +- level_zero/core/source/event/event.cpp | 6 +- level_zero/core/source/image/image_hw.inl | 6 +- level_zero/core/source/kernel/kernel_imp.cpp | 6 +- .../compression_selector_l0.cpp | 4 +- .../source/printf_handler/printf_handler.cpp | 4 +- .../unit_tests/fixtures/memory_ipc_fixture.h | 8 +- .../test/unit_tests/fixtures/module_fixture.h | 8 +- .../test/unit_tests/mocks/mock_cmdlist.cpp | 4 +- .../core/test/unit_tests/mocks/mock_device.h | 2 +- .../core/test/unit_tests/mocks/mock_event.cpp | 4 +- .../core/test/unit_tests/mocks/mock_kernel.h | 2 +- .../sources/cmdlist/test_cmdlist_2.cpp | 48 +-- .../sources/cmdlist/test_cmdlist_4.cpp | 4 +- .../sources/cmdlist/test_cmdlist_5.cpp | 4 +- .../sources/cmdlist/test_cmdlist_blit.cpp | 14 +- .../sources/cmdqueue/test_cmdqueue_1.cpp | 12 +- .../sources/cmdqueue/test_cmdqueue_2.cpp | 8 +- .../debugger/linux/test_l0_debugger_linux.cpp | 8 +- .../sources/debugger/test_l0_debugger_1.cpp | 16 +- .../debugger/test_module_with_debug.cpp | 2 +- .../debugger/test_source_level_debugger.cpp | 4 +- .../unit_tests/sources/device/test_device.cpp | 18 +- .../driver/host_pointer_manager_tests.cpp | 4 +- .../unit_tests/sources/driver/test_driver.cpp | 2 +- .../unit_tests/sources/event/test_event.cpp | 6 +- .../sources/helper/heap_assigner_l0_tests.cpp | 14 +- .../unit_tests/sources/image/test_image.cpp | 6 +- .../unit_tests/sources/kernel/test_kernel.cpp | 14 +- .../compression_selector_l0_tests.cpp | 12 +- .../unit_tests/sources/module/test_module.cpp | 20 +- .../printf_handler/test_printf_handler.cpp | 4 +- .../tools/source/metrics/metric_query_imp.cpp | 2 +- .../command_queue/enqueue_fill_buffer.h | 6 +- opencl/source/command_queue/enqueue_svm.h | 6 +- opencl/source/kernel/kernel.cpp | 10 +- opencl/source/mem_obj/buffer.cpp | 24 +- opencl/source/mem_obj/buffer.h | 6 +- opencl/source/mem_obj/image.cpp | 6 +- opencl/source/mem_obj/mem_obj.cpp | 2 +- opencl/source/mem_obj/mem_obj.h | 4 +- opencl/source/mem_obj/mem_obj_helper.cpp | 4 +- opencl/source/mem_obj/pipe.cpp | 4 +- .../compression_selector_ocl.cpp | 10 +- .../memory_manager/migration_controller.cpp | 6 +- opencl/source/program/printf_handler.cpp | 2 +- opencl/source/sharings/d3d/d3d_buffer.h | 4 +- opencl/source/sharings/d3d/d3d_surface.cpp | 6 +- opencl/source/sharings/d3d/d3d_texture.cpp | 10 +- .../sharings/gl/windows/gl_buffer_windows.cpp | 4 +- .../gl/windows/gl_texture_windows.cpp | 6 +- .../sharings/unified/unified_buffer.cpp | 4 +- .../source/sharings/unified/unified_image.cpp | 4 +- .../sharings/unified/unified_sharing.cpp | 6 +- .../source/sharings/unified/unified_sharing.h | 4 +- opencl/source/sharings/va/va_surface.cpp | 4 +- .../api/cl_unified_shared_memory_tests.inl | 14 +- .../aub_mem_dump/aub_alloc_dump_tests.cpp | 24 +- .../aub_multicontext_tests_xehp_and_later.cpp | 2 +- .../compression_aub_tests_xehp_and_later.cpp | 2 +- .../enqueue_read_buffer_aub_tests.cpp | 4 +- .../command_stream/aub_mi_atomic_tests.cpp | 6 +- ..._walker_partition_tests_xehp_and_later.cpp | 2 +- .../mi_math_aub_tests_dg2_and_later.cpp | 2 +- .../aub_tests/fixtures/aub_fixture.cpp | 4 +- .../aub_tests/fixtures/simple_arg_fixture.h | 4 +- ...tateless_compression_in_sba_xe_hp_core.cpp | 12 +- ...ateless_compression_in_sba_xe_hpg_core.cpp | 12 +- .../command_queue/blit_enqueue_tests.cpp | 12 +- .../command_queue/command_queue_tests.cpp | 12 +- .../command_queue/dispatch_walker_tests.cpp | 6 +- .../enqueue_command_without_kernel_tests.cpp | 2 +- ...and_without_kernel_tests_dg2_and_later.cpp | 2 +- .../enqueue_fill_buffer_tests.cpp | 2 +- .../command_queue/enqueue_kernel_1_tests.cpp | 8 +- .../enqueue_read_buffer_tests.cpp | 4 +- .../enqueue_read_image_tests.cpp | 2 +- .../command_queue/enqueue_svm_tests.cpp | 6 +- .../cl_command_stream_receiver_tests.cpp | 6 +- ...and_stream_receiver_flush_task_2_tests.cpp | 6 +- ...and_stream_receiver_flush_task_3_tests.cpp | 2 +- .../command_stream_receiver_hw_2_tests.cpp | 4 +- ...stream_receiver_hw_tests_dg2_and_later.cpp | 6 +- ...tream_receiver_hw_tests_xehp_and_later.cpp | 10 +- .../experimental_command_buffer_tests.cpp | 6 +- .../test/unit_test/d3d_sharing/d3d9_tests.cpp | 6 +- .../unit_test/d3d_sharing/d3d_tests_part2.cpp | 6 +- .../unit_test/event/event_builder_tests.cpp | 4 +- opencl/test/unit_test/event/event_tests.cpp | 10 +- .../unit_test/fixtures/d3d_test_fixture.h | 6 +- .../gen12lp/buffer_tests_gen12lp.inl | 4 +- .../gen12lp/coherency_tests_gen12lp.inl | 4 +- .../gen12lp/dg1/hw_helper_tests_dg1.cpp | 4 +- .../gen12lp/hw_helper_tests_gen12lp.inl | 28 +- .../gen12lp/tgllp/buffer_tests_tgllp.cpp | 4 +- opencl/test/unit_test/gtpin/gtpin_tests.cpp | 6 +- .../hardware_commands_helper_tests.cpp | 8 +- .../helpers/heap_assigner_ocl_tests.cpp | 4 +- .../unit_test/helpers/hw_helper_tests.cpp | 16 +- .../memory_properties_helpers_tests.cpp | 6 +- .../helpers/task_information_tests.cpp | 12 +- .../helpers/test_preamble_xehp_and_later.cpp | 8 +- .../unit_test/kernel/cache_flush_tests.inl | 8 +- .../cache_flush_xehp_and_later_tests.inl | 8 +- .../kernel/kernel_arg_buffer_tests.cpp | 52 +-- opencl/test/unit_test/kernel/kernel_tests.cpp | 10 +- .../test/unit_test/mem_obj/buffer_tests.cpp | 66 ++-- .../create_image_in_local_memory_tests.cpp | 2 +- .../mem_obj/image2d_from_buffer_tests.cpp | 4 +- .../image_release_mapped_ptr_tests.cpp | 4 +- opencl/test/unit_test/mem_obj/image_tests.cpp | 2 +- .../mem_obj/mem_obj_destruction_tests.cpp | 8 +- .../internal_allocation_storage_tests.cpp | 38 +-- ..._manager_allocate_in_device_pool_tests.cpp | 58 ++-- ...nager_allocate_in_preferred_pool_tests.cpp | 298 +++++++++--------- .../memory_manager_multi_device_tests.cpp | 8 +- .../memory_manager/memory_manager_tests.cpp | 198 ++++++------ .../memory_manager/storage_info_tests.cpp | 86 ++--- .../unified_memory_manager_tests.cpp | 22 +- .../linux/drm_memory_manager_mt_tests.cpp | 6 +- .../linux/drm_command_stream_mm_tests.cpp | 6 +- .../linux/drm_command_stream_tests_1.cpp | 20 +- .../linux/drm_command_stream_tests_2.cpp | 24 +- ...rm_command_stream_xehp_and_later_tests.cpp | 6 +- .../linux/drm_gem_close_worker_tests.cpp | 4 +- .../drm_memory_manager_localmem_tests.cpp | 74 ++--- .../linux/drm_memory_manager_tests.cpp | 288 ++++++++--------- .../linux/file_logger_linux_tests.cpp | 10 +- .../linux/ioctl_helper_tests_prelim.cpp | 6 +- .../windows/device_command_stream_tests.cpp | 10 +- .../windows/file_logger_win_tests.cpp | 6 +- .../windows/mock_wddm_allocation.h | 4 +- .../os_interface/windows/wddm20_tests.cpp | 28 +- ..._manager_allocate_in_device_pool_tests.cpp | 38 +-- .../windows/wddm_memory_manager_tests.cpp | 104 +++--- .../wddm_residency_controller_tests.cpp | 18 +- .../unit_test/program/kernel_info_tests.cpp | 4 +- .../test/unit_test/program/program_tests.cpp | 8 +- .../windows/gl_create_from_texture_tests.cpp | 4 +- .../sharings/gl/windows/gl_sharing_tests.cpp | 4 +- .../unified/unified_sharing_fixtures.h | 6 +- .../unified/unified_sharing_image_tests.cpp | 6 +- .../unified/unified_sharing_tests.cpp | 10 +- .../unit_test/utilities/file_logger_tests.cpp | 96 +++--- .../utilities/tag_allocator_tests.cpp | 10 +- .../copy_engine_tests_xe_hp_core.cpp | 2 +- .../xe_hp_core/hw_helper_tests_xe_hp_core.cpp | 4 +- .../xehp/memory_manager_tests_xehp.inl | 4 +- .../hw_helper_tests_xe_hpc_core.cpp | 30 +- .../test_cmds_programming_xe_hpc_core.cpp | 8 +- .../dg2/memory_manager_tests_dg2.cpp | 22 +- .../dg2/test_cmds_programming_dg2.cpp | 8 +- .../test_cmds_programming_xe_hpg_core.cpp | 8 +- shared/source/aub/aub_helper.h | 34 +- shared/source/aub_mem_dump/aub_alloc_dump.h | 14 +- shared/source/built_ins/built_ins.cpp | 4 +- shared/source/built_ins/sip.cpp | 6 +- .../source/command_container/cmdcontainer.cpp | 6 +- .../command_encoder_xehp_and_later.inl | 2 +- .../aub_command_stream_receiver_hw_base.inl | 2 +- .../command_stream_receiver.cpp | 20 +- .../command_stream_receiver_simulated_hw.h | 4 +- .../experimental_command_buffer.cpp | 6 +- .../scratch_space_controller_base.cpp | 2 +- ...cratch_space_controller_xehp_and_later.cpp | 4 +- shared/source/device/device.cpp | 2 +- .../direct_submission_hw.inl | 6 +- .../gen12lp/command_encoder_gen12lp.cpp | 2 +- shared/source/gen12lp/hw_helper_gen12lp.cpp | 2 +- shared/source/helpers/app_resource_helper.cpp | 94 +++--- shared/source/helpers/app_resource_helper.h | 6 +- .../source/helpers/bindless_heaps_helper.cpp | 4 +- .../extra_allocation_data_xehp_and_later.inl | 20 +- .../helpers/flat_batch_buffer_helper_hw.inl | 6 +- shared/source/helpers/heap_assigner.cpp | 14 +- shared/source/helpers/heap_assigner.h | 10 +- shared/source/helpers/heap_helper.cpp | 6 +- .../helpers/memory_properties_helpers.h | 2 +- .../memory_properties_helpers_base.inl | 2 +- shared/source/helpers/timestamp_packet.h | 6 +- shared/source/memory_manager/CMakeLists.txt | 3 +- .../memory_manager/allocation_properties.h | 12 +- .../source/memory_manager/allocation_type.h | 59 ++++ .../memory_manager/allocations_list.cpp | 6 +- .../source/memory_manager/allocations_list.h | 4 +- .../definitions/storage_info.cpp | 30 +- .../memory_manager/graphics_allocation.h | 56 +--- .../internal_allocation_storage.cpp | 6 +- .../internal_allocation_storage.h | 6 +- .../source/memory_manager/memory_manager.cpp | 210 ++++++------ shared/source/memory_manager/memory_manager.h | 20 +- .../multi_graphics_allocation.cpp | 4 +- .../multi_graphics_allocation.h | 4 +- .../os_agnostic_memory_manager.cpp | 20 +- .../os_agnostic_memory_manager.h | 4 +- .../memory_manager/unified_memory_manager.cpp | 22 +- .../memory_manager/unified_memory_manager.h | 2 +- .../os_interface/linux/drm_allocation.cpp | 8 +- .../os_interface/linux/drm_memory_manager.cpp | 42 +-- .../os_interface/linux/drm_memory_manager.h | 4 +- .../windows/wddm_device_command_stream.inl | 6 +- .../windows/wddm_memory_manager.cpp | 32 +- .../windows/wddm_memory_manager.h | 4 +- shared/source/program/kernel_info.cpp | 2 +- .../source/program/program_initialization.cpp | 4 +- shared/source/program/sync_buffer_handler.cpp | 2 +- shared/source/utilities/hw_timestamps.h | 6 +- shared/source/utilities/logger.cpp | 90 +++--- shared/source/utilities/perf_counter.h | 6 +- .../utilities/software_tags_manager.cpp | 6 +- .../command_stream_receiver_hw_xe_hp_core.cpp | 2 +- .../xe_hpc_core/hw_helper_xe_hpc_core.cpp | 4 +- .../debug_settings_manager_tests.cpp | 4 +- .../fixtures/direct_submission_fixture.h | 4 +- .../helpers/blit_commands_helper_tests.cpp | 12 +- .../helpers/blit_commands_helper_tests.inl | 4 +- .../blit_commands_helper_tests_gen12lp.cpp | 16 +- ...est_blit_commands_helper_pvc_and_later.cpp | 18 +- ...st_blit_commands_helper_xehp_and_later.cpp | 90 +++--- .../libult/ult_command_stream_receiver.h | 2 +- .../mocks/linux/mock_drm_memory_manager.cpp | 4 +- .../mocks/linux/mock_drm_memory_manager.h | 2 +- .../common/mocks/mock_allocation_properties.h | 14 +- shared/test/common/mocks/mock_gmm.h | 4 +- .../test/common/mocks/mock_memory_manager.cpp | 2 +- .../test/common/mocks/mock_memory_manager.h | 4 +- shared/test/common/mocks/mock_sip.cpp | 4 +- .../windows/mock_wddm_memory_manager.h | 4 +- .../xe_hpc_core/test_encode_xe_hpc_core.cpp | 14 +- .../command_container_tests.cpp | 10 +- .../command_encoder_tests.cpp | 2 +- ...nd_encoder_tests_xe_hpg_core_and_later.cpp | 4 +- .../aub_command_stream_receiver_1_tests.cpp | 38 +-- .../aub_command_stream_receiver_2_tests.cpp | 6 +- .../aub_command_stream_receiver_3_tests.cpp | 24 +- .../command_stream/aub_file_stream_tests.cpp | 2 +- ...ommand_stream_receiver_simulated_tests.cpp | 34 +- .../command_stream_receiver_tests.cpp | 34 +- .../command_stream/compute_mode_tests.h | 2 +- .../tbx_command_stream_tests.cpp | 22 +- .../unit_test/device/neo_device_tests.cpp | 2 +- .../windows/wddm_direct_submission_tests.cpp | 2 +- .../command_encoder_tests_xehp_and_later.cpp | 2 +- .../unit_test/encoders/test_encode_states.cpp | 2 +- .../heap_assigner/heap_assigner_tests.cpp | 20 +- .../unit_test/helpers/app_resource_tests.cpp | 102 +++--- .../graphics_allocation_tests.cpp | 54 ++-- .../multi_graphics_allocation_tests.cpp | 24 +- .../special_heap_pool_tests.cpp | 4 +- .../os_interface/linux/drm_query_tests.cpp | 2 +- .../program/program_initialization_tests.cpp | 20 +- .../utilities/software_tags_manager_tests.cpp | 4 +- ...nd_stream_receiver_2_tests_xe_hpc_core.cpp | 4 +- 262 files changed, 2075 insertions(+), 2063 deletions(-) create mode 100644 shared/source/memory_manager/allocation_type.h diff --git a/level_zero/core/source/cmdlist/cmdlist.cpp b/level_zero/core/source/cmdlist/cmdlist.cpp index 647621faa2..6b4e5e30a0 100644 --- a/level_zero/core/source/cmdlist/cmdlist.cpp +++ b/level_zero/core/source/cmdlist/cmdlist.cpp @@ -61,7 +61,7 @@ NEO::GraphicsAllocation *CommandList::getAllocationFromHostPtrMap(const void *bu } } if (this->cmdListType == CommandListType::TYPE_IMMEDIATE && this->isFlushTaskSubmissionEnabled) { - auto allocation = this->csr->getInternalAllocationStorage()->obtainTemporaryAllocationWithPtr(bufferSize, buffer, NEO::GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR); + auto allocation = this->csr->getInternalAllocationStorage()->obtainTemporaryAllocationWithPtr(bufferSize, buffer, NEO::AllocationType::EXTERNAL_HOST_PTR); if (allocation != nullptr) { auto alloc = allocation.get(); this->csr->getInternalAllocationStorage()->storeAllocation(std::move(allocation), NEO::AllocationUsage::TEMPORARY_ALLOCATION); @@ -97,8 +97,8 @@ void CommandList::removeDeallocationContainerData() { if (allocData) { device->getDriverHandle()->getSvmAllocsManager()->removeSVMAlloc(*allocData); } - if (!((deallocation->getAllocationType() == NEO::GraphicsAllocation::AllocationType::INTERNAL_HEAP) || - (deallocation->getAllocationType() == NEO::GraphicsAllocation::AllocationType::LINEAR_STREAM))) { + if (!((deallocation->getAllocationType() == NEO::AllocationType::INTERNAL_HEAP) || + (deallocation->getAllocationType() == NEO::AllocationType::LINEAR_STREAM))) { memoryManager->freeGraphicsMemory(deallocation); eraseDeallocationContainerEntry(deallocation); } @@ -141,8 +141,8 @@ void CommandList::makeResidentAndMigrate(bool performMigration) { csr->makeResident(*alloc); if (performMigration && - (alloc->getAllocationType() == NEO::GraphicsAllocation::AllocationType::SVM_GPU || - alloc->getAllocationType() == NEO::GraphicsAllocation::AllocationType::SVM_CPU)) { + (alloc->getAllocationType() == NEO::AllocationType::SVM_GPU || + alloc->getAllocationType() == NEO::AllocationType::SVM_CPU)) { auto pageFaultManager = device->getDriverHandle()->getMemoryManager()->getPageFaultManager(); pageFaultManager->moveAllocationToGpuDomain(reinterpret_cast(alloc->getGpuAddress())); } diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index b050365fc7..52be139eeb 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -1512,11 +1512,11 @@ ze_result_t CommandListCoreFamily::appendMemoryFill(void *ptr, size_t patternAllocationSize = alignUp(patternSize, MemoryConstants::cacheLineSize); uint32_t patternSizeInEls = static_cast(patternAllocationSize / middleElSize); - auto patternGfxAlloc = device->obtainReusableAllocation(patternAllocationSize, NEO::GraphicsAllocation::AllocationType::FILL_PATTERN); + auto patternGfxAlloc = device->obtainReusableAllocation(patternAllocationSize, NEO::AllocationType::FILL_PATTERN); if (patternGfxAlloc == nullptr) { patternGfxAlloc = device->getDriverHandle()->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getNEODevice()->getRootDeviceIndex(), patternAllocationSize, - NEO::GraphicsAllocation::AllocationType::FILL_PATTERN, + NEO::AllocationType::FILL_PATTERN, device->getNEODevice()->getDeviceBitfield()}); } void *patternGfxAllocPtr = patternGfxAlloc->getUnderlyingBuffer(); @@ -2106,7 +2106,7 @@ ze_result_t CommandListCoreFamily::appendQueryKernelTimestamps( } size_t alignedSize = alignUp(sizeof(EventData) * numEvents, MemoryConstants::pageSize64k); - NEO::GraphicsAllocation::AllocationType allocationType = NEO::GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER; + NEO::AllocationType allocationType = NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER; auto devices = device->getNEODevice()->getDeviceBitfield(); NEO::AllocationProperties allocationProperties{device->getRootDeviceIndex(), true, diff --git a/level_zero/core/source/cmdqueue/cmdqueue.cpp b/level_zero/core/source/cmdqueue/cmdqueue.cpp index 0a05b740da..bdf945b081 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue.cpp +++ b/level_zero/core/source/cmdqueue/cmdqueue.cpp @@ -185,17 +185,17 @@ ze_command_queue_mode_t CommandQueueImp::getSynchronousMode() const { 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::GraphicsAllocation::AllocationType::COMMAND_BUFFER, + NEO::AllocationType::COMMAND_BUFFER, (device->getNEODevice()->getNumGenericSubDevices() > 1u) /* multiOsContextCapable */, false, device->getNEODevice()->getDeviceBitfield()}; - auto firstBuffer = device->obtainReusableAllocation(alignedSize, NEO::GraphicsAllocation::AllocationType::COMMAND_BUFFER); + auto firstBuffer = device->obtainReusableAllocation(alignedSize, NEO::AllocationType::COMMAND_BUFFER); if (!firstBuffer) { firstBuffer = device->getNEODevice()->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); } - auto secondBuffer = device->obtainReusableAllocation(alignedSize, NEO::GraphicsAllocation::AllocationType::COMMAND_BUFFER); + auto secondBuffer = device->obtainReusableAllocation(alignedSize, NEO::AllocationType::COMMAND_BUFFER); if (!secondBuffer) { secondBuffer = device->getNEODevice()->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); } diff --git a/level_zero/core/source/context/context_imp.cpp b/level_zero/core/source/context/context_imp.cpp index 0b6db13e43..3b6bf9b3c2 100644 --- a/level_zero/core/source/context/context_imp.cpp +++ b/level_zero/core/source/context/context_imp.cpp @@ -485,7 +485,7 @@ ze_result_t ContextImp::openEventPoolIpcHandle(ze_ipc_event_pool_handle_t hIpc, size_t alignedSize = alignUp(numEvents * eventSize, MemoryConstants::pageSize64k); NEO::AllocationProperties unifiedMemoryProperties{rootDeviceIndex, alignedSize, - NEO::GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, + NEO::AllocationType::BUFFER_HOST_MEMORY, systemMemoryBitfield}; unifiedMemoryProperties.subDevicesBitfield = neoDevice->getDeviceBitfield(); diff --git a/level_zero/core/source/debugger/debugger_l0.cpp b/level_zero/core/source/debugger/debugger_l0.cpp index 839ba27c9d..82038a9718 100644 --- a/level_zero/core/source/debugger/debugger_l0.cpp +++ b/level_zero/core/source/debugger/debugger_l0.cpp @@ -33,7 +33,7 @@ void DebuggerL0::initialize() { sbaTrackingGpuVa = device->getMemoryManager()->reserveGpuAddress(MemoryConstants::pageSize, device->getRootDeviceIndex()); NEO::AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize, - NEO::GraphicsAllocation::AllocationType::DEBUG_SBA_TRACKING_BUFFER, + NEO::AllocationType::DEBUG_SBA_TRACKING_BUFFER, false, device->getDeviceBitfield()}; @@ -55,7 +55,7 @@ void DebuggerL0::initialize() { auto &hwInfo = device->getHardwareInfo(); auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily); NEO::AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize64k, - NEO::GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA, + NEO::AllocationType::DEBUG_MODULE_AREA, false, device->getDeviceBitfield()}; moduleDebugArea = device->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); diff --git a/level_zero/core/source/device/device.h b/level_zero/core/source/device/device.h index fac45b377a..65422bc68c 100644 --- a/level_zero/core/source/device/device.h +++ b/level_zero/core/source/device/device.h @@ -144,7 +144,7 @@ struct Device : _ze_device_handle_t { virtual SysmanDevice *getSysmanHandle() = 0; virtual ze_result_t getCsrForOrdinalAndIndex(NEO::CommandStreamReceiver **csr, uint32_t ordinal, uint32_t index) = 0; virtual ze_result_t getCsrForLowPriority(NEO::CommandStreamReceiver **csr) = 0; - virtual NEO::GraphicsAllocation *obtainReusableAllocation(size_t requiredSize, NEO::GraphicsAllocation::AllocationType type) = 0; + virtual NEO::GraphicsAllocation *obtainReusableAllocation(size_t requiredSize, NEO::AllocationType type) = 0; virtual void storeReusableAllocation(NEO::GraphicsAllocation &alloc) = 0; protected: diff --git a/level_zero/core/source/device/device_imp.cpp b/level_zero/core/source/device/device_imp.cpp index 438e7976f8..457128e1b4 100644 --- a/level_zero/core/source/device/device_imp.cpp +++ b/level_zero/core/source/device/device_imp.cpp @@ -845,7 +845,7 @@ Device *Device::create(DriverHandle *driverHandle, NEO::Device *neoDevice, bool debugSurface = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( {device->getRootDeviceIndex(), true, debugSurfaceSize, - NEO::GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA, + NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, device->getNEODevice()->getDeviceBitfield()}); @@ -1009,7 +1009,7 @@ NEO::GraphicsAllocation *DeviceImp::allocateManagedMemoryFromHostPtr(void *buffe } allocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {getRootDeviceIndex(), false, size, NEO::GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, false, neoDevice->getDeviceBitfield()}, + {getRootDeviceIndex(), false, size, NEO::AllocationType::BUFFER_HOST_MEMORY, false, neoDevice->getDeviceBitfield()}, buffer); if (allocation == nullptr) { @@ -1029,7 +1029,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::GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, + NEO::AllocationType::EXTERNAL_HOST_PTR, false, neoDevice->getDeviceBitfield()}; properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = true; auto allocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties, @@ -1044,7 +1044,7 @@ NEO::GraphicsAllocation *DeviceImp::allocateMemoryFromHostPtr(const void *buffer return allocation; } -NEO::GraphicsAllocation *DeviceImp::obtainReusableAllocation(size_t requiredSize, NEO::GraphicsAllocation::AllocationType type) { +NEO::GraphicsAllocation *DeviceImp::obtainReusableAllocation(size_t requiredSize, NEO::AllocationType type) { auto alloc = allocationsForReuse->detachAllocation(requiredSize, nullptr, nullptr, type); if (alloc == nullptr) return nullptr; diff --git a/level_zero/core/source/device/device_imp.h b/level_zero/core/source/device/device_imp.h index 98c84795f0..c3811bed33 100644 --- a/level_zero/core/source/device/device_imp.h +++ b/level_zero/core/source/device/device_imp.h @@ -94,7 +94,7 @@ struct DeviceImp : public Device { SysmanDevice *getSysmanHandle() override; ze_result_t getCsrForOrdinalAndIndex(NEO::CommandStreamReceiver **csr, uint32_t ordinal, uint32_t index) override; ze_result_t getCsrForLowPriority(NEO::CommandStreamReceiver **csr) override; - NEO::GraphicsAllocation *obtainReusableAllocation(size_t requiredSize, NEO::GraphicsAllocation::AllocationType type) override; + NEO::GraphicsAllocation *obtainReusableAllocation(size_t requiredSize, NEO::AllocationType type) override; void storeReusableAllocation(NEO::GraphicsAllocation &alloc) override; NEO::Device *getActiveDevice() const; diff --git a/level_zero/core/source/driver/driver_handle_imp.cpp b/level_zero/core/source/driver/driver_handle_imp.cpp index 4a613c8291..3ea26a8569 100644 --- a/level_zero/core/source/driver/driver_handle_imp.cpp +++ b/level_zero/core/source/driver/driver_handle_imp.cpp @@ -421,7 +421,7 @@ void *DriverHandleImp::importFdHandle(ze_device_handle_t hDevice, ze_ipc_memory_ NEO::osHandle osHandle = static_cast(handle); NEO::AllocationProperties unifiedMemoryProperties{neoDevice->getRootDeviceIndex(), MemoryConstants::pageSize, - NEO::GraphicsAllocation::AllocationType::BUFFER, + NEO::AllocationType::BUFFER, neoDevice->getDeviceBitfield()}; unifiedMemoryProperties.subDevicesBitfield = neoDevice->getDeviceBitfield(); NEO::GraphicsAllocation *alloc = @@ -499,7 +499,7 @@ NEO::GraphicsAllocation *DriverHandleImp::getPeerAllocation(Device *device, void *DriverHandleImp::importNTHandle(ze_device_handle_t hDevice, void *handle) { auto neoDevice = Device::fromHandle(hDevice)->getNEODevice(); - auto alloc = this->getMemoryManager()->createGraphicsAllocationFromNTHandle(handle, neoDevice->getRootDeviceIndex(), NEO::GraphicsAllocation::AllocationType::SHARED_BUFFER); + auto alloc = this->getMemoryManager()->createGraphicsAllocationFromNTHandle(handle, neoDevice->getRootDeviceIndex(), NEO::AllocationType::SHARED_BUFFER); 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 ec55acfadb..72f237340f 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-2021 Intel Corporation + * Copyright (C) 2020-2022 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::GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, + NEO::AllocationType::EXTERNAL_HOST_PTR, 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 edad4271b3..9671363ddd 100644 --- a/level_zero/core/source/event/event.cpp +++ b/level_zero/core/source/event/event.cpp @@ -79,14 +79,14 @@ ze_result_t EventPoolImp::initialize(DriverHandle *driver, Context *context, uin eventSize = static_cast(alignUp(EventPacketsCount::eventPackets * hwHelper.getSingleTimestampPacketSize(), eventAlignment)); size_t alignedSize = alignUp(numEvents * eventSize, MemoryConstants::pageSize64k); - NEO::GraphicsAllocation::AllocationType allocationType = isEventPoolTimestampFlagSet() ? NEO::GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER - : NEO::GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY; + NEO::AllocationType allocationType = isEventPoolTimestampFlagSet() ? NEO::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER + : NEO::AllocationType::BUFFER_HOST_MEMORY; if (this->devices.size() > 1) { useDeviceAlloc = false; } if (useDeviceAlloc && !isEventPoolTimestampFlagSet()) { - allocationType = NEO::GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER; + allocationType = NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER; } eventPoolAllocations = std::make_unique(maxRootDeviceIndex); diff --git a/level_zero/core/source/image/image_hw.inl b/level_zero/core/source/image/image_hw.inl index 2020ff1286..2ddfd64a85 100644 --- a/level_zero/core/source/image/image_hw.inl +++ b/level_zero/core/source/image/image_hw.inl @@ -78,7 +78,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::GraphicsAllocation::AllocationType::SHARED_IMAGE, device->getNEODevice()->getDeviceBitfield()); + NEO::AllocationProperties properties(device->getRootDeviceIndex(), true, imgInfo, NEO::AllocationType::SHARED_IMAGE, device->getNEODevice()->getDeviceBitfield()); allocation = device->getNEODevice()->getMemoryManager()->createGraphicsAllocationFromSharedHandle(lookupTable.sharedHandleType.fd, properties, false, false); device->getNEODevice()->getMemoryManager()->closeSharedHandle(allocation); } else if (lookupTable.sharedHandleType.isNTHandle) { @@ -86,10 +86,10 @@ 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::GraphicsAllocation::AllocationType::SHARED_IMAGE); + allocation = device->getNEODevice()->getMemoryManager()->createGraphicsAllocationFromNTHandle(lookupTable.sharedHandleType.ntHnadle, device->getNEODevice()->getRootDeviceIndex(), NEO::AllocationType::SHARED_IMAGE); } } else { - NEO::AllocationProperties properties(device->getRootDeviceIndex(), true, imgInfo, NEO::GraphicsAllocation::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 3d0379126e..d188aa324e 100644 --- a/level_zero/core/source/kernel/kernel_imp.cpp +++ b/level_zero/core/source/kernel/kernel_imp.cpp @@ -102,7 +102,7 @@ void KernelImmutableData::initialize(NEO::KernelInfo *kernelInfo, Device *device auto kernelIsaSize = kernelInfo->heapInfo.KernelHeapSize; UNRECOVERABLE_IF(kernelIsaSize == 0); UNRECOVERABLE_IF(!kernelInfo->heapInfo.pKernelHeap); - const auto allocType = internalKernel ? NEO::GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL : NEO::GraphicsAllocation::AllocationType::KERNEL_ISA; + const auto allocType = internalKernel ? NEO::AllocationType::KERNEL_ISA_INTERNAL : NEO::AllocationType::KERNEL_ISA; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties( {neoDevice->getRootDeviceIndex(), kernelIsaSize, allocType, neoDevice->getDeviceBitfield()}); @@ -716,7 +716,7 @@ NEO::GraphicsAllocation *KernelImp::allocatePrivateMemoryGraphicsAllocation() { UNRECOVERABLE_IF(privateSurfaceSize == 0); auto privateMemoryGraphicsAllocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {neoDevice->getRootDeviceIndex(), privateSurfaceSize, NEO::GraphicsAllocation::AllocationType::PRIVATE_SURFACE, neoDevice->getDeviceBitfield()}); + {neoDevice->getRootDeviceIndex(), privateSurfaceSize, NEO::AllocationType::PRIVATE_SURFACE, neoDevice->getDeviceBitfield()}); UNRECOVERABLE_IF(privateMemoryGraphicsAllocation == nullptr); return privateMemoryGraphicsAllocation; @@ -751,7 +751,7 @@ ze_result_t KernelImp::initialize(const ze_kernel_desc_t *desc) { this->schedulingHintExpFlag = hwHelper.getDefaultThreadArbitrationPolicy(); UNRECOVERABLE_IF(!this->kernelImmData->getKernelInfo()->heapInfo.pKernelHeap); - if (isaAllocation->getAllocationType() == NEO::GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL) { + if (isaAllocation->getAllocationType() == NEO::AllocationType::KERNEL_ISA_INTERNAL) { NEO::MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *isaAllocation), *neoDevice, 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 92dee602e8..ed9e30b8a3 100644 --- a/level_zero/core/source/memory_manager/compression_selector_l0.cpp +++ b/level_zero/core/source/memory_manager/compression_selector_l0.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -13,7 +13,7 @@ bool CompressionSelector::preferCompressedAllocation(const AllocationProperties bool preferredCompression = false; int32_t compressionEnabled = DebugManager.flags.EnableUsmCompression.get(); if (compressionEnabled == 1) { - if ((properties.allocationType == GraphicsAllocation::AllocationType::SVM_GPU) || + if ((properties.allocationType == AllocationType::SVM_GPU) || (properties.flags.isUSMDeviceAllocation)) { preferredCompression = true; } diff --git a/level_zero/core/source/printf_handler/printf_handler.cpp b/level_zero/core/source/printf_handler/printf_handler.cpp index 00849476bf..84fbbd0ba7 100644 --- a/level_zero/core/source/printf_handler/printf_handler.cpp +++ b/level_zero/core/source/printf_handler/printf_handler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -17,7 +17,7 @@ namespace L0 { NEO::GraphicsAllocation *PrintfHandler::createPrintfBuffer(Device *device) { NEO::AllocationProperties properties( - device->getRootDeviceIndex(), PrintfHandler::printfBufferSize, NEO::GraphicsAllocation::AllocationType::PRINTF_SURFACE, device->getNEODevice()->getDeviceBitfield()); + device->getRootDeviceIndex(), PrintfHandler::printfBufferSize, NEO::AllocationType::PRINTF_SURFACE, device->getNEODevice()->getDeviceBitfield()); properties.alignment = MemoryConstants::pageSize64k; auto allocation = device->getNEODevice()->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); 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 9ced0274aa..c14bfac213 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 @@ -236,7 +236,7 @@ class MemoryManagerIpcMock : public NEO::MemoryManager { NEO::GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation) override { return nullptr; } void addAllocationToHostPtrManager(NEO::GraphicsAllocation *memory) override{}; void removeAllocationFromHostPtrManager(NEO::GraphicsAllocation *memory) override{}; - NEO::GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) override { return nullptr; }; + NEO::GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override { return nullptr; }; AllocationStatus populateOsHandles(NEO::OsHandleStorage &handleStorage, uint32_t rootDeviceIndex) override { return AllocationStatus::Success; }; void cleanOsHandles(NEO::OsHandleStorage &handleStorage, uint32_t rootDeviceIndex) override{}; void freeGraphicsMemoryImpl(NEO::GraphicsAllocation *gfxAllocation) override{}; @@ -270,7 +270,7 @@ class MemoryManagerOpenIpcMock : public MemoryManagerIpcMock { return nullptr; } auto alloc = new NEO::MockGraphicsAllocation(0, - NEO::GraphicsAllocation::AllocationType::BUFFER, + NEO::AllocationType::BUFFER, reinterpret_cast(sharedHandleAddress++), 0x1000, 0, @@ -279,9 +279,9 @@ class MemoryManagerOpenIpcMock : public MemoryManagerIpcMock { alloc->setGpuBaseAddress(0xabcd); return alloc; } - NEO::GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) override { + NEO::GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override { auto alloc = new NEO::MockGraphicsAllocation(0, - NEO::GraphicsAllocation::AllocationType::BUFFER, + NEO::AllocationType::BUFFER, reinterpret_cast(sharedHandleAddress++), 0x1000, 0, diff --git a/level_zero/core/test/unit_tests/fixtures/module_fixture.h b/level_zero/core/test/unit_tests/fixtures/module_fixture.h index e2bfd11143..1f90ab32f9 100644 --- a/level_zero/core/test/unit_tests/fixtures/module_fixture.h +++ b/level_zero/core/test/unit_tests/fixtures/module_fixture.h @@ -62,7 +62,7 @@ struct ModuleImmutableDataFixture : public DeviceFixture { isaGraphicsAllocation.release(); } isaGraphicsAllocation.reset(new NEO::MockGraphicsAllocation(0, - NEO::GraphicsAllocation::AllocationType::KERNEL_ISA, + NEO::AllocationType::KERNEL_ISA, reinterpret_cast(0x1234), 0x1000, 0, @@ -307,7 +307,7 @@ struct ModuleWithZebinFixture : public DeviceFixture { kernelDescriptor = mockKernelDescriptor; this->device = device; isaGraphicsAllocation.reset(new NEO::MockGraphicsAllocation(0, - NEO::GraphicsAllocation::AllocationType::KERNEL_ISA, + NEO::AllocationType::KERNEL_ISA, reinterpret_cast(0x1234), 0x1000, 0, @@ -331,14 +331,14 @@ struct ModuleWithZebinFixture : public DeviceFixture { void addSegments() { kernelImmDatas.push_back(std::make_unique(device)); translationUnit->globalVarBuffer = new NEO::MockGraphicsAllocation(0, - NEO::GraphicsAllocation::AllocationType::GLOBAL_SURFACE, + NEO::AllocationType::GLOBAL_SURFACE, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); translationUnit->globalConstBuffer = new NEO::MockGraphicsAllocation(0, - NEO::GraphicsAllocation::AllocationType::GLOBAL_SURFACE, + NEO::AllocationType::GLOBAL_SURFACE, reinterpret_cast(0x1234), 0x1000, 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 bb1b0e1fe9..9d1cbd644d 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_cmdlist.cpp +++ b/level_zero/core/test/unit_tests/mocks/mock_cmdlist.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -18,7 +18,7 @@ MockCommandList::MockCommandList(Device *device) : WhiteBox<::L0::CommandList>(d this->device = device; size_t batchBufferSize = 65536u; batchBuffer = new uint8_t[batchBufferSize]; - mockAllocation = new NEO::GraphicsAllocation(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + mockAllocation = new NEO::GraphicsAllocation(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, &batchBuffer, reinterpret_cast(&batchBuffer), 0, sizeof(batchBufferSize), MemoryPool::System4KBPages); } diff --git a/level_zero/core/test/unit_tests/mocks/mock_device.h b/level_zero/core/test/unit_tests/mocks/mock_device.h index 07757e0161..6727713732 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_device.h +++ b/level_zero/core/test/unit_tests/mocks/mock_device.h @@ -79,7 +79,7 @@ struct Mock : public Device { ADDMETHOD_NOBASE(getDebugProperties, ze_result_t, ZE_RESULT_SUCCESS, (zet_device_debug_properties_t * properties)); ADDMETHOD_NOBASE(getDebugSession, DebugSession *, nullptr, (const zet_debug_config_t &config)); ADDMETHOD_NOBASE_VOIDRETURN(removeDebugSession, ()); - ADDMETHOD_NOBASE(obtainReusableAllocation, NEO::GraphicsAllocation *, nullptr, (size_t requiredSize, NEO::GraphicsAllocation::AllocationType type)) + ADDMETHOD_NOBASE(obtainReusableAllocation, NEO::GraphicsAllocation *, nullptr, (size_t requiredSize, NEO::AllocationType type)) ADDMETHOD_NOBASE_VOIDRETURN(storeReusableAllocation, (NEO::GraphicsAllocation & alloc)); DebugSession *createDebugSession(const zet_debug_config_t &config, ze_result_t &result) override { 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 48f25e8395..fc568d8c12 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_event.cpp +++ b/level_zero/core/test/unit_tests/mocks/mock_event.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -10,7 +10,7 @@ namespace L0 { namespace ult { -Mock::Mock() : mockAllocation(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, +Mock::Mock() : mockAllocation(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, &memory, reinterpret_cast(&memory), 0, sizeof(memory), MemoryPool::System4KBPages) {} diff --git a/level_zero/core/test/unit_tests/mocks/mock_kernel.h b/level_zero/core/test/unit_tests/mocks/mock_kernel.h index 0f873fc821..812bb79021 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_kernel.h +++ b/level_zero/core/test/unit_tests/mocks/mock_kernel.h @@ -111,7 +111,7 @@ struct Mock<::L0::Kernel> : public WhiteBox<::L0::Kernel> { this->kernelImmData = &immutableData; - auto allocation = new NEO::GraphicsAllocation(0, NEO::GraphicsAllocation::AllocationType::KERNEL_ISA, + auto allocation = new NEO::GraphicsAllocation(0, NEO::AllocationType::KERNEL_ISA, nullptr, 0, 0, 4096, MemoryPool::System4KBPages); 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 9cd604e421..8704c88986 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 @@ -213,10 +213,10 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenPageFaultCopyCalledThenappendPa MockCommandListHw cmdList; size_t size = (sizeof(uint32_t) * 4); cmdList.initialize(device, NEO::EngineGroupType::RenderCompute, 0u); - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x2345), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); cmdList.appendPageFaultCopy(&mockAllocationDst, &mockAllocationSrc, size, false); @@ -228,10 +228,10 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenPageFaultCopyCalledWithCopyEngi MockCommandListHw cmdList; size_t size = (sizeof(uint32_t) * 4); cmdList.initialize(device, NEO::EngineGroupType::Copy, 0u); - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x2345), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); cmdList.appendPageFaultCopy(&mockAllocationDst, &mockAllocationSrc, size, false); @@ -242,10 +242,10 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenPageFaultCopyCalledThenappendPa MockCommandListHw cmdList; size_t size = ((sizeof(uint32_t) * 4) + 1); cmdList.initialize(device, NEO::EngineGroupType::RenderCompute, 0u); - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x2345), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); cmdList.appendPageFaultCopy(&mockAllocationDst, &mockAllocationSrc, size, false); @@ -257,10 +257,10 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenPageFaultCopyCalledAndErrorOnMi MockCommandListHw cmdList(true); size_t size = ((sizeof(uint32_t) * 4) + 1); cmdList.initialize(device, NEO::EngineGroupType::RenderCompute, 0u); - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x2345), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); cmdList.appendPageFaultCopy(&mockAllocationDst, &mockAllocationSrc, size, false); @@ -272,10 +272,10 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenPageFaultCopyCalledWithCopyEngi MockCommandListHw cmdList; size_t size = ((sizeof(uint32_t) * 4) + 1); cmdList.initialize(device, NEO::EngineGroupType::Copy, 0u); - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x2345), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); cmdList.appendPageFaultCopy(&mockAllocationDst, &mockAllocationSrc, size, false); @@ -286,10 +286,10 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenPageFaultCopyCalledWithCopyEngi MockCommandListHw cmdList(true); size_t size = ((sizeof(uint32_t) * 4) + 1); cmdList.initialize(device, NEO::EngineGroupType::Copy, 0u); - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x2345), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); cmdList.appendPageFaultCopy(&mockAllocationDst, &mockAllocationSrc, size, false); @@ -300,10 +300,10 @@ HWTEST2_F(CommandListCreate, givenCommandListWhen4GBytePageFaultCopyCalledThenPa MockCommandListHw cmdList; size_t size = 0x100000000; cmdList.initialize(device, NEO::EngineGroupType::RenderCompute, 0u); - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x100003456), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); cmdList.appendPageFaultCopy(&mockAllocationDst, &mockAllocationSrc, size, false); @@ -315,10 +315,10 @@ HWTEST2_F(CommandListCreate, givenCommandListWhen4GBytePageFaultCopyCalledThenPa MockCommandListHw cmdList; size_t size = 0x100000001; cmdList.initialize(device, NEO::EngineGroupType::RenderCompute, 0u); - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x100003456), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); cmdList.appendPageFaultCopy(&mockAllocationDst, &mockAllocationSrc, size, false); @@ -907,10 +907,10 @@ HWTEST2_F(CommandListCreate, givenCopyCommandListWhenCopyRegionWithinMaxBlitSize ze_copy_region_t dstRegion = srcRegion; Vec3 srcSize = {0x1000, 0x100, 1}; Vec3 dstSize = {0x100, 0x100, 1}; - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); size_t rowPitch = copySize.x; @@ -940,10 +940,10 @@ HWTEST2_F(CommandListCreate, givenCopyCommandListWhenCopyRegionWithinMaxBlitSize ze_copy_region_t dstRegion = srcRegion; Vec3 srcSize = {0x1000, 0x100, 1}; Vec3 dstSize = {0x100, 0x100, 1}; - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); size_t rowPitch = copySize.x; @@ -972,10 +972,10 @@ HWTEST2_F(CommandListCreate, givenCopyCommandListWhenCopyRegionGreaterThanMaxBli ze_copy_region_t dstRegion = srcRegion; Vec3 srcSize = {2 * BlitterConstants::maxBlitWidth, 2 * BlitterConstants::maxBlitHeight, 1}; Vec3 dstSize = srcSize; - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); size_t rowPitch = copySize.x; @@ -1079,11 +1079,11 @@ HWTEST2_F(CommandListAppendMemoryCopyBlit, whenAppendMemoryCopyBlitIsAppendedAnd useSize -= sizeof(MI_BATCH_BUFFER_END); commandList->commandContainer.getCommandStream()->getSpace(useSize); - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); void *srcPtr = reinterpret_cast(mockAllocationSrc.getGpuAddress()); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x2345), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); 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 be023202bb..4bdbd542a8 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 @@ -288,10 +288,10 @@ HWTEST_F(CommandListImmediateFlushTaskComputeTests, givenUseCsrImmediateSubmissi NEO::DebugManager.flags.EnableFlushTaskSubmission.set(1); size_t size = 0x100000001; - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x100003456), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); 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 3bb506ae51..413c6aba22 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 @@ -28,7 +28,7 @@ using CommandListCreate = Test; class MockEvent : public ::L0::Event { public: MockEvent() { - mockAllocation.reset(new NEO::MockGraphicsAllocation(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + mockAllocation.reset(new NEO::MockGraphicsAllocation(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages)); this->timestampSizeInDw = 1; @@ -176,7 +176,7 @@ HWTEST2_F(AppendQueryKernelTimestamps, givenCommandListWhenAppendQueryKernelTime containsDstPtr = true; } if (residentGfxAlloc->getAllocationType() == - NEO::GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER) { + NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER) { gpuTimeStampAlloc = true; } } 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 b7914caa03..385b7d1c2b 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 @@ -43,7 +43,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::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + mockAllocation.reset(new NEO::MockGraphicsAllocation(rootDeviceIndex, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages)); data.gpuAllocations.addAllocation(mockAllocation.get()); @@ -160,10 +160,10 @@ HWTEST2_F(AppendMemoryCopy, givenCopyOnlyCommandListThenDcFlushIsNotAddedAfterBl uint64_t srcOffset = 0x101; uint64_t dstOffset = 0x201; uint64_t copySize = 0x301; - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(srcPtr), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(dstPtr), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); commandList->appendMemoryCopyBlit(ptrOffset(dstPtr, dstOffset), &mockAllocationDst, 0, ptrOffset(srcPtr, srcOffset), &mockAllocationSrc, 0, copySize); @@ -197,10 +197,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::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); @@ -256,10 +256,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::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); 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 8394f43332..ca3531348a 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 @@ -1216,8 +1216,8 @@ HWTEST2_F(CommandQueueDestroy, givenCommandQueueAndCommandListWithSshAndScratchW auto commandListHandle = commandList->toHandle(); void *alloc = alignedMalloc(0x100, 0x100); - NEO::GraphicsAllocation graphicsAllocation1(0, NEO::GraphicsAllocation::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); - NEO::GraphicsAllocation graphicsAllocation2(0, NEO::GraphicsAllocation::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.sshAllocations.push_back(&graphicsAllocation1); commandList->commandContainer.sshAllocations.push_back(&graphicsAllocation2); @@ -1244,8 +1244,8 @@ HWTEST2_F(CommandQueueDestroy, givenCommandQueueAndCommandListWithSshAndPrivateS auto commandListHandle = commandList->toHandle(); void *alloc = alignedMalloc(0x100, 0x100); - NEO::GraphicsAllocation graphicsAllocation1(0, NEO::GraphicsAllocation::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); - NEO::GraphicsAllocation graphicsAllocation2(0, NEO::GraphicsAllocation::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.sshAllocations.push_back(&graphicsAllocation1); commandList->commandContainer.sshAllocations.push_back(&graphicsAllocation2); @@ -1293,8 +1293,8 @@ HWTEST2_F(ExecuteCommandListTests, givenExecuteCommandListWhenItReturnsThenConta auto commandListHandle = commandList->toHandle(); void *alloc = alignedMalloc(0x100, 0x100); - NEO::GraphicsAllocation graphicsAllocation1(0, NEO::GraphicsAllocation::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); - NEO::GraphicsAllocation graphicsAllocation2(0, NEO::GraphicsAllocation::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.sshAllocations.push_back(&graphicsAllocation1); commandList->commandContainer.sshAllocations.push_back(&graphicsAllocation2); 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 139360c5bc..09b409b7e0 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 @@ -597,7 +597,7 @@ TEST_F(CommandQueueInitTests, givenMultipleSubDevicesWhenInitializingThenAllocat uint32_t cmdBufferAllocationsFound = 0; for (auto &allocationProperties : memoryManager->storedAllocationProperties) { - if (allocationProperties.allocationType == NEO::GraphicsAllocation::AllocationType::COMMAND_BUFFER) { + if (allocationProperties.allocationType == NEO::AllocationType::COMMAND_BUFFER) { cmdBufferAllocationsFound++; EXPECT_EQ(expectedBitfield, allocationProperties.subDevicesBitfield.to_ulong()); EXPECT_EQ(1u, allocationProperties.flags.multiOsContextCapable); @@ -752,12 +752,12 @@ HWTEST2_F(CommandQueueScratchTests, givenCommandQueueWhenHandleScratchSpaceThenP NEO::HeapContainer heapContainer; void *surfaceHeap = alignedMalloc(0x1000, 0x1000); - NEO::GraphicsAllocation graphicsAllocationHeap(0, NEO::GraphicsAllocation::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::GraphicsAllocation::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; @@ -811,7 +811,7 @@ HWTEST2_F(CommandQueueScratchTests, givenCommandQueueWhenHandleScratchSpaceAndHe bool gsbaStateDirty = false; bool frontEndStateDirty = false; - NEO::GraphicsAllocation graphicsAllocation(1u, NEO::GraphicsAllocation::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/debugger/linux/test_l0_debugger_linux.cpp b/level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp index 0e4f35a92f..936206b79a 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -137,7 +137,7 @@ TEST_F(L0DebuggerLinuxTest, whenRegisterElfisCalledThenItRegistersBindExtHandles NEO::DebugData debugData; debugData.vIsa = "01234567890"; debugData.vIsaSize = 10; - MockDrmAllocation isaAllocation(GraphicsAllocation::AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); + MockDrmAllocation isaAllocation(AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); MockBufferObject bo(drmMock, 0, 0, 1); isaAllocation.bufferObjects[0] = &bo; device->getL0Debugger()->registerElf(&debugData, &isaAllocation); @@ -157,7 +157,7 @@ TEST_F(L0DebuggerLinuxTest, whenRegisterElfisCalledInAllocationWithNoBOThenItReg NEO::DebugData debugData; debugData.vIsa = "01234567890"; debugData.vIsaSize = 10; - MockDrmAllocation isaAllocation(GraphicsAllocation::AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); + MockDrmAllocation isaAllocation(AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); device->getL0Debugger()->registerElf(&debugData, &isaAllocation); EXPECT_EQ(static_cast(10u), drmMock->registeredDataSize); @@ -169,7 +169,7 @@ TEST_F(L0DebuggerLinuxTest, givenNoOSInterfaceThenRegisterElfDoesNothing) { debugData.vIsa = "01234567890"; debugData.vIsaSize = 10; drmMock->registeredDataSize = 0; - MockDrmAllocation isaAllocation(GraphicsAllocation::AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); + MockDrmAllocation isaAllocation(AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); device->getL0Debugger()->registerElf(&debugData, &isaAllocation); 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 a75cb91be1..671b3ebf3f 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -113,7 +113,7 @@ TEST(Debugger, givenDebuggingEnabledInExecEnvWhenAllocatingIsaThenSingleBankIsUs std::unique_ptr neoDevice(NEO::MockDevice::create(executionEnvironment, 0u)); auto allocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {neoDevice->getRootDeviceIndex(), 4096, NEO::GraphicsAllocation::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()}); + {neoDevice->getRootDeviceIndex(), 4096, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()}); if (allocation->getMemoryPool() == MemoryPool::LocalMemory) { EXPECT_EQ(1u, allocation->storageInfo.getMemoryBanks()); @@ -138,7 +138,7 @@ HWTEST_F(L0DebuggerTest, givenL0DebuggerWhenCreatedThenPerContextSbaTrackingBuff ASSERT_NE(nullptr, sbaAllocation); allocations.push_back(sbaAllocation); - EXPECT_EQ(NEO::GraphicsAllocation::AllocationType::DEBUG_SBA_TRACKING_BUFFER, sbaAllocation->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::DEBUG_SBA_TRACKING_BUFFER, sbaAllocation->getAllocationType()); EXPECT_EQ(MemoryPool::System4KBPages, sbaAllocation->getMemoryPool()); } @@ -774,10 +774,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::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::GraphicsAllocation srcPtr(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - NEO::GraphicsAllocation dstPtr(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::GraphicsAllocation dstPtr(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x2345), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); @@ -797,10 +797,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::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::GraphicsAllocation srcPtr(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - NEO::GraphicsAllocation dstPtr(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::GraphicsAllocation dstPtr(0, NEO::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x2345), size, 0, sizeof(uint32_t), MemoryPool::System4KBPages); @@ -1097,7 +1097,7 @@ HWTEST_F(L0DebuggerTest, givenDebuggerWhenCreatedThenModuleHeapDebugAreaIsCreate EXPECT_EQ(1, memoryOperationsHandler->makeResidentCalledCount); auto allocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {neoDevice->getRootDeviceIndex(), 4096, NEO::GraphicsAllocation::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()}); + {neoDevice->getRootDeviceIndex(), 4096, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()}); EXPECT_EQ(allocation->storageInfo.getMemoryBanks(), debugArea->storageInfo.getMemoryBanks()); diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp index 0a8de46de3..51455f2a99 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp @@ -322,7 +322,7 @@ HWTEST_F(KernelDebugSurfaceTest, givenDebuggerAndBindfulKernelWhenAppendingKerne auto debugSurface = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( {device->getRootDeviceIndex(), true, NEO::SipKernel::maxDbgSurfaceSize, - NEO::GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA, + NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, device->getNEODevice()->getDeviceBitfield()}); diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_source_level_debugger.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_source_level_debugger.cpp index f520fb35fb..a34d951559 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_source_level_debugger.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_source_level_debugger.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -235,7 +235,7 @@ using DeviceWithDebuggerEnabledTest = Test; TEST_F(DeviceWithDebuggerEnabledTest, givenDebuggingEnabledWhenDeviceIsCreatedThenItHasDebugSurfaceCreatedWithCorrectAllocationType) { ASSERT_NE(nullptr, deviceL0->getDebugSurface()); - EXPECT_EQ(NEO::GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA, deviceL0->getDebugSurface()->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA, deviceL0->getDebugSurface()->getAllocationType()); } TEST_F(DeviceWithDebuggerEnabledTest, givenSldDebuggerWhenGettingL0DebuggerThenNullptrIsReturned) { diff --git a/level_zero/core/test/unit_tests/sources/device/test_device.cpp b/level_zero/core/test/unit_tests/sources/device/test_device.cpp index 1aff57e662..5cecc57fab 100644 --- a/level_zero/core/test/unit_tests/sources/device/test_device.cpp +++ b/level_zero/core/test/unit_tests/sources/device/test_device.cpp @@ -588,7 +588,7 @@ TEST_F(DeviceTest, givenEmptySVmAllocStorageWhenAllocateManagedMemoryFromHostPtr int data; auto allocation = device->allocateManagedMemoryFromHostPtr(&data, sizeof(data), nullptr); EXPECT_NE(nullptr, allocation); - EXPECT_EQ(NEO::GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, allocation->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::BUFFER_HOST_MEMORY, allocation->getAllocationType()); EXPECT_EQ(rootDeviceIndex, allocation->getRootDeviceIndex()); neoDevice->getMemoryManager()->freeGraphicsMemory(allocation); } @@ -602,7 +602,7 @@ TEST_F(DeviceTest, givenEmptySVmAllocStorageWhenAllocateMemoryFromHostPtrThenVal auto allocation = device->allocateMemoryFromHostPtr(data.get(), allocationSize, false); EXPECT_NE(nullptr, allocation); - EXPECT_EQ(NEO::GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, allocation->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::EXTERNAL_HOST_PTR, allocation->getAllocationType()); EXPECT_EQ(rootDeviceIndex, allocation->getRootDeviceIndex()); auto alignedPtr = alignDown(data.get(), MemoryConstants::pageSize); @@ -624,11 +624,11 @@ TEST_F(DeviceTest, givenNonEmptyAllocationsListWhenRequestingAllocationSmallerOr auto allocation = device->getDriverHandle()->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getNEODevice()->getRootDeviceIndex(), allocationSize, - NEO::GraphicsAllocation::AllocationType::FILL_PATTERN, + NEO::AllocationType::FILL_PATTERN, neoDevice->getDeviceBitfield()}); device->storeReusableAllocation(*allocation); EXPECT_FALSE(deviceImp->allocationsForReuse->peekIsEmpty()); - auto obtaindedAllocation = device->obtainReusableAllocation(dataSize, NEO::GraphicsAllocation::AllocationType::FILL_PATTERN); + auto obtaindedAllocation = device->obtainReusableAllocation(dataSize, NEO::AllocationType::FILL_PATTERN); EXPECT_TRUE(deviceImp->allocationsForReuse->peekIsEmpty()); EXPECT_NE(nullptr, obtaindedAllocation); EXPECT_EQ(allocation, obtaindedAllocation); @@ -644,11 +644,11 @@ TEST_F(DeviceTest, givenNonEmptyAllocationsListWhenRequestingAllocationBiggerInS auto allocation = device->getDriverHandle()->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getNEODevice()->getRootDeviceIndex(), allocationSize, - NEO::GraphicsAllocation::AllocationType::FILL_PATTERN, + NEO::AllocationType::FILL_PATTERN, neoDevice->getDeviceBitfield()}); device->storeReusableAllocation(*allocation); EXPECT_FALSE(deviceImp->allocationsForReuse->peekIsEmpty()); - auto obtaindedAllocation = device->obtainReusableAllocation(4 * dataSize + 1u, NEO::GraphicsAllocation::AllocationType::FILL_PATTERN); + auto obtaindedAllocation = device->obtainReusableAllocation(4 * dataSize + 1u, NEO::AllocationType::FILL_PATTERN); EXPECT_EQ(nullptr, obtaindedAllocation); EXPECT_FALSE(deviceImp->allocationsForReuse->peekIsEmpty()); } @@ -662,11 +662,11 @@ TEST_F(DeviceTest, givenNonEmptyAllocationsListAndUnproperAllocationTypeWhenRequ auto allocation = device->getDriverHandle()->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getNEODevice()->getRootDeviceIndex(), allocationSize, - NEO::GraphicsAllocation::AllocationType::BUFFER, + NEO::AllocationType::BUFFER, neoDevice->getDeviceBitfield()}); device->storeReusableAllocation(*allocation); EXPECT_FALSE(deviceImp->allocationsForReuse->peekIsEmpty()); - auto obtaindedAllocation = device->obtainReusableAllocation(4 * dataSize + 1u, NEO::GraphicsAllocation::AllocationType::FILL_PATTERN); + auto obtaindedAllocation = device->obtainReusableAllocation(4 * dataSize + 1u, NEO::AllocationType::FILL_PATTERN); EXPECT_EQ(nullptr, obtaindedAllocation); EXPECT_FALSE(deviceImp->allocationsForReuse->peekIsEmpty()); } @@ -711,7 +711,7 @@ TEST_F(DeviceHostPointerTest, givenHostPointerNotAcceptedByKernelThenNewAllocati auto allocation = device->allocateMemoryFromHostPtr(buffer, size, true); EXPECT_NE(nullptr, allocation); - EXPECT_EQ(NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, allocation->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::INTERNAL_HOST_MEMORY, 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 4f9799eae3..e01b537a74 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 @@ -81,7 +81,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::GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, false, neoDevice->getDeviceBitfield()}, + {device->getRootDeviceIndex(), false, usmSize, NEO::AllocationType::BUFFER_HOST_MEMORY, false, neoDevice->getDeviceBitfield()}, usmBuffer); ASSERT_NE(nullptr, usmAllocation); @@ -111,7 +111,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::GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, false, neoDevice->getDeviceBitfield()}, + {device->getRootDeviceIndex(), false, usmSize, NEO::AllocationType::BUFFER_HOST_MEMORY, 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 fd2eee1522..d706451ada 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 @@ -154,7 +154,7 @@ class MemoryManagerNTHandleMock : public NEO::OsAgnosticMemoryManager { public: MemoryManagerNTHandleMock(NEO::ExecutionEnvironment &executionEnvironment) : NEO::OsAgnosticMemoryManager(executionEnvironment) {} - NEO::GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) override { + NEO::GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override { auto graphicsAllocation = createMemoryAllocation(allocType, nullptr, reinterpret_cast(1), 1, 4096u, reinterpret_cast(handle), MemoryPool::SystemCpuInaccessible, rootDeviceIndex, false, false, false); 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 30525e1371..08af3458bf 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 @@ -41,7 +41,7 @@ class MemoryManagerEventPoolFailMock : public NEO::MemoryManager { NEO::GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation) override { return nullptr; } void addAllocationToHostPtrManager(NEO::GraphicsAllocation *memory) override{}; void removeAllocationFromHostPtrManager(NEO::GraphicsAllocation *memory) override{}; - NEO::GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) override { return nullptr; }; + NEO::GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override { return nullptr; }; AllocationStatus populateOsHandles(NEO::OsHandleStorage &handleStorage, uint32_t rootDeviceIndex) override { return AllocationStatus::Success; }; void cleanOsHandles(NEO::OsHandleStorage &handleStorage, uint32_t rootDeviceIndex) override{}; void freeGraphicsMemoryImpl(NEO::GraphicsAllocation *gfxAllocation) override{}; @@ -461,7 +461,7 @@ TEST_F(EventPoolCreate, whenHostVisibleFlagNotSetThenEventAllocationIsOnDevice) EXPECT_EQ(ZE_RESULT_SUCCESS, result); ASSERT_NE(nullptr, eventPool); - EXPECT_EQ(NEO::GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, eventPool->getAllocation().getAllocationType()); + EXPECT_EQ(NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, eventPool->getAllocation().getAllocationType()); EXPECT_NE(systemMemoryBitfield, memoryManager->recentlyPassedDeviceBitfield); EXPECT_EQ(neoDevice->getDeviceBitfield(), memoryManager->recentlyPassedDeviceBitfield); } @@ -804,7 +804,7 @@ TEST_F(TimestampEventCreate, givenTimestampEventThenAllocationsIsOfPacketTagBuff auto allocation = &eventPool->getAllocation(); ASSERT_NE(nullptr, allocation); - EXPECT_EQ(NEO::GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, allocation->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, allocation->getAllocationType()); } TEST_F(TimestampEventCreate, givenEventTimestampWhenPacketCountIsSetThenCorrectOffsetIsReturned) { 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 d024491af6..291450cd6b 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -24,21 +24,21 @@ HWTEST2_F(AlocationHelperTests, givenLinearStreamTypeWhenUseExternalAllocatorFor DebugManagerStateRestore dbgRestorer; DebugManager.flags.UseExternalAllocatorForSshAndDsh.set(false); HeapAssigner heapAssigner = {}; - EXPECT_FALSE(heapAssigner.use32BitHeap(GraphicsAllocation::AllocationType::LINEAR_STREAM)); + EXPECT_FALSE(heapAssigner.use32BitHeap(AllocationType::LINEAR_STREAM)); } HWTEST2_F(AlocationHelperTests, givenLinearStreamTypeWhenUseExternalAllocatorForSshAndDshEnabledThenUse32BitIsTrue, Platforms) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.UseExternalAllocatorForSshAndDsh.set(true); HeapAssigner heapAssigner = {}; - EXPECT_TRUE(heapAssigner.use32BitHeap(GraphicsAllocation::AllocationType::LINEAR_STREAM)); + EXPECT_TRUE(heapAssigner.use32BitHeap(AllocationType::LINEAR_STREAM)); } HWTEST2_F(AlocationHelperTests, givenLinearStreamTypeWhenUseIternalAllocatorThenUseHeapExternal, Platforms) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.UseExternalAllocatorForSshAndDsh.set(true); HeapAssigner heapAssigner = {}; - auto heapIndex = heapAssigner.get32BitHeapIndex(GraphicsAllocation::AllocationType::LINEAR_STREAM, true, *defaultHwInfo.get(), false); + auto heapIndex = heapAssigner.get32BitHeapIndex(AllocationType::LINEAR_STREAM, true, *defaultHwInfo.get(), false); EXPECT_EQ(heapIndex, NEO::HeapIndex::HEAP_EXTERNAL_DEVICE_MEMORY); } struct MockMemoryManagerAllocationHelper : public MemoryManagerMock { @@ -53,7 +53,7 @@ TEST_F(AlocationHelperTests, GivenLinearStreamAllocTypeWhenUseExternalAllocatorF DebugManagerStateRestore dbgRestorer; DebugManager.flags.UseExternalAllocatorForSshAndDsh.set(true); AllocationData allocationData; - allocationData.type = GraphicsAllocation::AllocationType::LINEAR_STREAM; + allocationData.type = AllocationType::LINEAR_STREAM; std::unique_ptr mockMemoryManager(new MockMemoryManagerAllocationHelper(*device->getNEODevice()->getExecutionEnvironment())); mockMemoryManager->allocateGraphicsMemory(allocationData); EXPECT_EQ(mockMemoryManager->passedUseLocalMem, HwInfoConfig::get(device->getHwInfo().platform.eProductFamily)->heapInLocalMem(device->getHwInfo())); @@ -63,7 +63,7 @@ TEST_F(AlocationHelperTests, GivenInternalAllocTypeWhenUseExternalAllocatorForSs DebugManagerStateRestore dbgRestorer; DebugManager.flags.UseExternalAllocatorForSshAndDsh.set(false); AllocationData allocationData; - allocationData.type = GraphicsAllocation::AllocationType::KERNEL_ISA; + allocationData.type = AllocationType::KERNEL_ISA; std::unique_ptr mockMemoryManager(new MockMemoryManagerAllocationHelper(*device->getNEODevice()->getExecutionEnvironment())); mockMemoryManager->allocateGraphicsMemory(allocationData); EXPECT_FALSE(mockMemoryManager->passedUseLocalMem); @@ -73,7 +73,7 @@ TEST_F(AlocationHelperTests, givenLinearStreamAllocationWhenSelectingHeapWithUse DebugManagerStateRestore dbgRestorer; DebugManager.flags.UseExternalAllocatorForSshAndDsh.set(true); std::unique_ptr mockMemoryManager(new MockMemoryManagerAllocationHelper(*device->getNEODevice()->getExecutionEnvironment())); - GraphicsAllocation allocation{0, GraphicsAllocation::AllocationType::LINEAR_STREAM, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; + GraphicsAllocation allocation{0, AllocationType::LINEAR_STREAM, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; 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 2b54c241dc..d5864e2f69 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 @@ -357,8 +357,8 @@ class MemoryManagerNTHandleMock : public NEO::OsAgnosticMemoryManager { public: MemoryManagerNTHandleMock(NEO::ExecutionEnvironment &executionEnvironment) : NEO::OsAgnosticMemoryManager(executionEnvironment) {} - NEO::GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) override { - auto graphicsAllocation = createMemoryAllocation(GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, nullptr, reinterpret_cast(1), 1, + NEO::GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override { + auto graphicsAllocation = createMemoryAllocation(AllocationType::INTERNAL_HOST_MEMORY, nullptr, reinterpret_cast(1), 1, 4096u, reinterpret_cast(handle), MemoryPool::SystemCpuInaccessible, rootDeviceIndex, false, false, false); graphicsAllocation->setSharedHandle(static_cast(reinterpret_cast(handle))); @@ -520,7 +520,7 @@ HWTEST2_P(TestImageFormats, givenValidLayoutAndTypeWhenCreateImageCoreFamilyThen imageHW->initialize(device, &zeDesc); - EXPECT_EQ(imageHW->getAllocation()->getAllocationType(), NEO::GraphicsAllocation::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 bba9ca887b..094293dd1b 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 @@ -411,7 +411,7 @@ TEST_F(KernelImmutableDataTests, givenInternalModuleWhenKernelIsCreatedThenIsaIs bool isInternal = true; std::unique_ptr mockKernelImmData = std::make_unique(perHwThreadPrivateMemorySizeRequested); - mockKernelImmData->getIsaGraphicsAllocation()->setAllocationType(GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL); + mockKernelImmData->getIsaGraphicsAllocation()->setAllocationType(AllocationType::KERNEL_ISA_INTERNAL); size_t previouscopyMemoryToAllocationCalledTimes = mockMemoryManager->copyMemoryToAllocationCalledTimes; @@ -467,7 +467,7 @@ TEST_F(KernelImmutableDataTests, givenInternalModuleWhenKernelIsCreatedIsaIsNotC kernelMock.immutableData.kernelInfo = kernelInfo; kernelMock.immutableData.surfaceStateHeapSize = 64; kernelMock.immutableData.surfaceStateHeapTemplate.reset(new uint8_t[64]); - kernelMock.immutableData.getIsaGraphicsAllocation()->setAllocationType(GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL); + kernelMock.immutableData.getIsaGraphicsAllocation()->setAllocationType(AllocationType::KERNEL_ISA_INTERNAL); kernelInfo->kernelDescriptor.payloadMappings.implicitArgs.systemThreadSurfaceAddress.bindful = 0; moduleMock->translationUnit->programInfo.kernelInfos.push_back(kernelInfo); @@ -1332,7 +1332,7 @@ struct KernelIsaTests : Test { TEST_F(KernelIsaTests, givenKernelAllocationInLocalMemoryWhenCreatingWithoutAllowedCpuAccessThenUseBcsForTransfer) { DebugManagerStateRestore restore; DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::CpuAccessDisallowed)); - DebugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(NEO::GraphicsAllocation::AllocationType::KERNEL_ISA) - 1)); + DebugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(NEO::AllocationType::KERNEL_ISA) - 1)); uint32_t kernelHeap = 0; KernelInfo kernelInfo; @@ -1358,7 +1358,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::GraphicsAllocation::AllocationType::KERNEL_ISA) - 1)); + DebugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(NEO::AllocationType::KERNEL_ISA) - 1)); uint32_t kernelHeap = 0; KernelInfo kernelInfo; @@ -1380,7 +1380,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::GraphicsAllocation::AllocationType::KERNEL_ISA) - 1)); + DebugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(NEO::AllocationType::KERNEL_ISA) - 1)); device->getNEODevice()->getExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = false; @@ -1410,7 +1410,7 @@ TEST_F(KernelIsaTests, givenKernelInfoWhenInitializingImmutableDataWithInternalI KernelImmutableData kernelImmutableData(device); kernelImmutableData.initialize(&kernelInfo, device, 0, nullptr, nullptr, true); - EXPECT_EQ(NEO::GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL, kernelImmutableData.getIsaGraphicsAllocation()->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::KERNEL_ISA_INTERNAL, kernelImmutableData.getIsaGraphicsAllocation()->getAllocationType()); } TEST_F(KernelIsaTests, givenKernelInfoWhenInitializingImmutableDataWithNonInternalIsaThenCorrectAllocationTypeIsUsed) { @@ -1422,7 +1422,7 @@ TEST_F(KernelIsaTests, givenKernelInfoWhenInitializingImmutableDataWithNonIntern KernelImmutableData kernelImmutableData(device); kernelImmutableData.initialize(&kernelInfo, device, 0, nullptr, nullptr, false); - EXPECT_EQ(NEO::GraphicsAllocation::AllocationType::KERNEL_ISA, kernelImmutableData.getIsaGraphicsAllocation()->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::KERNEL_ISA, kernelImmutableData.getIsaGraphicsAllocation()->getAllocationType()); } TEST_F(KernelIsaTests, givenKernelInfoWhenInitializingImmutableDataWithIsaThenPaddingIsAdded) { 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 4ad5cd7682..807f91d250 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -16,7 +16,7 @@ namespace ult { TEST(CompressionSelectorL0Tests, GivenDefaultDebugFlagWhenProvidingUsmAllocationThenExpectCompressionDisabled) { DeviceBitfield deviceBitfield{0x0}; AllocationProperties properties(0, MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::BUFFER, + AllocationType::BUFFER, deviceBitfield); properties.flags.isUSMDeviceAllocation = 1u; @@ -29,7 +29,7 @@ TEST(CompressionSelectorL0Tests, GivenDisabledDebugFlagWhenProvidingUsmAllocatio DeviceBitfield deviceBitfield{0x0}; AllocationProperties properties(0, MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::BUFFER, + AllocationType::BUFFER, deviceBitfield); properties.flags.isUSMDeviceAllocation = 1u; @@ -42,7 +42,7 @@ TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingUsmAllocation DeviceBitfield deviceBitfield{0x0}; AllocationProperties properties(0, MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::BUFFER, + AllocationType::BUFFER, deviceBitfield); properties.flags.isUSMDeviceAllocation = 1u; @@ -55,7 +55,7 @@ TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingSvmGpuAllocat DeviceBitfield deviceBitfield{0x0}; AllocationProperties properties(0, MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::SVM_GPU, + AllocationType::SVM_GPU, deviceBitfield); EXPECT_TRUE(NEO::CompressionSelector::preferCompressedAllocation(properties, *defaultHwInfo)); @@ -67,7 +67,7 @@ TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingOtherAllocati DeviceBitfield deviceBitfield{0x0}; AllocationProperties properties(0, MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, + AllocationType::BUFFER_HOST_MEMORY, deviceBitfield); EXPECT_FALSE(NEO::CompressionSelector::preferCompressedAllocation(properties, *defaultHwInfo)); 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 d87063ffac..bac4896e60 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 @@ -92,13 +92,13 @@ HWTEST_F(ModuleTest, givenBuiltinModuleTypeWhenCreatingModuleThenCorrectTypeIsSe HWTEST_F(ModuleTest, givenUserModuleWhenCreatedThenCorrectAllocationTypeIsUsedForIsa) { createKernel(); - EXPECT_EQ(NEO::GraphicsAllocation::AllocationType::KERNEL_ISA, kernel->getIsaAllocation()->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::KERNEL_ISA, kernel->getIsaAllocation()->getAllocationType()); } HWTEST_F(ModuleTest, givenBuiltinModuleWhenCreatedThenCorrectAllocationTypeIsUsedForIsa) { createModuleFromBinary(ModuleType::Builtin); createKernel(); - EXPECT_EQ(NEO::GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL, kernel->getIsaAllocation()->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::KERNEL_ISA_INTERNAL, kernel->getIsaAllocation()->getAllocationType()); } using ModuleTestSupport = IsWithinProducts; @@ -1154,7 +1154,7 @@ TEST_F(ModuleDynamicLinkTests, givenModuleWithUnresolvedSymbolWhenTheOtherModule auto kernelImmData = std::make_unique>(device); kernelImmData->isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::GraphicsAllocation::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); auto isaPtr = kernelImmData->getIsaGraphicsAllocation()->getUnderlyingBuffer(); @@ -1200,7 +1200,7 @@ TEST_F(ModuleDynamicLinkTests, givenModuleWithUnresolvedSymbolWhenTheOtherModule auto kernelImmData = std::make_unique>(device); kernelImmData->isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::GraphicsAllocation::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); module0->kernelImmDatas.push_back(std::move(kernelImmData)); @@ -1260,7 +1260,7 @@ TEST_F(ModuleDynamicLinkTests, givenModuleWithUnresolvedSymbolWhenTheOtherModule auto kernelImmData = std::make_unique>(device); kernelImmData->isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::GraphicsAllocation::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); module0->kernelImmDatas.push_back(std::move(kernelImmData)); @@ -1321,7 +1321,7 @@ TEST_F(ModuleDynamicLinkTests, givenModuleWithUnresolvedSymbolsNotPresentInAnoth auto kernelImmData = std::make_unique>(device); kernelImmData->isaGraphicsAllocation.reset(neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::GraphicsAllocation::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()})); module0->kernelImmDatas.push_back(std::move(kernelImmData)); @@ -1749,8 +1749,8 @@ kernels: zebin.data(), zebin.size()); auto retVal = moduleTu.processUnpackedBinary(); EXPECT_TRUE(retVal); - EXPECT_EQ(GraphicsAllocation::AllocationType::SVM_ZERO_COPY, moduleTu.globalConstBuffer->getAllocationType()); - EXPECT_EQ(GraphicsAllocation::AllocationType::SVM_ZERO_COPY, moduleTu.globalVarBuffer->getAllocationType()); + EXPECT_EQ(AllocationType::SVM_ZERO_COPY, moduleTu.globalConstBuffer->getAllocationType()); + EXPECT_EQ(AllocationType::SVM_ZERO_COPY, moduleTu.globalVarBuffer->getAllocationType()); } HWTEST_F(ModuleTranslationUnitTest, WhenBuildOptionsAreNullThenReuseExistingOptions) { @@ -2030,9 +2030,9 @@ TEST_F(ModuleDebugDataTest, GivenDebugDataWithRelocationsWhenCreatingRelocatedDe module->translationUnit = std::make_unique(device); module->translationUnit->globalVarBuffer = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::GraphicsAllocation::AllocationType::BUFFER, neoDevice->getDeviceBitfield()}); + {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::AllocationType::BUFFER, neoDevice->getDeviceBitfield()}); module->translationUnit->globalConstBuffer = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( - {device->getRootDeviceIndex(), MemoryConstants::pageSize, NEO::GraphicsAllocation::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 1f3a8abf41..4f1d3e80fd 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -19,7 +19,7 @@ TEST(PrintfHandler, whenPrintfBufferIscreatedThenCorrectAllocationTypeIsUsed) { Mock l0Device(neoDevice, neoDevice->getExecutionEnvironment()); auto allocation = PrintfHandler::createPrintfBuffer(&l0Device); - EXPECT_EQ(NEO::GraphicsAllocation::AllocationType::PRINTF_SURFACE, allocation->getAllocationType()); + EXPECT_EQ(NEO::AllocationType::PRINTF_SURFACE, allocation->getAllocationType()); neoDevice->getMemoryManager()->freeGraphicsMemory(allocation); } diff --git a/level_zero/tools/source/metrics/metric_query_imp.cpp b/level_zero/tools/source/metrics/metric_query_imp.cpp index e3525bb07c..eb421a826f 100644 --- a/level_zero/tools/source/metrics/metric_query_imp.cpp +++ b/level_zero/tools/source/metrics/metric_query_imp.cpp @@ -570,7 +570,7 @@ bool OaMetricQueryPoolImp::allocateGpuMemory() { // Allocate gpu memory. NEO::AllocationProperties properties( - metricSource.getDevice().getRootDeviceIndex(), allocationSize, NEO::GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, metricSource.getDevice().getNEODevice()->getDeviceBitfield()); + metricSource.getDevice().getRootDeviceIndex(), allocationSize, NEO::AllocationType::BUFFER_HOST_MEMORY, 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 e2673273fb..88c887f491 100644 --- a/opencl/source/command_queue/enqueue_fill_buffer.h +++ b/opencl/source/command_queue/enqueue_fill_buffer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -35,12 +35,12 @@ cl_int CommandQueueHw::enqueueFillBuffer( auto commandStreamReceieverOwnership = getGpgpuCommandStreamReceiver().obtainUniqueOwnership(); auto storageWithAllocations = getGpgpuCommandStreamReceiver().getInternalAllocationStorage(); - auto allocationType = GraphicsAllocation::AllocationType::FILL_PATTERN; + auto allocationType = AllocationType::FILL_PATTERN; auto patternAllocation = storageWithAllocations->obtainReusableAllocation(patternSize, allocationType).release(); commandStreamReceieverOwnership.unlock(); if (!patternAllocation) { - patternAllocation = memoryManager->allocateGraphicsMemoryWithProperties({getDevice().getRootDeviceIndex(), alignUp(patternSize, MemoryConstants::cacheLineSize), GraphicsAllocation::AllocationType::FILL_PATTERN, getDevice().getDeviceBitfield()}); + patternAllocation = memoryManager->allocateGraphicsMemoryWithProperties({getDevice().getRootDeviceIndex(), alignUp(patternSize, MemoryConstants::cacheLineSize), AllocationType::FILL_PATTERN, getDevice().getDeviceBitfield()}); } if (patternSize == 1) { diff --git a/opencl/source/command_queue/enqueue_svm.h b/opencl/source/command_queue/enqueue_svm.h index 41204b4bc1..0171ae62ff 100644 --- a/opencl/source/command_queue/enqueue_svm.h +++ b/opencl/source/command_queue/enqueue_svm.h @@ -77,7 +77,7 @@ cl_int CommandQueueHw::enqueueSVMMap(cl_bool blockingMap, } bool blocking = blockingMap == CL_TRUE; - if (svmData->gpuAllocations.getAllocationType() == GraphicsAllocation::AllocationType::SVM_ZERO_COPY) { + if (svmData->gpuAllocations.getAllocationType() == AllocationType::SVM_ZERO_COPY) { NullSurface s; Surface *surfaces[] = {&s}; if (context->isProvidingPerformanceHints()) { @@ -153,7 +153,7 @@ cl_int CommandQueueHw::enqueueSVMUnmap(void *svmPtr, return CL_INVALID_VALUE; } - if (svmData->gpuAllocations.getAllocationType() == GraphicsAllocation::AllocationType::SVM_ZERO_COPY) { + if (svmData->gpuAllocations.getAllocationType() == AllocationType::SVM_ZERO_COPY) { NullSurface s; Surface *surfaces[] = {&s}; enqueueHandler(surfaces, @@ -457,7 +457,7 @@ cl_int CommandQueueHw::enqueueSVMMemFill(void *svmPtr, auto commandStreamReceieverOwnership = getGpgpuCommandStreamReceiver().obtainUniqueOwnership(); auto storageWithAllocations = getGpgpuCommandStreamReceiver().getInternalAllocationStorage(); - auto allocationType = GraphicsAllocation::AllocationType::FILL_PATTERN; + auto allocationType = AllocationType::FILL_PATTERN; auto patternAllocation = storageWithAllocations->obtainReusableAllocation(patternSize, allocationType).release(); commandStreamReceieverOwnership.unlock(); diff --git a/opencl/source/kernel/kernel.cpp b/opencl/source/kernel/kernel.cpp index 5b823f442f..0c12af83a6 100644 --- a/opencl/source/kernel/kernel.cpp +++ b/opencl/source/kernel/kernel.cpp @@ -326,7 +326,7 @@ cl_int Kernel::patchPrivateSurface() { privateSurface = executionEnvironment.memoryManager->allocateGraphicsMemoryWithProperties( {rootDeviceIndex, static_cast(privateSurfaceSize), - GraphicsAllocation::AllocationType::PRIVATE_SURFACE, + AllocationType::PRIVATE_SURFACE, pClDevice->getDeviceBitfield()}); if (privateSurface == nullptr) { return CL_OUT_OF_RESOURCES; @@ -1928,7 +1928,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() == GraphicsAllocation::AllocationType::SHARED_BUFFER) { + if (buffer && buffer->getMultiGraphicsAllocation().getAllocationType() == AllocationType::SHARED_BUFFER) { return true; } } @@ -1941,13 +1941,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() == GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY) { + if (buffer && buffer->getMultiGraphicsAllocation().getAllocationType() == AllocationType::BUFFER_HOST_MEMORY) { return true; } } if (SVM_ALLOC_OBJ == kernelArguments.at(i).type && !arg.as().isPureStateful()) { auto svmAlloc = reinterpret_cast(getKernelArg(i)); - if (svmAlloc && svmAlloc->getAllocationType() == GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY) { + if (svmAlloc && svmAlloc->getAllocationType() == AllocationType::BUFFER_HOST_MEMORY) { return true; } } @@ -1961,7 +1961,7 @@ bool Kernel::hasIndirectStatelessAccessToHostMemory() const { } for (auto gfxAllocation : kernelUnifiedMemoryGfxAllocations) { - if (gfxAllocation->getAllocationType() == GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY) { + if (gfxAllocation->getAllocationType() == AllocationType::BUFFER_HOST_MEMORY) { return true; } } diff --git a/opencl/source/mem_obj/buffer.cpp b/opencl/source/mem_obj/buffer.cpp index a796773a16..254e643654 100644 --- a/opencl/source/mem_obj/buffer.cpp +++ b/opencl/source/mem_obj/buffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -214,7 +214,7 @@ Buffer *Buffer::create(Context *context, allocationInfo[rootDeviceIndex].allocateMemory = true; } - if (allocationInfo[rootDeviceIndex].allocationType == GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY) { + if (allocationInfo[rootDeviceIndex].allocationType == AllocationType::BUFFER_HOST_MEMORY) { if (memoryProperties.flags.useHostPtr) { if (allocationInfo[rootDeviceIndex].alignementSatisfied) { allocationInfo[rootDeviceIndex].allocateMemory = false; @@ -239,7 +239,7 @@ Buffer *Buffer::create(Context *context, allocationInfo[rootDeviceIndex].memory = svmData->gpuAllocations.getGraphicsAllocation(rootDeviceIndex); allocationInfo[rootDeviceIndex].allocationType = allocationInfo[rootDeviceIndex].memory->getAllocationType(); allocationInfo[rootDeviceIndex].isHostPtrSVM = true; - allocationInfo[rootDeviceIndex].zeroCopyAllowed = allocationInfo[rootDeviceIndex].memory->getAllocationType() == GraphicsAllocation::AllocationType::SVM_ZERO_COPY; + allocationInfo[rootDeviceIndex].zeroCopyAllowed = allocationInfo[rootDeviceIndex].memory->getAllocationType() == AllocationType::SVM_ZERO_COPY; allocationInfo[rootDeviceIndex].copyMemoryFromHostPtr = false; allocationInfo[rootDeviceIndex].allocateMemory = false; allocationInfo[rootDeviceIndex].mapAllocation = svmData->cpuAllocation; @@ -297,7 +297,7 @@ Buffer *Buffer::create(Context *context, //if allocation failed for CL_MEM_USE_HOST_PTR case retry with non zero copy path if (memoryProperties.flags.useHostPtr && !allocationInfo[rootDeviceIndex].memory && Buffer::isReadOnlyMemoryPermittedByFlags(memoryProperties)) { - allocationInfo[rootDeviceIndex].allocationType = GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY; + allocationInfo[rootDeviceIndex].allocationType = AllocationType::BUFFER_HOST_MEMORY; allocationInfo[rootDeviceIndex].zeroCopyAllowed = false; allocationInfo[rootDeviceIndex].copyMemoryFromHostPtr = true; AllocationProperties allocProperties = MemoryPropertiesHelper::getAllocationProperties(rootDeviceIndex, memoryProperties, @@ -322,8 +322,8 @@ Buffer *Buffer::create(Context *context, allocationInfo[rootDeviceIndex].copyMemoryFromHostPtr = true; } } - } else if (allocationInfo[rootDeviceIndex].allocationType == GraphicsAllocation::AllocationType::BUFFER && !compressionEnabled) { - allocationInfo[rootDeviceIndex].allocationType = GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY; + } else if (allocationInfo[rootDeviceIndex].allocationType == AllocationType::BUFFER && !compressionEnabled) { + allocationInfo[rootDeviceIndex].allocationType = AllocationType::BUFFER_HOST_MEMORY; } allocationInfo[rootDeviceIndex].memory->setAllocationType(allocationInfo[rootDeviceIndex].allocationType); @@ -368,7 +368,7 @@ Buffer *Buffer::create(Context *context, if (!allocationInfo[rootDeviceIndex].zeroCopyAllowed && !allocationInfo[rootDeviceIndex].isHostPtrSVM) { AllocationProperties properties{rootDeviceIndex, false, // allocateMemory - size, GraphicsAllocation::AllocationType::MAP_ALLOCATION, + size, AllocationType::MAP_ALLOCATION, false, // isMultiStorageAllocation context->getDeviceBitfieldForAllocation(rootDeviceIndex)}; properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = true; @@ -494,19 +494,19 @@ void Buffer::checkMemory(MemoryProperties memoryProperties, return; } -GraphicsAllocation::AllocationType Buffer::getGraphicsAllocationTypeAndCompressionPreference(const MemoryProperties &properties, Context &context, - bool &compressionEnabled, bool isLocalMemoryEnabled) { +AllocationType Buffer::getGraphicsAllocationTypeAndCompressionPreference(const MemoryProperties &properties, Context &context, + bool &compressionEnabled, bool isLocalMemoryEnabled) { if (context.isSharedContext || properties.flags.forceHostMemory) { compressionEnabled = false; - return GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY; + return AllocationType::BUFFER_HOST_MEMORY; } if (properties.flags.useHostPtr && !isLocalMemoryEnabled) { compressionEnabled = false; - return GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY; + return AllocationType::BUFFER_HOST_MEMORY; } - return GraphicsAllocation::AllocationType::BUFFER; + return AllocationType::BUFFER; } bool Buffer::isReadOnlyMemoryPermittedByFlags(const MemoryProperties &properties) { diff --git a/opencl/source/mem_obj/buffer.h b/opencl/source/mem_obj/buffer.h index a239722bdf..8474df50b5 100644 --- a/opencl/source/mem_obj/buffer.h +++ b/opencl/source/mem_obj/buffer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -186,8 +186,8 @@ class Buffer : public MemObj { MemoryManager *memMngr, uint32_t rootDeviceIndex, bool forceCopyHostPtr); - static GraphicsAllocation::AllocationType getGraphicsAllocationTypeAndCompressionPreference(const MemoryProperties &properties, Context &context, - bool &compressionEnabled, bool localMemoryEnabled); + static AllocationType getGraphicsAllocationTypeAndCompressionPreference(const MemoryProperties &properties, Context &context, + bool &compressionEnabled, bool localMemoryEnabled); static bool isReadOnlyMemoryPermittedByFlags(const MemoryProperties &properties); void transferData(void *dst, void *src, size_t copySize, size_t copyOffset); diff --git a/opencl/source/mem_obj/image.cpp b/opencl/source/mem_obj/image.cpp index b2cf2bc2ec..87e273b80f 100644 --- a/opencl/source/mem_obj/image.cpp +++ b/opencl/source/mem_obj/image.cpp @@ -307,7 +307,7 @@ Image *Image::create(Context *context, gmm = new Gmm(clientContext, imgInfo, StorageInfo{}, preferCompression); allocationInfo[rootDeviceIndex].memory = memoryManager->allocateGraphicsMemoryWithProperties({rootDeviceIndex, false, // allocateMemory - imgInfo.size, GraphicsAllocation::AllocationType::SHARED_CONTEXT_IMAGE, + imgInfo.size, AllocationType::SHARED_CONTEXT_IMAGE, false, // isMultiStorageAllocation context->getDeviceBitfieldForAllocation(rootDeviceIndex)}, hostPtr); @@ -318,7 +318,7 @@ Image *Image::create(Context *context, if (allocationInfo[rootDeviceIndex].memory) { AllocationProperties properties{rootDeviceIndex, false, // allocateMemory - hostPtrMinSize, GraphicsAllocation::AllocationType::MAP_ALLOCATION, + hostPtrMinSize, AllocationType::MAP_ALLOCATION, false, // isMultiStorageAllocation context->getDeviceBitfieldForAllocation(rootDeviceIndex)}; properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = true; @@ -348,7 +348,7 @@ Image *Image::create(Context *context, } if (parentBuffer == nullptr) { - allocationInfo[rootDeviceIndex].memory->setAllocationType(GraphicsAllocation::AllocationType::IMAGE); + allocationInfo[rootDeviceIndex].memory->setAllocationType(AllocationType::IMAGE); } allocationInfo[rootDeviceIndex].memory->setMemObjectsAllocationWithWritableFlags(!memoryProperties.flags.readOnly && diff --git a/opencl/source/mem_obj/mem_obj.cpp b/opencl/source/mem_obj/mem_obj.cpp index a433276a8b..2f92242d53 100644 --- a/opencl/source/mem_obj/mem_obj.cpp +++ b/opencl/source/mem_obj/mem_obj.cpp @@ -373,7 +373,7 @@ void *MemObj::getBasePtrForMap(uint32_t rootDeviceIndex) { } AllocationProperties properties{rootDeviceIndex, false, // allocateMemory - getSize(), GraphicsAllocation::AllocationType::MAP_ALLOCATION, + getSize(), AllocationType::MAP_ALLOCATION, false, //isMultiStorageAllocation context->getDeviceBitfieldForAllocation(rootDeviceIndex)}; diff --git a/opencl/source/mem_obj/mem_obj.h b/opencl/source/mem_obj/mem_obj.h index 969f585fa7..d63da3d7dc 100644 --- a/opencl/source/mem_obj/mem_obj.h +++ b/opencl/source/mem_obj/mem_obj.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -40,7 +40,7 @@ namespace CreateMemObj { struct AllocationInfo { GraphicsAllocation *mapAllocation = nullptr; GraphicsAllocation *memory = nullptr; - GraphicsAllocation::AllocationType allocationType = GraphicsAllocation::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 8699fc990c..7219496756 100644 --- a/opencl/source/mem_obj/mem_obj_helper.cpp +++ b/opencl/source/mem_obj/mem_obj_helper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -80,7 +80,7 @@ AllocationProperties MemObjHelper::getAllocationPropertiesWithImageInfo( const HardwareInfo &hwInfo, DeviceBitfield subDevicesBitfieldParam, bool deviceOnlyVisibilty) { auto deviceBitfield = MemoryPropertiesHelper::adjustDeviceBitfield(rootDeviceIndex, memoryProperties, subDevicesBitfieldParam); - AllocationProperties allocationProperties{rootDeviceIndex, allocateMemory, imgInfo, GraphicsAllocation::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 94fdf6fe56..65571c7d5f 100644 --- a/opencl/source/mem_obj/pipe.cpp +++ b/opencl/source/mem_obj/pipe.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -62,7 +62,7 @@ Pipe *Pipe::create(Context *context, AllocationProperties allocProperties = MemoryPropertiesHelper::getAllocationProperties(rootDeviceIndex, memoryProperties, true, // allocateMemory - size, GraphicsAllocation::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 614de29392..78b0a933d8 100644 --- a/opencl/source/memory_manager/compression_selector_ocl.cpp +++ b/opencl/source/memory_manager/compression_selector_ocl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -11,10 +11,10 @@ namespace NEO { bool CompressionSelector::preferCompressedAllocation(const AllocationProperties &properties, const HardwareInfo &hwInfo) { switch (properties.allocationType) { - case GraphicsAllocation::AllocationType::GLOBAL_SURFACE: - case GraphicsAllocation::AllocationType::CONSTANT_SURFACE: - case GraphicsAllocation::AllocationType::SVM_GPU: - case GraphicsAllocation::AllocationType::PRINTF_SURFACE: { + case AllocationType::GLOBAL_SURFACE: + case AllocationType::CONSTANT_SURFACE: + case AllocationType::SVM_GPU: + case AllocationType::PRINTF_SURFACE: { const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); return hwInfoConfig.allowStatelessCompression(hwInfo); } diff --git a/opencl/source/memory_manager/migration_controller.cpp b/opencl/source/memory_manager/migration_controller.cpp index 7d94e1bb30..09f796ac99 100644 --- a/opencl/source/memory_manager/migration_controller.cpp +++ b/opencl/source/memory_manager/migration_controller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -55,7 +55,7 @@ void MigrationController::migrateMemory(Context &context, MemoryManager &memoryM } else { auto srcCmdQ = context.getSpecialQueue(sourceRootDeviceIndex); - if (srcMemory->getAllocationType() == GraphicsAllocation::AllocationType::IMAGE) { + if (srcMemory->getAllocationType() == AllocationType::IMAGE) { auto pImage = static_cast(memObj); size_t origin[3] = {}; size_t region[3] = {}; @@ -76,7 +76,7 @@ void MigrationController::migrateMemory(Context &context, MemoryManager &memoryM } else { auto dstCmdQ = context.getSpecialQueue(targetRootDeviceIndex); - if (dstMemory->getAllocationType() == GraphicsAllocation::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 fad6a3f4b8..5db9ed6898 100644 --- a/opencl/source/program/printf_handler.cpp +++ b/opencl/source/program/printf_handler.cpp @@ -52,7 +52,7 @@ void PrintfHandler::prepareDispatch(const MultiDispatchInfo &multiDispatchInfo) } auto rootDeviceIndex = device.getRootDeviceIndex(); kernel = multiDispatchInfo.peekMainKernel(); - printfSurface = device.getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, printfSurfaceSize, GraphicsAllocation::AllocationType::PRINTF_SURFACE, device.getDeviceBitfield()}); + printfSurface = device.getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, printfSurfaceSize, AllocationType::PRINTF_SURFACE, device.getDeviceBitfield()}); auto &hwInfo = device.getHardwareInfo(); auto &helper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); diff --git a/opencl/source/sharings/d3d/d3d_buffer.h b/opencl/source/sharings/d3d/d3d_buffer.h index 8286fe7dc3..59166c10fb 100644 --- a/opencl/source/sharings/d3d/d3d_buffer.h +++ b/opencl/source/sharings/d3d/d3d_buffer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -42,7 +42,7 @@ class D3DBuffer : public D3DSharing { AllocationProperties properties = {context->getDevice(0)->getRootDeviceIndex(), false, // allocateMemory 0, // size - GraphicsAllocation::AllocationType::SHARED_BUFFER, + AllocationType::SHARED_BUFFER, false, // isMultiStorageAllocation context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())}; auto alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(toOsHandle(sharedHandle), properties, true, false); diff --git a/opencl/source/sharings/d3d/d3d_surface.cpp b/opencl/source/sharings/d3d/d3d_surface.cpp index f2f0c8ef41..47e66de7f1 100644 --- a/opencl/source/sharings/d3d/d3d_surface.cpp +++ b/opencl/source/sharings/d3d/d3d_surface.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -84,7 +84,7 @@ Image *D3DSurface::create(Context *context, cl_dx9_surface_info_khr *surfaceInfo AllocationProperties allocProperties(rootDeviceIndex, false, // allocateMemory 0u, // size - GraphicsAllocation::AllocationType::SHARED_IMAGE, + AllocationType::SHARED_IMAGE, false, // isMultiStorageAllocation context->getDeviceBitfieldForAllocation(rootDeviceIndex)); alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(toOsHandle(surfaceInfo->shared_handle), allocProperties, @@ -106,7 +106,7 @@ Image *D3DSurface::create(Context *context, cl_dx9_surface_info_khr *surfaceInfo memoryProperties, context->getDevice(0)->getHardwareInfo(), context->getDeviceBitfieldForAllocation(rootDeviceIndex), context->isSingleDeviceContext()); - allocProperties.allocationType = GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY; + allocProperties.allocationType = AllocationType::SHARED_RESOURCE_COPY; 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 0119590d39..8120141b2b 100644 --- a/opencl/source/sharings/d3d/d3d_texture.cpp +++ b/opencl/source/sharings/d3d/d3d_texture.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -77,7 +77,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, GraphicsAllocation::AllocationType::SHARED_IMAGE); + alloc = memoryManager->createGraphicsAllocationFromNTHandle(sharedHandle, rootDeviceIndex, AllocationType::SHARED_IMAGE); } else { err.set(CL_INVALID_D3D11_RESOURCE_KHR); return nullptr; @@ -87,7 +87,7 @@ Image *D3DTexture::create2d(Context *context, D3DTexture2d *d3dTexture, cl_ AllocationProperties allocProperties(rootDeviceIndex, false, // allocateMemory 0u, // size - GraphicsAllocation::AllocationType::SHARED_IMAGE, + AllocationType::SHARED_IMAGE, 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, GraphicsAllocation::AllocationType::SHARED_IMAGE); + alloc = memoryManager->createGraphicsAllocationFromNTHandle(sharedHandle, rootDeviceIndex, AllocationType::SHARED_IMAGE); } 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 - GraphicsAllocation::AllocationType::SHARED_IMAGE, + AllocationType::SHARED_IMAGE, false, // isMultiStorageAllocation context->getDeviceBitfieldForAllocation(rootDeviceIndex)); if (memoryManager->verifyHandle(toOsHandle(sharedHandle), rootDeviceIndex, false)) { diff --git a/opencl/source/sharings/gl/windows/gl_buffer_windows.cpp b/opencl/source/sharings/gl/windows/gl_buffer_windows.cpp index ee7e33245e..e5b69af151 100644 --- a/opencl/source/sharings/gl/windows/gl_buffer_windows.cpp +++ b/opencl/source/sharings/gl/windows/gl_buffer_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -146,7 +146,7 @@ GraphicsAllocation *GlBuffer::createGraphicsAllocation(Context *context, unsigne AllocationProperties properties = {context->getDevice(0)->getRootDeviceIndex(), false, // allocateMemory 0u, // size - GraphicsAllocation::AllocationType::SHARED_BUFFER, + AllocationType::SHARED_BUFFER, 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 78d2a487c6..3fc4d05476 100644 --- a/opencl/source/sharings/gl/windows/gl_texture_windows.cpp +++ b/opencl/source/sharings/gl/windows/gl_texture_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -54,7 +54,7 @@ Image *GlTexture::createSharedGlTexture(Context *context, cl_mem_flags flags, cl AllocationProperties allocProperties(context->getDevice(0)->getRootDeviceIndex(), false, // allocateMemory 0u, // size - GraphicsAllocation::AllocationType::SHARED_IMAGE, + AllocationType::SHARED_IMAGE, false, // isMultiStorageAllocation context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())); auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(texInfo.globalShareHandle, allocProperties, false, false); @@ -125,7 +125,7 @@ Image *GlTexture::createSharedGlTexture(Context *context, cl_mem_flags flags, cl GraphicsAllocation *mcsAlloc = nullptr; if (texInfo.globalShareHandleMCS) { - AllocationProperties allocProperties(context->getDevice(0)->getRootDeviceIndex(), 0, GraphicsAllocation::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); 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 719459b12f..2de44ab0e3 100644 --- a/opencl/source/sharings/unified/unified_buffer.cpp +++ b/opencl/source/sharings/unified/unified_buffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2020 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -21,7 +21,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, GraphicsAllocation::AllocationType::SHARED_BUFFER); + auto graphicsAllocation = UnifiedBuffer::createGraphicsAllocation(context, extMem, AllocationType::SHARED_BUFFER); 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 3dda034a5a..c4a999d34d 100644 --- a/opencl/source/sharings/unified/unified_image.cpp +++ b/opencl/source/sharings/unified/unified_image.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -32,7 +32,7 @@ Image *UnifiedImage::createSharedUnifiedImage(Context *context, cl_mem_flags fla imgInfo.imgDesc = Image::convertDescriptor(*imageDesc); imgInfo.surfaceFormat = &clSurfaceFormat->surfaceFormat; - GraphicsAllocation *graphicsAllocation = createGraphicsAllocation(context, description, GraphicsAllocation::AllocationType::SHARED_IMAGE); + GraphicsAllocation *graphicsAllocation = createGraphicsAllocation(context, description, AllocationType::SHARED_IMAGE); if (!graphicsAllocation) { errorCode.set(CL_INVALID_MEM_OBJECT); return nullptr; diff --git a/opencl/source/sharings/unified/unified_sharing.cpp b/opencl/source/sharings/unified/unified_sharing.cpp index c2dc3ee49f..024e063ffd 100644 --- a/opencl/source/sharings/unified/unified_sharing.cpp +++ b/opencl/source/sharings/unified/unified_sharing.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -32,11 +32,11 @@ void UnifiedSharing::synchronizeObject(UpdateData &updateData) { void UnifiedSharing::releaseResource(MemObj *memObject, uint32_t rootDeviceIndex) { } -GraphicsAllocation *UnifiedSharing::createGraphicsAllocation(Context *context, UnifiedSharingMemoryDescription description, GraphicsAllocation::AllocationType allocationType) { +GraphicsAllocation *UnifiedSharing::createGraphicsAllocation(Context *context, UnifiedSharingMemoryDescription description, AllocationType allocationType) { auto memoryManager = context->getMemoryManager(); switch (description.type) { case UnifiedSharingHandleType::Win32Nt: { - return memoryManager->createGraphicsAllocationFromNTHandle(description.handle, context->getDevice(0)->getRootDeviceIndex(), GraphicsAllocation::AllocationType::SHARED_IMAGE); + return memoryManager->createGraphicsAllocationFromNTHandle(description.handle, context->getDevice(0)->getRootDeviceIndex(), AllocationType::SHARED_IMAGE); } case UnifiedSharingHandleType::LinuxFd: case UnifiedSharingHandleType::Win32Shared: { diff --git a/opencl/source/sharings/unified/unified_sharing.h b/opencl/source/sharings/unified/unified_sharing.h index 9b1d9888f6..5dd564a0ce 100644 --- a/opencl/source/sharings/unified/unified_sharing.h +++ b/opencl/source/sharings/unified/unified_sharing.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2020 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -40,7 +40,7 @@ class UnifiedSharing : public SharingHandler { void synchronizeObject(UpdateData &updateData) override; void releaseResource(MemObj *memObject, uint32_t rootDeviceIndex) override; - static GraphicsAllocation *createGraphicsAllocation(Context *context, UnifiedSharingMemoryDescription description, GraphicsAllocation::AllocationType allocationType); + static GraphicsAllocation *createGraphicsAllocation(Context *context, UnifiedSharingMemoryDescription description, AllocationType allocationType); private: UnifiedSharingFunctions *sharingFunctions; diff --git a/opencl/source/sharings/va/va_surface.cpp b/opencl/source/sharings/va/va_surface.cpp index d1cc49c1a1..4f8625c919 100644 --- a/opencl/source/sharings/va/va_surface.cpp +++ b/opencl/source/sharings/va/va_surface.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -113,7 +113,7 @@ Image *VASurface::createSharedVaSurface(Context *context, VASharingFunctions *sh AllocationProperties properties(context->getDevice(0)->getRootDeviceIndex(), false, // allocateMemory - imgInfo, GraphicsAllocation::AllocationType::SHARED_IMAGE, + imgInfo, AllocationType::SHARED_IMAGE, context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())); auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, properties, false, false); 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 d5a37ff5b9..e88e0202bc 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -958,7 +958,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(GraphicsAllocation::AllocationType::BUFFER, gpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER, gpuAllocation->getAllocationType()); EXPECT_EQ(gpuAllocation->getGpuAddress(), castToUint64(unifiedMemoryDeviceAllocation)); EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize64k), gpuAllocation->getUnderlyingBufferSize()); @@ -981,7 +981,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(), GraphicsAllocation::AllocationType::WRITE_COMBINED); + EXPECT_EQ(gpuAllocation->getAllocationType(), AllocationType::WRITE_COMBINED); EXPECT_EQ(gpuAllocation->getGpuAddress(), castToUint64(unifiedMemoryDeviceAllocation)); EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize64k), gpuAllocation->getUnderlyingBufferSize()); @@ -1147,8 +1147,8 @@ TEST_F(MultiRootDeviceClUnifiedSharedMemoryTests, WhenClHostMemAllocIntelIsCalle EXPECT_EQ(graphicsAllocation1->getRootDeviceIndex(), 1u); EXPECT_EQ(graphicsAllocation2->getRootDeviceIndex(), 2u); - EXPECT_EQ(graphicsAllocation1->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); - EXPECT_EQ(graphicsAllocation2->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(graphicsAllocation1->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(graphicsAllocation2->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); EXPECT_EQ(graphicsAllocation1->getGpuAddress(), castToUint64(unifiedMemoryHostAllocation)); EXPECT_EQ(graphicsAllocation2->getGpuAddress(), castToUint64(unifiedMemoryHostAllocation)); @@ -1184,8 +1184,8 @@ TEST_F(MultiRootDeviceClUnifiedSharedMemoryTests, WhenClSharedMemAllocIntelIsCal EXPECT_EQ(graphicsAllocation1->getRootDeviceIndex(), 1u); EXPECT_EQ(graphicsAllocation2->getRootDeviceIndex(), 2u); - EXPECT_EQ(graphicsAllocation1->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); - EXPECT_EQ(graphicsAllocation2->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(graphicsAllocation1->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(graphicsAllocation2->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); EXPECT_EQ(graphicsAllocation1->getGpuAddress(), castToUint64(unifiedMemorySharedAllocation)); EXPECT_EQ(graphicsAllocation2->getGpuAddress(), castToUint64(unifiedMemorySharedAllocation)); diff --git a/opencl/test/unit_test/aub_mem_dump/aub_alloc_dump_tests.cpp b/opencl/test/unit_test/aub_mem_dump/aub_alloc_dump_tests.cpp index 4a70d2212a..ecdbb8dbb9 100644 --- a/opencl/test/unit_test/aub_mem_dump/aub_alloc_dump_tests.cpp +++ b/opencl/test/unit_test/aub_mem_dump/aub_alloc_dump_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -42,43 +42,43 @@ HWTEST_F(AubAllocDumpTests, givenBufferOrImageWhenGraphicsAllocationIsKnownThenI auto memoryManager = pDevice->getMemoryManager(); auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{pDevice->getRootDeviceIndex(), MemoryConstants::pageSize}); - gfxAllocation->setAllocationType(GraphicsAllocation::AllocationType::BUFFER); + gfxAllocation->setAllocationType(AllocationType::BUFFER); EXPECT_FALSE(gfxAllocation->isMemObjectsAllocationWithWritableFlags()); EXPECT_FALSE(AubAllocDump::isWritableBuffer(*gfxAllocation)); - gfxAllocation->setAllocationType(GraphicsAllocation::AllocationType::BUFFER); + gfxAllocation->setAllocationType(AllocationType::BUFFER); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); - gfxAllocation->setAllocationType(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + gfxAllocation->setAllocationType(AllocationType::BUFFER_HOST_MEMORY); gfxAllocation->setMemObjectsAllocationWithWritableFlags(false); EXPECT_FALSE(AubAllocDump::isWritableBuffer(*gfxAllocation)); - gfxAllocation->setAllocationType(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + gfxAllocation->setAllocationType(AllocationType::BUFFER_HOST_MEMORY); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); - gfxAllocation->setAllocationType(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR); + gfxAllocation->setAllocationType(AllocationType::EXTERNAL_HOST_PTR); gfxAllocation->setMemObjectsAllocationWithWritableFlags(false); EXPECT_FALSE(AubAllocDump::isWritableBuffer(*gfxAllocation)); - gfxAllocation->setAllocationType(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR); + gfxAllocation->setAllocationType(AllocationType::EXTERNAL_HOST_PTR); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); - gfxAllocation->setAllocationType(GraphicsAllocation::AllocationType::MAP_ALLOCATION); + gfxAllocation->setAllocationType(AllocationType::MAP_ALLOCATION); gfxAllocation->setMemObjectsAllocationWithWritableFlags(false); EXPECT_FALSE(AubAllocDump::isWritableBuffer(*gfxAllocation)); - gfxAllocation->setAllocationType(GraphicsAllocation::AllocationType::MAP_ALLOCATION); + gfxAllocation->setAllocationType(AllocationType::MAP_ALLOCATION); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); - gfxAllocation->setAllocationType(GraphicsAllocation::AllocationType::IMAGE); + gfxAllocation->setAllocationType(AllocationType::IMAGE); gfxAllocation->setMemObjectsAllocationWithWritableFlags(false); EXPECT_FALSE(AubAllocDump::isWritableImage(*gfxAllocation)); - gfxAllocation->setAllocationType(GraphicsAllocation::AllocationType::IMAGE); + gfxAllocation->setAllocationType(AllocationType::IMAGE); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableImage(*gfxAllocation)); @@ -125,7 +125,7 @@ HWTEST_F(AubAllocDumpTests, givenNonWritableBufferWhenDumpAllocationIsCalledAndD DebugManager.flags.AUBDumpBufferFormat.set("BIN"); auto memoryManager = pDevice->getMemoryManager(); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::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/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 6e10418f3e..026830b966 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 @@ -369,7 +369,7 @@ struct StaticWalkerPartitionFourTilesTests : EnqueueWithWalkerPartitionFourTiles const AllocationProperties commandStreamAllocationProperties{rootDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::COMMAND_BUFFER, + AllocationType::COMMAND_BUFFER, 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 046b275711..3100991475 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 @@ -97,7 +97,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(GraphicsAllocation::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 c5cadb8b42..c4e37feaa9 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -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, GraphicsAllocation::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 025ce6a22e..431b0d9b05 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 @@ -24,7 +24,7 @@ struct MiAtomicAubFixture : public AUBFixture { AllocationProperties commandBufferProperties = {device->getRootDeviceIndex(), true, MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::COMMAND_BUFFER, + AllocationType::COMMAND_BUFFER, false, device->getDeviceBitfield()}; streamAllocation = memoryManager->allocateGraphicsMemoryWithProperties(commandBufferProperties); @@ -33,7 +33,7 @@ struct MiAtomicAubFixture : public AUBFixture { AllocationProperties deviceBufferProperties = {device->getRootDeviceIndex(), true, MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::BUFFER, + AllocationType::BUFFER, false, device->getDeviceBitfield()}; deviceSurface = memoryManager->allocateGraphicsMemoryWithProperties(deviceBufferProperties); @@ -42,7 +42,7 @@ struct MiAtomicAubFixture : public AUBFixture { AllocationProperties systemBufferProperties = {device->getRootDeviceIndex(), true, MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::SVM_CPU, + AllocationType::SVM_CPU, 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 79bc1d1e58..4c74628a7a 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 @@ -220,7 +220,7 @@ struct AubWalkerPartitionZeroFixture : public AubWalkerPartitionFixture { DebugManager.flags.ExperimentalSetWalkerPartitionCount.set(0); DebugManager.flags.ExperimentalSetWalkerPartitionType.set(0); - commandBufferProperties = std::make_unique(device->getRootDeviceIndex(), true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::COMMAND_BUFFER, false, device->getDeviceBitfield()); + commandBufferProperties = std::make_unique(device->getRootDeviceIndex(), true, MemoryConstants::pageSize, AllocationType::COMMAND_BUFFER, false, device->getDeviceBitfield()); auto memoryManager = this->device->getMemoryManager(); streamAllocation = memoryManager->allocateGraphicsMemoryWithProperties(*commandBufferProperties); helperSurface = memoryManager->allocateGraphicsMemoryWithProperties(*commandBufferProperties); 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 39b84a0439..8c8dd41685 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 @@ -30,7 +30,7 @@ struct MiMath : public AUBFixture, public ::testing::Test { void SetUp() override { AUBFixture::SetUp(defaultHwInfo.get()); - streamAllocation = this->device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()}); + streamAllocation = this->device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::COMMAND_BUFFER, 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 7dddfad8f0..657e14c5d1 100644 --- a/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.cpp +++ b/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -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(GraphicsAllocation::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 6d109b0533..0761c1a61b 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -78,7 +78,7 @@ struct SimpleArgFixture : public FixtureFactory::IndirectHeapFixture, outBuffer = AUBCommandStreamFixture::createResidentAllocationAndStoreItInCsr(pDestMemory, sizeUserMemory); ASSERT_NE(nullptr, outBuffer); - outBuffer->setAllocationType(GraphicsAllocation::AllocationType::BUFFER); + outBuffer->setAllocationType(AllocationType::BUFFER); outBuffer->setMemObjectsAllocationWithWritableFlags(true); } diff --git a/opencl/test/unit_test/aub_tests/xe_hp_core/aub_tests_stateless_compression_in_sba_xe_hp_core.cpp b/opencl/test/unit_test/aub_tests/xe_hp_core/aub_tests_stateless_compression_in_sba_xe_hp_core.cpp index b10220a0cf..a96299f1f1 100644 --- a/opencl/test/unit_test/aub_tests/xe_hp_core/aub_tests_stateless_compression_in_sba_xe_hp_core.cpp +++ b/opencl/test/unit_test/aub_tests/xe_hp_core/aub_tests_stateless_compression_in_sba_xe_hp_core.cpp @@ -52,7 +52,7 @@ XE_HP_CORE_TEST_P(StatelessCompressionInSBA, GENERATEONLY_givenCompressedBuffers auto unCompressedBuffer = std::unique_ptr(Buffer::create(context, CL_MEM_UNCOMPRESSED_HINT_INTEL, bufferSize, nullptr, retVal)); auto unCompressedAllocation = unCompressedBuffer->getGraphicsAllocation(device->getRootDeviceIndex()); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, unCompressedAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER, unCompressedAllocation->getAllocationType()); EXPECT_FALSE(unCompressedAllocation->isCompressionEnabled()); EXPECT_EQ(MemoryPool::LocalMemory, unCompressedAllocation->getMemoryPool()); @@ -156,7 +156,7 @@ XE_HP_CORE_TEST_P(StatelessCompressionInSBA, givenUncompressibleBufferInHostMemo auto unCompressedBuffer = std::unique_ptr(Buffer::create(context, CL_MEM_UNCOMPRESSED_HINT_INTEL, bufferSize, nullptr, retVal)); auto unCompressedAllocation = unCompressedBuffer->getGraphicsAllocation(device->getRootDeviceIndex()); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, unCompressedAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER, unCompressedAllocation->getAllocationType()); EXPECT_FALSE(unCompressedAllocation->isCompressionEnabled()); EXPECT_EQ(MemoryPool::LocalMemory, unCompressedAllocation->getMemoryPool()); @@ -168,7 +168,7 @@ XE_HP_CORE_TEST_P(StatelessCompressionInSBA, givenUncompressibleBufferInHostMemo 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(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, uncompressibleAllocationInHostMemory->getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, uncompressibleAllocationInHostMemory->getAllocationType()); EXPECT_TRUE(MemoryPool::isSystemMemoryPool(uncompressibleAllocationInHostMemory->getMemoryPool())); retVal = pCmdQ->enqueueWriteBuffer(compressedBuffer.get(), CL_FALSE, 0, bufferSize, writePattern, nullptr, 0, nullptr, nullptr); @@ -218,7 +218,7 @@ XE_HP_CORE_TEST_P(StatelessCompressionInSBA, givenUncompressibleHostMemoryAlloca EXPECT_NE(nullptr, uncompressibleHostMemAllocPtr); auto uncompressibleHostMemAlloc = context->getSVMAllocsManager()->getSVMAllocs()->get(uncompressibleHostMemAllocPtr)->gpuAllocations.getGraphicsAllocation(device->getRootDeviceIndex()); EXPECT_NE(nullptr, uncompressibleHostMemAlloc); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, uncompressibleHostMemAlloc->getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, uncompressibleHostMemAlloc->getAllocationType()); EXPECT_TRUE(MemoryPool::isSystemMemoryPool(uncompressibleHostMemAlloc->getMemoryPool())); retVal = clEnqueueMemcpyINTEL(pCmdQ, true, compressedDeviceMemAllocPtr, writePattern, bufferSize, 0, nullptr, nullptr); @@ -505,7 +505,7 @@ XE_HP_CORE_TEST_F(StatelessCompressionInSBAWithBCS, GENERATEONLY_givenCompressed 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(GraphicsAllocation::AllocationType::BUFFER, unCompressedAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER, unCompressedAllocation->getAllocationType()); EXPECT_FALSE(unCompressedAllocation->isCompressionEnabled()); EXPECT_EQ(MemoryPool::LocalMemory, unCompressedAllocation->getMemoryPool()); @@ -548,7 +548,7 @@ XE_HP_CORE_TEST_F(StatelessCompressionInSBAWithBCS, givenUncompressibleBufferInH 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(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, uncompressibleAllocationInHostMemory->getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, uncompressibleAllocationInHostMemory->getAllocationType()); EXPECT_TRUE(MemoryPool::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/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 0bf7a9a903..89c77998bd 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 @@ -55,7 +55,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(GraphicsAllocation::AllocationType::BUFFER, unCompressedAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER, unCompressedAllocation->getAllocationType()); EXPECT_FALSE(unCompressedAllocation->isCompressionEnabled()); EXPECT_EQ(MemoryPool::LocalMemory, unCompressedAllocation->getMemoryPool()); @@ -159,7 +159,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(GraphicsAllocation::AllocationType::BUFFER, unCompressedAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER, unCompressedAllocation->getAllocationType()); EXPECT_FALSE(unCompressedAllocation->isCompressionEnabled()); EXPECT_EQ(MemoryPool::LocalMemory, unCompressedAllocation->getMemoryPool()); @@ -171,7 +171,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(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, uncompressibleAllocationInHostMemory->getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, uncompressibleAllocationInHostMemory->getAllocationType()); EXPECT_TRUE(MemoryPool::isSystemMemoryPool(uncompressibleAllocationInHostMemory->getMemoryPool())); retVal = pCmdQ->enqueueWriteBuffer(compressedBuffer.get(), CL_FALSE, 0, bufferSize, writePattern, nullptr, 0, nullptr, nullptr); @@ -221,7 +221,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(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, uncompressibleHostMemAlloc->getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, uncompressibleHostMemAlloc->getAllocationType()); EXPECT_TRUE(MemoryPool::isSystemMemoryPool(uncompressibleHostMemAlloc->getMemoryPool())); retVal = clEnqueueMemcpyINTEL(pCmdQ, true, compressedDeviceMemAllocPtr, writePattern, bufferSize, 0, nullptr, nullptr); @@ -511,7 +511,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(GraphicsAllocation::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)); @@ -553,7 +553,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(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, uncompressibleAllocationInHostMemory->getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, uncompressibleAllocationInHostMemory->getAllocationType()); EXPECT_TRUE(MemoryPool::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/command_queue/blit_enqueue_tests.cpp b/opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp index 9f5c88fb98..0ad3cd045f 100644 --- a/opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp +++ b/opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp @@ -160,7 +160,7 @@ struct BlitEnqueueTests : public ::testing::Test { } void setAllocationType(GraphicsAllocation *graphicsAllocation, bool compressed) { - graphicsAllocation->setAllocationType(GraphicsAllocation::AllocationType::BUFFER); + graphicsAllocation->setAllocationType(AllocationType::BUFFER); if (compressed && !graphicsAllocation->getDefaultGmm()) { auto clientContext = device->getRootDeviceEnvironment().getGmmClientContext(); @@ -1907,7 +1907,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(GraphicsAllocation::AllocationType::KERNEL_ISA) - 1)); + DebugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(AllocationType::KERNEL_ISA) - 1)); uint32_t kernelHeap = 0; KernelInfo kernelInfo; @@ -1929,7 +1929,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(GraphicsAllocation::AllocationType::KERNEL_ISA) - 1)); + DebugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(AllocationType::KERNEL_ISA) - 1)); uint32_t kernelHeap = 0; KernelInfo kernelInfo; @@ -1947,7 +1947,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(GraphicsAllocation::AllocationType::KERNEL_ISA) - 1)); + DebugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(AllocationType::KERNEL_ISA) - 1)); device->getExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = false; @@ -1994,7 +1994,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(GraphicsAllocation::AllocationType::KERNEL_ISA) - 1)); + DebugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(AllocationType::KERNEL_ISA) - 1)); device->getExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true; @@ -2020,7 +2020,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(GraphicsAllocation::AllocationType::KERNEL_ISA) - 1)); + DebugManager.flags.ForceNonSystemMemoryPlacement.set(1 << (static_cast(AllocationType::KERNEL_ISA) - 1)); device->getExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true; 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 73d6310137..548b6af3f8 100644 --- a/opencl/test/unit_test/command_queue/command_queue_tests.cpp +++ b/opencl/test/unit_test/command_queue/command_queue_tests.cpp @@ -457,7 +457,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, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), requiredSize, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); auto &commandStreamReceiver = cmdQ.getGpgpuCommandStreamReceiver(); commandStreamReceiver.getInternalAllocationStorage()->storeAllocation(std::unique_ptr(allocation), REUSABLE_ALLOCATION); @@ -510,7 +510,7 @@ TEST_F(CommandQueueCommandStreamTest, givenCommandQueueWhenGetCSIsCalledThenComm auto commandStreamAllocation = commandStream.getGraphicsAllocation(); ASSERT_NE(nullptr, commandStreamAllocation); - EXPECT_EQ(GraphicsAllocation::AllocationType::COMMAND_BUFFER, commandStreamAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::COMMAND_BUFFER, commandStreamAllocation->getAllocationType()); } HWTEST_F(CommandQueueCommandStreamTest, givenMultiDispatchInfoWithSingleKernelWithFlushAllocationsDisabledWhenEstimatingNodesCountThenItEqualsMultiDispatchInfoSize) { @@ -652,9 +652,9 @@ HWTEST_P(CommandQueueIndirectHeapTest, givenCommandStreamReceiverWithReusableAll GraphicsAllocation *allocation = nullptr; auto &commandStreamReceiver = pClDevice->getUltCommandStreamReceiver(); - auto allocationType = GraphicsAllocation::AllocationType::LINEAR_STREAM; + auto allocationType = AllocationType::LINEAR_STREAM; if (this->GetParam() == IndirectHeap::Type::INDIRECT_OBJECT && commandStreamReceiver.canUse4GbHeaps) { - allocationType = GraphicsAllocation::AllocationType::INTERNAL_HEAP; + allocationType = AllocationType::INTERNAL_HEAP; } allocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), allocationSize, allocationType, pDevice->getDeviceBitfield()}); if (this->GetParam() == IndirectHeap::Type::SURFACE_STATE) { @@ -801,9 +801,9 @@ HWTEST_P(CommandQueueIndirectHeapTest, givenCommandQueueWhenGetIndirectHeapIsCal const auto &indirectHeap = cmdQ.getIndirectHeap(heapType, 100); auto indirectHeapAllocation = indirectHeap.getGraphicsAllocation(); ASSERT_NE(nullptr, indirectHeapAllocation); - auto expectedAllocationType = GraphicsAllocation::AllocationType::LINEAR_STREAM; + auto expectedAllocationType = AllocationType::LINEAR_STREAM; if (requireInternalHeap) { - expectedAllocationType = GraphicsAllocation::AllocationType::INTERNAL_HEAP; + expectedAllocationType = AllocationType::INTERNAL_HEAP; } 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 293ea05126..990f571c94 100644 --- a/opencl/test/unit_test/command_queue/dispatch_walker_tests.cpp +++ b/opencl/test/unit_test/command_queue/dispatch_walker_tests.cpp @@ -894,7 +894,7 @@ HWTEST_F(DispatchWalkerTest, givenThereAreAllocationsForReuseWhenDispatchWalkerI auto &csr = pCmdQ->getGpgpuCommandStreamReceiver(); auto allocation = csr.getMemoryManager()->allocateGraphicsMemoryWithProperties({csr.getRootDeviceIndex(), MemoryConstants::pageSize64k + CSRequirements::csOverfetchSize, - GraphicsAllocation::AllocationType::COMMAND_BUFFER, csr.getOsContext().getDeviceBitfield()}); + AllocationType::COMMAND_BUFFER, csr.getOsContext().getDeviceBitfield()}); csr.getInternalAllocationStorage()->storeAllocation(std::unique_ptr{allocation}, REUSABLE_ALLOCATION); ASSERT_FALSE(csr.getInternalAllocationStorage()->getAllocationsForReuse().peekIsEmpty()); @@ -945,8 +945,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, GraphicsAllocation::AllocationType::KERNEL_ISA, pDevice->getDeviceBitfield()}); - auto kernelIsaWithSamplerAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::KERNEL_ISA, pDevice->getDeviceBitfield()}); + 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()}); 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 2d136eb697..341e9a24af 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 @@ -366,7 +366,7 @@ HWTEST_F(DispatchFlagsTests, givenMockKernelWhenSettingAdditionalKernelExecInfoT EnqueueProperties enqueueProperties(false, false, false, true, false, nullptr); - auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, 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 159066b2f0..b4469aa993 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 @@ -38,7 +38,7 @@ HWTEST2_F(DispatchFlagsTests, whenSubmittingKernelWithAdditionalKernelExecInfoTh EnqueueProperties enqueueProperties(false, false, false, true, false, nullptr); - auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, 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 194aa8967b..afd0ed82ae 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 @@ -520,7 +520,7 @@ HWTEST_F(EnqueueFillBufferCmdTests, givenEnqueueFillBufferWhenPatternAllocationI GraphicsAllocation *patternAllocation = csr.getAllocationsForReuse().peekHead(); ASSERT_NE(nullptr, patternAllocation); - EXPECT_EQ(GraphicsAllocation::AllocationType::FILL_PATTERN, patternAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::FILL_PATTERN, patternAllocation->getAllocationType()); } struct EnqueueFillBufferHw : public ::testing::Test { 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 7a2bdea198..7fdef7e3d6 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -741,7 +741,7 @@ HWTEST_F(EnqueueKernelTest, givenReducedAddressSpaceGraphicsAllocationForHostPtr auto memoryManager = mockCsr->getMemoryManager(); uint32_t hostPtr[10]{}; - AllocationProperties properties{device->getRootDeviceIndex(), false, 1, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, false, device->getDeviceBitfield()}; + AllocationProperties properties{device->getRootDeviceIndex(), false, 1, AllocationType::EXTERNAL_HOST_PTR, false, device->getDeviceBitfield()}; properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = true; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, hostPtr); MockKernelWithInternals mockKernel(*device, context); @@ -765,7 +765,7 @@ HWTEST_F(EnqueueKernelTest, givenReducedAddressSpaceGraphicsAllocationForHostPtr auto memoryManager = mockCsr->getMemoryManager(); uint32_t hostPtr[10]{}; - AllocationProperties properties{device->getRootDeviceIndex(), false, 1, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, false, device->getDeviceBitfield()}; + AllocationProperties properties{device->getRootDeviceIndex(), false, 1, AllocationType::EXTERNAL_HOST_PTR, false, device->getDeviceBitfield()}; properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = false; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, hostPtr); MockKernelWithInternals mockKernel(*device, context); @@ -790,7 +790,7 @@ HWTEST_F(EnqueueKernelTest, givenFullAddressSpaceGraphicsAllocationWhenEnqueueKe auto memoryManager = mockCsr->getMemoryManager(); uint32_t hostPtr[10]{}; - AllocationProperties properties{device->getRootDeviceIndex(), false, 1, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, false, device->getDeviceBitfield()}; + AllocationProperties properties{device->getRootDeviceIndex(), false, 1, AllocationType::EXTERNAL_HOST_PTR, 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 d63f823be8..cd9385c072 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -515,7 +515,7 @@ HWTEST_F(EnqueueReadBufferTypeTest, givenCommandQueueWhenEnqueueReadBufferIsCall HWTEST_F(EnqueueReadBufferTypeTest, givenCommandQueueWhenEnqueueReadBufferWithMapAllocationIsCalledThenItDoesntCallNotifyFunction) { auto mockCmdQ = std::make_unique>(context, pClDevice, nullptr); void *ptr = nonZeroCopyBuffer->getCpuAddressForMemoryTransfer(); - GraphicsAllocation mapAllocation{0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; + GraphicsAllocation mapAllocation{0, AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; 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 5a749dcfeb..ef5f544e05 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 @@ -886,7 +886,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, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; + GraphicsAllocation mapAllocation{0, AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; 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_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp index 6d808681b6..3bbf38d959 100644 --- a/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp @@ -739,7 +739,7 @@ TEST_F(EnqueueSvmTest, givenEnqueueSVMMemFillWhenPatternAllocationIsObtainedThen GraphicsAllocation *patternAllocation = csr.getAllocationsForReuse().peekHead(); ASSERT_NE(nullptr, patternAllocation); - EXPECT_EQ(GraphicsAllocation::AllocationType::FILL_PATTERN, patternAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::FILL_PATTERN, patternAllocation->getAllocationType()); } TEST_F(EnqueueSvmTest, GivenSvmAllocationWhenEnqueingKernelThenSuccessIsReturned) { @@ -1480,7 +1480,7 @@ HWTEST_F(createHostUnifiedMemoryAllocationTest, auto alignedSize = alignUp(allocationSize, MemoryConstants::pageSize64k); auto memoryManager = context.getMemoryManager(); - auto allocationType = GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY; + auto allocationType = AllocationType::BUFFER_HOST_MEMORY; auto maxRootDeviceIndex = numDevices - 1u; std::vector rootDeviceIndices; @@ -1526,7 +1526,7 @@ HWTEST_F(createHostUnifiedMemoryAllocationTest, auto alignedSize = alignUp(allocationSize, MemoryConstants::pageSize64k); auto memoryManager = context.getMemoryManager(); - auto allocationType = GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY; + auto allocationType = AllocationType::BUFFER_HOST_MEMORY; auto maxRootDeviceIndex = numDevices - 1u; std::vector 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 55ccac83c2..e71ccce81b 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 @@ -56,7 +56,7 @@ HWTEST_F(ClCommandStreamReceiverTests, givenCommandStreamReceiverWhenFenceAlloca EXPECT_TRUE(csr.createGlobalFenceAllocation()); ASSERT_NE(nullptr, csr.globalFenceAllocation); - EXPECT_EQ(GraphicsAllocation::AllocationType::GLOBAL_FENCE, csr.globalFenceAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::GLOBAL_FENCE, csr.globalFenceAllocation->getAllocationType()); } HWTEST_F(ClCommandStreamReceiverTests, givenCommandStreamReceiverWhenGettingFenceAllocationThenCorrectFenceAllocationIsReturned) { @@ -69,7 +69,7 @@ HWTEST_F(ClCommandStreamReceiverTests, givenCommandStreamReceiverWhenGettingFenc EXPECT_TRUE(csr.createGlobalFenceAllocation()); ASSERT_NE(nullptr, csr.getGlobalFenceAllocation()); - EXPECT_EQ(GraphicsAllocation::AllocationType::GLOBAL_FENCE, csr.getGlobalFenceAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::GLOBAL_FENCE, csr.getGlobalFenceAllocation()->getAllocationType()); } using CommandStreamReceiverMultiRootDeviceTest = MultiRootDeviceFixture; @@ -81,7 +81,7 @@ TEST_F(CommandStreamReceiverMultiRootDeviceTest, WhenCreatingCommandStreamGraphi EXPECT_EQ(expectedRootDeviceIndex, commandStreamReceiver->getRootDeviceIndex()); // Linear stream / Command buffer - GraphicsAllocation *allocation = mockMemoryManager->allocateGraphicsMemoryWithProperties({expectedRootDeviceIndex, 128u, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device1->getDeviceBitfield()}); + GraphicsAllocation *allocation = mockMemoryManager->allocateGraphicsMemoryWithProperties({expectedRootDeviceIndex, 128u, AllocationType::COMMAND_BUFFER, 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 3e7fc38e5c..e1e8ed4ca8 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 @@ -505,7 +505,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCommandStreamReceiverWhenFenc EXPECT_TRUE(csr.isMadeNonResident(csr.globalFenceAllocation)); ASSERT_NE(nullptr, csr.globalFenceAllocation); - EXPECT_EQ(GraphicsAllocation::AllocationType::GLOBAL_FENCE, csr.globalFenceAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::GLOBAL_FENCE, csr.globalFenceAllocation->getAllocationType()); } HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCommandStreamReceiverWhenFenceAllocationIsRequiredButNotCreatedThenItIsNotMadeResidentDuringFlushSmallTask) { @@ -888,7 +888,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenForced32BitAllocationsModeSto auto newScratchAllocation = commandStreamReceiver->getScratchAllocation(); EXPECT_NE(scratchAllocation, newScratchAllocation); // Allocation changed - std::unique_ptr allocationReusable = commandStreamReceiver->getInternalAllocationStorage()->obtainReusableAllocation(4096, GraphicsAllocation::AllocationType::LINEAR_STREAM); + std::unique_ptr allocationReusable = commandStreamReceiver->getInternalAllocationStorage()->obtainReusableAllocation(4096, AllocationType::LINEAR_STREAM); if (allocationReusable.get() != nullptr) { if constexpr (is64bit) { @@ -923,7 +923,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, GraphicsAllocation::AllocationType::SCRATCH_SURFACE); + std::unique_ptr allocationTemporary = commandStreamReceiver->getTemporaryAllocations().detachAllocation(0, nullptr, csrPtr, AllocationType::SCRATCH_SURFACE); 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 490f475abd..acb9cd9151 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 @@ -1765,7 +1765,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, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); + auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); IndirectHeap *dsh = nullptr, *ioh = nullptr, *ssh = nullptr; pCmdQ->allocateHeapMemory(IndirectHeap::Type::DYNAMIC_STATE, 4096u, dsh); 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 61d5950464..b1c5f6a463 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 @@ -827,7 +827,7 @@ HWTEST_F(BcsTests, givenMapAllocationWhenDispatchReadWriteOperationThenSetValidG constexpr size_t mapAllocationSize = MemoryConstants::pageSize * 2; auto mapAllocationPtr = allocateAlignedMemory(mapAllocationSize, MemoryConstants::pageSize); - AllocationProperties properties{csr.getRootDeviceIndex(), false, mapAllocationSize, GraphicsAllocation::AllocationType::MAP_ALLOCATION, false, pDevice->getDeviceBitfield()}; + AllocationProperties properties{csr.getRootDeviceIndex(), false, mapAllocationSize, AllocationType::MAP_ALLOCATION, false, pDevice->getDeviceBitfield()}; GraphicsAllocation *mapAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, mapAllocationPtr.get()); auto mapAllocationOffset = 0x1234; @@ -949,7 +949,7 @@ HWTEST_F(BcsTests, givenMapAllocationInBuiltinOpParamsWhenConstructingThenUseItA constexpr size_t mapAllocationSize = MemoryConstants::pageSize * 2; auto mapAllocationPtr = allocateAlignedMemory(mapAllocationSize, MemoryConstants::pageSize); - AllocationProperties properties{csr.getRootDeviceIndex(), false, mapAllocationSize, GraphicsAllocation::AllocationType::MAP_ALLOCATION, false, pDevice->getDeviceBitfield()}; + AllocationProperties properties{csr.getRootDeviceIndex(), false, mapAllocationSize, AllocationType::MAP_ALLOCATION, 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 eb5c64d7b3..09bb9e2397 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 @@ -41,7 +41,7 @@ HWTEST2_F(CommandStreamReceiverHwTestDg2AndLater, givenGen12AndLaterWhenRayTraci EXPECT_EQ(sizeof(_3DSTATE_BTD), cmdSize); auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); - AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SCRATCH_SURFACE, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::SCRATCH_SURFACE, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); commandStreamReceiver.perDssBackedBuffer = allocation; std::unique_ptr buffer(new char[cmdSize]); @@ -76,7 +76,7 @@ HWTEST2_F(CommandStreamReceiverFlushTasDg2AndLaterTests, givenProgramPipeControl EXPECT_EQ(expectedCmdSize, cmdSize); auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); - AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SCRATCH_SURFACE, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::SCRATCH_SURFACE, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); commandStreamReceiver.perDssBackedBuffer = allocation; @@ -148,7 +148,7 @@ HWTEST2_F(CommandStreamReceiverHwTestDg2AndLater, givenGen12AndLaterWhenRayTraci EXPECT_EQ(sizeof(_3DSTATE_BTD), cmdSize); auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); - AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SCRATCH_SURFACE, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::SCRATCH_SURFACE, 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 063c946774..eac9f08e0f 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 @@ -367,9 +367,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverHwTestXeHPAndLater, givenScrat bool stateBaseAddressDirty = false; void *surfaceHeap = alignedMalloc(0x1000, 0x1000); - NEO::GraphicsAllocation heap1(1u, NEO::GraphicsAllocation::AllocationType::BUFFER, surfaceHeap, 0u, 0u, 0u, MemoryPool::System4KBPages, 0u); - NEO::GraphicsAllocation heap2(1u, NEO::GraphicsAllocation::AllocationType::BUFFER, surfaceHeap, 0u, 0u, 0u, MemoryPool::System4KBPages, 0u); - NEO::GraphicsAllocation heap3(1u, NEO::GraphicsAllocation::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); @@ -408,7 +408,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverHwTestXeHPAndLater, givenScrat *pDevice->executionEnvironment, *commandStreamReceiver->getInternalAllocationStorage()); - NEO::GraphicsAllocation graphicsAllocation(1u, NEO::GraphicsAllocation::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; @@ -446,7 +446,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverHwTestXeHPAndLater, givenScrat *pDevice->executionEnvironment, *commandStreamReceiver->getInternalAllocationStorage()); - NEO::GraphicsAllocation graphicsAllocation(1u, NEO::GraphicsAllocation::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 0548e2dc19..235d0d3834 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -275,9 +275,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, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({rootDeviceIndex, 3 * MemoryConstants::pageSize64k, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); storage->storeAllocation(std::unique_ptr(allocation), REUSABLE_ALLOCATION); - allocation = memoryManager->allocateGraphicsMemoryWithProperties({rootDeviceIndex, 3 * MemoryConstants::pageSize64k, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + allocation = memoryManager->allocateGraphicsMemoryWithProperties({rootDeviceIndex, 3 * MemoryConstants::pageSize64k, AllocationType::COMMAND_BUFFER, 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 16ab14bc69..88676b1b4d 100644 --- a/opencl/test/unit_test/d3d_sharing/d3d9_tests.cpp +++ b/opencl/test/unit_test/d3d_sharing/d3d9_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -41,7 +41,7 @@ class MockMM : public OsAgnosticMemoryManager { } GraphicsAllocation *allocateGraphicsMemoryForImage(const AllocationData &allocationData) override { auto gmm = std::make_unique(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(), *allocationData.imgInfo, StorageInfo{}, false); - AllocationProperties properties(allocationData.rootDeviceIndex, nullptr, false, GraphicsAllocation::AllocationType::SHARED_IMAGE, false, {}); + AllocationProperties properties(allocationData.rootDeviceIndex, nullptr, false, AllocationType::SHARED_IMAGE, false, {}); auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(1, properties, false, false); alloc->setDefaultGmm(forceGmm); gmmOwnershipPassed = true; @@ -245,7 +245,7 @@ TEST_F(D3D9Tests, givenD3DHandleWhenCreatingSharedSurfaceThenAllocationTypeImage ASSERT_NE(nullptr, sharedImg.get()); auto graphicsAllocation = sharedImg->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex()); ASSERT_NE(nullptr, graphicsAllocation); - EXPECT_EQ(GraphicsAllocation::AllocationType::SHARED_IMAGE, graphicsAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::SHARED_IMAGE, graphicsAllocation->getAllocationType()); } TEST_F(D3D9Tests, givenUPlaneWhenCreateSurfaceThenChangeWidthHeightAndPitch) { 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 9a9522e275..f412173623 100644 --- a/opencl/test/unit_test/d3d_sharing/d3d_tests_part2.cpp +++ b/opencl/test/unit_test/d3d_sharing/d3d_tests_part2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -445,7 +445,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(rootDeviceIndex)); - EXPECT_EQ(GraphicsAllocation::AllocationType::SHARED_IMAGE, image->getGraphicsAllocation(rootDeviceIndex)->getAllocationType()); + EXPECT_EQ(AllocationType::SHARED_IMAGE, image->getGraphicsAllocation(rootDeviceIndex)->getAllocationType()); } TYPED_TEST_P(D3DTests, givenD3DTexture3dWhenOclImageIsCreatedThenSharedImageAllocationTypeIsSet) { @@ -461,7 +461,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(rootDeviceIndex)); - EXPECT_EQ(GraphicsAllocation::AllocationType::SHARED_IMAGE, image->getGraphicsAllocation(rootDeviceIndex)->getAllocationType()); + EXPECT_EQ(AllocationType::SHARED_IMAGE, image->getGraphicsAllocation(rootDeviceIndex)->getAllocationType()); } TYPED_TEST_P(D3DTests, givenSharedObjectFromInvalidContextWhen3dCreatedThenReturnCorrectCode) { diff --git a/opencl/test/unit_test/event/event_builder_tests.cpp b/opencl/test/unit_test/event/event_builder_tests.cpp index 227c105a9d..28d1bcb19b 100644 --- a/opencl/test/unit_test/event/event_builder_tests.cpp +++ b/opencl/test/unit_test/event/event_builder_tests.cpp @@ -91,7 +91,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, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); std::vector surfaces; auto kernelOperation = std::make_unique(cmdStream, *device->getDefaultEngine().commandStreamReceiver->getInternalAllocationStorage()); @@ -141,7 +141,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, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, 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 a2b8938144..83b4c96eca 100644 --- a/opencl/test/unit_test/event/event_tests.cpp +++ b/opencl/test/unit_test/event/event_tests.cpp @@ -484,7 +484,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, GraphicsAllocation::AllocationType::COMMAND_BUFFER, false, pDevice->getDeviceBitfield()})); + auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), true, 4096, AllocationType::COMMAND_BUFFER, 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); @@ -536,7 +536,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, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); + auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, 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); @@ -571,7 +571,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, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); + auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, 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); @@ -1028,7 +1028,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, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); + auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); std::vector surfaces; auto kernelOperation = std::make_unique(cmdStream, *pDevice->getDefaultEngine().commandStreamReceiver->getInternalAllocationStorage()); @@ -1568,7 +1568,7 @@ HWTEST_F(InternalsEventTest, givenAbortedCommandWhenSubmitCalledThenDontUpdateFl MockKernelWithInternals mockKernelWithInternals(*pClDevice); auto pKernel = mockKernelWithInternals.mockKernel; - auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); + auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, AllocationType::COMMAND_BUFFER, 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 6adecdf513..1d3465291e 100644 --- a/opencl/test/unit_test/fixtures/d3d_test_fixture.h +++ b/opencl/test/unit_test/fixtures/d3d_test_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -55,11 +55,11 @@ class D3DTests : public PlatformFixture, public ::testing::Test { gmmOwnershipPassed = true; return alloc; } - GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) override { + GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override { if (failAlloc) { return nullptr; } - AllocationProperties properties(rootDeviceIndex, true, 0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, false, false, 0); + AllocationProperties properties(rootDeviceIndex, true, 0, AllocationType::INTERNAL_HOST_MEMORY, false, false, 0); auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(toOsHandle(handle), properties, false, false); 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 ed0ce70087..a872696754 100644 --- a/opencl/test/unit_test/gen12lp/buffer_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/buffer_tests_gen12lp.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -73,7 +73,7 @@ GEN12LPTEST_F(BufferTestsTgllp, givenConstantSurfaceWhenProgrammingSurfaceStateT nullptr, retVal)); ASSERT_EQ(CL_SUCCESS, retVal); - buffer->getGraphicsAllocation(0)->setAllocationType(GraphicsAllocation::AllocationType::CONSTANT_SURFACE); + buffer->getGraphicsAllocation(0)->setAllocationType(AllocationType::CONSTANT_SURFACE); 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/coherency_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl index 8b54fd9550..906669a7ab 100644 --- a/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -46,7 +46,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, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(device->getRootDeviceIndex(), false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); alloc = device->getMemoryManager()->createGraphicsAllocationFromSharedHandle(static_cast(123), properties, false, false); } diff --git a/opencl/test/unit_test/gen12lp/dg1/hw_helper_tests_dg1.cpp b/opencl/test/unit_test/gen12lp/dg1/hw_helper_tests_dg1.cpp index 0dc09b192b..78cac7322c 100644 --- a/opencl/test/unit_test/gen12lp/dg1/hw_helper_tests_dg1.cpp +++ b/opencl/test/unit_test/gen12lp/dg1/hw_helper_tests_dg1.cpp @@ -59,7 +59,7 @@ DG1TEST_F(HwHelperTestDg1, givenBufferAllocationTypeWhenSetExtraAllocationDataIs auto &hwHelper = HwHelper::get(renderCoreFamily); AllocationData allocData{}; allocData.flags.useSystemMemory = true; - AllocationProperties allocProperties(0, 1, GraphicsAllocation::AllocationType::BUFFER, {}); + AllocationProperties allocProperties(0, 1, AllocationType::BUFFER, {}); allocData.storageInfo.isLockable = false; allocProperties.flags.shareable = false; hwHelper.setExtraAllocationData(allocData, allocProperties, *defaultHwInfo); @@ -70,7 +70,7 @@ DG1TEST_F(HwHelperTestDg1, givenBufferAllocationTypeWhenSetExtraAllocationDataIs auto &hwHelper = HwHelper::get(renderCoreFamily); AllocationData allocData{}; allocData.flags.useSystemMemory = true; - AllocationProperties allocProperties(0, 1, GraphicsAllocation::AllocationType::BUFFER, {}); + AllocationProperties allocProperties(0, 1, AllocationType::BUFFER, {}); allocData.storageInfo.isLockable = false; allocProperties.flags.shareable = true; hwHelper.setExtraAllocationData(allocData, allocProperties, *defaultHwInfo); diff --git a/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl index 9959aeb26b..5a35b4c40e 100644 --- a/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -230,7 +230,7 @@ GEN12LPTEST_F(HwHelperTestsGen12LpBuffer, givenBufferThenCheckResourceCompatibil buffer.reset(Buffer::create(context.get(), 0, MemoryConstants::cacheLineSize, nullptr, retVal)); - buffer->getGraphicsAllocation(rootDeviceIndex)->setAllocationType(GraphicsAllocation::AllocationType::BUFFER); + buffer->getGraphicsAllocation(rootDeviceIndex)->setAllocationType(AllocationType::BUFFER); EXPECT_TRUE(helper.checkResourceCompatibility(*buffer->getGraphicsAllocation(rootDeviceIndex))); } @@ -326,17 +326,17 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenAllocationTypeWithCpuAccessRequiredWhenC DebugManagerStateRestore restore; DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::CpuAccessDisallowed)); - const GraphicsAllocation::AllocationType allocationTypesToUseSystemMemory[] = { - GraphicsAllocation::AllocationType::COMMAND_BUFFER, - GraphicsAllocation::AllocationType::CONSTANT_SURFACE, - GraphicsAllocation::AllocationType::GLOBAL_SURFACE, - GraphicsAllocation::AllocationType::INTERNAL_HEAP, - GraphicsAllocation::AllocationType::LINEAR_STREAM, - GraphicsAllocation::AllocationType::PIPE, - GraphicsAllocation::AllocationType::PRINTF_SURFACE, - GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, - GraphicsAllocation::AllocationType::RING_BUFFER, - GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER}; + 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}; MockMemoryManager mockMemoryManager; for (auto allocationType : allocationTypesToUseSystemMemory) { @@ -349,7 +349,7 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenAllocationTypeWithCpuAccessRequiredWhenC } AllocationData allocData{}; - AllocationProperties properties(mockRootDeviceIndex, true, 10, GraphicsAllocation::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 436e036bbd..ea08140ec7 100644 --- a/opencl/test/unit_test/gen12lp/tgllp/buffer_tests_tgllp.cpp +++ b/opencl/test/unit_test/gen12lp/tgllp/buffer_tests_tgllp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -70,7 +70,7 @@ GEN12LPTEST_F(BufferTestsTgllp, givenConstantSurfaceWhenProgrammingSurfaceStateT nullptr, retVal)); ASSERT_EQ(CL_SUCCESS, retVal); - buffer->getGraphicsAllocation(0)->setAllocationType(GraphicsAllocation::AllocationType::CONSTANT_SURFACE); + buffer->getGraphicsAllocation(0)->setAllocationType(AllocationType::CONSTANT_SURFACE); 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 096ab5ce4b..84e2a033e7 100644 --- a/opencl/test/unit_test/gtpin/gtpin_tests.cpp +++ b/opencl/test/unit_test/gtpin/gtpin_tests.cpp @@ -2366,7 +2366,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, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); + auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 128, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()})); std::vector surfaces; auto kernelOperation = std::make_unique(cmdStream, *mockCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage()); @@ -2470,11 +2470,11 @@ HWTEST_F(GTPinTestsWithLocalMemory, givenGtPinCanUseSharedAllocationWhenGtPinBuf auto cpuAllocation = allocData->cpuAllocation; ASSERT_NE(nullptr, cpuAllocation); - EXPECT_NE(GraphicsAllocation::AllocationType::UNIFIED_SHARED_MEMORY, cpuAllocation->getAllocationType()); + EXPECT_NE(AllocationType::UNIFIED_SHARED_MEMORY, cpuAllocation->getAllocationType()); auto gpuAllocation = allocData->gpuAllocations.getGraphicsAllocation(pDevice->getRootDeviceIndex()); ASSERT_NE(nullptr, gpuAllocation); - EXPECT_NE(GraphicsAllocation::AllocationType::UNIFIED_SHARED_MEMORY, gpuAllocation->getAllocationType()); + EXPECT_NE(AllocationType::UNIFIED_SHARED_MEMORY, gpuAllocation->getAllocationType()); uint8_t *address = nullptr; status = gtpinMapBuffer((gtpin::context_handle_t)ctxt, resource, &address); 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 71cfc8c74c..c54290e0ee 100644 --- a/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp @@ -218,7 +218,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, givenIndirectHeapNotAllocatedF } HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, givenIndirectHeapAllocatedFromInternalPoolWhenSendCrossThreadDataIsCalledThenHeapBaseOffsetIsReturned) { - auto internalAllocation = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::INTERNAL_HEAP, pDevice->getDeviceBitfield())); + auto internalAllocation = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP, pDevice->getDeviceBitfield())); IndirectHeap indirectHeap(internalAllocation, true); auto expectedOffset = internalAllocation->getGpuAddressToPatch(); @@ -645,12 +645,12 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, WhenGettingBindingTableStateTh // setup global memory char globalBuffer[16]; - GraphicsAllocation gfxGlobalAlloc(0, GraphicsAllocation::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, GraphicsAllocation::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 @@ -1420,7 +1420,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, HardwareCommandsTestXeHpAndLater, givenIndirectHeap } HWCMDTEST_F(IGFX_XE_HP_CORE, HardwareCommandsTestXeHpAndLater, givenIndirectHeapAllocatedFromInternalPoolWhenSendCrossThreadDataIsCalledThenHeapBaseOffsetIsReturned) { - auto internalAllocation = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::INTERNAL_HEAP, pDevice->getDeviceBitfield())); + auto internalAllocation = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP, 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 ceaabffef2..c9376d0eb4 100644 --- a/opencl/test/unit_test/helpers/heap_assigner_ocl_tests.cpp +++ b/opencl/test/unit_test/helpers/heap_assigner_ocl_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -19,7 +19,7 @@ HWTEST_F(AlocationHelperTests, givenLinearStreamTypeWhenUseExternalAllocatorForS DebugManagerStateRestore dbgRestorer; DebugManager.flags.UseExternalAllocatorForSshAndDsh.set(true); HeapAssigner heapAssigner = {}; - EXPECT_FALSE(heapAssigner.use32BitHeap(GraphicsAllocation::AllocationType::LINEAR_STREAM)); + EXPECT_FALSE(heapAssigner.use32BitHeap(AllocationType::LINEAR_STREAM)); } } // namespace NEO \ No newline at end of file diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index 646a3226ab..778e7413c0 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -479,7 +479,7 @@ HWTEST_F(HwHelperTest, givenCreatedSurfaceStateBufferWhenAllocationProvidedThenU uint64_t gpuAddr = 0x4000u; size_t allocSize = size; length.Length = static_cast(allocSize - 1); - GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 0u); + GraphicsAllocation allocation(0, AllocationType::UNKNOWN, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 0u); allocation.setDefaultGmm(new Gmm(pDevice->getGmmClientContext(), allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize(), 0, false)); SURFACE_TYPE type = RENDER_SURFACE_STATE::SURFACE_TYPE_SURFTYPE_BUFFER; helper.setRenderSurfaceStateForBuffer(rootDeviceEnvironment, stateBuffer, size, addr, 0, pitch, &allocation, false, type, true, false); @@ -516,7 +516,7 @@ HWTEST_F(HwHelperTest, givenCreatedSurfaceStateBufferWhenGmmAndAllocationCompres void *cpuAddr = reinterpret_cast(0x4000); uint64_t gpuAddr = 0x4000u; size_t allocSize = size; - GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::BUFFER, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 0u); + GraphicsAllocation allocation(0, AllocationType::BUFFER, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 0u); allocation.setDefaultGmm(new Gmm(rootDeviceEnvironment.getGmmClientContext(), allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize(), 0, false)); allocation.getDefaultGmm()->isCompressionEnabled = true; SURFACE_TYPE type = RENDER_SURFACE_STATE::SURFACE_TYPE_SURFTYPE_BUFFER; @@ -548,7 +548,7 @@ HWTEST_F(HwHelperTest, givenCreatedSurfaceStateBufferWhenGmmCompressionDisabledA void *cpuAddr = reinterpret_cast(0x4000); uint64_t gpuAddr = 0x4000u; size_t allocSize = size; - GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::BUFFER, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1); + GraphicsAllocation allocation(0, AllocationType::BUFFER, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1); allocation.setDefaultGmm(new Gmm(rootDeviceEnvironment.getGmmClientContext(), allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize(), 0, false)); SURFACE_TYPE type = RENDER_SURFACE_STATE::SURFACE_TYPE_SURFTYPE_BUFFER; helper.setRenderSurfaceStateForBuffer(rootDeviceEnvironment, stateBuffer, size, addr, 0, pitch, &allocation, false, type, false, false); @@ -581,7 +581,7 @@ HWTEST_F(HwHelperTest, givenOverrideMocsIndexForScratchSpaceWhenSurfaceStateIsPr void *cpuAddr = reinterpret_cast(0x4000); uint64_t gpuAddr = 0x4000u; size_t allocSize = size; - GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::BUFFER, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1); + GraphicsAllocation allocation(0, AllocationType::BUFFER, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1); allocation.setDefaultGmm(new Gmm(rootDeviceEnvironment.getGmmClientContext(), allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize(), 0, false)); SURFACE_TYPE type = RENDER_SURFACE_STATE::SURFACE_TYPE_SURFTYPE_BUFFER; helper.setRenderSurfaceStateForBuffer(rootDeviceEnvironment, stateBuffer, size, addr, 0, pitch, &allocation, false, type, false, false); @@ -613,7 +613,7 @@ HWTEST_F(HwHelperTest, givenCreatedSurfaceStateBufferWhenGmmAndAllocationCompres void *cpuAddr = reinterpret_cast(0x4000); uint64_t gpuAddr = 0x4000u; size_t allocSize = size; - GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::BUFFER, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1u); + GraphicsAllocation allocation(0, AllocationType::BUFFER, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1u); allocation.setDefaultGmm(new Gmm(rootDeviceEnvironment.getGmmClientContext(), allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize(), 0, false)); allocation.getDefaultGmm()->isCompressionEnabled = true; SURFACE_TYPE type = RENDER_SURFACE_STATE::SURFACE_TYPE_SURFTYPE_BUFFER; @@ -991,7 +991,7 @@ HWTEST_F(HwHelperTest, givenLockableAllocationWhenGettingIsBlitCopyRequiredForLo hwInfo.capabilityTable.blitterOperationsSupported = true; MockGraphicsAllocation graphicsAllocation; - graphicsAllocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + graphicsAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); EXPECT_TRUE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType())); graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); @@ -1021,7 +1021,7 @@ HWTEST_F(HwHelperTest, givenNotLockableAllocationWhenGettingIsBlitCopyRequiredFo hwInfo.capabilityTable.blitterOperationsSupported = true; MockGraphicsAllocation graphicsAllocation; - graphicsAllocation.setAllocationType(GraphicsAllocation::AllocationType::SVM_GPU); + graphicsAllocation.setAllocationType(AllocationType::SVM_GPU); EXPECT_FALSE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType())); graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); @@ -1051,7 +1051,7 @@ HWTEST2_F(HwHelperTest, givenDefaultHwHelperHwWhenGettingIsBlitCopyRequiredForLo auto &helper = HwHelper::get(renderCoreFamily); MockGraphicsAllocation graphicsAllocation; graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); - graphicsAllocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + graphicsAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(*defaultHwInfo, graphicsAllocation)); } diff --git a/opencl/test/unit_test/helpers/memory_properties_helpers_tests.cpp b/opencl/test/unit_test/helpers/memory_properties_helpers_tests.cpp index f909e87fc6..112569efa4 100644 --- a/opencl/test/unit_test/helpers/memory_properties_helpers_tests.cpp +++ b/opencl/test/unit_test/helpers/memory_properties_helpers_tests.cpp @@ -32,7 +32,7 @@ TEST(MemoryProperties, givenResource48BitMemoryPropertySetWhenGetAllocationPrope HardwareInfo hwInfo(*defaultHwInfo); - auto allocationProperties = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, true, 0, GraphicsAllocation::AllocationType::BUFFER, + auto allocationProperties = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, true, 0, AllocationType::BUFFER, false, hwInfo, deviceBitfield, false); EXPECT_EQ(1u, allocationProperties.flags.resource48Bit); @@ -360,7 +360,7 @@ TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsIntelWhenParsingMemoryPrope } TEST_F(MemoryPropertiesHelperTests, givenDifferentParametersWhenCallingFillCachePolicyInPropertiesThenFlushL3FlagsAreCorrectlySet) { - AllocationProperties allocationProperties{mockRootDeviceIndex, 0, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield}; + AllocationProperties allocationProperties{mockRootDeviceIndex, 0, AllocationType::BUFFER, mockDeviceBitfield}; for (auto uncached : ::testing::Bool()) { for (auto readOnly : ::testing::Bool()) { @@ -491,7 +491,7 @@ TEST_F(MemoryPropertiesHelperTests, givenUsmInitialPlacementSetWhenCallingHasIni } TEST_F(MemoryPropertiesHelperTests, WhenCallingSetInitialPlacementThenCorrectValueIsSetInAllocationProperties) { - AllocationProperties allocationProperties{mockRootDeviceIndex, 0, GraphicsAllocation::AllocationType::UNIFIED_SHARED_MEMORY, mockDeviceBitfield}; + AllocationProperties allocationProperties{mockRootDeviceIndex, 0, AllocationType::UNIFIED_SHARED_MEMORY, mockDeviceBitfield}; for (auto initialPlacement : {GraphicsAllocation::UsmInitialPlacement::CPU, GraphicsAllocation::UsmInitialPlacement::GPU}) { MemoryPropertiesHelper::setUSMInitialPlacement(allocationProperties, initialPlacement); diff --git a/opencl/test/unit_test/helpers/task_information_tests.cpp b/opencl/test/unit_test/helpers/task_information_tests.cpp index 61bc933093..c85421fcf8 100644 --- a/opencl/test/unit_test/helpers/task_information_tests.cpp +++ b/opencl/test/unit_test/helpers/task_information_tests.cpp @@ -105,7 +105,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, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); std::vector surfaces; auto kernelOperation = std::make_unique(cmdStream, *device->getDefaultEngine().commandStreamReceiver->getInternalAllocationStorage()); @@ -138,7 +138,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, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); auto &heapAllocation1 = *ih1->getGraphicsAllocation(); auto &heapAllocation2 = *ih2->getGraphicsAllocation(); @@ -217,7 +217,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, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); std::vector surfaces; auto kernelOperation = std::make_unique(cmdStream, *mockCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage()); @@ -265,7 +265,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, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); std::vector surfaces; auto kernelOperation = std::make_unique(cmdStream, *mockCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage()); @@ -317,7 +317,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, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); auto kernelOperation = std::make_unique(cmdStream, *mockCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage()); kernelOperation->setHeaps(ih1, ih2, ih3); std::unique_ptr command(new CommandWithoutKernel(*mockCmdQ, kernelOperation)); @@ -355,7 +355,7 @@ HWTEST_F(DispatchFlagsTests, givenCommandComputeKernelWhenSubmitThenPassCorrectD mockCmdQ->dispatchHints = 1234; PreemptionMode preemptionMode = device->getPreemptionMode(); - auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto cmdStream = new LinearStream(device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 1, AllocationType::COMMAND_BUFFER, 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 20efe8d811..97079e666f 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -460,7 +460,7 @@ struct CompressionParamsSupportedMatcher { HWTEST2_F(StateBaseAddressXeHPAndLaterTests, givenMemoryCompressionEnabledWhenAppendingSbaThenEnableStatelessCompressionForAllStatelessAccesses, CompressionParamsSupportedMatcher) { auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); - AllocationProperties properties(pDevice->getRootDeviceIndex(), 1, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), 1, AllocationType::BUFFER, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); IndirectHeap indirectHeap(allocation, 1); @@ -480,7 +480,7 @@ HWTEST2_F(StateBaseAddressXeHPAndLaterTests, givenMemoryCompressionEnabledWhenAp HWCMDTEST_F(IGFX_XE_HP_CORE, StateBaseAddressXeHPAndLaterTests, givenNonZeroInternalHeapBaseAddressWhenSettingIsDisabledThenExpectCommandValueZero) { auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); - AllocationProperties properties(pDevice->getRootDeviceIndex(), 1, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), 1, AllocationType::BUFFER, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); IndirectHeap indirectHeap(allocation, 1); @@ -498,7 +498,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, GraphicsAllocation::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/cache_flush_tests.inl b/opencl/test/unit_test/kernel/cache_flush_tests.inl index 45ebab5c48..a288e7d1ff 100644 --- a/opencl/test/unit_test/kernel/cache_flush_tests.inl +++ b/opencl/test/unit_test/kernel/cache_flush_tests.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -238,7 +238,7 @@ class GivenCacheFlushAfterWalkerEnabledAndProperSteppingIsSetWhenAllocationRequi ASSERT_NE(nullptr, svmAllocation); svmAllocation->setFlushL3Required(true); - mockKernel.kernelInfo.kernelAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::INTERNAL_HEAP)); + mockKernel.kernelInfo.kernelAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP)); mockKernel.mockKernel->kernelArgRequiresCacheFlush.resize(1); mockKernel.mockKernel->setArgSvmAlloc(0, svm, svmAllocation); @@ -293,7 +293,7 @@ class GivenCacheFlushAfterWalkerAndTimestampPacketsEnabledWhenAllocationRequires auto svmAllocation = svmManager.getSVMAlloc(svm)->gpuAllocations.getGraphicsAllocation(pDevice->getRootDeviceIndex()); svmAllocation->setFlushL3Required(true); - mockKernel.kernelInfo.kernelAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::INTERNAL_HEAP)); + mockKernel.kernelInfo.kernelAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP)); mockKernel.mockKernel->kernelArgRequiresCacheFlush.resize(1); mockKernel.mockKernel->setArgSvmAlloc(0, svm, svmAllocation); @@ -351,7 +351,7 @@ class GivenCacheFlushAfterWalkerDisabledAndProperSteppingIsSetWhenAllocationRequ ASSERT_NE(nullptr, svmAllocation); svmAllocation->setFlushL3Required(true); - mockKernel.kernelInfo.kernelAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::INTERNAL_HEAP)); + mockKernel.kernelInfo.kernelAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP)); mockKernel.mockKernel->kernelArgRequiresCacheFlush.resize(1); mockKernel.mockKernel->setArgSvmAlloc(0, svm, svmAllocation); diff --git a/opencl/test/unit_test/kernel/cache_flush_xehp_and_later_tests.inl b/opencl/test/unit_test/kernel/cache_flush_xehp_and_later_tests.inl index cf603f49c7..420c2563ba 100644 --- a/opencl/test/unit_test/kernel/cache_flush_xehp_and_later_tests.inl +++ b/opencl/test/unit_test/kernel/cache_flush_xehp_and_later_tests.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -264,7 +264,7 @@ class GivenCacheFlushAfterWalkerEnabledWhenAllocationRequiresCacheFlushThenFlush auto svmAllocation = svmManager.getSVMAlloc(svm)->gpuAllocations.getGraphicsAllocation(pDevice->getRootDeviceIndex()); svmAllocation->setFlushL3Required(true); - mockKernel.kernelInfo.kernelAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::INTERNAL_HEAP, pDevice->getDeviceBitfield())); + mockKernel.kernelInfo.kernelAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP, pDevice->getDeviceBitfield())); mockKernel.mockKernel->kernelArgRequiresCacheFlush.resize(1); mockKernel.mockKernel->setArgSvmAlloc(0, svm, svmAllocation); @@ -317,7 +317,7 @@ class GivenCacheFlushAfterWalkerAndTimestampPacketsEnabledWhenAllocationRequires auto svmAllocation = svmManager.getSVMAlloc(svm)->gpuAllocations.getGraphicsAllocation(pDevice->getRootDeviceIndex()); svmAllocation->setFlushL3Required(true); - mockKernel.kernelInfo.kernelAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::INTERNAL_HEAP, pDevice->getDeviceBitfield())); + mockKernel.kernelInfo.kernelAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP, pDevice->getDeviceBitfield())); mockKernel.mockKernel->kernelArgRequiresCacheFlush.resize(1); mockKernel.mockKernel->setArgSvmAlloc(0, svm, svmAllocation); @@ -373,7 +373,7 @@ class GivenCacheFlushAfterWalkerDisabledWhenAllocationRequiresCacheFlushThenFlus auto svmAllocation = svmManager.getSVMAlloc(svm)->gpuAllocations.getGraphicsAllocation(pDevice->getRootDeviceIndex()); svmAllocation->setFlushL3Required(true); - mockKernel.kernelInfo.kernelAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::INTERNAL_HEAP, pDevice->getDeviceBitfield())); + mockKernel.kernelInfo.kernelAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties(pDevice->getRootDeviceIndex(), true, MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP, pDevice->getDeviceBitfield())); mockKernel.mockKernel->kernelArgRequiresCacheFlush.resize(1); mockKernel.mockKernel->setArgSvmAlloc(0, svm, svmAllocation); 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 f6cda1b6ac..4e866a23bf 100644 --- a/opencl/test/unit_test/kernel/kernel_arg_buffer_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_arg_buffer_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -32,7 +32,7 @@ using namespace NEO; struct KernelArgBufferTest : public Test { struct AllocationTypeHelper { - GraphicsAllocation::AllocationType allocationType; + AllocationType allocationType; bool compressed; }; }; @@ -323,7 +323,7 @@ TEST_F(KernelArgBufferTest, givenNoCacheFlushBufferWhenSettingAsArgThenNotExpect TEST_F(KernelArgBufferTest, givenBufferWhenHasDirectStatelessAccessToHostMemoryIsCalledThenReturnFalse) { MockBuffer buffer; - buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(GraphicsAllocation::AllocationType::BUFFER); + buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::BUFFER); auto val = (cl_mem)&buffer; auto pVal = &val; @@ -340,7 +340,7 @@ TEST_F(KernelArgBufferTest, givenBufferWhenHasDirectStatelessAccessToHostMemoryI TEST_F(KernelArgBufferTest, givenSharedBufferWhenHasDirectStatelessAccessToSharedBufferIsCalledThenReturnCorrectValue) { MockBuffer buffer; - buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(GraphicsAllocation::AllocationType::SHARED_BUFFER); + buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::SHARED_BUFFER); auto val = (cl_mem)&buffer; auto pVal = &val; @@ -357,7 +357,7 @@ TEST_F(KernelArgBufferTest, givenSharedBufferWhenHasDirectStatelessAccessToShare TEST_F(KernelArgBufferTest, givenBufferInHostMemoryWhenHasDirectStatelessAccessToHostMemoryIsCalledThenReturnCorrectValue) { MockBuffer buffer; - buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::BUFFER_HOST_MEMORY); auto val = (cl_mem)&buffer; auto pVal = &val; @@ -376,7 +376,7 @@ TEST_F(KernelArgBufferTest, givenGfxAllocationWhenHasDirectStatelessAccessToHost char data[128]; void *ptr = &data; MockGraphicsAllocation gfxAllocation(ptr, 128); - gfxAllocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER); + gfxAllocation.setAllocationType(AllocationType::BUFFER); for (auto pureStatefulBufferAccess : {false, true}) { pKernelInfo->setBufferStateful(0, pureStatefulBufferAccess); @@ -392,7 +392,7 @@ TEST_F(KernelArgBufferTest, givenGfxAllocationInHostMemoryWhenHasDirectStateless char data[128]; void *ptr = &data; MockGraphicsAllocation gfxAllocation(ptr, 128); - gfxAllocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + gfxAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); for (auto pureStatefulBufferAccess : {false, true}) { pKernelInfo->setBufferStateful(0, pureStatefulBufferAccess); @@ -430,15 +430,15 @@ TEST_F(KernelArgBufferTest, givenKernelWithIndirectStatelessAccessWhenHasIndirec MockKernel kernelWithNoIndirectHostAllocations(pProgram, kernelInfo, *pClDevice); EXPECT_FALSE(kernelWithNoIndirectHostAllocations.hasIndirectStatelessAccessToHostMemory()); - const auto allocationTypes = {GraphicsAllocation::AllocationType::BUFFER, - GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY}; + const auto allocationTypes = {AllocationType::BUFFER, + AllocationType::BUFFER_HOST_MEMORY}; MockKernel kernelWithIndirectUnifiedMemoryAllocation(pProgram, kernelInfo, *pClDevice); MockGraphicsAllocation gfxAllocation; for (const auto type : allocationTypes) { gfxAllocation.setAllocationType(type); kernelWithIndirectUnifiedMemoryAllocation.setUnifiedMemoryExecInfo(&gfxAllocation); - if (type == GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY) { + if (type == AllocationType::BUFFER_HOST_MEMORY) { EXPECT_TRUE(kernelWithIndirectUnifiedMemoryAllocation.hasIndirectStatelessAccessToHostMemory()); } else { EXPECT_FALSE(kernelWithIndirectUnifiedMemoryAllocation.hasIndirectStatelessAccessToHostMemory()); @@ -488,7 +488,7 @@ TEST_F(KernelArgBufferTest, givenSetArgBufferOnKernelWithDirectStatelessAccessTo DebugManager.flags.EnableStatelessCompression.set(1); MockBuffer buffer; - buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(GraphicsAllocation::AllocationType::SHARED_BUFFER); + buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::SHARED_BUFFER); auto val = (cl_mem)&buffer; auto pVal = &val; @@ -510,7 +510,7 @@ TEST_F(KernelArgBufferTest, givenSetArgBufferOnKernelWithDirectStatelessAccessTo DebugManager.flags.EnableStatelessCompression.set(1); MockBuffer buffer; - buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::BUFFER_HOST_MEMORY); auto val = (cl_mem)&buffer; auto pVal = &val; @@ -555,7 +555,7 @@ TEST_F(KernelArgBufferTest, givenSetArgSvmAllocOnKernelWithDirectStatelessAccess char data[128]; void *ptr = &data; MockGraphicsAllocation gfxAllocation(ptr, 128); - gfxAllocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + gfxAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); auto retVal = pKernel->setArgSvmAlloc(0, ptr, &gfxAllocation); EXPECT_EQ(CL_SUCCESS, retVal); @@ -596,7 +596,7 @@ TEST_F(KernelArgBufferTest, givenSetUnifiedMemoryExecInfoOnKernelWithNoIndirectS pKernelInfo->hasIndirectStatelessAccess = false; MockGraphicsAllocation gfxAllocation; - gfxAllocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + gfxAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); pKernel->setUnifiedMemoryExecInfo(&gfxAllocation); @@ -615,8 +615,8 @@ TEST_F(KernelArgBufferTest, givenSetUnifiedMemoryExecInfoOnKernelWithIndirectSta pKernelInfo->hasIndirectStatelessAccess = true; - const auto allocationTypes = {GraphicsAllocation::AllocationType::BUFFER, - GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY}; + const auto allocationTypes = {AllocationType::BUFFER, + AllocationType::BUFFER_HOST_MEMORY}; MockGraphicsAllocation gfxAllocation; @@ -625,7 +625,7 @@ TEST_F(KernelArgBufferTest, givenSetUnifiedMemoryExecInfoOnKernelWithIndirectSta pKernel->setUnifiedMemoryExecInfo(&gfxAllocation); - if (type == GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY) { + if (type == AllocationType::BUFFER_HOST_MEMORY) { EXPECT_TRUE(pKernel->hasIndirectStatelessAccessToHostMemory()); } else { EXPECT_FALSE(pKernel->hasIndirectStatelessAccessToHostMemory()); @@ -635,7 +635,7 @@ TEST_F(KernelArgBufferTest, givenSetUnifiedMemoryExecInfoOnKernelWithIndirectSta pKernel->updateAuxTranslationRequired(); - if (type == GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY) { + if (type == AllocationType::BUFFER_HOST_MEMORY) { EXPECT_TRUE(pKernel->isAuxTranslationRequired()); } else { EXPECT_FALSE(pKernel->isAuxTranslationRequired()); @@ -652,10 +652,10 @@ TEST_F(KernelArgBufferTest, givenSetUnifiedMemoryExecInfoOnKernelWithIndirectSta pKernelInfo->hasIndirectStatelessAccess = true; - constexpr std::array allocationTypes = {{{GraphicsAllocation::AllocationType::BUFFER, false}, - {GraphicsAllocation::AllocationType::BUFFER, true}, - {GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, false}, - {GraphicsAllocation::AllocationType::SVM_GPU, true}}}; + constexpr std::array allocationTypes = {{{AllocationType::BUFFER, false}, + {AllocationType::BUFFER, true}, + {AllocationType::BUFFER_HOST_MEMORY, false}, + {AllocationType::SVM_GPU, true}}}; auto gmm = std::make_unique(pDevice->getRootDeviceEnvironment().getGmmClientContext(), nullptr, 0, 0, false); MockGraphicsAllocation gfxAllocation; @@ -693,10 +693,10 @@ TEST_F(KernelArgBufferTest, givenSVMAllocsManagerWithCompressedSVMAllocationsWhe DebugManagerStateRestore debugRestorer; DebugManager.flags.EnableStatelessCompression.set(1); - constexpr std::array allocationTypes = {{{GraphicsAllocation::AllocationType::BUFFER, false}, - {GraphicsAllocation::AllocationType::BUFFER, true}, - {GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, false}, - {GraphicsAllocation::AllocationType::SVM_GPU, true}}}; + constexpr std::array allocationTypes = {{{AllocationType::BUFFER, false}, + {AllocationType::BUFFER, true}, + {AllocationType::BUFFER_HOST_MEMORY, false}, + {AllocationType::SVM_GPU, true}}}; auto gmm = std::make_unique(pDevice->getRootDeviceEnvironment().getGmmClientContext(), nullptr, 0, 0, false); diff --git a/opencl/test/unit_test/kernel/kernel_tests.cpp b/opencl/test/unit_test/kernel/kernel_tests.cpp index 42262d2004..a160f38756 100644 --- a/opencl/test/unit_test/kernel/kernel_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_tests.cpp @@ -764,7 +764,7 @@ TEST_F(KernelGlobalSurfaceTest, givenBuiltInKernelWhenKernelIsCreatedThenGlobalS char buffer[16]; - GraphicsAllocation gfxAlloc(0, GraphicsAllocation::AllocationType::UNKNOWN, buffer, (uint64_t)buffer - 8u, 8, static_cast(1u), MemoryPool::MemoryNull); + GraphicsAllocation gfxAlloc(0, AllocationType::UNKNOWN, buffer, (uint64_t)buffer - 8u, 8, static_cast(1u), MemoryPool::MemoryNull); uint64_t bufferAddress = (uint64_t)gfxAlloc.getUnderlyingBuffer(); // create kernel @@ -791,7 +791,7 @@ TEST_F(KernelGlobalSurfaceTest, givenNDRangeKernelWhenKernelIsCreatedThenGlobalS char buffer[16]; - GraphicsAllocation gfxAlloc(0, GraphicsAllocation::AllocationType::UNKNOWN, buffer, (uint64_t)buffer - 8u, 8, MemoryPool::MemoryNull, 0u); + GraphicsAllocation gfxAlloc(0, AllocationType::UNKNOWN, buffer, (uint64_t)buffer - 8u, 8, MemoryPool::MemoryNull, 0u); uint64_t bufferAddress = gfxAlloc.getGpuAddress(); // create kernel @@ -884,7 +884,7 @@ TEST_F(KernelConstantSurfaceTest, givenBuiltInKernelWhenKernelIsCreatedThenConst char buffer[16]; - GraphicsAllocation gfxAlloc(0, GraphicsAllocation::AllocationType::UNKNOWN, buffer, (uint64_t)buffer - 8u, 8, static_cast(1u), MemoryPool::MemoryNull); + GraphicsAllocation gfxAlloc(0, AllocationType::UNKNOWN, buffer, (uint64_t)buffer - 8u, 8, static_cast(1u), MemoryPool::MemoryNull); uint64_t bufferAddress = (uint64_t)gfxAlloc.getUnderlyingBuffer(); // create kernel @@ -910,7 +910,7 @@ TEST_F(KernelConstantSurfaceTest, givenNDRangeKernelWhenKernelIsCreatedThenConst char buffer[16]; - GraphicsAllocation gfxAlloc(0, GraphicsAllocation::AllocationType::UNKNOWN, buffer, (uint64_t)buffer - 8u, 8, MemoryPool::MemoryNull, 0u); + GraphicsAllocation gfxAlloc(0, AllocationType::UNKNOWN, buffer, (uint64_t)buffer - 8u, 8, MemoryPool::MemoryNull, 0u); uint64_t bufferAddress = gfxAlloc.getGpuAddress(); // create kernel @@ -2897,7 +2897,7 @@ HWTEST2_F(KernelConstantSurfaceTest, givenKernelWithConstantSurfaceWhenKernelIsC pKernelInfo->setGlobalConstantsSurface(8, 0, 0); char buffer[MemoryConstants::pageSize64k]; - GraphicsAllocation gfxAlloc(0, GraphicsAllocation::AllocationType::CONSTANT_SURFACE, buffer, + GraphicsAllocation gfxAlloc(0, AllocationType::CONSTANT_SURFACE, buffer, MemoryConstants::pageSize64k, static_cast(8), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); MockContext context(pClDevice); diff --git a/opencl/test/unit_test/mem_obj/buffer_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_tests.cpp index 5ff4abe937..716a8ff2a4 100644 --- a/opencl/test/unit_test/mem_obj/buffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_tests.cpp @@ -356,9 +356,9 @@ TEST(Buffer, givenNullptrPassedToBufferCreateWhenNoSharedContextOrCompressedBuff ASSERT_NE(nullptr, buffer.get()); if (MemoryPool::isSystemMemoryPool(buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getMemoryPool())) { - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType()); } else { - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER, buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType()); } } @@ -379,7 +379,7 @@ TEST(Buffer, givenHostPtrPassedToBufferCreateWhenMemUseHostPtrFlagisSetAndBuffer auto mapAllocation = buffer->getMapAllocation(device.get()->getRootDeviceIndex()); EXPECT_NE(nullptr, mapAllocation); EXPECT_EQ(offsetedPtr, mapAllocation->getUnderlyingBuffer()); - EXPECT_EQ(GraphicsAllocation::AllocationType::MAP_ALLOCATION, mapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::MAP_ALLOCATION, mapAllocation->getAllocationType()); alignedFree(ptr); } @@ -395,7 +395,7 @@ TEST(Buffer, givenAlignedHostPtrPassedToBufferCreateWhenNoSharedContextOrCompres std::unique_ptr buffer(Buffer::create(&ctx, flags, MemoryConstants::pageSize, hostPtr, retVal)); ASSERT_NE(nullptr, buffer.get()); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, buffer->getMultiGraphicsAllocation().getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, buffer->getMultiGraphicsAllocation().getAllocationType()); } TEST(Buffer, givenAllocHostPtrFlagPassedToBufferCreateWhenNoSharedContextOrCompressedBuffersThenBuffersAllocationTypeIsBufferHostMemory) { @@ -408,7 +408,7 @@ TEST(Buffer, givenAllocHostPtrFlagPassedToBufferCreateWhenNoSharedContextOrCompr std::unique_ptr buffer(Buffer::create(&ctx, flags, MemoryConstants::pageSize, nullptr, retVal)); ASSERT_NE(nullptr, buffer.get()); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, buffer->getMultiGraphicsAllocation().getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, buffer->getMultiGraphicsAllocation().getAllocationType()); } TEST(Buffer, givenCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferCompressedTypeIsReturnedIn64Bit) { @@ -422,7 +422,7 @@ TEST(Buffer, givenCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferC auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, false); EXPECT_TRUE(compressionEnabled); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type); + EXPECT_EQ(AllocationType::BUFFER, type); } TEST(Buffer, givenCompressedBuffersDisabledLocalMemoryEnabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturnedIn64Bit) { @@ -436,7 +436,7 @@ TEST(Buffer, givenCompressedBuffersDisabledLocalMemoryEnabledWhenAllocationTypeI auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, true); EXPECT_FALSE(compressionEnabled); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type); + EXPECT_EQ(AllocationType::BUFFER, type); } TEST(Buffer, givenSharedContextWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) { @@ -450,7 +450,7 @@ TEST(Buffer, givenSharedContextWhenAllocationTypeIsQueriedThenBufferHostMemoryTy auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, false); EXPECT_FALSE(compressionEnabled); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type); + EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, type); } TEST(Buffer, givenSharedContextAndCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) { @@ -464,7 +464,7 @@ TEST(Buffer, givenSharedContextAndCompressedBuffersEnabledWhenAllocationTypeIsQu auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, false); EXPECT_FALSE(compressionEnabled); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type); + EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, type); } TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) { @@ -479,7 +479,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledWhenAllocationTypeIsQuerie auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, false); EXPECT_FALSE(compressionEnabled); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type); + EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, type); } TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) { @@ -494,7 +494,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledWhenAllocationTypeIsQueried auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, true); EXPECT_FALSE(compressionEnabled); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type); + EXPECT_EQ(AllocationType::BUFFER, type); } TEST(Buffer, givenAllocHostPtrFlagWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) { @@ -509,7 +509,7 @@ TEST(Buffer, givenAllocHostPtrFlagWhenAllocationTypeIsQueriedThenBufferTypeIsRet auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, false); EXPECT_FALSE(compressionEnabled); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type); + EXPECT_EQ(AllocationType::BUFFER, type); } TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledAndCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferMemoryTypeIsReturned) { @@ -524,7 +524,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledAndCompressedBuffersEnable auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, false); EXPECT_FALSE(compressionEnabled); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type); + EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, type); } TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledAndCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferMemoryTypeIsReturned) { @@ -539,7 +539,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledAndCompressedBuffersEnabled auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, true); EXPECT_TRUE(compressionEnabled); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type); + EXPECT_EQ(AllocationType::BUFFER, type); } TEST(Buffer, givenUseHostPointerFlagAndForceSharedPhysicalStorageWhenLocalMemoryIsEnabledThenBufferHostMemoryTypeIsReturned) { @@ -554,7 +554,7 @@ TEST(Buffer, givenUseHostPointerFlagAndForceSharedPhysicalStorageWhenLocalMemory auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, true); EXPECT_FALSE(compressionEnabled); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type); + EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, type); } TEST(Buffer, givenAllocHostPtrFlagAndCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferCompressedTypeIsReturned) { @@ -569,7 +569,7 @@ TEST(Buffer, givenAllocHostPtrFlagAndCompressedBuffersEnabledWhenAllocationTypeI auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, false); EXPECT_TRUE(compressionEnabled); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type); + EXPECT_EQ(AllocationType::BUFFER, type); } TEST(Buffer, givenZeroFlagsNoSharedContextAndCompressedBuffersDisabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) { @@ -583,7 +583,7 @@ TEST(Buffer, givenZeroFlagsNoSharedContextAndCompressedBuffersDisabledWhenAlloca auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, false); EXPECT_FALSE(compressionEnabled); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type); + EXPECT_EQ(AllocationType::BUFFER, type); } TEST(Buffer, givenClMemCopyHostPointerPassedToBufferCreateWhenAllocationIsNotInSystemMemoryPoolThenAllocationIsWrittenByEnqueueWriteBuffer) { @@ -643,7 +643,7 @@ TEST_F(CompressedBuffersTests, givenBufferCompressedAllocationAndZeroCopyHostPtr auto allocation = buffer->getGraphicsAllocation(device->getRootDeviceIndex()); EXPECT_EQ(cacheAlignedHostPtr, allocation->getUnderlyingBuffer()); EXPECT_TRUE(buffer->isMemObjZeroCopy()); - EXPECT_EQ(allocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(allocation->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); uint32_t pattern[2] = {0, 0}; pattern[0] = 0xdeadbeef; @@ -662,7 +662,7 @@ TEST_F(CompressedBuffersTests, givenBufferCompressedAllocationAndZeroCopyHostPtr allocation = buffer->getGraphicsAllocation(device->getRootDeviceIndex()); EXPECT_EQ(cacheAlignedHostPtr, allocation->getUnderlyingBuffer()); EXPECT_TRUE(buffer->isMemObjZeroCopy()); - EXPECT_EQ(allocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(allocation->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); EXPECT_THAT(allocation->getUnderlyingBuffer(), MemCompare(&pattern[0], sizeof(pattern))); @@ -671,7 +671,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(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); EXPECT_TRUE(buffer->isMemObjZeroCopy()); EXPECT_EQ(1u, buffer->getSize()); } @@ -679,7 +679,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(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); EXPECT_TRUE(buffer->isMemObjZeroCopy()); EXPECT_EQ(1u, buffer->getSize()); } @@ -691,9 +691,9 @@ TEST_F(CompressedBuffersTests, givenBufferNotCompressedAllocationAndNoHostPtrWhe auto allocation = buffer->getGraphicsAllocation(device->getRootDeviceIndex()); EXPECT_TRUE(buffer->isMemObjZeroCopy()); if (MemoryPool::isSystemMemoryPool(allocation->getMemoryPool())) { - EXPECT_EQ(allocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(allocation->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); } else { - EXPECT_EQ(allocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER); + EXPECT_EQ(allocation->getAllocationType(), AllocationType::BUFFER); } auto memoryManager = static_cast(device->getExecutionEnvironment()->memoryManager.get()); @@ -703,11 +703,11 @@ TEST_F(CompressedBuffersTests, givenBufferNotCompressedAllocationAndNoHostPtrWhe allocation = buffer->getGraphicsAllocation(device->getRootDeviceIndex()); if (HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).isBufferSizeSuitableForCompression(bufferSize, *hwInfo)) { EXPECT_FALSE(buffer->isMemObjZeroCopy()); - EXPECT_EQ(allocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER); + EXPECT_EQ(allocation->getAllocationType(), AllocationType::BUFFER); EXPECT_EQ(!memoryManager->allocate32BitGraphicsMemoryImplCalled, allocation->isCompressionEnabled()); } else { EXPECT_TRUE(buffer->isMemObjZeroCopy()); - EXPECT_EQ(allocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(allocation->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); } } @@ -720,15 +720,15 @@ TEST_F(CompressedBuffersTests, givenBufferCompressedAllocationWhenSharedContextI buffer.reset(Buffer::create(context.get(), CL_MEM_READ_WRITE, bufferSize, nullptr, retVal)); auto graphicsAllocation = buffer->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex()); if (HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).isBufferSizeSuitableForCompression(bufferSize, *hwInfo)) { - EXPECT_EQ(graphicsAllocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER); + EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::BUFFER); EXPECT_EQ(!memoryManager->allocate32BitGraphicsMemoryImplCalled, graphicsAllocation->isCompressionEnabled()); } else { - EXPECT_EQ(graphicsAllocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); } context->isSharedContext = true; buffer.reset(Buffer::create(context.get(), CL_MEM_USE_HOST_PTR, bufferSize, hostPtr, retVal)); graphicsAllocation = buffer->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex()); - EXPECT_EQ(graphicsAllocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); } TEST_F(CompressedBuffersTests, givenDebugVariableSetWhenHwFlagIsNotSetThenSelectOptionFromDebugFlag) { @@ -742,10 +742,10 @@ TEST_F(CompressedBuffersTests, givenDebugVariableSetWhenHwFlagIsNotSetThenSelect buffer.reset(Buffer::create(context.get(), 0, bufferSize, nullptr, retVal)); auto graphicsAllocation = buffer->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex()); if (HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).isBufferSizeSuitableForCompression(bufferSize, *hwInfo)) { - EXPECT_EQ(graphicsAllocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER); + EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::BUFFER); EXPECT_EQ(!memoryManager->allocate32BitGraphicsMemoryImplCalled, graphicsAllocation->isCompressionEnabled()); } else { - EXPECT_EQ(graphicsAllocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); } DebugManager.flags.RenderCompressedBuffersEnabled.set(0); @@ -807,7 +807,7 @@ TEST_F(CompressedBuffersCopyHostMemoryTests, givenCompressedBufferWhenCopyFromHo EXPECT_EQ(bufferSize, mockCmdQ->writeBufferSize); EXPECT_EQ(hostPtr, mockCmdQ->writeBufferPtr); } else { - EXPECT_EQ(graphicsAllocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); EXPECT_EQ(0u, mockCmdQ->writeBufferCounter); EXPECT_FALSE(mockCmdQ->writeBufferBlocking); EXPECT_EQ(0u, mockCmdQ->writeBufferOffset); @@ -966,9 +966,9 @@ TEST_P(NoHostPtr, WhenGettingAllocationTypeThenCorrectBufferTypeIsReturned) { auto allocation = buffer->getGraphicsAllocation(pClDevice->getRootDeviceIndex()); if (MemoryPool::isSystemMemoryPool(allocation->getMemoryPool())) { - EXPECT_EQ(allocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + EXPECT_EQ(allocation->getAllocationType(), AllocationType::BUFFER_HOST_MEMORY); } else { - EXPECT_EQ(allocation->getAllocationType(), GraphicsAllocation::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)); 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 4e93037c3c..cd521e7c7b 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 @@ -79,7 +79,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(GraphicsAllocation::AllocationType::IMAGE, imgGfxAlloc->getAllocationType()); + EXPECT_EQ(AllocationType::IMAGE, imgGfxAlloc->getAllocationType()); EXPECT_FALSE(imgGfxAlloc->getDefaultGmm()->useSystemMemoryPool); EXPECT_LT(GmmHelper::canonize(mockMemoryManager->getGfxPartition(imgGfxAlloc->getRootDeviceIndex())->getHeapBase(HeapIndex::HEAP_STANDARD64KB)), imgGfxAlloc->getGpuAddress()); EXPECT_GT(GmmHelper::canonize(mockMemoryManager->getGfxPartition(imgGfxAlloc->getRootDeviceIndex())->getHeapLimit(HeapIndex::HEAP_STANDARD64KB)), imgGfxAlloc->getGpuAddress()); 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 303b9d187a..c2a0345e49 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -475,7 +475,7 @@ TEST_F(Image2dFromBufferTest, givenBufferWhenImageFromBufferThenIsImageFromBuffe EXPECT_TRUE(imageFromBuffer->isImageFromBuffer()); auto graphicsAllocation = imageFromBuffer->getGraphicsAllocation(context.getDevice(0)->getRootDeviceIndex()); - EXPECT_TRUE(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY == graphicsAllocation->getAllocationType()); + EXPECT_TRUE(AllocationType::BUFFER_HOST_MEMORY == 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 86fa1dc8c9..c55def614d 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -67,7 +67,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, GraphicsAllocation::AllocationType::MAP_ALLOCATION, false, device->getDeviceBitfield()}; + AllocationProperties properties{0, false, MemoryConstants::cacheLineSize, AllocationType::MAP_ALLOCATION, 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 2afcf791bb..408cb78b14 100644 --- a/opencl/test/unit_test/mem_obj/image_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_tests.cpp @@ -681,7 +681,7 @@ TEST_P(CreateImageNoHostPtr, whenImageIsCreatedThenItHasProperAccessAndCacheProp ASSERT_NE(nullptr, image); auto allocation = image->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex()); - EXPECT_TRUE(allocation->getAllocationType() == GraphicsAllocation::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 f96091eca5..c12ff8c490 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 @@ -325,7 +325,7 @@ HWTEST_P(MemObjSyncDestructionTest, givenMemObjWithMapAllocationWhenAsyncDestruc AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::MAP_ALLOCATION, + AllocationType::MAP_ALLOCATION, false, context->getDeviceBitfieldForAllocation(device->getRootDeviceIndex())}; mapAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, nullptr); @@ -364,7 +364,7 @@ HWTEST_P(MemObjSyncDestructionTest, givenMemObjWithMapAllocationWhenAsyncDestruc AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::MAP_ALLOCATION, + AllocationType::MAP_ALLOCATION, false, context->getDeviceBitfieldForAllocation(device->getRootDeviceIndex())}; mapAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, nullptr); @@ -395,7 +395,7 @@ HWTEST_P(MemObjAsyncDestructionTest, givenMemObjWithMapAllocationWithoutMemUseHo AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::MAP_ALLOCATION, + AllocationType::MAP_ALLOCATION, false, context->getDeviceBitfieldForAllocation(device->getRootDeviceIndex())}; mapAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, nullptr); @@ -435,7 +435,7 @@ HWTEST_P(MemObjAsyncDestructionTest, givenMemObjWithMapAllocationWithMemUseHostP AllocationProperties properties{device->getRootDeviceIndex(), false, MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::MAP_ALLOCATION, + AllocationType::MAP_ALLOCATION, false, context->getDeviceBitfieldForAllocation(device->getRootDeviceIndex())}; mapAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, hostPtr); diff --git a/opencl/test/unit_test/memory_manager/internal_allocation_storage_tests.cpp b/opencl/test/unit_test/memory_manager/internal_allocation_storage_tests.cpp index 557f1749fc..28b8254959 100644 --- a/opencl/test/unit_test/memory_manager/internal_allocation_storage_tests.cpp +++ b/opencl/test/unit_test/memory_manager/internal_allocation_storage_tests.cpp @@ -75,27 +75,27 @@ TEST_F(InternalAllocationStorageTest, whenCleanAllocationListThenRemoveOnlyCompl } TEST_F(InternalAllocationStorageTest, whenAllocationIsStoredAsReusableButIsStillUsedThenCannotBeObtained) { - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, MemoryConstants::pageSize, GraphicsAllocation::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, GraphicsAllocation::AllocationType::BUFFER); + auto newAllocation = storage->obtainReusableAllocation(1, AllocationType::BUFFER); EXPECT_EQ(nullptr, newAllocation); storage->cleanAllocationList(2u, REUSABLE_ALLOCATION); } TEST_F(InternalAllocationStorageTest, whenAllocationIsStoredAsTemporaryAndIsStillUsedThenCanBeObtained) { - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, MemoryConstants::pageSize, GraphicsAllocation::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(), GraphicsAllocation::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()); @@ -105,23 +105,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, GraphicsAllocation::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(), GraphicsAllocation::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, GraphicsAllocation::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, GraphicsAllocation::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); @@ -130,7 +130,7 @@ TEST_F(InternalAllocationStorageTest, whenCompletedAllocationIsStoredAsReusableA auto *hwTag = csr->getTagAddress(); *hwTag = 2u; - auto reusedAllocation = storage->obtainReusableAllocation(1, GraphicsAllocation::AllocationType::BUFFER).release(); + auto reusedAllocation = storage->obtainReusableAllocation(1, AllocationType::BUFFER).release(); EXPECT_EQ(allocation, reusedAllocation); EXPECT_TRUE(csr->getAllocationsForReuse().peekIsEmpty()); @@ -139,7 +139,7 @@ TEST_F(InternalAllocationStorageTest, whenCompletedAllocationIsStoredAsReusableA TEST_F(InternalAllocationStorageTest, whenNotUsedAllocationIsStoredAsReusableAndThenCanBeObtained) { - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, MemoryConstants::pageSize, GraphicsAllocation::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()); @@ -149,7 +149,7 @@ TEST_F(InternalAllocationStorageTest, whenNotUsedAllocationIsStoredAsReusableAnd EXPECT_EQ(0u, allocation->getTaskCount(csr->getOsContext().getContextId())); EXPECT_FALSE(csr->getAllocationsForReuse().peekIsEmpty()); - auto reusedAllocation = storage->obtainReusableAllocation(1, GraphicsAllocation::AllocationType::BUFFER).release(); + auto reusedAllocation = storage->obtainReusableAllocation(1, AllocationType::BUFFER).release(); EXPECT_EQ(allocation, reusedAllocation); EXPECT_TRUE(csr->getAllocationsForReuse().peekIsEmpty()); @@ -160,9 +160,9 @@ TEST_F(InternalAllocationStorageTest, whenObtainAllocationFromMidlleOfReusableLi auto &reusableAllocations = csr->getAllocationsForReuse(); EXPECT_TRUE(reusableAllocations.peekIsEmpty()); - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, 1, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield}); - auto allocation2 = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, 10000, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield}); - auto allocation3 = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, 1, GraphicsAllocation::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); @@ -192,7 +192,7 @@ TEST_F(InternalAllocationStorageTest, whenObtainAllocationFromMidlleOfReusableLi EXPECT_EQ(allocation3, allocation2->next); EXPECT_EQ(allocation, allocation2->prev); - auto reusableAllocation = storage->obtainReusableAllocation(10000, GraphicsAllocation::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); @@ -213,12 +213,12 @@ TEST_F(InternalAllocationStorageTest, whenObtainAllocationFromMidlleOfReusableLi TEST_F(InternalAllocationStorageTest, givenAllocationWhenItIsPutOnReusableListWhenOtherAllocationTypeIsRequestedThenNullIsReturned) { EXPECT_TRUE(csr->getAllocationsForReuse().peekIsEmpty()); - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(AllocationProperties{0, MemoryConstants::pageSize, GraphicsAllocation::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, GraphicsAllocation::AllocationType::INTERNAL_HEAP); + auto internalAllocation = storage->obtainReusableAllocation(1, AllocationType::INTERNAL_HEAP); EXPECT_EQ(nullptr, internalAllocation); } @@ -288,11 +288,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, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY); + std::unique_ptr allocationReusable = csr->getAllocationsForReuse().detachAllocation(0, nullptr, csr, AllocationType::INTERNAL_HOST_MEMORY); EXPECT_EQ(nullptr, allocationReusable.get()); *tagAddress = 0x1; - allocationReusable = csr->getAllocationsForReuse().detachAllocation(0, nullptr, csr, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY); + allocationReusable = csr->getAllocationsForReuse().detachAllocation(0, nullptr, csr, AllocationType::INTERNAL_HOST_MEMORY); EXPECT_EQ(allocation, allocationReusable.get()); memoryManager->freeGraphicsMemory(allocationReusable.release()); diff --git a/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp b/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp index 139568e640..2d516baae2 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp +++ b/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -60,10 +60,10 @@ TEST(AllocationFlagsTest, givenAllocateMemoryFlagWhenGetAllocationFlagsIsCalledT UltDeviceFactory deviceFactory{1, 0}; auto pDevice = deviceFactory.rootDevices[0]; MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice); - auto allocationProperties = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, true, 0, GraphicsAllocation::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, GraphicsAllocation::AllocationType::BUFFER, false, hwInfo, {}, true); + auto allocationProperties2 = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, false, 0, AllocationType::BUFFER, false, hwInfo, {}, true); EXPECT_FALSE(allocationProperties2.flags.allocateMemory); } @@ -73,13 +73,13 @@ TEST(UncacheableFlagsTest, givenUncachedResourceFlagWhenGetAllocationFlagsIsCall auto pDevice = deviceFactory.rootDevices[0]; MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, flagsIntel, 0, pDevice); auto allocationFlags = MemoryPropertiesHelper::getAllocationProperties( - 0, memoryProperties, false, 0, GraphicsAllocation::AllocationType::BUFFER, false, pDevice->getHardwareInfo(), {}, true); + 0, memoryProperties, false, 0, AllocationType::BUFFER, false, pDevice->getHardwareInfo(), {}, true); EXPECT_TRUE(allocationFlags.flags.uncacheable); flagsIntel = 0; memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, flagsIntel, 0, pDevice); auto allocationFlags2 = MemoryPropertiesHelper::getAllocationProperties( - 0, memoryProperties, false, 0, GraphicsAllocation::AllocationType::BUFFER, false, pDevice->getHardwareInfo(), {}, true); + 0, memoryProperties, false, 0, AllocationType::BUFFER, false, pDevice->getHardwareInfo(), {}, true); EXPECT_FALSE(allocationFlags2.flags.uncacheable); } @@ -91,13 +91,13 @@ TEST(AllocationFlagsTest, givenReadOnlyResourceFlagWhenGetAllocationFlagsIsCalle auto allocationFlags = MemoryPropertiesHelper::getAllocationProperties( - 0, memoryProperties, true, 0, GraphicsAllocation::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 = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice); auto allocationFlags2 = MemoryPropertiesHelper::getAllocationProperties( - 0, memoryProperties, true, 0, GraphicsAllocation::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); } @@ -235,7 +235,7 @@ TEST(MemoryManagerTest, givenEnabledLocalMemoryWhenAllocate32BitFailsThenGraphic MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success; AllocationData allocData; - allocData.type = GraphicsAllocation::AllocationType::KERNEL_ISA; // HEAP_INTERNAL will be used + allocData.type = AllocationType::KERNEL_ISA; // HEAP_INTERNAL will be used allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.allocateMemory = true; @@ -254,7 +254,7 @@ HWTEST_F(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocatingDebugAreaThenH MemoryManagerCreate osAgnosticMemoryManager(false, true, executionEnvironment); NEO::AllocationProperties properties{0, true, MemoryConstants::pageSize64k, - NEO::GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA, + NEO::AllocationType::DEBUG_MODULE_AREA, false, mockDeviceBitfield}; properties.flags.use32BitFrontWindow = true; @@ -306,8 +306,8 @@ TEST(BaseMemoryManagerTest, givenDebugVariableSetWhenCompressedBufferIsCreatedTh executionEnvironment.initGmm(); MemoryManagerCreate memoryManager(false, true, executionEnvironment); - AllocationProperties allocPropertiesBuffer(mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield); - AllocationProperties allocPropertiesBufferCompressed(mockRootDeviceIndex, 1, GraphicsAllocation::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); @@ -378,7 +378,7 @@ TEST(BaseMemoryManagerTest, givenSvmGpuAllocationTypeWhenAllocateSystemMemoryFai allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = GraphicsAllocation::AllocationType::SVM_GPU; + allocData.type = AllocationType::SVM_GPU; allocData.hostPtr = reinterpret_cast(0x1000); memoryManager.failInAllocate = true; @@ -402,7 +402,7 @@ TEST(BaseMemoryManagerTest, givenSvmGpuAllocationTypeWhenAllocationSucceedThenRe allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = GraphicsAllocation::AllocationType::SVM_GPU; + allocData.type = AllocationType::SVM_GPU; allocData.hostPtr = reinterpret_cast(0x1000); auto allocation = memoryManager.allocateGraphicsMemoryInDevicePool(allocData, status); @@ -420,7 +420,7 @@ TEST(MemoryAllocationTest, givenMultiTileVisiblityWhenAskedForFlagsThenL3NeedsTo auto pClDevice = deviceFactory.rootDevices[0]; auto context = std::make_unique(pClDevice); auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &pClDevice->getDevice()); - auto allocationFlags = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, true, 0, GraphicsAllocation::AllocationType::BUFFER, false, hwInfo, {}, context->isSingleDeviceContext()); + auto allocationFlags = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, true, 0, AllocationType::BUFFER, false, hwInfo, {}, context->isSingleDeviceContext()); EXPECT_TRUE(allocationFlags.flags.flushL3RequiredForRead); EXPECT_TRUE(allocationFlags.flags.flushL3RequiredForWrite); } @@ -434,7 +434,7 @@ TEST(MemoryAllocationTest, givenMultiTileVisiblityAndUncachedWhenAskedForFlagsTh HardwareInfo hwInfo(*defaultHwInfo); auto allocationFlags = MemoryPropertiesHelper::getAllocationProperties( - 0, memoryProperties, true, 0, GraphicsAllocation::AllocationType::BUFFER, false, hwInfo, {}, context->isSingleDeviceContext()); + 0, memoryProperties, true, 0, AllocationType::BUFFER, false, hwInfo, {}, context->isSingleDeviceContext()); EXPECT_FALSE(allocationFlags.flags.flushL3RequiredForRead); EXPECT_FALSE(allocationFlags.flags.flushL3RequiredForWrite); } @@ -443,7 +443,7 @@ TEST(MemoryAllocationTest, givenAubDumpForceAllToLocalMemoryWhenMemoryAllocation DebugManagerStateRestore debugRestorer; DebugManager.flags.AUBDumpForceAllToLocalMemory.set(true); - MemoryAllocation allocation(mockRootDeviceIndex, GraphicsAllocation::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()); } @@ -452,7 +452,7 @@ TEST(MemoryAllocationTest, givenAubDumpForceAllToLocalMemoryWhenMemoryAllocation DebugManagerStateRestore debugRestorer; DebugManager.flags.AUBDumpForceAllToLocalMemory.set(true); - MemoryAllocation allocation(mockRootDeviceIndex, GraphicsAllocation::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()); @@ -462,7 +462,7 @@ HWTEST_F(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocateInternalAllocati MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::INTERNAL_HEAP, mockDeviceBitfield}, nullptr); + auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP, mockDeviceBitfield}, nullptr); EXPECT_NE(nullptr, allocation); EXPECT_TRUE(allocation->is32BitAllocation()); EXPECT_TRUE(memoryManager.allocationInDevicePoolCreated); @@ -474,7 +474,7 @@ TEST(MemoryManagerTest, givenDisabledLocalMemoryWhenAllocateInternalAllocationIn MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, false, executionEnvironment); - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::INTERNAL_HEAP, mockDeviceBitfield}, nullptr); + auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP, mockDeviceBitfield}, nullptr); EXPECT_NE(nullptr, allocation); EXPECT_TRUE(allocation->is32BitAllocation()); EXPECT_NE(MemoryPool::LocalMemory, allocation->getMemoryPool()); @@ -503,13 +503,13 @@ HWTEST_F(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocatingKernelIsaThenL MockExecutionEnvironment executionEnvironment(&hwInfo); MockMemoryManager memoryManager(false, true, executionEnvironment); - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::KERNEL_ISA, mockDeviceBitfield}, nullptr); + auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::KERNEL_ISA, mockDeviceBitfield}, nullptr); EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool()); EXPECT_TRUE(memoryManager.allocationInDevicePoolCreated); memoryManager.freeGraphicsMemory(allocation); - allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL, mockDeviceBitfield}, nullptr); + allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::KERNEL_ISA_INTERNAL, mockDeviceBitfield}, nullptr); EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool()); EXPECT_TRUE(memoryManager.allocationInDevicePoolCreated); @@ -520,7 +520,7 @@ HWTEST_F(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocateKernelIsaInDevic MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::INTERNAL_HEAP, mockDeviceBitfield}, nullptr); + auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP, mockDeviceBitfield}, nullptr); EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool()); EXPECT_TRUE(memoryManager.allocationInDevicePoolCreated); @@ -531,7 +531,7 @@ HWTEST_F(MemoryManagerTests, givenEnabledLocalMemoryWhenLinearStreamIsAllocatedI MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::LINEAR_STREAM, mockDeviceBitfield}, nullptr); + auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::LINEAR_STREAM, mockDeviceBitfield}, nullptr); EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool()); EXPECT_TRUE(memoryManager.allocationInDevicePoolCreated); @@ -567,34 +567,34 @@ TEST(MemoryManagerTest, givenNotSetUseSystemMemoryWhenGraphicsAllocationInDevice MockMemoryManager memoryManager(false, true, executionEnvironment); - AllocationProperties allocProperties(mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::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(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, mockRootDeviceIndex)->getOccupiedMemorySizeForBank(0)); + EXPECT_EQ(0u, memoryManager.getLocalMemoryUsageBankSelector(AllocationType::EXTERNAL_HOST_PTR, mockRootDeviceIndex)->getOccupiedMemorySizeForBank(0)); } TEST(MemoryManagerTest, givenSetUseSystemMemoryWhenGraphicsAllocationInDevicePoolIsAllocatedThenlocalMemoryUsageIsNotUpdated) { MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - AllocationProperties allocProperties(mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, mockDeviceBitfield); + AllocationProperties allocProperties(mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::EXTERNAL_HOST_PTR, 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(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, mockRootDeviceIndex)->getOccupiedMemorySizeForBank(0)); + EXPECT_EQ(0u, memoryManager.getLocalMemoryUsageBankSelector(AllocationType::EXTERNAL_HOST_PTR, mockRootDeviceIndex)->getOccupiedMemorySizeForBank(0)); } TEST(MemoryManagerTest, givenInternalAllocationTypeWhenIsAllocatedInDevicePoolThenIntenalUsageBankSelectorIsUpdated) { MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - AllocationProperties allocProperties(mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); + AllocationProperties allocProperties(mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr); EXPECT_NE(nullptr, allocation); @@ -615,7 +615,7 @@ TEST(MemoryManagerTest, givenExternalAllocationTypeWhenIsAllocatedInDevicePoolTh MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - AllocationProperties allocProperties(mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties allocProperties(mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield); auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr); EXPECT_NE(nullptr, allocation); diff --git a/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.cpp b/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.cpp index 9fb837e43c..b440cbbf33 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.cpp +++ b/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.cpp @@ -26,13 +26,13 @@ using namespace NEO; -using MemoryManagerGetAlloctionData32BitAnd64kbPagesAllowedTest = testing::TestWithParam; +using MemoryManagerGetAlloctionData32BitAnd64kbPagesAllowedTest = testing::TestWithParam; using MemoryManagerGetAlloctionDataTests = ::testing::Test; TEST_F(MemoryManagerGetAlloctionDataTests, givenHostMemoryAllocationTypeAndAllocateMemoryFlagAndNullptrWhenAllocationDataIsQueriedThenCorrectFlagsAndSizeAreSet) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::BUFFER_HOST_MEMORY, false, mockDeviceBitfield); MockMemoryManager mockMemoryManager; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); @@ -43,7 +43,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenHostMemoryAllocationTypeAndAlloc TEST_F(MemoryManagerGetAlloctionDataTests, givenNonHostMemoryAllocatoinTypeWhenAllocationDataIsQueriedThenUseSystemMemoryFlagsIsNotSet) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, GraphicsAllocation::AllocationType::BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::BUFFER, false, mockDeviceBitfield); MockMemoryManager mockMemoryManager; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); @@ -54,12 +54,12 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenNonHostMemoryAllocatoinTypeWhenA } TEST_F(MemoryManagerGetAlloctionDataTests, givenForceSystemMemoryFlagWhenAllocationDataIsQueriedThenUseSystemMemoryFlagsIsSet) { - auto firstAllocationIdx = static_cast(GraphicsAllocation::AllocationType::UNKNOWN); - auto lastAllocationIdx = static_cast(GraphicsAllocation::AllocationType::COUNT); + auto firstAllocationIdx = static_cast(AllocationType::UNKNOWN); + auto lastAllocationIdx = static_cast(AllocationType::COUNT); for (int allocationIdx = firstAllocationIdx + 1; allocationIdx != lastAllocationIdx; allocationIdx++) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, static_cast(allocationIdx), false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, static_cast(allocationIdx), false, mockDeviceBitfield); properties.flags.forceSystemMemory = true; MockMemoryManager mockMemoryManager; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); @@ -71,7 +71,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenForceSystemMemoryFlagWhenAllocat TEST_F(MemoryManagerGetAlloctionDataTests, givenMultiRootDeviceIndexAllocationPropertiesWhenAllocationDataIsQueriedThenUseSystemMemoryFlagsIsSet) { { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, GraphicsAllocation::AllocationType::BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::BUFFER, false, mockDeviceBitfield); properties.flags.crossRootDeviceAccess = true; MockMemoryManager mockMemoryManager; @@ -83,7 +83,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenMultiRootDeviceIndexAllocationPr { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, GraphicsAllocation::AllocationType::IMAGE, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::IMAGE, false, mockDeviceBitfield); properties.flags.crossRootDeviceAccess = true; MockMemoryManager mockMemoryManager; @@ -97,7 +97,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenMultiRootDeviceIndexAllocationPr TEST_F(MemoryManagerGetAlloctionDataTests, givenDisabledCrossRootDeviceAccsessFlagInAllocationPropertiesWhenAllocationDataIsQueriedThenUseSystemMemoryFlagsIsNotSet) { { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, GraphicsAllocation::AllocationType::BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::BUFFER, false, mockDeviceBitfield); properties.flags.crossRootDeviceAccess = false; MockMemoryManager mockMemoryManager; @@ -109,7 +109,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenDisabledCrossRootDeviceAccsessFl { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, GraphicsAllocation::AllocationType::IMAGE, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::IMAGE, false, mockDeviceBitfield); properties.flags.crossRootDeviceAccess = false; MockMemoryManager mockMemoryManager; @@ -122,7 +122,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenDisabledCrossRootDeviceAccsessFl HWTEST_F(MemoryManagerGetAlloctionDataTests, givenCommandBufferAllocationTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, GraphicsAllocation::AllocationType::COMMAND_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::COMMAND_BUFFER, false, mockDeviceBitfield); MockMemoryManager mockMemoryManager; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); @@ -133,7 +133,7 @@ HWTEST_F(MemoryManagerGetAlloctionDataTests, givenCommandBufferAllocationTypeWhe TEST_F(MemoryManagerGetAlloctionDataTests, givenAllocateMemoryFlagTrueWhenHostPtrIsNotNullThenAllocationDataHasHostPtrNulled) { AllocationData allocData; char memory = 0; - AllocationProperties properties(mockRootDeviceIndex, true, sizeof(memory), GraphicsAllocation::AllocationType::BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, sizeof(memory), AllocationType::BUFFER, false, mockDeviceBitfield); MockMemoryManager mockMemoryManager; mockMemoryManager.getAllocationData(allocData, properties, &memory, mockMemoryManager.createStorageInfoFromProperties(properties)); @@ -144,7 +144,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenAllocateMemoryFlagTrueWhenHostPt TEST_F(MemoryManagerGetAlloctionDataTests, givenBufferTypeWhenAllocationDataIsQueriedThenForcePinFlagIsSet) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, GraphicsAllocation::AllocationType::BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::BUFFER, false, mockDeviceBitfield); MockMemoryManager mockMemoryManager; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); @@ -154,7 +154,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenBufferTypeWhenAllocationDataIsQu TEST_F(MemoryManagerGetAlloctionDataTests, givenBufferHostMemoryTypeWhenAllocationDataIsQueriedThenForcePinFlagIsSet) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::BUFFER_HOST_MEMORY, false, mockDeviceBitfield); MockMemoryManager mockMemoryManager; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); @@ -164,7 +164,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenBufferHostMemoryTypeWhenAllocati TEST_F(MemoryManagerGetAlloctionDataTests, givenBufferCompressedTypeWhenAllocationDataIsQueriedThenForcePinFlagIsSet) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, GraphicsAllocation::AllocationType::BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::BUFFER, false, mockDeviceBitfield); properties.flags.preferCompressed = true; MockMemoryManager mockMemoryManager; @@ -175,7 +175,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenBufferCompressedTypeWhenAllocati TEST_F(MemoryManagerGetAlloctionDataTests, givenWriteCombinedTypeWhenAllocationDataIsQueriedThenForcePinFlagIsSet) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, GraphicsAllocation::AllocationType::WRITE_COMBINED, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::WRITE_COMBINED, false, mockDeviceBitfield); MockMemoryManager mockMemoryManager; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); @@ -185,7 +185,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenWriteCombinedTypeWhenAllocationD TEST_F(MemoryManagerGetAlloctionDataTests, givenDefaultAllocationFlagsWhenAllocationDataIsQueriedThenAllocateMemoryIsFalse) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, false, 0, GraphicsAllocation::AllocationType::BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, false, 0, AllocationType::BUFFER, false, mockDeviceBitfield); properties.flags.preferCompressed = true; char memory; MockMemoryManager mockMemoryManager; @@ -196,7 +196,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenDefaultAllocationFlagsWhenAlloca TEST_F(MemoryManagerGetAlloctionDataTests, givenDebugModeWhenCertainAllocationTypesAreSelectedThenSystemPlacementIsChoosen) { DebugManagerStateRestore restorer; - auto allocationType = GraphicsAllocation::AllocationType::BUFFER; + auto allocationType = AllocationType::BUFFER; auto mask = 1llu << (static_cast(allocationType) - 1); DebugManager.flags.ForceSystemMemoryPlacement.set(mask); @@ -208,7 +208,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenDebugModeWhenCertainAllocationTy EXPECT_TRUE(allocData.flags.useSystemMemory); allocData.flags.useSystemMemory = false; - allocationType = GraphicsAllocation::AllocationType::WRITE_COMBINED; + allocationType = AllocationType::WRITE_COMBINED; mask |= 1llu << (static_cast(allocationType) - 1); DebugManager.flags.ForceSystemMemoryPlacement.set(mask); @@ -222,7 +222,7 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenDebugModeWhenCertainAllocationTy EXPECT_TRUE(allocData.flags.useSystemMemory); allocData.flags.useSystemMemory = false; - allocationType = GraphicsAllocation::AllocationType::IMAGE; + allocationType = AllocationType::IMAGE; mask = 1llu << (static_cast(allocationType) - 1); DebugManager.flags.ForceSystemMemoryPlacement.set(mask); @@ -249,7 +249,7 @@ TEST_P(MemoryManagerGetAlloctionData32BitAnd64kbPagesAllowedTest, given64kbAllow AllocationData allocData; AllocationProperties properties(mockRootDeviceIndex, 10, allocType, mockDeviceBitfield); - bool bufferCompressedType = (allocType == GraphicsAllocation::AllocationType::BUFFER); + bool bufferCompressedType = (allocType == AllocationType::BUFFER); properties.flags.preferCompressed = bufferCompressedType; @@ -280,27 +280,27 @@ TEST_P(MemoryManagerGetAlloctionData32BitAnd64kbPagesNotAllowedTest, givenAlloca EXPECT_EQ(allocType, allocData.type); } -static const GraphicsAllocation::AllocationType allocationTypesWith32BitAnd64KbPagesAllowed[] = {GraphicsAllocation::AllocationType::BUFFER, - GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, - GraphicsAllocation::AllocationType::PIPE, - GraphicsAllocation::AllocationType::SCRATCH_SURFACE, - GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE, - GraphicsAllocation::AllocationType::PRIVATE_SURFACE, - GraphicsAllocation::AllocationType::PRINTF_SURFACE, - GraphicsAllocation::AllocationType::CONSTANT_SURFACE, - GraphicsAllocation::AllocationType::GLOBAL_SURFACE, - GraphicsAllocation::AllocationType::WRITE_COMBINED}; +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}; INSTANTIATE_TEST_CASE_P(Allow32BitAnd64kbPagesTypes, MemoryManagerGetAlloctionData32BitAnd64kbPagesAllowedTest, ::testing::ValuesIn(allocationTypesWith32BitAnd64KbPagesAllowed)); -static const GraphicsAllocation::AllocationType allocationTypesWith32BitAnd64KbPagesNotAllowed[] = {GraphicsAllocation::AllocationType::COMMAND_BUFFER, - GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, - GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER, - GraphicsAllocation::AllocationType::IMAGE, - GraphicsAllocation::AllocationType::INSTRUCTION_HEAP, - GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY}; +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}; INSTANTIATE_TEST_CASE_P(Disallow32BitAnd64kbPagesTypes, MemoryManagerGetAlloctionData32BitAnd64kbPagesNotAllowedTest, @@ -312,7 +312,7 @@ TEST(MemoryManagerTest, givenForced32BitSetWhenGraphicsMemoryFor32BitAllowedType memoryManager.setForce32BitAllocations(true); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER, mockDeviceBitfield); memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); @@ -335,7 +335,7 @@ TEST(MemoryManagerTest, givenEnabledShareableWhenGraphicsAllocationIsAllocatedTh MockMemoryManager memoryManager(false, false, executionEnvironment); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER, mockDeviceBitfield); properties.flags.shareable = true; memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); @@ -353,7 +353,7 @@ TEST(MemoryManagerTest, givenEnabledShareableWhenGraphicsAllocationIsCalledAndSy MockMemoryManager memoryManager(false, false, executionEnvironment); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER, mockDeviceBitfield); properties.flags.shareable = true; memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); @@ -372,7 +372,7 @@ TEST(MemoryManagerTest, givenForced32BitEnabledWhenGraphicsMemoryWihtoutAllow32B memoryManager.setForce32BitAllocations(true); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER, mockDeviceBitfield); memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); allocData.flags.allow32Bit = false; @@ -390,7 +390,7 @@ TEST(MemoryManagerTest, givenForced32BitDisabledWhenGraphicsMemoryWith32BitFlagF memoryManager.setForce32BitAllocations(false); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER, mockDeviceBitfield); memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); @@ -406,7 +406,7 @@ TEST(MemoryManagerTest, givenEnabled64kbPagesWhenGraphicsMemoryMustBeHostMemoryA executionEnvironment.initGmm(); MockMemoryManager memoryManager(true, false, executionEnvironment); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield); memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); @@ -424,7 +424,7 @@ TEST(MemoryManagerTest, givenEnabled64kbPagesWhenGraphicsMemoryWithoutAllow64kbP MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(true, false, executionEnvironment); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER, mockDeviceBitfield); memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); allocData.flags.allow64kbPages = false; @@ -441,7 +441,7 @@ TEST(MemoryManagerTest, givenDisabled64kbPagesWhenGraphicsMemoryMustBeHostMemory MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, false, executionEnvironment); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield); memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); @@ -460,7 +460,7 @@ TEST(MemoryManagerTest, givenForced32BitAndEnabled64kbPagesWhenGraphicsMemoryMus memoryManager.setForce32BitAllocations(true); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 10, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield); memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties)); @@ -479,7 +479,7 @@ TEST(MemoryManagerTest, givenEnabled64kbPagesWhenGraphicsMemoryIsAllocatedWithHo MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(true, false, executionEnvironment); AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, false, 1, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, false, 1, AllocationType::BUFFER_HOST_MEMORY, false, mockDeviceBitfield); char memory[1]; memoryManager.getAllocationData(allocData, properties, &memory, memoryManager.createStorageInfoFromProperties(properties)); @@ -498,7 +498,7 @@ TEST(MemoryManagerTest, givenMemoryManagerWhenGraphicsMemoryAllocationInDevicePo memoryManager.failInDevicePool = true; - auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::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()); @@ -510,7 +510,7 @@ TEST(MemoryManagerTest, givenMemoryManagerWhenBufferTypeIsPassedThenAllocateGrap MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield}); + auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}); EXPECT_NE(nullptr, allocation); memoryManager.freeGraphicsMemory(allocation); } @@ -521,7 +521,7 @@ TEST(MemoryManagerTest, givenMemoryManagerWhenBufferTypeIsPassedAndAllocateInDev memoryManager.failInDevicePoolWithError = true; - auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield}); + auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}); ASSERT_EQ(nullptr, allocation); EXPECT_FALSE(memoryManager.allocationInDevicePoolCreated); @@ -531,7 +531,7 @@ TEST(MemoryManagerTest, givenMemoryManagerWhenBufferTypeIsPassedAndAllocateInDev TEST(MemoryManagerTest, givenSvmAllocationTypeWhenGetAllocationDataIsCalledThenAllocatingMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.allocateMemory); } @@ -539,7 +539,7 @@ TEST(MemoryManagerTest, givenSvmAllocationTypeWhenGetAllocationDataIsCalledThenA TEST(MemoryManagerTest, givenSvmAllocationTypeWhenGetAllocationDataIsCalledThen64kbPagesAreAllowedAnd32BitAllocationIsDisallowed) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.allow64kbPages); EXPECT_FALSE(allocData.flags.allow32Bit); @@ -548,7 +548,7 @@ TEST(MemoryManagerTest, givenSvmAllocationTypeWhenGetAllocationDataIsCalledThen6 TEST(MemoryManagerTest, givenTagBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::TAG_BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::TAG_BUFFER, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); } @@ -556,7 +556,7 @@ TEST(MemoryManagerTest, givenTagBufferTypeWhenGetAllocationDataIsCalledThenSyste TEST(MemoryManagerTest, givenGlobalFenceTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::GLOBAL_FENCE, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::GLOBAL_FENCE, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); } @@ -564,7 +564,7 @@ TEST(MemoryManagerTest, givenGlobalFenceTypeWhenGetAllocationDataIsCalledThenSys TEST(MemoryManagerTest, givenPreemptionTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::PREEMPTION, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::PREEMPTION, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); } @@ -572,7 +572,7 @@ TEST(MemoryManagerTest, givenPreemptionTypeWhenGetAllocationDataIsCalledThenSyst TEST(MemoryManagerTest, givenPreemptionTypeWhenGetAllocationDataIsCalledThen64kbPagesAllowed) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::PREEMPTION, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::PREEMPTION, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.allow64kbPages); } @@ -580,7 +580,7 @@ TEST(MemoryManagerTest, givenPreemptionTypeWhenGetAllocationDataIsCalledThen64kb TEST(MemoryManagerTest, givenPreemptionTypeWhenGetAllocationDataIsCalledThen48BitResourceIsTrue) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::PREEMPTION, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::PREEMPTION, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.resource48Bit); } @@ -588,7 +588,7 @@ TEST(MemoryManagerTest, givenPreemptionTypeWhenGetAllocationDataIsCalledThen48Bi TEST(MemoryManagerTest, givenSharedContextImageTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::SHARED_CONTEXT_IMAGE, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::SHARED_CONTEXT_IMAGE, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); } @@ -596,7 +596,7 @@ TEST(MemoryManagerTest, givenSharedContextImageTypeWhenGetAllocationDataIsCalled TEST(MemoryManagerTest, givenMCSTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::MCS, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::MCS, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); } @@ -604,7 +604,7 @@ TEST(MemoryManagerTest, givenMCSTypeWhenGetAllocationDataIsCalledThenSystemMemor TEST(MemoryManagerTest, givenPipeTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::PIPE, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::PIPE, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); } @@ -612,7 +612,7 @@ TEST(MemoryManagerTest, givenPipeTypeWhenGetAllocationDataIsCalledThenSystemMemo TEST(MemoryManagerTest, givenGlobalSurfaceTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::GLOBAL_SURFACE, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::GLOBAL_SURFACE, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); } @@ -620,7 +620,7 @@ TEST(MemoryManagerTest, givenGlobalSurfaceTypeWhenGetAllocationDataIsCalledThenS TEST(MemoryManagerTest, givenWriteCombinedTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::WRITE_COMBINED, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::WRITE_COMBINED, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); } @@ -628,7 +628,7 @@ TEST(MemoryManagerTest, givenWriteCombinedTypeWhenGetAllocationDataIsCalledThenS TEST(MemoryManagerTest, givenInternalHostMemoryTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::INTERNAL_HOST_MEMORY, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); } @@ -636,7 +636,7 @@ TEST(MemoryManagerTest, givenInternalHostMemoryTypeWhenGetAllocationDataIsCalled TEST(MemoryManagerTest, givenFillPatternTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::FILL_PATTERN, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::FILL_PATTERN, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); } @@ -646,7 +646,7 @@ using GetAllocationDataTestHw = ::testing::Test; HWTEST_F(GetAllocationDataTestHw, givenLinearStreamTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::LINEAR_STREAM, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::LINEAR_STREAM, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -655,7 +655,7 @@ HWTEST_F(GetAllocationDataTestHw, givenLinearStreamTypeWhenGetAllocationDataIsCa HWTEST_F(GetAllocationDataTestHw, givenTimestampPacketTagBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequestedAndRequireCpuAccess) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_EQ(UnitTestHelper::requiresTimestampPacketsInSystemMemory(*defaultHwInfo), allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -664,7 +664,7 @@ HWTEST_F(GetAllocationDataTestHw, givenTimestampPacketTagBufferTypeWhenGetAlloca TEST(MemoryManagerTest, givenProfilingTagBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::PROFILING_TAG_BUFFER, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); EXPECT_FALSE(allocData.flags.requiresCpuAccess); @@ -673,7 +673,7 @@ TEST(MemoryManagerTest, givenProfilingTagBufferTypeWhenGetAllocationDataIsCalled TEST(MemoryManagerTest, givenAllocationPropertiesWithMultiOsContextCapableFlagEnabledWhenAllocateMemoryThenAllocationDataIsMultiOsContextCapable) { MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, false, executionEnvironment); - AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}; properties.flags.multiOsContextCapable = true; AllocationData allocData; @@ -684,7 +684,7 @@ TEST(MemoryManagerTest, givenAllocationPropertiesWithMultiOsContextCapableFlagEn TEST(MemoryManagerTest, givenAllocationPropertiesWithMultiOsContextCapableFlagDisabledWhenAllocateMemoryThenAllocationDataIsNotMultiOsContextCapable) { MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, false, executionEnvironment); - AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}; properties.flags.multiOsContextCapable = false; AllocationData allocData; @@ -695,7 +695,7 @@ TEST(MemoryManagerTest, givenAllocationPropertiesWithMultiOsContextCapableFlagDi TEST(MemoryManagerTest, givenConstantSurfaceTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::CONSTANT_SURFACE, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::CONSTANT_SURFACE, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); } @@ -703,7 +703,7 @@ TEST(MemoryManagerTest, givenConstantSurfaceTypeWhenGetAllocationDataIsCalledThe HWTEST_F(GetAllocationDataTestHw, givenInternalHeapTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::INTERNAL_HEAP, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::INTERNAL_HEAP, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -712,7 +712,7 @@ HWTEST_F(GetAllocationDataTestHw, givenInternalHeapTypeWhenGetAllocationDataIsCa HWTEST_F(GetAllocationDataTestHw, givenGpuTimestampDeviceBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -720,7 +720,7 @@ HWTEST_F(GetAllocationDataTestHw, givenGpuTimestampDeviceBufferTypeWhenGetAlloca HWTEST_F(GetAllocationDataTestHw, givenPrintfAllocationWhenGetAllocationDataIsCalledThenDontForceSystemMemoryAndRequireCpuAccess) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -729,7 +729,7 @@ HWTEST_F(GetAllocationDataTestHw, givenPrintfAllocationWhenGetAllocationDataIsCa HWTEST_F(GetAllocationDataTestHw, givenLinearStreamAllocationWhenGetAllocationDataIsCalledThenDontForceSystemMemoryAndRequireCpuAccess) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::LINEAR_STREAM, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::LINEAR_STREAM, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -738,7 +738,7 @@ HWTEST_F(GetAllocationDataTestHw, givenLinearStreamAllocationWhenGetAllocationDa HWTEST_F(GetAllocationDataTestHw, givenConstantSurfaceAllocationWhenGetAllocationDataIsCalledThenDontForceSystemMemoryAndRequireCpuAccess) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::CONSTANT_SURFACE, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::CONSTANT_SURFACE, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -746,11 +746,11 @@ HWTEST_F(GetAllocationDataTestHw, givenConstantSurfaceAllocationWhenGetAllocatio HWTEST_F(GetAllocationDataTestHw, givenKernelIsaTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::KERNEL_ISA, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::KERNEL_ISA, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_NE(defaultHwInfo->featureTable.flags.ftrLocalMemory, allocData.flags.useSystemMemory); - AllocationProperties properties2{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL, mockDeviceBitfield}; + AllocationProperties properties2{mockRootDeviceIndex, 1, AllocationType::KERNEL_ISA_INTERNAL, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties2, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_NE(defaultHwInfo->featureTable.flags.ftrLocalMemory, allocData.flags.useSystemMemory); } @@ -758,7 +758,7 @@ HWTEST_F(GetAllocationDataTestHw, givenKernelIsaTypeWhenGetAllocationDataIsCalle HWTEST_F(GetAllocationDataTestHw, givenLinearStreamWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::LINEAR_STREAM, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::LINEAR_STREAM, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -767,7 +767,7 @@ HWTEST_F(GetAllocationDataTestHw, givenLinearStreamWhenGetAllocationDataIsCalled HWTEST_F(GetAllocationDataTestHw, givenPrintfAllocationWhenGetAllocationDataIsCalledThenDontUseSystemMemoryAndRequireCpuAccess) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::PRINTF_SURFACE, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::PRINTF_SURFACE, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_FALSE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.requiresCpuAccess); @@ -777,7 +777,7 @@ TEST(MemoryManagerTest, givenExternalHostMemoryWhenGetAllocationDataIsCalledThen AllocationData allocData; auto hostPtr = reinterpret_cast(0x1234); MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, false, 1, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, false, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, false, 1, AllocationType::EXTERNAL_HOST_PTR, false, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, hostPtr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); EXPECT_FALSE(allocData.flags.allocateMemory); @@ -792,11 +792,11 @@ TEST(MemoryManagerTest, GivenAllocationPropertiesWhenGettingAllocationDataThenSa AllocationData allocData; MockExecutionEnvironment executionEnvironment{defaultHwInfo.get(), true, rootDevicesCount}; MockMemoryManager mockMemoryManager{executionEnvironment}; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::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, GraphicsAllocation::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); } @@ -805,7 +805,7 @@ TEST(MemoryManagerTest, givenMapAllocationWhenGetAllocationDataIsCalledThenItHas AllocationData allocData; auto hostPtr = reinterpret_cast(0x1234); MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, false, 1, GraphicsAllocation::AllocationType::MAP_ALLOCATION, false, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, false, 1, AllocationType::MAP_ALLOCATION, false, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, hostPtr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); EXPECT_FALSE(allocData.flags.allocateMemory); @@ -817,7 +817,7 @@ TEST(MemoryManagerTest, givenMapAllocationWhenGetAllocationDataIsCalledThenItHas HWTEST_F(GetAllocationDataTestHw, givenRingBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 0x10000u, GraphicsAllocation::AllocationType::RING_BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 0x10000u, AllocationType::RING_BUFFER, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.allocateMemory); @@ -831,7 +831,7 @@ HWTEST_F(GetAllocationDataTestHw, givenRingBufferAllocationWhenGetAllocationData HWTEST_F(GetAllocationDataTestHw, givenSemaphoreBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 0x1000u, GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 0x1000u, AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.allocateMemory); @@ -844,7 +844,7 @@ HWTEST_F(GetAllocationDataTestHw, givenSemaphoreBufferAllocationWhenGetAllocatio TEST(MemoryManagerTest, givenDirectBufferPlacementSetWhenDefaultIsUsedThenExpectNoFlagsChanged) { AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, GraphicsAllocation::AllocationType::RING_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::RING_BUFFER, mockDeviceBitfield); MockMemoryManager::overrideAllocationData(allocationData, properties); EXPECT_EQ(0u, allocationData.flags.requiresCpuAccess); @@ -855,7 +855,7 @@ TEST(MemoryManagerTest, givenDirectBufferPlacementSetWhenOverrideToNonSystemThen DebugManagerStateRestore restorer; DebugManager.flags.DirectSubmissionBufferPlacement.set(0); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, GraphicsAllocation::AllocationType::RING_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::RING_BUFFER, mockDeviceBitfield); MockMemoryManager::overrideAllocationData(allocationData, properties); EXPECT_EQ(1u, allocationData.flags.requiresCpuAccess); @@ -866,7 +866,7 @@ TEST(MemoryManagerTest, givenDirectBufferPlacementSetWhenOverrideToSystemThenExp DebugManagerStateRestore restorer; DebugManager.flags.DirectSubmissionBufferPlacement.set(1); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, GraphicsAllocation::AllocationType::RING_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::RING_BUFFER, mockDeviceBitfield); MockMemoryManager::overrideAllocationData(allocationData, properties); EXPECT_EQ(0u, allocationData.flags.requiresCpuAccess); @@ -875,7 +875,7 @@ TEST(MemoryManagerTest, givenDirectBufferPlacementSetWhenOverrideToSystemThenExp TEST(MemoryManagerTest, givenDirectSemaphorePlacementSetWhenDefaultIsUsedThenExpectNoFlagsChanged) { AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); MockMemoryManager::overrideAllocationData(allocationData, properties); EXPECT_EQ(0u, allocationData.flags.requiresCpuAccess); @@ -886,7 +886,7 @@ TEST(MemoryManagerTest, givenDirectSemaphorePlacementSetWhenOverrideToNonSystemT DebugManagerStateRestore restorer; DebugManager.flags.DirectSubmissionSemaphorePlacement.set(0); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); MockMemoryManager::overrideAllocationData(allocationData, properties); EXPECT_EQ(1u, allocationData.flags.requiresCpuAccess); @@ -897,7 +897,7 @@ TEST(MemoryManagerTest, givenDirectSemaphorePlacementSetWhenOverrideToSystemThen DebugManagerStateRestore restorer; DebugManager.flags.DirectSubmissionSemaphorePlacement.set(1); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); MockMemoryManager::overrideAllocationData(allocationData, properties); EXPECT_EQ(0u, allocationData.flags.requiresCpuAccess); @@ -908,7 +908,7 @@ TEST(MemoryManagerTest, givenDirectBufferAddressingWhenOverrideToNo48BitThenExpe DebugManagerStateRestore restorer; DebugManager.flags.DirectSubmissionBufferAddressing.set(0); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, GraphicsAllocation::AllocationType::RING_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::RING_BUFFER, mockDeviceBitfield); allocationData.flags.resource48Bit = 1; MockMemoryManager::overrideAllocationData(allocationData, properties); @@ -919,7 +919,7 @@ TEST(MemoryManagerTest, givenDirectBufferAddressingWhenOverrideTo48BitThenExpect DebugManagerStateRestore restorer; DebugManager.flags.DirectSubmissionBufferAddressing.set(1); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, GraphicsAllocation::AllocationType::RING_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::RING_BUFFER, mockDeviceBitfield); allocationData.flags.resource48Bit = 0; MockMemoryManager::overrideAllocationData(allocationData, properties); @@ -928,7 +928,7 @@ TEST(MemoryManagerTest, givenDirectBufferAddressingWhenOverrideTo48BitThenExpect TEST(MemoryManagerTest, givenDirectBufferAddressingDefaultWhenNoOverrideThenExpect48BitFlagSame) { AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, GraphicsAllocation::AllocationType::RING_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::RING_BUFFER, mockDeviceBitfield); allocationData.flags.resource48Bit = 0; MockMemoryManager::overrideAllocationData(allocationData, properties); @@ -944,7 +944,7 @@ TEST(MemoryManagerTest, givenDirectSemaphoreAddressingWhenOverrideToNo48BitThenE DebugManagerStateRestore restorer; DebugManager.flags.DirectSubmissionSemaphoreAddressing.set(0); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); allocationData.flags.resource48Bit = 1; MockMemoryManager::overrideAllocationData(allocationData, properties); @@ -955,7 +955,7 @@ TEST(MemoryManagerTest, givenDirectSemaphoreAddressingWhenOverrideTo48BitThenExp DebugManagerStateRestore restorer; DebugManager.flags.DirectSubmissionSemaphoreAddressing.set(1); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); allocationData.flags.resource48Bit = 0; MockMemoryManager::overrideAllocationData(allocationData, properties); @@ -964,7 +964,7 @@ TEST(MemoryManagerTest, givenDirectSemaphoreAddressingWhenOverrideTo48BitThenExp TEST(MemoryManagerTest, givenDirectSemaphoreAddressingDefaultWhenNoOverrideThenExpect48BitFlagSame) { AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::SEMAPHORE_BUFFER, mockDeviceBitfield); allocationData.flags.resource48Bit = 0; MockMemoryManager::overrideAllocationData(allocationData, properties); @@ -978,12 +978,12 @@ TEST(MemoryManagerTest, givenDirectSemaphoreAddressingDefaultWhenNoOverrideThenE TEST(MemoryManagerTest, givenForceNonSystemMaskWhenAllocationTypeMatchesMaskThenExpectSystemFlagFalse) { DebugManagerStateRestore restorer; - auto allocationType = GraphicsAllocation::AllocationType::BUFFER; + auto allocationType = AllocationType::BUFFER; auto mask = 1llu << (static_cast(allocationType) - 1); DebugManager.flags.ForceNonSystemMemoryPlacement.set(mask); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::BUFFER, mockDeviceBitfield); allocationData.flags.useSystemMemory = 1; MockMemoryManager::overrideAllocationData(allocationData, properties); EXPECT_EQ(0u, allocationData.flags.useSystemMemory); @@ -991,12 +991,12 @@ TEST(MemoryManagerTest, givenForceNonSystemMaskWhenAllocationTypeMatchesMaskThen TEST(MemoryManagerTest, givenForceNonSystemMaskWhenAllocationTypeNotMatchesMaskThenExpectSystemFlagTrue) { DebugManagerStateRestore restorer; - auto allocationType = GraphicsAllocation::AllocationType::BUFFER; + auto allocationType = AllocationType::BUFFER; auto mask = 1llu << (static_cast(allocationType) - 1); DebugManager.flags.ForceNonSystemMemoryPlacement.set(mask); AllocationData allocationData; - AllocationProperties properties(mockRootDeviceIndex, 0x1000, GraphicsAllocation::AllocationType::COMMAND_BUFFER, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 0x1000, AllocationType::COMMAND_BUFFER, mockDeviceBitfield); allocationData.flags.useSystemMemory = 1; MockMemoryManager::overrideAllocationData(allocationData, properties); EXPECT_EQ(1u, allocationData.flags.useSystemMemory); @@ -1005,7 +1005,7 @@ TEST(MemoryManagerTest, givenForceNonSystemMaskWhenAllocationTypeNotMatchesMaskT TEST(MemoryManagerTest, givenDebugContextSaveAreaTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::DEBUG_CONTEXT_SAVE_AREA, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); EXPECT_TRUE(allocData.flags.zeroMemory); @@ -1014,7 +1014,7 @@ TEST(MemoryManagerTest, givenDebugContextSaveAreaTypeWhenGetAllocationDataIsCall TEST(MemoryManagerTest, givenPropertiesWithOsContextWhenGetAllocationDataIsCalledThenOsContextIsSet) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{0, 1, GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA, mockDeviceBitfield}; + AllocationProperties properties{0, 1, AllocationType::DEBUG_CONTEXT_SAVE_AREA, mockDeviceBitfield}; MockOsContext osContext(0u, EngineDescriptorHelper::getDefaultDescriptor(HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0])); @@ -1027,7 +1027,7 @@ TEST(MemoryManagerTest, givenPropertiesWithOsContextWhenGetAllocationDataIsCalle TEST(MemoryManagerTest, givenPropertiesWithGpuAddressWhenGetAllocationDataIsCalledThenGpuAddressIsSet) { AllocationData allocData; MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::DEBUG_CONTEXT_SAVE_AREA, mockDeviceBitfield}; properties.gpuAddress = 0x4000; @@ -1039,7 +1039,7 @@ TEST(MemoryManagerTest, givenEnableLocalMemoryAndMemoryManagerWhenBufferTypeIsPa MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield}, + auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}, nullptr); EXPECT_NE(nullptr, allocation); memoryManager.freeGraphicsMemory(allocation); @@ -1065,7 +1065,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 = GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY; + allocProperties.allocationType = AllocationType::SHARED_RESOURCE_COPY; auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr); ASSERT_NE(nullptr, allocation); @@ -1078,10 +1078,10 @@ TEST(MemoryManagerTest, givenEnabledLocalMemoryWhenAllocatingSharedResourceCopyT memoryManager.freeGraphicsMemory(allocation); } -using MemoryManagerGetAlloctionDataHaveToBeForcedTo48BitTest = testing::TestWithParam>; +using MemoryManagerGetAlloctionDataHaveToBeForcedTo48BitTest = testing::TestWithParam>; TEST_P(MemoryManagerGetAlloctionDataHaveToBeForcedTo48BitTest, givenAllocationTypesHaveToBeForcedTo48BitThenAllocationDataResource48BitIsSet) { - GraphicsAllocation::AllocationType allocationType; + AllocationType allocationType; bool propertiesFlag48Bit; std::tie(allocationType, propertiesFlag48Bit) = GetParam(); @@ -1095,10 +1095,10 @@ TEST_P(MemoryManagerGetAlloctionDataHaveToBeForcedTo48BitTest, givenAllocationTy EXPECT_TRUE(allocationData.flags.resource48Bit); } -using MemoryManagerGetAlloctionDataHaveNotToBeForcedTo48BitTest = testing::TestWithParam>; +using MemoryManagerGetAlloctionDataHaveNotToBeForcedTo48BitTest = testing::TestWithParam>; TEST_P(MemoryManagerGetAlloctionDataHaveNotToBeForcedTo48BitTest, givenAllocationTypesHaveNotToBeForcedTo48BitThenAllocationDataResource48BitIsSetProperly) { - GraphicsAllocation::AllocationType allocationType; + AllocationType allocationType; bool propertiesFlag48Bit; std::tie(allocationType, propertiesFlag48Bit) = GetParam(); @@ -1112,47 +1112,47 @@ TEST_P(MemoryManagerGetAlloctionDataHaveNotToBeForcedTo48BitTest, givenAllocatio EXPECT_EQ(allocationData.flags.resource48Bit, propertiesFlag48Bit); } -static const GraphicsAllocation::AllocationType allocationHaveToBeForcedTo48Bit[] = { - GraphicsAllocation::AllocationType::COMMAND_BUFFER, - GraphicsAllocation::AllocationType::IMAGE, - GraphicsAllocation::AllocationType::INDIRECT_OBJECT_HEAP, - GraphicsAllocation::AllocationType::INSTRUCTION_HEAP, - GraphicsAllocation::AllocationType::INTERNAL_HEAP, - GraphicsAllocation::AllocationType::KERNEL_ISA, - GraphicsAllocation::AllocationType::LINEAR_STREAM, - GraphicsAllocation::AllocationType::MCS, - GraphicsAllocation::AllocationType::SCRATCH_SURFACE, - GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE, - GraphicsAllocation::AllocationType::SHARED_CONTEXT_IMAGE, - GraphicsAllocation::AllocationType::SHARED_IMAGE, - GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY, - GraphicsAllocation::AllocationType::SURFACE_STATE_HEAP, - GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, +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_CONTEXT_IMAGE, + AllocationType::SHARED_IMAGE, + AllocationType::SHARED_RESOURCE_COPY, + AllocationType::SURFACE_STATE_HEAP, + AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, }; -static const GraphicsAllocation::AllocationType allocationHaveNotToBeForcedTo48Bit[] = { - GraphicsAllocation::AllocationType::BUFFER, - GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, - GraphicsAllocation::AllocationType::CONSTANT_SURFACE, - GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, - GraphicsAllocation::AllocationType::FILL_PATTERN, - GraphicsAllocation::AllocationType::GLOBAL_SURFACE, - GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, - GraphicsAllocation::AllocationType::MAP_ALLOCATION, - GraphicsAllocation::AllocationType::PIPE, - GraphicsAllocation::AllocationType::PRINTF_SURFACE, - GraphicsAllocation::AllocationType::PRIVATE_SURFACE, - GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER, - GraphicsAllocation::AllocationType::SHARED_BUFFER, - GraphicsAllocation::AllocationType::SVM_CPU, - GraphicsAllocation::AllocationType::SVM_GPU, - GraphicsAllocation::AllocationType::SVM_ZERO_COPY, - GraphicsAllocation::AllocationType::TAG_BUFFER, - GraphicsAllocation::AllocationType::GLOBAL_FENCE, - GraphicsAllocation::AllocationType::WRITE_COMBINED, - GraphicsAllocation::AllocationType::RING_BUFFER, - GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER, - GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA, +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::RING_BUFFER, + AllocationType::SEMAPHORE_BUFFER, + AllocationType::DEBUG_CONTEXT_SAVE_AREA, }; INSTANTIATE_TEST_CASE_P(ForceTo48Bit, diff --git a/opencl/test/unit_test/memory_manager/memory_manager_multi_device_tests.cpp b/opencl/test/unit_test/memory_manager/memory_manager_multi_device_tests.cpp index 47c6c2a92b..23442131eb 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_multi_device_tests.cpp +++ b/opencl/test/unit_test/memory_manager/memory_manager_multi_device_tests.cpp @@ -17,8 +17,8 @@ using namespace NEO; using MemoryManagerMultiDeviceTest = MemoryAllocatorMultiDeviceFixture<10>; TEST_P(MemoryManagerMultiDeviceTest, givenRootDeviceIndexSpecifiedWhenAllocateGraphicsMemoryIsCalledThenGraphicsAllocationHasTheSameRootDeviceIndex) { - std::vector allocationTypes{GraphicsAllocation::AllocationType::BUFFER, - GraphicsAllocation::AllocationType::KERNEL_ISA}; + std::vector allocationTypes{AllocationType::BUFFER, + AllocationType::KERNEL_ISA}; for (auto allocationType : allocationTypes) { for (uint32_t rootDeviceIndex = 0; rootDeviceIndex < getNumRootDevices(); ++rootDeviceIndex) { AllocationProperties properties{rootDeviceIndex, true, MemoryConstants::pageSize, allocationType, false, false, mockDeviceBitfield}; @@ -68,7 +68,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, GraphicsAllocation::AllocationType::TAG_BUFFER, systemMemoryBitfield}; + AllocationProperties unifiedMemoryProperties{rootDeviceIndices.at(0), MemoryConstants::pageSize, AllocationType::TAG_BUFFER, systemMemoryBitfield}; memoryManager->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, unifiedMemoryProperties, *tagsMultiAllocation); EXPECT_NE(nullptr, tagsMultiAllocation); @@ -95,7 +95,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, GraphicsAllocation::AllocationType::TAG_BUFFER, systemMemoryBitfield}; + AllocationProperties unifiedMemoryProperties{rootDeviceIndices.at(0), MemoryConstants::pageSize, AllocationType::TAG_BUFFER, systemMemoryBitfield}; memoryManager->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, unifiedMemoryProperties, *tagsMultiAllocation); EXPECT_NE(nullptr, tagsMultiAllocation); diff --git a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp index 3ab26f192c..364a8f4edb 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp @@ -90,7 +90,7 @@ TEST(MemoryManagerTest, givenLocalMemoryRequiredWhenSelectingHeapThenPickDeviceH } TEST(MemoryManagerTest, whenCreatingAllocPropertiesForMultiStorageResourceThenMultiStorageResourcesFlagIsSetToTrue) { - AllocationProperties properties{0, false, 0u, GraphicsAllocation::AllocationType::SCRATCH_SURFACE, false, true, 0}; + AllocationProperties properties{0, false, 0u, AllocationType::SCRATCH_SURFACE, false, true, 0}; EXPECT_TRUE(properties.multiStorageResource); } @@ -125,7 +125,7 @@ TEST(GraphicsAllocationTest, GivenNonSharedResourceHandleWhenAllocationIsCreated void *cpuPtr = (void *)0x30000; size_t size = 0x1000; osHandle sharedHandle = Sharing::nonSharedResource; - GraphicsAllocation gfxAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, cpuPtr, size, sharedHandle, MemoryPool::MemoryNull, 0u); + GraphicsAllocation gfxAllocation(0, AllocationType::UNKNOWN, cpuPtr, size, sharedHandle, MemoryPool::MemoryNull, 0u); uint64_t expectedGpuAddr = static_cast(reinterpret_cast(gfxAllocation.getUnderlyingBuffer())); EXPECT_EQ(expectedGpuAddr, gfxAllocation.getGpuAddress()); @@ -139,7 +139,7 @@ TEST(GraphicsAllocationTest, WhenGettingAddressesThenAddressesAreCorrect) { uint64_t gpuBaseAddr = 0x10000; size_t size = 0x1000; - GraphicsAllocation gfxAllocation(0, GraphicsAllocation::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()); @@ -156,7 +156,7 @@ TEST(GraphicsAllocationTest, WhenGettingGpuAddressToPatchThenOffsetIsCorrect) { uint64_t gpuBaseAddr = 0x10000; size_t size = 0x1000; - GraphicsAllocation gfxAllocation(0, GraphicsAllocation::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()); } @@ -167,7 +167,7 @@ TEST(GraphicsAllocationTest, WhenSetSizeThenUnderlyingBufferSizeIsSet) { uint64_t gpuBaseAddr = 0x10000; size_t size = 0x2000; - GraphicsAllocation gfxAllocation(0, GraphicsAllocation::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; @@ -431,7 +431,7 @@ TEST_F(MemoryAllocatorTest, GivenPointerAndSizeWhenAskedToCreateGrahicsAllocatio TEST_F(MemoryAllocatorTest, givenMemoryManagerWhenAskedFor32bitAllocationThen32bitGraphicsAllocationIsReturned) { size_t size = 10; - auto allocation = memoryManager->allocate32BitGraphicsMemory(device->getRootDeviceIndex(), size, nullptr, GraphicsAllocation::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()); @@ -441,8 +441,8 @@ TEST_F(MemoryAllocatorTest, givenMemoryManagerWhenAskedFor32bitAllocationThen32b TEST_F(MemoryAllocatorTest, givenNotEnoughSpaceInAllocatorWhenAskedFor32bitAllocationThenNullptrIsReturned) { size_t size = 0xfffff000; - auto allocationFirst = memoryManager->allocate32BitGraphicsMemory(device->getRootDeviceIndex(), 0x5000, nullptr, GraphicsAllocation::AllocationType::BUFFER); - auto allocation = memoryManager->allocate32BitGraphicsMemory(device->getRootDeviceIndex(), size, nullptr, GraphicsAllocation::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); } @@ -450,8 +450,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, GraphicsAllocation::AllocationType::BUFFER); - auto allocation = memoryManager->allocate32BitGraphicsMemory(device->getRootDeviceIndex(), size, ptr, GraphicsAllocation::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); } @@ -459,7 +459,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, GraphicsAllocation::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()); @@ -474,7 +474,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, GraphicsAllocation::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); @@ -486,7 +486,7 @@ TEST_F(MemoryAllocatorTest, givenAllocationWithFragmentsWhenCallingFreeGraphicsM TEST_F(MemoryAllocatorTest, GivenShareableEnabledAndDisabledWhenAskedToCreateGrahicsAllocationThenValidAllocationIsReturned) { AllocationData allocationData; - allocationData.type = GraphicsAllocation::AllocationType::BUFFER; + allocationData.type = AllocationType::BUFFER; allocationData.flags.shareable = 1u; auto shareableAllocation = memoryManager->allocateGraphicsMemory(allocationData); @@ -501,7 +501,7 @@ TEST_F(MemoryAllocatorTest, GivenShareableEnabledAndDisabledWhenAskedToCreateGra } TEST_F(MemoryAllocatorTest, givenAllocationWithoutFragmentsWhenCallingFreeGraphicsMemoryThenCallHandleFenceCompletion) { - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::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); @@ -618,7 +618,7 @@ HWTEST_F(MemoryAllocatorTest, givenSupportFor1MbAligmentWhenAllocateGraphicsMemo auto osAgnosticMemoryManager = std::make_unique>(true, false, *executionEnvironment); osAgnosticMemoryManager->failInDevicePool = true; - MockAllocationProperties properties(mockRootDeviceIndex, true, size, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield); + MockAllocationProperties properties(mockRootDeviceIndex, true, size, AllocationType::BUFFER, mockDeviceBitfield); properties.flags.preferCompressed = true; auto allocationWithEnabled1MbAlignment = osAgnosticMemoryManager->allocateGraphicsMemoryWithProperties(properties, ptr); @@ -747,19 +747,19 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWhenIsLimitedGPUOnTypeIsCalledTh MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MyOsAgnosticMemoryManager memoryManager(executionEnvironment); memoryManager.is32bit = false; - EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, GraphicsAllocation::AllocationType::BUFFER)); - EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, GraphicsAllocation::AllocationType::IMAGE)); - EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, GraphicsAllocation::AllocationType::MAP_ALLOCATION)); + EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::BUFFER)); + EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::IMAGE)); + EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::MAP_ALLOCATION)); memoryManager.is32bit = true; if (executionEnvironment.rootDeviceEnvironments[mockRootDeviceIndex]->isFullRangeSvm()) { - EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, GraphicsAllocation::AllocationType::BUFFER)); - EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, GraphicsAllocation::AllocationType::IMAGE)); - EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, GraphicsAllocation::AllocationType::MAP_ALLOCATION)); + EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::BUFFER)); + EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::IMAGE)); + EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::MAP_ALLOCATION)); } else { - EXPECT_TRUE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, GraphicsAllocation::AllocationType::BUFFER)); - EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, GraphicsAllocation::AllocationType::IMAGE)); - EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, GraphicsAllocation::AllocationType::MAP_ALLOCATION)); + EXPECT_TRUE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::BUFFER)); + EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::IMAGE)); + EXPECT_FALSE(memoryManager.isLimitedGPUOnType(mockRootDeviceIndex, AllocationType::MAP_ALLOCATION)); } } @@ -774,7 +774,7 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWhenAskedFor32BitAllocationWhenL memoryManager.forceLimitedRangeAllocator(0, 0xFFFFFFFFF); AllocationData allocationData; - memoryManager.getAllocationData(allocationData, {mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::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); @@ -792,7 +792,7 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWhenAskedForNon32BitAllocationWh memoryManager.forceLimitedRangeAllocator(0, 0xFFFFFFFFF); AllocationData allocationData; - memoryManager.getAllocationData(allocationData, {mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::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); @@ -1093,7 +1093,7 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWhenAllocate32BitGraphicsMemoryW void *ptr = reinterpret_cast(0x1001); auto size = MemoryConstants::pageSize; - auto allocation = memoryManager.allocate32BitGraphicsMemory(mockRootDeviceIndex, size, ptr, GraphicsAllocation::AllocationType::BUFFER); + auto allocation = memoryManager.allocate32BitGraphicsMemory(mockRootDeviceIndex, size, ptr, AllocationType::BUFFER); ASSERT_NE(nullptr, allocation); EXPECT_EQ(MemoryPool::System4KBPagesWith32BitGpuAddressing, allocation->getMemoryPool()); @@ -1107,7 +1107,7 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWhenAllocate32BitGraphicsMemoryW void *ptr = nullptr; auto size = MemoryConstants::pageSize; - auto allocation = memoryManager.allocate32BitGraphicsMemory(mockRootDeviceIndex, size, ptr, GraphicsAllocation::AllocationType::BUFFER); + auto allocation = memoryManager.allocate32BitGraphicsMemory(mockRootDeviceIndex, size, ptr, AllocationType::BUFFER); ASSERT_NE(nullptr, allocation); EXPECT_EQ(MemoryPool::System4KBPagesWith32BitGpuAddressing, allocation->getMemoryPool()); @@ -1121,7 +1121,7 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWith64KBPagesEnabledWhenAllocate if (memoryManager.isLimitedGPU(0)) { GTEST_SKIP(); } - auto svmAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}); + auto svmAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}); EXPECT_NE(nullptr, svmAllocation); EXPECT_EQ(MemoryPool::System64KBPages, svmAllocation->getMemoryPool()); memoryManager.freeGraphicsMemory(svmAllocation); @@ -1134,7 +1134,7 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWith64KBPagesDisabledWhenAllocat if (memoryManager.isLimitedGPU(0)) { GTEST_SKIP(); } - auto svmAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}); + auto svmAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}); EXPECT_EQ(MemoryPool::System4KBPages, svmAllocation->getMemoryPool()); memoryManager.freeGraphicsMemory(svmAllocation); } @@ -1144,7 +1144,7 @@ TEST(OsAgnosticMemoryManager, givenDefaultMemoryManagerWhenCreateGraphicsAllocat MemoryManagerCreate memoryManager(false, false, executionEnvironment); osHandle handle = 1; auto size = 4096u; - AllocationProperties properties(mockRootDeviceIndex, false, size, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); auto sharedAllocation = memoryManager.createGraphicsAllocationFromSharedHandle(handle, properties, false, false); EXPECT_NE(nullptr, sharedAllocation); EXPECT_FALSE(sharedAllocation->isCoherent()); @@ -1160,7 +1160,7 @@ TEST(OsAgnosticMemoryManager, givenDefaultMemoryManagerWhenCreateGraphicsAllocat MemoryManagerCreate memoryManager(false, false, executionEnvironment); osHandle handle = 1; auto size = 4096u; - AllocationProperties properties(mockRootDeviceIndex, false, size, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, false, mockDeviceBitfield); EXPECT_EQ(properties.subDevicesBitfield, mockDeviceBitfield); EXPECT_EQ(properties.rootDeviceIndex, 0u); @@ -1180,7 +1180,7 @@ TEST(OsAgnosticMemoryManager, givenDefaultMemoryManagerWhenCreateGraphicsAllocat MemoryManagerCreate memoryManager(false, false, executionEnvironment); osHandle handle = 1; auto size = 4096u; - AllocationProperties properties(mockRootDeviceIndex, false, size, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); auto sharedAllocation = memoryManager.createGraphicsAllocationFromSharedHandle(handle, properties, true, false); EXPECT_NE(nullptr, sharedAllocation); EXPECT_TRUE(sharedAllocation->is32BitAllocation()); @@ -1195,7 +1195,7 @@ TEST(OsAgnosticMemoryManager, givenDefaultMemoryManagerWhenCreateGraphicsAllocat TEST(OsAgnosticMemoryManager, givenMemoryManagerWhenCreateAllocationFromNtHandleIsCalledThenReturnNullptr) { MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); OsAgnosticMemoryManager memoryManager(executionEnvironment); - auto graphicsAllocation = memoryManager.createGraphicsAllocationFromNTHandle((void *)1, 0, GraphicsAllocation::AllocationType::SHARED_IMAGE); + auto graphicsAllocation = memoryManager.createGraphicsAllocationFromNTHandle((void *)1, 0, AllocationType::SHARED_IMAGE); EXPECT_EQ(nullptr, graphicsAllocation); } @@ -1293,7 +1293,7 @@ TEST(OsAgnosticMemoryManager, givenDebugModuleAreaTypeWhenCreatingAllocationThen const auto size = MemoryConstants::pageSize64k; NEO::AllocationProperties properties{0, true, size, - NEO::GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA, + NEO::AllocationType::DEBUG_MODULE_AREA, false, mockDeviceBitfield}; @@ -1330,7 +1330,7 @@ TEST(OsAgnosticMemoryManager, givenLocalMemoryAndDebugModuleAreaTypeWhenCreating const auto size = MemoryConstants::pageSize64k; NEO::AllocationProperties properties{0, true, size, - NEO::GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA, + NEO::AllocationType::DEBUG_MODULE_AREA, false, mockDeviceBitfield}; @@ -1359,7 +1359,7 @@ TEST(OsAgnosticMemoryManager, givenEnabledLocalMemoryWhenAllocatingGraphicsMemor MockMemoryManager memoryManager(false, true, *executionEnvironment); AllocationData allocationData; - allocationData.type = GraphicsAllocation::AllocationType::KERNEL_ISA; + allocationData.type = AllocationType::KERNEL_ISA; allocationData.flags.useSystemMemory = 1; allocationData.size = 4096; @@ -1375,7 +1375,7 @@ TEST(OsAgnosticMemoryManager, givenEnabledLocalMemoryWhenAllocatingGraphicsMemor TEST(OsAgnosticMemoryManager, givenForcedSystemMemoryForIsaAndEnabledLocalMemoryWhenAllocatingGraphicsMemoryThenBaseAddressIsEqualToInternalHeapBaseAddress) { DebugManagerStateRestore dbgRestore; - DebugManager.flags.ForceSystemMemoryPlacement.set(1 << (static_cast(GraphicsAllocation::AllocationType::KERNEL_ISA) - 1)); + DebugManager.flags.ForceSystemMemoryPlacement.set(1 << (static_cast(AllocationType::KERNEL_ISA) - 1)); ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo(); @@ -1384,7 +1384,7 @@ TEST(OsAgnosticMemoryManager, givenForcedSystemMemoryForIsaAndEnabledLocalMemory MockMemoryManager memoryManager(false, true, *executionEnvironment); size_t kernelIsaSize = 4096; - auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({0, kernelIsaSize, GraphicsAllocation::AllocationType::KERNEL_ISA, 1}); + auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({0, kernelIsaSize, AllocationType::KERNEL_ISA, 1}); ASSERT_NE(nullptr, allocation); auto instructionHeapBaseAddress = memoryManager.getInternalHeapBaseAddress(0, false); @@ -1492,11 +1492,11 @@ TEST(OsAgnosticMemoryManager, GivenEnabled64kbPagesWhenHostMemoryAllocationIsCre GTEST_SKIP(); } - GraphicsAllocation *galloc = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize64k, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield}); + GraphicsAllocation *galloc = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize64k, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield}); EXPECT_NE(nullptr, galloc); memoryManager.freeGraphicsMemory(galloc); - galloc = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize64k, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield}); + galloc = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize64k, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield}); EXPECT_NE(nullptr, galloc); EXPECT_NE(nullptr, galloc->getUnderlyingBuffer()); size_t size = (executionEnvironment.rootDeviceEnvironments[0u]->getHardwareInfo()->capabilityTable.hostPtrTrackingEnabled) ? MemoryConstants::pageSize64k : MemoryConstants::pageSize; @@ -1512,7 +1512,7 @@ TEST(OsAgnosticMemoryManager, givenPointerAndSizeWhenCreateInternalAllocationIsC MockMemoryManager memoryManager(false, false, executionEnvironment); auto ptr = (void *)0x100000; size_t allocationSize = 4096; - auto graphicsAllocation = memoryManager.allocate32BitGraphicsMemory(mockRootDeviceIndex, allocationSize, ptr, GraphicsAllocation::AllocationType::INTERNAL_HEAP); + auto graphicsAllocation = memoryManager.allocate32BitGraphicsMemory(mockRootDeviceIndex, allocationSize, ptr, AllocationType::INTERNAL_HEAP); EXPECT_EQ(ptr, graphicsAllocation->getUnderlyingBuffer()); EXPECT_EQ(allocationSize, graphicsAllocation->getUnderlyingBufferSize()); memoryManager.freeGraphicsMemory(graphicsAllocation); @@ -1542,7 +1542,7 @@ TEST_P(OsAgnosticMemoryManagerWithParams, givenReducedGpuAddressSpaceWhenAllocat } OsAgnosticMemoryManager memoryManager(executionEnvironment); auto hostPtr = reinterpret_cast(0x5001); - AllocationProperties properties{0, false, 13, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, false, mockDeviceBitfield}; + AllocationProperties properties{0, false, 13, AllocationType::EXTERNAL_HOST_PTR, false, mockDeviceBitfield}; properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = requiresL3Flush; auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(properties, hostPtr); EXPECT_NE(nullptr, allocation); @@ -1561,13 +1561,13 @@ TEST_P(OsAgnosticMemoryManagerWithParams, givenFullGpuAddressSpaceWhenAllocateGr } OsAgnosticMemoryManager memoryManager(executionEnvironment); auto hostPtr = reinterpret_cast(0x5001); - AllocationProperties properties{0, false, 13, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, false, mockDeviceBitfield}; + AllocationProperties properties{0, false, 13, AllocationType::EXTERNAL_HOST_PTR, 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(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, allocation->getAllocationType()); + EXPECT_EQ(AllocationType::EXTERNAL_HOST_PTR, allocation->getAllocationType()); memoryManager.freeGraphicsMemory(allocation); } @@ -1588,7 +1588,7 @@ TEST_P(OsAgnosticMemoryManagerWithParams, givenDisabledHostPtrTrackingWhenAlloca OsAgnosticMemoryManager memoryManager(executionEnvironment); auto hostPtr = reinterpret_cast(0x5001); - AllocationProperties properties{0, false, 13, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, false, mockDeviceBitfield}; + AllocationProperties properties{0, false, 13, AllocationType::EXTERNAL_HOST_PTR, false, mockDeviceBitfield}; properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = requiresL3Flush; auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(properties, hostPtr); EXPECT_NE(nullptr, allocation); @@ -1745,7 +1745,7 @@ TEST(MemoryManager, givenSharedResourceCopyWhenAllocatingGraphicsMemoryThenAlloc AllocationData allocationData; allocationData.imgInfo = &imgInfo; - allocationData.type = GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY; + allocationData.type = AllocationType::SHARED_RESOURCE_COPY; auto imageAllocation = memoryManager.allocateGraphicsMemory(allocationData); EXPECT_NE(nullptr, imageAllocation); @@ -1765,7 +1765,7 @@ TEST(MemoryManager, givenImageAndLimitedGPUWhenAllocatingGraphicsMemoryThenAlloc AllocationData allocationData; allocationData.imgInfo = &imgInfo; - allocationData.type = GraphicsAllocation::AllocationType::IMAGE; + allocationData.type = AllocationType::IMAGE; auto imageAllocation = memoryManager.allocateGraphicsMemory(allocationData); EXPECT_NE(nullptr, imageAllocation); @@ -1781,7 +1781,7 @@ TEST(MemoryManager, givenBufferAndLimitedGPUWhenAllocatingGraphicsMemoryThenAllo AllocationData allocationData; allocationData.size = 4096u; - allocationData.type = GraphicsAllocation::AllocationType::BUFFER; + allocationData.type = AllocationType::BUFFER; auto bufferAllocation = memoryManager.allocateGraphicsMemory(allocationData); EXPECT_NE(nullptr, bufferAllocation); @@ -1801,7 +1801,7 @@ TEST(MemoryManager, givenBufferHostMemoryAndHostPtrTrackingDisabledWhenAllocatin AllocationData allocationData{}; allocationData.hostPtr = bufferData; allocationData.size = 4096u; - allocationData.type = GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY; + allocationData.type = AllocationType::BUFFER_HOST_MEMORY; auto bufferAllocation = memoryManager.allocateGraphicsMemory(allocationData); EXPECT_NE(nullptr, bufferAllocation); @@ -1824,7 +1824,7 @@ TEST(MemoryManager, givenBufferHostMemoryAndHostPtrTrackingDisabledAndForce32bit AllocationData allocationData{}; allocationData.hostPtr = bufferData; allocationData.size = 4096u; - allocationData.type = GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY; + allocationData.type = AllocationType::BUFFER_HOST_MEMORY; auto bufferAllocation = memoryManager.allocateGraphicsMemory(allocationData); EXPECT_NE(nullptr, bufferAllocation); @@ -1838,7 +1838,7 @@ TEST(MemoryManager, givenShareableWhenAllocatingGraphicsMemoryThenAllocateSharea AllocationData allocationData; allocationData.size = 4096u; - allocationData.type = GraphicsAllocation::AllocationType::BUFFER; + allocationData.type = AllocationType::BUFFER; allocationData.flags.shareable = true; auto allocation = memoryManager.allocateGraphicsMemory(allocationData); @@ -2204,7 +2204,7 @@ TEST(GraphicsAllocation, givenSharedHandleBasedConstructorWhenGraphicsAllocation void *addressWithTrailingBitSet = reinterpret_cast(address); uint64_t expectedGpuAddress = 0xf0000000; osHandle sharedHandle{}; - GraphicsAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, addressWithTrailingBitSet, 1u, sharedHandle, MemoryPool::MemoryNull, 0u); + GraphicsAllocation graphicsAllocation(0, AllocationType::UNKNOWN, addressWithTrailingBitSet, 1u, sharedHandle, MemoryPool::MemoryNull, 0u); EXPECT_EQ(expectedGpuAddress, graphicsAllocation.getGpuAddress()); } @@ -2354,19 +2354,19 @@ TEST(MemoryManagerTest, givenExecutionEnvrionmentWithCleanedRootDeviceExecutions TEST(MemoryManagerTest, givenAllocationTypesThatMayNeedL3FlushWhenCallingGetAllocationDataThenFlushL3FlagIsCorrectlySet) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::UNKNOWN, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 1, AllocationType::UNKNOWN, mockDeviceBitfield); properties.flags.flushL3RequiredForRead = 1; properties.flags.flushL3RequiredForWrite = 1; - GraphicsAllocation::AllocationType allocationTypesThatMayNeedL3Flush[] = { - GraphicsAllocation::AllocationType::BUFFER, - GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, - GraphicsAllocation::AllocationType::GLOBAL_SURFACE, GraphicsAllocation::AllocationType::IMAGE, - GraphicsAllocation::AllocationType::PIPE, GraphicsAllocation::AllocationType::SHARED_IMAGE, - GraphicsAllocation::AllocationType::SHARED_BUFFER, GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY, - GraphicsAllocation::AllocationType::SVM_ZERO_COPY, GraphicsAllocation::AllocationType::SVM_GPU, - GraphicsAllocation::AllocationType::SVM_CPU, GraphicsAllocation::AllocationType::WRITE_COMBINED, - GraphicsAllocation::AllocationType::MAP_ALLOCATION}; + 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}; MockMemoryManager mockMemoryManager; for (auto allocationType : allocationTypesThatMayNeedL3Flush) { @@ -2569,43 +2569,43 @@ class HeapSelectorTest : public Test { }; TEST_F(HeapSelectorTest, given32bitInternalAllocationWhenSelectingHeapThenInternalHeapIsUsed) { - GraphicsAllocation allocation{0, GraphicsAllocation::AllocationType::KERNEL_ISA, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; + GraphicsAllocation allocation{0, AllocationType::KERNEL_ISA, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; allocation.set32BitAllocation(true); EXPECT_EQ(MemoryManager::selectInternalHeap(allocation.isAllocatedInLocalMemoryPool()), memoryManager->selectHeap(&allocation, false, false, false)); - GraphicsAllocation allocation2{0, GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; + GraphicsAllocation allocation2{0, AllocationType::KERNEL_ISA_INTERNAL, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; allocation2.set32BitAllocation(true); EXPECT_EQ(MemoryManager::selectInternalHeap(allocation2.isAllocatedInLocalMemoryPool()), memoryManager->selectHeap(&allocation2, false, false, false)); } TEST_F(HeapSelectorTest, givenNon32bitInternalAllocationWhenSelectingHeapThenInternalHeapIsUsed) { - GraphicsAllocation allocation{0, GraphicsAllocation::AllocationType::KERNEL_ISA, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; + GraphicsAllocation allocation{0, AllocationType::KERNEL_ISA, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; allocation.set32BitAllocation(false); EXPECT_EQ(MemoryManager::selectInternalHeap(allocation.isAllocatedInLocalMemoryPool()), memoryManager->selectHeap(&allocation, false, false, false)); - GraphicsAllocation allocation2{0, GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; + GraphicsAllocation allocation2{0, AllocationType::KERNEL_ISA_INTERNAL, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; allocation2.set32BitAllocation(false); EXPECT_EQ(MemoryManager::selectInternalHeap(allocation2.isAllocatedInLocalMemoryPool()), memoryManager->selectHeap(&allocation2, false, false, false)); } TEST_F(HeapSelectorTest, given32bitExternalAllocationWhenSelectingHeapThenExternalHeapIsUsed) { - GraphicsAllocation allocation{0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; + GraphicsAllocation allocation{0, AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; allocation.set32BitAllocation(true); EXPECT_EQ(MemoryManager::selectExternalHeap(allocation.isAllocatedInLocalMemoryPool()), memoryManager->selectHeap(&allocation, false, false, false)); } TEST_F(HeapSelectorTest, givenLimitedAddressSpaceWhenSelectingHeapForExternalAllocationThenStandardHeapIsUsed) { - GraphicsAllocation allocation{0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; + GraphicsAllocation allocation{0, AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; EXPECT_EQ(HeapIndex::HEAP_STANDARD, memoryManager->selectHeap(&allocation, true, false, false)); } TEST_F(HeapSelectorTest, givenFullAddressSpaceWhenSelectingHeapForExternalAllocationWithPtrThenSvmHeapIsUsed) { - GraphicsAllocation allocation{0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; + GraphicsAllocation allocation{0, AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; EXPECT_EQ(HeapIndex::HEAP_SVM, memoryManager->selectHeap(&allocation, true, true, false)); } TEST_F(HeapSelectorTest, givenFullAddressSpaceWhenSelectingHeapForExternalAllocationWithoutPtrAndResourceIs64KSuitableThenStandard64kHeapIsUsed) { - GraphicsAllocation allocation{0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; + GraphicsAllocation allocation{0, AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; auto rootDeviceEnvironment = platform()->peekExecutionEnvironment()->rootDeviceEnvironments[0].get(); auto gmm = std::make_unique(rootDeviceEnvironment->getGmmClientContext(), nullptr, 0, 0, false); auto resourceInfo = static_cast(gmm->gmmResourceInfo.get()); @@ -2615,7 +2615,7 @@ TEST_F(HeapSelectorTest, givenFullAddressSpaceWhenSelectingHeapForExternalAlloca } TEST_F(HeapSelectorTest, givenFullAddressSpaceWhenSelectingHeapForExternalAllocationWithoutPtrAndResourceIsNot64KSuitableThenStandardHeapIsUsed) { - GraphicsAllocation allocation{0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; + GraphicsAllocation allocation{0, AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; auto rootDeviceEnvironment = platform()->peekExecutionEnvironment()->rootDeviceEnvironments[0].get(); auto gmm = std::make_unique(rootDeviceEnvironment->getGmmClientContext(), nullptr, 0, 0, false); auto resourceInfo = static_cast(gmm->gmmResourceInfo.get()); @@ -2633,26 +2633,26 @@ TEST_F(HeapSelectorTest, givenLimitedAddressSpaceWhenSelectingHeapForNullAllocat } TEST_F(HeapSelectorTest, givenDebugModuleAreaAllocationAndUseFrontWindowWhenSelectingHeapThenInternalFrontWindowHeapIsReturned) { - GraphicsAllocation allocation{0, GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA, nullptr, 0, 0, 0, MemoryPool::MemoryNull, 1}; + GraphicsAllocation allocation{0, AllocationType::DEBUG_MODULE_AREA, 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, GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA, nullptr, 0, 0, 0, MemoryPool::LocalMemory, 1}; + GraphicsAllocation allocation{0, AllocationType::DEBUG_MODULE_AREA, 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, GraphicsAllocation::AllocationType::COMMAND_BUFFER, nullptr, nullptr, 0, 0, 0, + MemoryAllocation allocation{0, AllocationType::COMMAND_BUFFER, nullptr, nullptr, 0, 0, 0, MemoryPool::MemoryNull, false, false, MemoryManager::maxOsContextCount}; - EXPECT_EQ(GraphicsAllocation::AllocationType::COMMAND_BUFFER, allocation.getAllocationType()); + EXPECT_EQ(AllocationType::COMMAND_BUFFER, allocation.getAllocationType()); } TEST(MemoryAllocationTest, givenMemoryPoolWhenPassedToMemoryAllocationConstructorThenMemoryPoolIsStored) { - MemoryAllocation allocation{0, GraphicsAllocation::AllocationType::COMMAND_BUFFER, nullptr, nullptr, 0, 0, 0, + MemoryAllocation allocation{0, AllocationType::COMMAND_BUFFER, nullptr, nullptr, 0, 0, 0, MemoryPool::System64KBPages, false, false, MemoryManager::maxOsContextCount}; EXPECT_EQ(MemoryPool::System64KBPages, allocation.getMemoryPool()); } @@ -2806,19 +2806,19 @@ HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhen64BitAndHostPtrTrackingDisab bool expectedValue = !is32bit; - auto result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, 0u); + auto result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::EXTERNAL_HOST_PTR, 0u); EXPECT_EQ(expectedValue, result); - result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::MAP_ALLOCATION, 0u); + result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::MAP_ALLOCATION, 0u); EXPECT_EQ(expectedValue, result); } HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingModeThenNonSvmHostPtrUsageIsSet) { memoryManager->setForceNonSvmForExternalHostPtr(true); - auto result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, 0u); + auto result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::EXTERNAL_HOST_PTR, 0u); EXPECT_EQ(true, result); - result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, 0u); + result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::BUFFER_HOST_MEMORY, 0u); EXPECT_EQ(false, result); } @@ -2827,8 +2827,8 @@ HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingModeThenNonSv hwInfoLocal.capabilityTable.hostPtrTrackingEnabled = true; memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[0u]->setHwInfo(&hwInfoLocal); int buffer = 0; - EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, 0u)); - EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, 0u)); + EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, AllocationType::EXTERNAL_HOST_PTR, 0u)); + EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, AllocationType::BUFFER_HOST_MEMORY, 0u)); } HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingDisabledAnd64bitsThenNonSvmBufferIsSetForBufferHostMemory) { @@ -2836,18 +2836,18 @@ HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingDisabledAnd64 hwInfoLocal.capabilityTable.hostPtrTrackingEnabled = false; memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[0u]->setHwInfo(&hwInfoLocal); int buffer = 0; - EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, 0u)); - EXPECT_EQ(!is32bit, memoryManager->isNonSvmBuffer(&buffer, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, 0u)); + EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, AllocationType::EXTERNAL_HOST_PTR, 0u)); + EXPECT_EQ(!is32bit, memoryManager->isNonSvmBuffer(&buffer, AllocationType::BUFFER_HOST_MEMORY, 0u)); } HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingEnabledThenNonSvmHostPtrUsageDependsOnFullRangeSvm) { DebugManagerStateRestore dbgRestore; DebugManager.flags.EnableHostPtrTracking.set(1); - auto result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, 0u); + auto result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::EXTERNAL_HOST_PTR, 0u); EXPECT_EQ(!executionEnvironment->rootDeviceEnvironments[0]->isFullRangeSvm() && !is32bit, result); - result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::MAP_ALLOCATION, 0u); + result = memoryManager->useNonSvmHostPtrAlloc(AllocationType::MAP_ALLOCATION, 0u); EXPECT_EQ(!executionEnvironment->rootDeviceEnvironments[0]->isFullRangeSvm() && !is32bit, result); } @@ -2883,7 +2883,7 @@ HWTEST_F(PageTableManagerTest, givenPageTableManagerWhenMapAuxGpuVaThenForAllEng memoryManager->getRegisteredEngines()[0].commandStreamReceiver->pageTableManager.reset(mockMngr); memoryManager->getRegisteredEngines()[1].commandStreamReceiver->pageTableManager.reset(mockMngr2); - MockGraphicsAllocation allocation(1u, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull); + MockGraphicsAllocation allocation(1u, AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull); MockGmm gmm(executionEnvironment->rootDeviceEnvironments[allocation.getRootDeviceIndex()]->getGmmClientContext()); gmm.isCompressionEnabled = true; allocation.setDefaultGmm(&gmm); @@ -2927,7 +2927,7 @@ HWTEST_F(PageTableManagerTest, givenPageTableManagerWhenUpdateAuxTableGmmErrorTh memoryManager->getRegisteredEngines()[0].commandStreamReceiver->pageTableManager.reset(mockMngr); - MockGraphicsAllocation allocation(1u, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull); + MockGraphicsAllocation allocation(1u, AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull); MockGmm gmm(executionEnvironment->rootDeviceEnvironments[allocation.getRootDeviceIndex()]->getGmmClientContext()); gmm.isCompressionEnabled = true; allocation.setDefaultGmm(&gmm); @@ -2959,7 +2959,7 @@ HWTEST_F(PageTableManagerTest, givenNullPageTableManagerWhenMapAuxGpuVaThenNoThr memoryManager->getRegisteredEngines()[0].commandStreamReceiver->pageTableManager.reset(nullptr); - MockGraphicsAllocation allocation(1u, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull); + MockGraphicsAllocation allocation(1u, AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull); MockGmm gmm(executionEnvironment->rootDeviceEnvironments[allocation.getRootDeviceIndex()]->getGmmClientContext()); gmm.isCompressionEnabled = true; allocation.setDefaultGmm(&gmm); @@ -2987,7 +2987,7 @@ HWTEST_F(PageTableManagerTest, givenNullPageTableManagerWhenMapAuxGpuVaThenRetur engine.commandStreamReceiver->pageTableManager.reset(nullptr); } - MockGraphicsAllocation allocation(1u, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull); + MockGraphicsAllocation allocation(1u, AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull); bool result = memoryManager->mapAuxGpuVA(&allocation); EXPECT_FALSE(result); @@ -3002,7 +3002,7 @@ HWTEST_F(PageTableManagerTest, givenMemoryManagerThatSupportsPageTableManagerWhe } auto memoryManager = new MockMemoryManager(false, false, *executionEnvironment); executionEnvironment->memoryManager.reset(memoryManager); - MockGraphicsAllocation allocation(1u, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull); + MockGraphicsAllocation allocation(1u, AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull); MockGmm gmm(executionEnvironment->rootDeviceEnvironments[allocation.getRootDeviceIndex()]->getGmmClientContext()); allocation.setDefaultGmm(&gmm); bool mapped = memoryManager->mapAuxGpuVA(&allocation); @@ -3013,7 +3013,7 @@ HWTEST_F(PageTableManagerTest, givenMemoryManagerThatSupportsPageTableManagerWhe TEST(MemoryManagerTest, givenDebugModuleAreaAllocationTypeWhenCallingGetAllocationDataThenUse32BitFrontWindowsIsSet) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, 1, AllocationType::DEBUG_MODULE_AREA, mockDeviceBitfield); MockMemoryManager mockMemoryManager; @@ -3024,8 +3024,8 @@ TEST(MemoryManagerTest, givenDebugModuleAreaAllocationTypeWhenCallingGetAllocati TEST(MemoryManagerTest, WhenCallingIsAllocationTypeToCaptureThenScratchAndPrivateTypesReturnTrue) { MockMemoryManager mockMemoryManager; - EXPECT_TRUE(mockMemoryManager.isAllocationTypeToCapture(GraphicsAllocation::AllocationType::SCRATCH_SURFACE)); - EXPECT_TRUE(mockMemoryManager.isAllocationTypeToCapture(GraphicsAllocation::AllocationType::PRIVATE_SURFACE)); + EXPECT_TRUE(mockMemoryManager.isAllocationTypeToCapture(AllocationType::SCRATCH_SURFACE)); + EXPECT_TRUE(mockMemoryManager.isAllocationTypeToCapture(AllocationType::PRIVATE_SURFACE)); } TEST(MemoryTransferHelperTest, WhenBlitterIsSelectedButBlitCopyFailsThenFallbackToCopyOnCPU) { @@ -3036,7 +3036,7 @@ TEST(MemoryTransferHelperTest, WhenBlitterIsSelectedButBlitCopyFailsThenFallback srcData[i] = i; } MockGraphicsAllocation graphicsAllocation{destData, sizeof(destData)}; - graphicsAllocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + graphicsAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); auto hwInfo = *defaultHwInfo; hwInfo.capabilityTable.blitterOperationsSupported = false; @@ -3057,7 +3057,7 @@ TEST(MemoryTransferHelperTest, givenBlitOperationSupportedWhenBcsEngineNotAvaila MockGraphicsAllocation graphicsAllocation{destData, sizeof(destData)}; graphicsAllocation.storageInfo.memoryBanks = 1; - graphicsAllocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER); + graphicsAllocation.setAllocationType(AllocationType::BUFFER); auto hwInfo = *defaultHwInfo; hwInfo.capabilityTable.blitterOperationsSupported = true; @@ -3076,7 +3076,7 @@ TEST(MemoryManagerTest, givenMemoryManagerWithLocalMemoryWhenCreatingMultiGraphi executionEnvironment.initGmm(); MockMemoryManager memoryManager(true, true, executionEnvironment); - AllocationProperties allocationProperties{mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SVM_GPU, systemMemoryBitfield}; + AllocationProperties allocationProperties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::SVM_GPU, systemMemoryBitfield}; auto localMemoryAllocation = memoryManager.allocateGraphicsMemoryWithProperties(allocationProperties); @@ -3105,7 +3105,7 @@ TEST(MemoryManagerTest, givenDuplicateRootDeviceIndicesWhenCreatingMultiGraphics executionEnvironment.initGmm(); MockMemoryManager memoryManager(true, true, executionEnvironment); - AllocationProperties allocationProperties{mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SVM_GPU, systemMemoryBitfield}; + AllocationProperties allocationProperties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::SVM_GPU, systemMemoryBitfield}; std::vector rootDeviceIndices{}; rootDeviceIndices.push_back(mockRootDeviceIndex); diff --git a/opencl/test/unit_test/memory_manager/storage_info_tests.cpp b/opencl/test/unit_test/memory_manager/storage_info_tests.cpp index 6041eda0ec..dac63bbd54 100644 --- a/opencl/test/unit_test/memory_manager/storage_info_tests.cpp +++ b/opencl/test/unit_test/memory_manager/storage_info_tests.cpp @@ -44,7 +44,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenEnabledFlagForMultiTileIsaPlacementWhenC DebugManagerStateRestore restorer; DebugManager.flags.MultiTileIsaPlacement.set(1); - GraphicsAllocation::AllocationType isaTypes[] = {GraphicsAllocation::AllocationType::KERNEL_ISA, GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL}; + AllocationType isaTypes[] = {AllocationType::KERNEL_ISA, AllocationType::KERNEL_ISA_INTERNAL}; for (uint32_t i = 0; i < 2; i++) { AllocationProperties properties{mockRootDeviceIndex, false, 0u, isaTypes[i], false, false, singleTileMask}; @@ -65,7 +65,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenEnabledFlagForMultiTileIsaPlacementWhenC TEST_F(MultiDeviceStorageInfoTest, givenDefaultFlagForMultiTileIsaPlacementWhenCreatingStorageInfoForKernelIsaThenSingleMemoryBanksIsOnAndPageTableClonningIsRequired) { - GraphicsAllocation::AllocationType isaTypes[] = {GraphicsAllocation::AllocationType::KERNEL_ISA, GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL}; + AllocationType isaTypes[] = {AllocationType::KERNEL_ISA, AllocationType::KERNEL_ISA_INTERNAL}; for (uint32_t i = 0; i < 2; i++) { AllocationProperties properties{mockRootDeviceIndex, false, 0u, isaTypes[i], false, false, singleTileMask}; @@ -89,7 +89,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenDisabledFlagForMultiTileIsaPlacementWhen DebugManagerStateRestore restorer; DebugManager.flags.MultiTileIsaPlacement.set(0); - GraphicsAllocation::AllocationType isaTypes[] = {GraphicsAllocation::AllocationType::KERNEL_ISA, GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL}; + AllocationType isaTypes[] = {AllocationType::KERNEL_ISA, AllocationType::KERNEL_ISA_INTERNAL}; for (uint32_t i = 0; i < 2; i++) { AllocationProperties properties{mockRootDeviceIndex, false, 0u, isaTypes[i], false, false, singleTileMask}; @@ -109,7 +109,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenDisabledFlagForMultiTileIsaPlacementWhen } TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForPrivateSurfaceWithOneTileThenOnlySingleBankIsUsed) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, GraphicsAllocation::AllocationType::PRIVATE_SURFACE, false, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::PRIVATE_SURFACE, 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, GraphicsAllocation::AllocationType::PRIVATE_SURFACE, false, false, allTilesMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::PRIVATE_SURFACE, 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, GraphicsAllocation::AllocationType::INTERNAL_HEAP, true, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::INTERNAL_HEAP, 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, GraphicsAllocation::AllocationType::INTERNAL_HEAP, false, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::INTERNAL_HEAP, 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, GraphicsAllocation::AllocationType::LINEAR_STREAM, true, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::LINEAR_STREAM, 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, GraphicsAllocation::AllocationType::LINEAR_STREAM, false, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::LINEAR_STREAM, false, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_FALSE(storageInfo.cloningOfPageTables); EXPECT_EQ(singleTileMask, storageInfo.memoryBanks); @@ -163,7 +163,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForL } TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForCommandBufferThenSingleMemoryBankIsOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, GraphicsAllocation::AllocationType::COMMAND_BUFFER, true, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::COMMAND_BUFFER, true, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); EXPECT_EQ(singleTileMask, storageInfo.memoryBanks); @@ -171,7 +171,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForCo } TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForCommandBufferThenSingleMemoryBankIsOnAndPageTableClonningIsNotRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, GraphicsAllocation::AllocationType::COMMAND_BUFFER, false, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::COMMAND_BUFFER, false, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_FALSE(storageInfo.cloningOfPageTables); EXPECT_FALSE(storageInfo.tileInstanced); @@ -180,7 +180,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForC } TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForScratchSpaceThenAllMemoryBankAreOnAndPageTableClonningIsNotRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, GraphicsAllocation::AllocationType::SCRATCH_SURFACE, true, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::SCRATCH_SURFACE, true, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_FALSE(storageInfo.cloningOfPageTables); EXPECT_TRUE(storageInfo.tileInstanced); @@ -189,7 +189,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForSc } TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForScratchSpaceThenSingleMemoryBankIsOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, GraphicsAllocation::AllocationType::SCRATCH_SURFACE, false, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::SCRATCH_SURFACE, false, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); EXPECT_EQ(singleTileMask, storageInfo.memoryBanks); @@ -197,7 +197,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForS } TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForPreemptionAllocationThenAllMemoryBankAreOnAndPageTableClonningIsNotRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, GraphicsAllocation::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); @@ -206,7 +206,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForPr } TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForPreemptionAllocationThenSingleMemoryBankIsOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, GraphicsAllocation::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); @@ -214,7 +214,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenCreatingStorageInfoForP } TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForWorkPartitionSurfaceThenAllMemoryBankAreOnAndPageTableClonningIsNotRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 0u, GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE, true, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 0u, AllocationType::WORK_PARTITION_SURFACE, true, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_FALSE(storageInfo.cloningOfPageTables); EXPECT_TRUE(storageInfo.tileInstanced); @@ -227,20 +227,20 @@ HWTEST_F(MultiDeviceStorageInfoTest, givenSingleTileCsrWhenAllocatingCsrSpecific auto &heap = commandStreamReceiver->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, MemoryConstants::pageSize64k); auto heapAllocation = heap.getGraphicsAllocation(); if (commandStreamReceiver->canUse4GbHeaps) { - EXPECT_EQ(GraphicsAllocation::AllocationType::INTERNAL_HEAP, heapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::INTERNAL_HEAP, heapAllocation->getAllocationType()); } else { - EXPECT_EQ(GraphicsAllocation::AllocationType::LINEAR_STREAM, heapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::LINEAR_STREAM, heapAllocation->getAllocationType()); } commandStreamReceiver->ensureCommandBufferAllocation(heap, heap.getAvailableSpace() + 1, 0u); auto commandBufferAllocation = heap.getGraphicsAllocation(); - EXPECT_EQ(GraphicsAllocation::AllocationType::COMMAND_BUFFER, commandBufferAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::COMMAND_BUFFER, commandBufferAllocation->getAllocationType()); EXPECT_NE(heapAllocation, commandBufferAllocation); EXPECT_NE(commandBufferAllocation->getMemoryPool(), MemoryPool::LocalMemory); } TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForBufferCompressedThenAllMemoryBanksAreOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, GraphicsAllocation::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); @@ -252,7 +252,7 @@ TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForBufferCompressedThe } TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForBufferThenAllMemoryBanksAreOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, GraphicsAllocation::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); @@ -263,7 +263,7 @@ TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForBufferThenAllMemory } TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForSVMGPUThenAllMemoryBanksAreOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, GraphicsAllocation::AllocationType::SVM_GPU, true, allTilesMask}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::SVM_GPU, true, allTilesMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); EXPECT_EQ(allTilesMask, storageInfo.memoryBanks); @@ -278,7 +278,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiStorageGranularityWhenCreatingStora DebugManager.flags.MultiStorageGranularity.set(128); DebugManager.flags.MultiStoragePolicy.set(1); - AllocationProperties properties{mockRootDeviceIndex, false, 10 * MemoryConstants::pageSize64k, GraphicsAllocation::AllocationType::SVM_GPU, true, allTilesMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 10 * MemoryConstants::pageSize64k, AllocationType::SVM_GPU, true, allTilesMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.cloningOfPageTables); EXPECT_EQ(allTilesMask, storageInfo.memoryBanks); @@ -289,7 +289,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiStorageGranularityWhenCreatingStora } TEST_F(MultiDeviceStorageInfoTest, givenTwoPagesAllocationSizeWhenCreatingStorageInfoForBufferThenSingleMemoryBankIsOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, 2 * MemoryConstants::pageSize64k, GraphicsAllocation::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()); @@ -298,7 +298,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenTwoPagesAllocationSizeWhenCreatingStorag } TEST_F(MultiDeviceStorageInfoTest, givenSpecifiedDeviceIndexWhenCreatingStorageInfoForBufferThenSingleMemoryBankIsOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, GraphicsAllocation::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); @@ -309,7 +309,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenSpecifiedDeviceIndexWhenCreatingStorageI TEST_F(MultiDeviceStorageInfoTest, givenResourceColouringNotSupportedWhenCreatingStorageInfoForBufferThenSingleMemoryBankIsOnAndPageTableClonningIsRequired) { memoryManager->supportsMultiStorageResources = false; - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, GraphicsAllocation::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()); @@ -318,7 +318,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenResourceColouringNotSupportedWhenCreatin } TEST_F(MultiDeviceStorageInfoTest, givenNonMultiStorageResourceWhenCreatingStorageInfoForBufferThenSingleMemoryBankIsOnAndPageTableClonningIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, GraphicsAllocation::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()); @@ -327,26 +327,26 @@ TEST_F(MultiDeviceStorageInfoTest, givenNonMultiStorageResourceWhenCreatingStora } TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForBufferThenLocalOnlyFlagIsRequired) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, GraphicsAllocation::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, GraphicsAllocation::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, GraphicsAllocation::AllocationType::SVM_GPU, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::SVM_GPU, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.localOnlyRequired); } TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForShareableSvmGpuThenLocalOnlyFlagIsRequiredAndIsNotLocable) { - AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, GraphicsAllocation::AllocationType::SVM_GPU, false, singleTileMask}; + AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::SVM_GPU, false, singleTileMask}; properties.flags.shareable = 1u; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_TRUE(storageInfo.localOnlyRequired); @@ -354,7 +354,7 @@ TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForShareableSvmGpuThen } TEST_F(MultiDeviceStorageInfoTest, givenReadOnlyBufferToBeCopiedAcrossTilesWhenCreatingStorageInfoThenCorrectValuesAreSet) { - AllocationProperties properties{mockRootDeviceIndex, false, 1u, GraphicsAllocation::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); @@ -370,7 +370,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenReadOnlyBufferToBeCopiedAcrossTilesWhenD DebugManager.flags.OverrideMultiStoragePlacement.set(proposedTiles.to_ulong()); - AllocationProperties properties{mockRootDeviceIndex, false, 64 * KB * 40, GraphicsAllocation::AllocationType::BUFFER, true, allTilesMask}; + AllocationProperties properties{mockRootDeviceIndex, false, 64 * KB * 40, AllocationType::BUFFER, true, allTilesMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); EXPECT_EQ(proposedTiles, storageInfo.memoryBanks); @@ -380,7 +380,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenReadOnlyBufferToBeCopiedAcrossTilesWhenD } TEST_F(MultiDeviceStorageInfoTest, givenLeastOccupiedBankAndOtherBitsEnabledInSubDeviceBitfieldWhenCreateStorageInfoThenTakeLeastOccupiedBankAsMemoryBank) { - AllocationProperties properties{mockRootDeviceIndex, false, 1u, GraphicsAllocation::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); @@ -391,17 +391,17 @@ TEST_F(MultiDeviceStorageInfoTest, givenLeastOccupiedBankAndOtherBitsEnabledInSu } TEST_F(MultiDeviceStorageInfoTest, givenNoSubdeviceBitfieldWhenCreateStorageInfoThenReturnEmptyStorageInfo) { - AllocationProperties properties{mockRootDeviceIndex, false, 1u, GraphicsAllocation::AllocationType::UNKNOWN, false, {}}; + AllocationProperties properties{mockRootDeviceIndex, false, 1u, AllocationType::UNKNOWN, false, {}}; StorageInfo emptyInfo{}; EXPECT_EQ(memoryManager->createStorageInfoFromProperties(properties).getMemoryBanks(), emptyInfo.getMemoryBanks()); } TEST_F(MultiDeviceStorageInfoTest, givenGraphicsAllocationWithCpuAccessRequiredWhenCreatingStorageInfoThenSetCpuVisibleSegmentIsRequiredAndIsLockableFlagIsEnabled) { - auto firstAllocationIdx = static_cast(GraphicsAllocation::AllocationType::UNKNOWN); - auto lastAllocationIdx = static_cast(GraphicsAllocation::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); + auto allocationType = static_cast(allocationIdx); AllocationProperties properties{mockRootDeviceIndex, false, 1u, allocationType, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); if (GraphicsAllocation::isCpuAccessRequired(properties.allocationType)) { @@ -414,11 +414,11 @@ TEST_F(MultiDeviceStorageInfoTest, givenGraphicsAllocationWithCpuAccessRequiredW } TEST_F(MultiDeviceStorageInfoTest, givenGraphicsAllocationThatIsLockableWhenCreatingStorageInfoThenIsLockableFlagIsEnabled) { - auto firstAllocationIdx = static_cast(GraphicsAllocation::AllocationType::UNKNOWN); - auto lastAllocationIdx = static_cast(GraphicsAllocation::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); + auto allocationType = static_cast(allocationIdx); AllocationProperties properties{mockRootDeviceIndex, false, 1u, allocationType, false, singleTileMask}; auto storageInfo = memoryManager->createStorageInfoFromProperties(properties); if (GraphicsAllocation::isLockable(properties.allocationType)) { @@ -433,7 +433,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenGpuTimestampAllocationWhenUsingSingleTil AllocationProperties properties{mockRootDeviceIndex, false, 1u, - GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, + AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, singleTileMask.count() > 1u, false, singleTileMask}; @@ -449,7 +449,7 @@ TEST_F(MultiDeviceStorageInfoTest, AllocationProperties properties{mockRootDeviceIndex, false, 1u, - GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, + AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, allTilesMask.count() > 1u, false, allTilesMask}; 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 335e6bb265..d5aace1e21 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 @@ -88,7 +88,7 @@ TEST_F(MultiDeviceSVMMemoryAllocatorTest, givenMultipleDevicesWhenCreatingSVMAll for (auto &rootDeviceIndex : context->getRootDeviceIndices()) { auto svmAllocation = svmManager->getSVMAlloc(ptr)->gpuAllocations.getGraphicsAllocation(rootDeviceIndex); EXPECT_NE(nullptr, svmAllocation); - EXPECT_EQ(GraphicsAllocation::AllocationType::SVM_ZERO_COPY, svmAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::SVM_ZERO_COPY, svmAllocation->getAllocationType()); EXPECT_FALSE(svmAllocation->isCoherent()); } @@ -118,7 +118,7 @@ TEST_F(SVMMemoryAllocatorTest, whenSVMAllocationIsFreedThenCannotBeGotAgain) { TEST_F(SVMMemoryAllocatorTest, givenSvmManagerWhenOperatedOnThenCorrectAllocationIsInsertedReturnedAndRemoved) { int data; size_t size = sizeof(data); - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, size, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, size, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield}); NEO::SvmAllocationData svmData(mockRootDeviceIndex); svmData.gpuAllocations.addAllocation(allocation); @@ -251,7 +251,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, whenDeviceAllocationIsCreatedThenItIsStoredW EXPECT_EQ(gpuAllocation->getMemoryPool(), MemoryPool::LocalMemory); EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize64k), gpuAllocation->getUnderlyingBufferSize()); - EXPECT_EQ(GraphicsAllocation::AllocationType::WRITE_COMBINED, gpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::WRITE_COMBINED, gpuAllocation->getAllocationType()); svmManager->freeSVMAlloc(ptr); } @@ -276,7 +276,7 @@ TEST_F(SVMMemoryAllocatorTest, givenNoWriteCombinedFlagwhenDeviceAllocationIsCre EXPECT_EQ(allocationSize, allocation->size); EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize64k), gpuAllocation->getUnderlyingBufferSize()); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, gpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER, gpuAllocation->getAllocationType()); svmManager->freeSVMAlloc(ptr); } @@ -294,7 +294,7 @@ TEST_F(SVMMemoryAllocatorTest, whenHostAllocationIsCreatedThenItIsStoredWithProp EXPECT_EQ(allocationSize, allocation->size); EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize64k), gpuAllocation->getUnderlyingBufferSize()); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, gpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, gpuAllocation->getAllocationType()); EXPECT_NE(gpuAllocation->getMemoryPool(), MemoryPool::LocalMemory); EXPECT_NE(nullptr, gpuAllocation->getUnderlyingBuffer()); svmManager->freeSVMAlloc(ptr); @@ -329,7 +329,7 @@ TEST_F(SVMMemoryAllocatorTest, whenSharedAllocationIsCreatedThenItIsStoredWithPr EXPECT_EQ(allocationSize, allocation->size); EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize64k), gpuAllocation->getUnderlyingBufferSize()); - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, gpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, gpuAllocation->getAllocationType()); EXPECT_NE(gpuAllocation->getMemoryPool(), MemoryPool::LocalMemory); EXPECT_NE(nullptr, gpuAllocation->getUnderlyingBuffer()); svmManager->freeSVMAlloc(ptr); @@ -358,8 +358,8 @@ TEST_F(SVMLocalMemoryAllocatorTest, whenSharedAllocationIsCreatedWithDebugFlagSe EXPECT_EQ(alignUp(allocationSize, 64 * KB), gpuAllocation->getUnderlyingBufferSize()); EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize2Mb), allocation->cpuAllocation->getUnderlyingBufferSize()); - EXPECT_EQ(GraphicsAllocation::AllocationType::SVM_GPU, gpuAllocation->getAllocationType()); - EXPECT_EQ(GraphicsAllocation::AllocationType::SVM_CPU, allocation->cpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::SVM_GPU, gpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::SVM_CPU, allocation->cpuAllocation->getAllocationType()); EXPECT_EQ(gpuAllocation->getMemoryPool(), MemoryPool::LocalMemory); EXPECT_NE(allocation->cpuAllocation->getMemoryPool(), MemoryPool::LocalMemory); @@ -387,8 +387,8 @@ TEST_F(SVMLocalMemoryAllocatorTest, whenSharedAllocationIsCreatedWithLocalMemory EXPECT_EQ(alignUp(allocationSize, 64 * KB), gpuAllocation->getUnderlyingBufferSize()); EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize2Mb), allocation->cpuAllocation->getUnderlyingBufferSize()); - EXPECT_EQ(GraphicsAllocation::AllocationType::SVM_GPU, gpuAllocation->getAllocationType()); - EXPECT_EQ(GraphicsAllocation::AllocationType::SVM_CPU, allocation->cpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::SVM_GPU, gpuAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::SVM_CPU, allocation->cpuAllocation->getAllocationType()); EXPECT_EQ(gpuAllocation->getMemoryPool(), MemoryPool::LocalMemory); EXPECT_NE(allocation->cpuAllocation->getMemoryPool(), MemoryPool::LocalMemory); @@ -416,7 +416,7 @@ TEST_F(SVMMemoryAllocatorTest, givenSharedAllocationsDebugFlagWhenDeviceMemoryIs EXPECT_EQ(allocationSize, allocation->size); EXPECT_EQ(alignUp(allocationSize, MemoryConstants::pageSize64k), gpuAllocation->getUnderlyingBufferSize()); - EXPECT_EQ(GraphicsAllocation::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 ada724d855..a82b36ff1a 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -52,7 +52,7 @@ TEST(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSharedAllocationIsCreatedFro auto createFunction = [&]() { size_t indexFree = index++; - AllocationProperties properties(0, false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(0, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); createdAllocations[indexFree] = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false); EXPECT_NE(nullptr, createdAllocations[indexFree]); EXPECT_GE(1u, memoryManager->peekSharedBosSize()); @@ -121,7 +121,7 @@ TEST(DrmMemoryManagerTest, givenMultipleThreadsWhenSharedAllocationIsCreatedThen auto createFunction = [&]() { size_t indexFree = index++; - AllocationProperties properties(0, false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(0, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); createdAllocations[indexFree] = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false); EXPECT_NE(nullptr, createdAllocations[indexFree]); diff --git a/opencl/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp index 10029f0a61..31ea5c2629 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp @@ -101,7 +101,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamMemExecTest, GivenDrmSupportsVmBindAndComplet mock->isVmBindAvailableCall.returnValue = true; TestedBufferObject bo(mock, 128); - MockDrmAllocation cmdBuffer(GraphicsAllocation::AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation cmdBuffer(AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages); cmdBuffer.bufferObjects[0] = &bo; uint8_t buff[128]; @@ -135,7 +135,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamMemExecTest, GivenDrmSupportsVmBindAndNotComp mock->isVmBindAvailableCall.returnValue = true; TestedBufferObject bo(mock, 128); - MockDrmAllocation cmdBuffer(GraphicsAllocation::AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation cmdBuffer(AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages); cmdBuffer.bufferObjects[0] = &bo; uint8_t buff[128]; @@ -170,7 +170,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamMemExecTest, GivenDrmSupportsCompletionFenceA mock->isVmBindAvailableCall.returnValue = false; TestedBufferObject bo(mock, 128); - MockDrmAllocation cmdBuffer(GraphicsAllocation::AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation cmdBuffer(AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages); cmdBuffer.bufferObjects[0] = &bo; uint8_t buff[128]; diff --git a/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp b/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp index a2eda8e1de..4d3e18552e 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp @@ -74,7 +74,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, WhenMakingResidentThenSucceeds) { .Times(0); EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_)) .Times(0); - DrmAllocation graphicsAllocation(0, GraphicsAllocation::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); } @@ -88,7 +88,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, WhenMakingResidentTwiceThenSucceeds) { EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_)) .Times(0); - DrmAllocation graphicsAllocation(0, GraphicsAllocation::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); @@ -104,7 +104,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenSizeZeroWhenMakingResidentTwiceThe EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_)) .Times(0); - DrmAllocation graphicsAllocation(0, GraphicsAllocation::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); } @@ -119,8 +119,8 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenResizedWhenMakingResidentTwiceThen EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_)) .Times(0); - DrmAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, nullptr, 1024, static_cast(1u), MemoryPool::MemoryNull); - DrmAllocation graphicsAllocation2(0, GraphicsAllocation::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); @@ -306,7 +306,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenInvalidAddressWhenFlushingThenSucc //allocate command buffer manually char *commandBuffer = new (std::nothrow) char[1024]; ASSERT_NE(nullptr, commandBuffer); - DrmAllocation commandBufferAllocation(0, GraphicsAllocation::AllocationType::COMMAND_BUFFER, nullptr, commandBuffer, 1024, static_cast(1u), MemoryPool::MemoryNull); + DrmAllocation commandBufferAllocation(0, AllocationType::COMMAND_BUFFER, nullptr, commandBuffer, 1024, static_cast(1u), MemoryPool::MemoryNull); LinearStream cs(&commandBufferAllocation); CommandStreamReceiverHw::addBatchBufferEnd(cs, nullptr); @@ -444,8 +444,8 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenCheckFlagsWhenFlushingThenSucceeds .Times(1) .WillRepeatedly(::testing::Return(0)); - DrmAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, (void *)0x7FFFFFFF, 1024, static_cast(0u), MemoryPool::MemoryNull); - DrmAllocation allocation2(0, GraphicsAllocation::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); @@ -478,7 +478,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenCheckDrmFreeWhenFlushingThenSuccee EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_)) .Times(2); - DrmAllocation allocation(0, GraphicsAllocation::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); @@ -519,7 +519,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenCheckDrmFreeCloseFailedWhenFlushin .WillOnce(::testing::Return(-1)); EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_)) .Times(2); - DrmAllocation allocation(0, GraphicsAllocation::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); diff --git a/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_2.cpp b/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_2.cpp index 03504f2752..5b138ddca1 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_2.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_2.cpp @@ -178,7 +178,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDrmCsrCreatedWithInactiveG HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDrmAllocationWhenGetBufferObjectToModifyIsCalledForAGivenHandleIdThenTheCorrespondingBufferObjectGetsModified) { auto size = 1024u; - auto allocation = new DrmAllocation(0, GraphicsAllocation::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++) { @@ -198,7 +198,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDrmAllocationWhenGetBuffer HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, WhenMakingResidentThenSucceeds) { auto buffer = this->createBO(1024); - auto allocation = new DrmAllocation(0, GraphicsAllocation::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); @@ -216,8 +216,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, GraphicsAllocation::AllocationType::UNKNOWN, buffer1, nullptr, buffer1->peekSize(), static_cast(0u), MemoryPool::MemoryNull); - auto allocation2 = new DrmAllocation(0, GraphicsAllocation::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()); @@ -240,7 +240,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenMultipleAllocationsWhenMak HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, WhenMakingResidentTwiceThenRefCountIsOne) { auto buffer = this->createBO(1024); - auto allocation = new DrmAllocation(0, GraphicsAllocation::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); @@ -757,7 +757,7 @@ class DrmMockBuffer : public MockBufferStorage, public Buffer { public: static DrmMockBuffer *create() { char *data = static_cast(::alignedMalloc(128, 64)); - DrmAllocation *alloc = new (std::nothrow) DrmAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, &data, sizeof(data), static_cast(0), MemoryPool::MemoryNull); + DrmAllocation *alloc = new (std::nothrow) DrmAllocation(0, AllocationType::UNKNOWN, nullptr, &data, sizeof(data), static_cast(0), MemoryPool::MemoryNull); return new DrmMockBuffer(data, 128, alloc); } @@ -833,7 +833,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenBindBOsFailsThenMakeBOsRes auto bo = this->createBO(size); BufferObjects bos{bo}; - auto allocation = new MockDrmAllocationBindBOs(0, GraphicsAllocation::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); @@ -849,7 +849,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenFragmentStorageAndBindBOFa auto bo = this->createBO(size); BufferObjects bos{bo}; - auto allocation = new MockDrmAllocationBindBO(0, GraphicsAllocation::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; @@ -880,7 +880,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenBindBOFailsThenBindBOsRetu auto bo = this->createBO(size); BufferObjects bos{bo}; - auto allocation = new MockDrmAllocationBindBO(0, GraphicsAllocation::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); @@ -896,7 +896,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenBindBOFailsWithMultipleMem auto bo2 = this->createBO(size); BufferObjects bos{bo, bo2}; - auto allocation = new MockDrmAllocationBindBO(0, GraphicsAllocation::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); @@ -914,7 +914,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenBindBOFailsWithMultipleMem auto bo2 = this->createBO(size); BufferObjects bos{bo, bo2}; - auto allocation = new MockDrmAllocationBindBO(0, GraphicsAllocation::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; @@ -931,7 +931,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenAllocationWithSingleBuffer auto size = 1024u; auto bo = this->createBO(size); BufferObjects bos{bo}; - auto allocation = new DrmAllocation(0, GraphicsAllocation::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/opencl/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_tests.cpp index 093c2b5040..91d95f90ef 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_tests.cpp +++ b/opencl/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(mock, 128); - MockDrmAllocation cmdBuffer(GraphicsAllocation::AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation cmdBuffer(AllocationType::COMMAND_BUFFER, 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, GraphicsAllocation::AllocationType::COMMAND_BUFFER}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{0, 1024, AllocationType::COMMAND_BUFFER}); allocation->updateTaskCount(2, defaultEngine.osContext->getContextId()); volatile uint32_t *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, GraphicsAllocation::AllocationType::COMMAND_BUFFER}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{0, 1024, AllocationType::COMMAND_BUFFER}); allocation->updateTaskCount(2, defaultEngine.osContext->getContextId()); volatile uint32_t *completionAddress = defaultEngine.commandStreamReceiver->getTagAddress(); diff --git a/opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp index 169c7d75ce..cf5c251e30 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -93,7 +93,7 @@ class DrmGemCloseWorkerFixture { class DrmAllocationWrapper : public DrmAllocation { public: DrmAllocationWrapper(BufferObject *bo) - : DrmAllocation(0, GraphicsAllocation::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/opencl/test/unit_test/os_interface/linux/drm_memory_manager_localmem_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_localmem_tests.cpp index bb7408bd4b..b2bd7e8597 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_localmem_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_localmem_tests.cpp @@ -146,7 +146,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenMultiRootDeviceEnvironmentAndMem auto memoryManager = std::make_unique(true, false, false, *executionEnvironment); size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, true, size, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); static_cast(executionEnvironment->rootDeviceEnvironments[0]->osInterface->getDriverModel()->as())->outputFd = 7; @@ -192,7 +192,7 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenMultiRootDeviceEnvironmentAndMemory auto memoryManager = std::make_unique(true, false, false, *executionEnvironment); size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, true, size, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); auto ptr = memoryManager->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, properties, multiGraphics); @@ -207,7 +207,7 @@ TEST_F(DrmMemoryManagerUsmSharedHandleTest, givenDrmMemoryManagerAndOsHandleWhen osHandle handle = 1u; this->mock->outputHandle = 2u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, true); ASSERT_NE(nullptr, graphicsAllocation); @@ -251,7 +251,7 @@ TEST_F(DrmMemoryManagerUsmSharedHandleTest, givenMultiRootDeviceEnvironmentAndMe auto memoryManager = std::make_unique(true, false, false, *executionEnvironment); size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, true, size, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); auto ptr = memoryManager->createUSMHostAllocationFromSharedHandle(1, properties, false); @@ -283,7 +283,7 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenMultiRootDeviceEnvironmentAndNoMemo auto memoryManager = std::make_unique(true, false, false, *executionEnvironment); size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, true, size, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, false, {}); + AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {}); auto ptr = memoryManager->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, properties, multiGraphics); @@ -465,7 +465,7 @@ TEST_F(DrmMemoryManagerLocalMemoryMemoryBankTest, givenDeviceMemoryWhenGraphicsA allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.useSystemMemory = false; - allocData.type = GraphicsAllocation::AllocationType::BUFFER; + allocData.type = AllocationType::BUFFER; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks = 1u; memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -479,7 +479,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenCpuAccessRequiredWhenAllocatingI allocData.size = MemoryConstants::pageSize; allocData.flags.requiresCpuAccess = true; allocData.flags.allocateMemory = true; - allocData.type = GraphicsAllocation::AllocationType::BUFFER; + allocData.type = AllocationType::BUFFER; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -498,7 +498,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenWriteCombinedAllocationWhenAlloc MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success; AllocationData allocData{}; allocData.size = MemoryConstants::pageSize; - allocData.type = GraphicsAllocation::AllocationType::WRITE_COMBINED; + allocData.type = AllocationType::WRITE_COMBINED; allocData.rootDeviceIndex = rootDeviceIndex; auto sizeAligned = alignUp(allocData.size + MemoryConstants::pageSize64k, 2 * MemoryConstants::megaByte) + 2 * MemoryConstants::megaByte; @@ -543,26 +543,26 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenSupportedTypeWhenAllocatingInDev auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr); bool resource48Bit[] = {true, false}; - GraphicsAllocation::AllocationType supportedTypes[] = {GraphicsAllocation::AllocationType::BUFFER, - GraphicsAllocation::AllocationType::IMAGE, - GraphicsAllocation::AllocationType::COMMAND_BUFFER, - GraphicsAllocation::AllocationType::LINEAR_STREAM, - GraphicsAllocation::AllocationType::INDIRECT_OBJECT_HEAP, - GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, - GraphicsAllocation::AllocationType::INTERNAL_HEAP, - GraphicsAllocation::AllocationType::KERNEL_ISA, - GraphicsAllocation::AllocationType::SVM_GPU}; + 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}; for (auto res48bit : resource48Bit) { for (auto supportedType : supportedTypes) { allocData.type = supportedType; - allocData.imgInfo = (GraphicsAllocation::AllocationType::IMAGE == supportedType) ? &imgInfo : nullptr; - allocData.hostPtr = (GraphicsAllocation::AllocationType::SVM_GPU == supportedType) ? ::alignedMalloc(allocData.size, 4096) : nullptr; + allocData.imgInfo = (AllocationType::IMAGE == supportedType) ? &imgInfo : nullptr; + allocData.hostPtr = (AllocationType::SVM_GPU == supportedType) ? ::alignedMalloc(allocData.size, 4096) : nullptr; switch (supportedType) { - case GraphicsAllocation::AllocationType::IMAGE: - case GraphicsAllocation::AllocationType::INDIRECT_OBJECT_HEAP: - case GraphicsAllocation::AllocationType::INTERNAL_HEAP: - case GraphicsAllocation::AllocationType::KERNEL_ISA: + case AllocationType::IMAGE: + case AllocationType::INDIRECT_OBJECT_HEAP: + case AllocationType::INTERNAL_HEAP: + case AllocationType::KERNEL_ISA: allocData.flags.resource48Bit = true; break; default: @@ -574,7 +574,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenSupportedTypeWhenAllocatingInDev EXPECT_EQ(MemoryManager::AllocationStatus::Success, status); auto gpuAddress = allocation->getGpuAddress(); - if (allocation->getAllocationType() == GraphicsAllocation::AllocationType::SVM_GPU) { + if (allocation->getAllocationType() == AllocationType::SVM_GPU) { 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); @@ -597,7 +597,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenSupportedTypeWhenAllocatingInDev } memoryManager->freeGraphicsMemory(allocation); - if (GraphicsAllocation::AllocationType::SVM_GPU == supportedType) { + if (AllocationType::SVM_GPU == supportedType) { ::alignedFree(const_cast(allocData.hostPtr)); } } @@ -614,7 +614,7 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenDrmMemoryManagerWithLocalMemoryWhen TEST_F(DrmMemoryManagerLocalMemoryWithCustomMockTest, givenDrmMemoryManagerWithLocalMemoryWhenLockResourceIsCalledOnBufferObjectThenReturnPtr) { BufferObject bo(mock, 1, 1024, 0); - DrmAllocation drmAllocation(0, GraphicsAllocation::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->lockResourceInLocalMemoryImpl(&bo); @@ -656,7 +656,7 @@ HWTEST2_F(DrmMemoryManagerFailInjectionTest, givenEnabledLocalMemoryWhenNewFails allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.allocateMemory = true; - allocData.type = GraphicsAllocation::AllocationType::BUFFER; + allocData.type = AllocationType::BUFFER; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = testedMemoryManager.allocateGraphicsMemoryInDevicePool(allocData, status); @@ -718,7 +718,7 @@ HWTEST2_F(DrmMemoryManagerCopyMemoryToAllocationTest, givenDrmMemoryManagerWhenC allocData.allFlags = 0; allocData.size = destinationAllocationSize; allocData.flags.allocateMemory = true; - allocData.type = GraphicsAllocation::AllocationType::KERNEL_ISA; + allocData.type = AllocationType::KERNEL_ISA; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks.set(0, true); MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success; @@ -741,7 +741,7 @@ HWTEST2_F(DrmMemoryManagerCopyMemoryToAllocationTest, givenDrmMemoryManagerWhenC allocData.allFlags = 0; allocData.size = dataToCopy.size(); allocData.flags.allocateMemory = true; - allocData.type = GraphicsAllocation::AllocationType::KERNEL_ISA; + allocData.type = AllocationType::KERNEL_ISA; allocData.rootDeviceIndex = rootDeviceIndex; allocData.storageInfo.memoryBanks.set(0, true); MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success; @@ -762,7 +762,7 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationTest, givenDrmMemoryManagerWhenCopy DrmMemoryManagerToTestCopyMemoryToAllocation drmMemoryManger(*executionEnvironment, false, 0); std::vector dataToCopy(sourceAllocationSize, 1u); - auto allocation = drmMemoryManger.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, destinationAllocationSize, GraphicsAllocation::AllocationType::KERNEL_ISA, mockDeviceBitfield}); + auto allocation = drmMemoryManger.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, destinationAllocationSize, AllocationType::KERNEL_ISA, mockDeviceBitfield}); ASSERT_NE(nullptr, allocation); auto ret = drmMemoryManger.copyMemoryToAllocation(allocation, offset, dataToCopy.data(), dataToCopy.size()); @@ -786,7 +786,7 @@ HWTEST2_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledO allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.allocateMemory = true; - allocData.type = GraphicsAllocation::AllocationType::INTERNAL_HEAP; + allocData.type = AllocationType::INTERNAL_HEAP; allocData.rootDeviceIndex = rootDeviceIndex; MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -817,7 +817,7 @@ TEST_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAl mockExp->ioctl_res_ext = &ioctlResExt; BufferObject bo(mockExp, 1, 0, 0); - DrmAllocation drmAllocation(0, GraphicsAllocation::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); @@ -833,7 +833,7 @@ TEST_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAl mockExp->failOnMmapOffset = true; BufferObject bo(mockExp, 1, 0, 0); - DrmAllocation drmAllocation(0, GraphicsAllocation::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); @@ -844,7 +844,7 @@ TEST_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAl } TEST_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationInLocalMemoryButBufferObjectIsNullThenReturnNullPtr) { - DrmAllocation drmAllocation(0, GraphicsAllocation::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); @@ -898,7 +898,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenGraphicsAllocationInDevicePoolIs AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = GraphicsAllocation::AllocationType::IMAGE; + allocData.type = AllocationType::IMAGE; allocData.flags.resource48Bit = true; allocData.imgInfo = &imgInfo; allocData.rootDeviceIndex = rootDeviceIndex; @@ -1014,7 +1014,7 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenAllocationWithInvalidCacheRegionWhe allocData.allFlags = 0; allocData.size = 18 * MemoryConstants::pageSize64k; allocData.flags.allocateMemory = true; - allocData.type = GraphicsAllocation::AllocationType::BUFFER; + allocData.type = AllocationType::BUFFER; allocData.storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3)); allocData.storageInfo.multiStorage = true; allocData.rootDeviceIndex = rootDeviceIndex; @@ -1032,7 +1032,7 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenAllocationWithUnifiedMemoryAllocati allocData.allFlags = 0; allocData.size = 18 * MemoryConstants::pageSize64k; allocData.flags.allocateMemory = true; - allocData.type = GraphicsAllocation::AllocationType::UNIFIED_SHARED_MEMORY; + allocData.type = AllocationType::UNIFIED_SHARED_MEMORY; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); diff --git a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp index 2598c1f87d..ac96aa5be2 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp @@ -62,14 +62,14 @@ using MemoryManagerMultiDeviceSharedHandleTest = MemoryAllocatorMultiDeviceFixtu TEST_P(MemoryManagerMultiDeviceSharedHandleTest, whenCreatingAllocationFromSharedHandleWithSameHandleAndSameRootDeviceThenSameBOIsUsed) { uint32_t handle0 = 0; uint32_t rootDeviceIndex0 = 0; - AllocationProperties properties0{rootDeviceIndex0, true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties0{rootDeviceIndex0, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; auto gfxAllocation0 = memoryManager->createGraphicsAllocationFromSharedHandle(handle0, properties0, false, false); ASSERT_NE(gfxAllocation0, nullptr); EXPECT_EQ(rootDeviceIndex0, gfxAllocation0->getRootDeviceIndex()); uint32_t handle1 = 0; uint32_t rootDeviceIndex1 = 0; - AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; auto gfxAllocation1 = memoryManager->createGraphicsAllocationFromSharedHandle(handle1, properties1, false, false); 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, GraphicsAllocation::AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties0{rootDeviceIndex0, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; auto gfxAllocation0 = memoryManager->createGraphicsAllocationFromSharedHandle(handle0, properties0, false, false); ASSERT_NE(gfxAllocation0, nullptr); EXPECT_EQ(rootDeviceIndex0, gfxAllocation0->getRootDeviceIndex()); uint32_t handle1 = 0; uint32_t rootDeviceIndex1 = 1; - AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; auto gfxAllocation1 = memoryManager->createGraphicsAllocationFromSharedHandle(handle1, properties1, false, false); ASSERT_NE(gfxAllocation1, nullptr); EXPECT_EQ(rootDeviceIndex1, gfxAllocation1->getRootDeviceIndex()); @@ -110,14 +110,14 @@ TEST_P(MemoryManagerMultiDeviceSharedHandleTest, whenCreatingAllocationFromShare TEST_P(MemoryManagerMultiDeviceSharedHandleTest, whenCreatingAllocationFromSharedHandleWithDifferentHandleAndSameRootDeviceThenDifferentBOIsUsed) { uint32_t handle0 = 0; uint32_t rootDeviceIndex0 = 0; - AllocationProperties properties0{rootDeviceIndex0, true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties0{rootDeviceIndex0, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; auto gfxAllocation0 = memoryManager->createGraphicsAllocationFromSharedHandle(handle0, properties0, false, false); ASSERT_NE(gfxAllocation0, nullptr); EXPECT_EQ(rootDeviceIndex0, gfxAllocation0->getRootDeviceIndex()); uint32_t handle1 = 1; uint32_t rootDeviceIndex1 = 0; - AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; auto gfxAllocation1 = memoryManager->createGraphicsAllocationFromSharedHandle(handle1, properties1, false, false); ASSERT_NE(gfxAllocation1, nullptr); EXPECT_EQ(rootDeviceIndex1, gfxAllocation1->getRootDeviceIndex()); @@ -134,14 +134,14 @@ TEST_P(MemoryManagerMultiDeviceSharedHandleTest, whenCreatingAllocationFromShare TEST_P(MemoryManagerMultiDeviceSharedHandleTest, whenCreatingAllocationFromSharedHandleWithDifferentHandleAndDifferentRootDeviceThenDifferentBOIsUsed) { uint32_t handle0 = 0; uint32_t rootDeviceIndex0 = 0; - AllocationProperties properties0{rootDeviceIndex0, true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties0{rootDeviceIndex0, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; auto gfxAllocation0 = memoryManager->createGraphicsAllocationFromSharedHandle(handle0, properties0, false, false); ASSERT_NE(gfxAllocation0, nullptr); EXPECT_EQ(rootDeviceIndex0, gfxAllocation0->getRootDeviceIndex()); uint32_t handle1 = 1; uint32_t rootDeviceIndex1 = 1; - AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, false, false, mockDeviceBitfield}; + AllocationProperties properties1{rootDeviceIndex1, true, MemoryConstants::pageSize, AllocationType::BUFFER, false, false, mockDeviceBitfield}; auto gfxAllocation1 = memoryManager->createGraphicsAllocationFromSharedHandle(handle1, properties1, false, false); ASSERT_NE(gfxAllocation1, nullptr); EXPECT_EQ(rootDeviceIndex1, gfxAllocation1->getRootDeviceIndex()); @@ -219,7 +219,7 @@ TEST_F(DrmMemoryManagerTest, GivenGraphicsAllocationWhenAddAndRemoveAllocationTo size_t size = 0x1000; const uint32_t rootDeviceIndex = 0u; - DrmAllocation gfxAllocation(rootDeviceIndex, GraphicsAllocation::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); @@ -688,7 +688,7 @@ TEST_F(DrmMemoryManagerTest, GivenAllocationWhenClosingSharedHandleThenSucceeds) osHandle handle = 1u; this->mock->outputHandle = 2u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false); EXPECT_EQ(handle, graphicsAllocation->peekSharedHandle()); @@ -1281,7 +1281,7 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationThen32 auto size = 10u; memoryManager->setForce32BitAllocations(true); - auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, nullptr, GraphicsAllocation::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); @@ -1304,7 +1304,7 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationWhenLi auto size = 10u; memoryManager->setForce32BitAllocations(true); - auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, nullptr, GraphicsAllocation::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); @@ -1509,7 +1509,7 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationWithHo auto size = 10u; void *host_ptr = reinterpret_cast(0x1000); memoryManager->setForce32BitAllocations(true); - auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, host_ptr, GraphicsAllocation::AllocationType::BUFFER); + auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, host_ptr, AllocationType::BUFFER); EXPECT_EQ(nullptr, allocation); mock->ioctl_res_ext = &mock->NONE; @@ -1523,7 +1523,7 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationAndAll auto size = 10u; memoryManager->setForce32BitAllocations(true); - auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, nullptr, GraphicsAllocation::AllocationType::BUFFER); + auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, nullptr, AllocationType::BUFFER); EXPECT_EQ(nullptr, allocation); mock->ioctl_res_ext = &mock->NONE; @@ -1537,7 +1537,7 @@ TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenAskedForInternal32Bit auto size = 10u; memoryManager->forceLimitedRangeAllocator(0xFFFFFFFFF); - auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, nullptr, GraphicsAllocation::AllocationType::INTERNAL_HEAP); + auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, nullptr, AllocationType::INTERNAL_HEAP); EXPECT_EQ(nullptr, allocation); mock->ioctl_res_ext = &mock->NONE; @@ -1660,7 +1660,7 @@ TEST_F(DrmMemoryManagerTest, GivenExhaustedInternalHeapWhenAllocate32BitIsCalled EXPECT_NE(0llu, alloc); size_t allocationSize = 4 * GB; - auto graphicsAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, allocationSize, nullptr, GraphicsAllocation::AllocationType::INTERNAL_HEAP); + auto graphicsAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, allocationSize, nullptr, AllocationType::INTERNAL_HEAP); EXPECT_EQ(nullptr, graphicsAllocation); } @@ -2143,7 +2143,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndOsHandleWhenCreateIsCalledT osHandle handle = 1u; this->mock->outputHandle = 2u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false); ASSERT_NE(nullptr, graphicsAllocation); @@ -2173,7 +2173,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryTest, givenDrmMemoryManagerWithLocalMemory osHandle handle = 1u; this->mock->outputHandle = 2u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false); ASSERT_NE(nullptr, graphicsAllocation); @@ -2207,7 +2207,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndOsHandleWhenCreateIsCalledA osHandle handle = 1u; this->mock->outputHandle = 2u; size_t size = 4096u; - AllocationProperties properties(rootDeviceIndex, false, size, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, false, 0u); + AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::SHARED_BUFFER, false, false, 0u); ASSERT_TRUE(properties.subDevicesBitfield.none()); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false); @@ -2257,12 +2257,12 @@ TEST_F(ClDrmMemoryManagerTest, givenOsHandleWithNonTiledObjectWhenCreateFromShar imgInfo.surfaceFormat = &gmmSurfaceFormat->surfaceFormat; imgInfo.plane = GMM_PLANE_Y; - AllocationProperties properties(rootDeviceIndex, false, imgInfo, GraphicsAllocation::AllocationType::SHARED_IMAGE, context.getDevice(0)->getDeviceBitfield()); + AllocationProperties properties(rootDeviceIndex, false, imgInfo, AllocationType::SHARED_IMAGE, context.getDevice(0)->getDeviceBitfield()); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false); ASSERT_NE(nullptr, graphicsAllocation); EXPECT_EQ(boHandle, mock->getTilingHandleIn); - EXPECT_EQ(GraphicsAllocation::AllocationType::SHARED_IMAGE, graphicsAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::SHARED_IMAGE, graphicsAllocation->getAllocationType()); auto gmm = graphicsAllocation->getDefaultGmm(); ASSERT_NE(nullptr, gmm); @@ -2299,12 +2299,12 @@ TEST_F(ClDrmMemoryManagerTest, givenOsHandleWithTileYObjectWhenCreateFromSharedH imgInfo.surfaceFormat = &gmmSurfaceFormat->surfaceFormat; imgInfo.plane = GMM_PLANE_Y; - AllocationProperties properties(rootDeviceIndex, false, imgInfo, GraphicsAllocation::AllocationType::SHARED_IMAGE, context.getDevice(0)->getDeviceBitfield()); + AllocationProperties properties(rootDeviceIndex, false, imgInfo, AllocationType::SHARED_IMAGE, context.getDevice(0)->getDeviceBitfield()); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false); ASSERT_NE(nullptr, graphicsAllocation); EXPECT_EQ(boHandle, mock->getTilingHandleIn); - EXPECT_EQ(GraphicsAllocation::AllocationType::SHARED_IMAGE, graphicsAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::SHARED_IMAGE, graphicsAllocation->getAllocationType()); auto gmm = graphicsAllocation->getDefaultGmm(); ASSERT_NE(nullptr, gmm); @@ -2341,12 +2341,12 @@ TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenCreateFromSharedHandleFa imgInfo.surfaceFormat = &gmmSurfaceFormat->surfaceFormat; imgInfo.plane = GMM_PLANE_Y; - AllocationProperties properties(rootDeviceIndex, false, imgInfo, GraphicsAllocation::AllocationType::SHARED_IMAGE, context.getDevice(0)->getDeviceBitfield()); + AllocationProperties properties(rootDeviceIndex, false, imgInfo, AllocationType::SHARED_IMAGE, context.getDevice(0)->getDeviceBitfield()); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false); ASSERT_NE(nullptr, graphicsAllocation); EXPECT_EQ(boHandle, mock->getTilingHandleIn); - EXPECT_EQ(GraphicsAllocation::AllocationType::SHARED_IMAGE, graphicsAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::SHARED_IMAGE, graphicsAllocation->getAllocationType()); auto gmm = graphicsAllocation->getDefaultGmm(); ASSERT_NE(nullptr, gmm); @@ -2359,7 +2359,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndOsHandleWhenAllocationFails osHandle handle = 1u; InjectedFunction method = [this, &handle](size_t failureIndex) { - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false); if (MemoryManagement::nonfailingAllocation == failureIndex) { @@ -2393,7 +2393,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndThreeOsHandlesWhenReuseCrea if (i == 2) this->mock->outputHandle = 3u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); graphicsAllocations[i] = memoryManager->createGraphicsAllocationFromSharedHandle(handles[i], properties, false, false); //Clang-tidy false positive WA @@ -2434,7 +2434,7 @@ TEST_F(DrmMemoryManagerTest, given32BitAddressingWhenBufferFromSharedHandleAndBi osHandle handle = 1u; this->mock->outputHandle = 2u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, true, false); auto drmAllocation = static_cast(graphicsAllocation); @@ -2452,7 +2452,7 @@ TEST_F(DrmMemoryManagerTest, given32BitAddressingWhenBufferFromSharedHandleIsCre memoryManager->setForce32BitAllocations(true); osHandle handle = 1u; this->mock->outputHandle = 2u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false); auto drmAllocation = static_cast(graphicsAllocation); @@ -2472,7 +2472,7 @@ TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenBufferFromSharedHandl memoryManager->forceLimitedRangeAllocator(0xFFFFFFFFF); osHandle handle = 1u; this->mock->outputHandle = 2u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false); EXPECT_FALSE(graphicsAllocation->is32BitAllocation()); auto drmAllocation = static_cast(graphicsAllocation); @@ -2490,7 +2490,7 @@ TEST_F(DrmMemoryManagerTest, givenNon32BitAddressingWhenBufferFromSharedHandleIs memoryManager->setForce32BitAllocations(false); osHandle handle = 1u; this->mock->outputHandle = 2u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, true, false); auto drmAllocation = static_cast(graphicsAllocation); EXPECT_FALSE(graphicsAllocation->is32BitAllocation()); @@ -2506,7 +2506,7 @@ TEST_F(DrmMemoryManagerTest, givenSharedHandleWhenAllocationIsCreatedAndIoctlPri osHandle handle = 1u; this->mock->outputHandle = 2u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, false); EXPECT_EQ(nullptr, graphicsAllocation); memoryManager->freeGraphicsMemory(graphicsAllocation); @@ -2519,7 +2519,7 @@ TEST_F(DrmMemoryManagerTest, givenTwoGraphicsAllocationsThatShareTheSameBufferOb mock->ioctl_expected.gemWait = 2; osHandle sharedHandle = 1u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, properties, false, false); auto graphicsAllocation2 = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, properties, false, false); @@ -2542,7 +2542,7 @@ TEST_F(DrmMemoryManagerTest, givenTwoGraphicsAllocationsThatDoesnShareTheSameBuf mock->ioctl_expected.gemWait = 2; osHandle sharedHandle = 1u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, properties, false, false); mock->outputHandle++; auto graphicsAllocation2 = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, properties, false, false); @@ -2560,7 +2560,7 @@ TEST_F(DrmMemoryManagerTest, givenTwoGraphicsAllocationsThatDoesnShareTheSameBuf } TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenDrmMemoryManagerWhenCreateAllocationFromNtHandleIsCalledThenReturnNullptr) { - auto graphicsAllocation = memoryManager->createGraphicsAllocationFromNTHandle(reinterpret_cast(1), 0, GraphicsAllocation::AllocationType::SHARED_IMAGE); + auto graphicsAllocation = memoryManager->createGraphicsAllocationFromNTHandle(reinterpret_cast(1), 0, AllocationType::SHARED_IMAGE); EXPECT_EQ(nullptr, graphicsAllocation); } @@ -2662,7 +2662,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledOnNullAl } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationWithoutBufferObjectThenReturnNullPtr) { - DrmAllocation drmAllocation(rootDeviceIndex, GraphicsAllocation::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); @@ -2681,7 +2681,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledButFails BufferObjectMock(Drm *drm) : BufferObject(drm, 1, 0, 1) {} }; BufferObjectMock bo(&drmMock); - DrmAllocation drmAllocation(rootDeviceIndex, GraphicsAllocation::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); @@ -2714,7 +2714,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenUnlockResourceIsCalledOnAl BufferObjectMock(Drm *drm) : BufferObject(drm, 1, 0, 1) {} }; auto bo = new BufferObjectMock(&drmMock); - auto drmAllocation = new DrmAllocation(rootDeviceIndex, GraphicsAllocation::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); @@ -2724,7 +2724,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenUnlockResourceIsCalledOnAl } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetDomainCpuIsCalledOnAllocationWithoutBufferObjectThenReturnFalse) { - DrmAllocation drmAllocation(rootDeviceIndex, GraphicsAllocation::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); @@ -2741,7 +2741,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetDomainCpuIsCalledButFai BufferObjectMock(Drm *drm) : BufferObject(drm, 1, 0, 1) {} }; BufferObjectMock bo(&drmMock); - DrmAllocation drmAllocation(rootDeviceIndex, GraphicsAllocation::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); @@ -2757,7 +2757,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetDomainCpuIsCalledOnAllo BufferObjectMock(Drm *drm) : BufferObject(drm, 1, 0, 1) {} }; BufferObjectMock bo(&drmMock); - DrmAllocation drmAllocation(rootDeviceIndex, GraphicsAllocation::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); @@ -2806,7 +2806,7 @@ TEST_F(DrmMemoryManagerTest, given32BitAllocatorWithHeapAllocatorWhenLargerFragm size_t pages3size = 3 * MemoryConstants::pageSize; void *host_ptr = reinterpret_cast(0x1000); - DrmAllocation *graphicsAlloaction = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, pages3size, host_ptr, GraphicsAllocation::AllocationType::BUFFER); + DrmAllocation *graphicsAlloaction = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, pages3size, host_ptr, AllocationType::BUFFER); auto bo = graphicsAlloaction->getBO(); EXPECT_EQ(pages3size, bo->peekSize()); @@ -2822,7 +2822,7 @@ TEST_F(DrmMemoryManagerTest, givenSharedAllocationWithSmallerThenRealSizeWhenCre mock->ioctl_expected.gemWait = 1; mock->ioctl_expected.gemClose = 1; osHandle sharedHandle = 1u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, properties, false, false); @@ -2882,7 +2882,7 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedForInternalAllocationWit auto bufferSize = MemoryConstants::pageSize; void *ptr = nullptr; - auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, GraphicsAllocation::AllocationType::INTERNAL_HEAP)); + auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, AllocationType::INTERNAL_HEAP)); ASSERT_NE(nullptr, drmAllocation); EXPECT_NE(nullptr, drmAllocation->getUnderlyingBuffer()); @@ -2912,7 +2912,7 @@ TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenAskedForInternalAlloc auto bufferSize = MemoryConstants::pageSize; void *ptr = nullptr; - auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, GraphicsAllocation::AllocationType::INTERNAL_HEAP)); + auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, AllocationType::INTERNAL_HEAP)); ASSERT_NE(nullptr, drmAllocation); EXPECT_NE(nullptr, drmAllocation->getUnderlyingBuffer()); @@ -2946,7 +2946,7 @@ TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenAskedForExternalAlloc auto bufferSize = MemoryConstants::pageSize; void *ptr = nullptr; - auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, GraphicsAllocation::AllocationType::BUFFER)); + auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, AllocationType::BUFFER)); ASSERT_NE(nullptr, drmAllocation); EXPECT_NE(nullptr, drmAllocation->getUnderlyingBuffer()); @@ -2960,7 +2960,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, GraphicsAllocation::AllocationType::INTERNAL_HEAP)); + auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, AllocationType::INTERNAL_HEAP)); ASSERT_EQ(nullptr, drmAllocation); } @@ -2971,7 +2971,7 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedForInternalAllocationWit auto bufferSize = MemoryConstants::pageSize; void *ptr = reinterpret_cast(0x100000); - auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, GraphicsAllocation::AllocationType::INTERNAL_HEAP)); + auto drmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, bufferSize, ptr, AllocationType::INTERNAL_HEAP)); ASSERT_NE(nullptr, drmAllocation); EXPECT_NE(nullptr, drmAllocation->getUnderlyingBuffer()); @@ -3037,7 +3037,7 @@ TEST_F(DrmMemoryManagerUSMHostAllocationTests, givenCallToAllocateGraphicsMemory allocationData.size = 16384; allocationData.rootDeviceIndex = rootDeviceIndex; allocationData.flags.isUSMHostAllocation = true; - allocationData.type = GraphicsAllocation::AllocationType::SVM_CPU; + allocationData.type = AllocationType::SVM_CPU; auto alloc = memoryManager->allocateGraphicsMemoryWithAlignment(allocationData); EXPECT_NE(nullptr, alloc); @@ -3283,7 +3283,7 @@ TEST_F(DrmMemoryManagerBasic, givenMemoryManagerWhenAllocate32BitGraphicsMemoryW void *ptr = reinterpret_cast(0x1001); auto size = MemoryConstants::pageSize; - auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, ptr, GraphicsAllocation::AllocationType::BUFFER); + auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, ptr, AllocationType::BUFFER); ASSERT_NE(nullptr, allocation); EXPECT_EQ(MemoryPool::System4KBPagesWith32BitGpuAddressing, allocation->getMemoryPool()); @@ -3297,7 +3297,7 @@ TEST_F(DrmMemoryManagerBasic, givenMemoryManagerWhenCreateAllocationFromHandleIs true, executionEnvironment)); auto osHandle = 1u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); auto allocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, false, false); EXPECT_NE(nullptr, allocation); EXPECT_EQ(MemoryPool::SystemCpuInaccessible, allocation->getMemoryPool()); @@ -3897,8 +3897,8 @@ TEST_F(DrmMemoryManagerBasic, givenImageOrSharedResourceCopyWhenGraphicsAllocati allocData.flags.allocateMemory = true; allocData.rootDeviceIndex = rootDeviceIndex; - GraphicsAllocation::AllocationType types[] = {GraphicsAllocation::AllocationType::IMAGE, - GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY}; + AllocationType types[] = {AllocationType::IMAGE, + AllocationType::SHARED_RESOURCE_COPY}; for (auto type : types) { allocData.type = type; @@ -3931,7 +3931,7 @@ TEST_F(DrmMemoryManagerTest, givenDebugModuleAreaTypeWhenCreatingAllocationThen3 const auto size = MemoryConstants::pageSize64k; NEO::AllocationProperties properties{device->getRootDeviceIndex(), true, size, - NEO::GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA, + NEO::AllocationType::DEBUG_MODULE_AREA, false, device->getDeviceBitfield()}; @@ -3959,18 +3959,18 @@ TEST_F(DrmMemoryManagerTest, givenDebugModuleAreaTypeWhenCreatingAllocationThen3 } TEST(DrmAllocationTest, givenAllocationTypeWhenPassedToDrmAllocationConstructorThenAllocationTypeIsStored) { - DrmAllocation allocation{0, GraphicsAllocation::AllocationType::COMMAND_BUFFER, nullptr, nullptr, static_cast(0), 0u, MemoryPool::MemoryNull}; - EXPECT_EQ(GraphicsAllocation::AllocationType::COMMAND_BUFFER, allocation.getAllocationType()); + DrmAllocation allocation{0, AllocationType::COMMAND_BUFFER, nullptr, nullptr, static_cast(0), 0u, MemoryPool::MemoryNull}; + EXPECT_EQ(AllocationType::COMMAND_BUFFER, allocation.getAllocationType()); - DrmAllocation allocation2{0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, nullptr, 0ULL, static_cast(0), MemoryPool::MemoryNull}; - EXPECT_EQ(GraphicsAllocation::AllocationType::UNKNOWN, allocation2.getAllocationType()); + DrmAllocation allocation2{0, AllocationType::UNKNOWN, nullptr, nullptr, 0ULL, static_cast(0), MemoryPool::MemoryNull}; + EXPECT_EQ(AllocationType::UNKNOWN, allocation2.getAllocationType()); } TEST(DrmAllocationTest, givenMemoryPoolWhenPassedToDrmAllocationConstructorThenMemoryPoolIsStored) { - DrmAllocation allocation{0, GraphicsAllocation::AllocationType::COMMAND_BUFFER, nullptr, nullptr, static_cast(0), 0u, MemoryPool::System64KBPages}; + DrmAllocation allocation{0, AllocationType::COMMAND_BUFFER, nullptr, nullptr, static_cast(0), 0u, MemoryPool::System64KBPages}; EXPECT_EQ(MemoryPool::System64KBPages, allocation.getMemoryPool()); - DrmAllocation allocation2{0, GraphicsAllocation::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()); } @@ -4017,13 +4017,13 @@ TEST_F(DrmMemoryManagerTest, givenSvmCpuAllocationWhenSizeAndAlignmentProvidedTh AllocationData allocationData; allocationData.size = 2 * MemoryConstants::megaByte; allocationData.alignment = 2 * MemoryConstants::megaByte; - allocationData.type = GraphicsAllocation::AllocationType::SVM_CPU; + allocationData.type = AllocationType::SVM_CPU; allocationData.rootDeviceIndex = rootDeviceIndex; DrmAllocation *allocation = memoryManager->allocateGraphicsMemoryWithAlignment(allocationData); ASSERT_NE(nullptr, allocation); - EXPECT_EQ(GraphicsAllocation::AllocationType::SVM_CPU, allocation->getAllocationType()); + EXPECT_EQ(AllocationType::SVM_CPU, allocation->getAllocationType()); EXPECT_EQ(allocationData.size, allocation->getUnderlyingBufferSize()); EXPECT_NE(nullptr, allocation->getUnderlyingBuffer()); @@ -4058,7 +4058,7 @@ TEST_F(DrmMemoryManagerTest, givenSvmCpuAllocationWhenSizeAndAlignmentProvidedBu AllocationData allocationData; allocationData.size = 2 * MemoryConstants::megaByte; allocationData.alignment = 2 * MemoryConstants::megaByte; - allocationData.type = GraphicsAllocation::AllocationType::SVM_CPU; + allocationData.type = AllocationType::SVM_CPU; allocationData.rootDeviceIndex = rootDeviceIndex; DrmAllocation *allocation = memoryManager->allocateGraphicsMemoryWithAlignment(allocationData); @@ -4117,7 +4117,7 @@ TEST(DrmMemoryManagerFreeGraphicsMemoryCallSequenceTest, givenDrmMemoryManagerAn executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*drm, 0u); GMockDrmMemoryManager gmockDrmMemoryManager(executionEnvironment); - AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::BUFFER, mockDeviceBitfield}; auto allocation = gmockDrmMemoryManager.allocateGraphicsMemoryWithProperties(properties); ASSERT_NE(allocation, nullptr); @@ -4141,7 +4141,7 @@ TEST(DrmMemoryManagerFreeGraphicsMemoryUnreferenceTest, givenDrmMemoryManagerAnd ::testing::NiceMock gmockDrmMemoryManager(executionEnvironment); osHandle handle = 1u; - AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); auto allocation = gmockDrmMemoryManager.createGraphicsAllocationFromSharedHandle(handle, properties, false, false); ASSERT_NE(nullptr, allocation); @@ -4179,7 +4179,7 @@ TEST(DrmAllocationTest, givenResourceRegistrationEnabledWhenAllocationTypeShould { MockBufferObject bo(&drm, 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA, MemoryPool::System4KBPages); + MockDrmAllocation allocation(AllocationType::DEBUG_CONTEXT_SAVE_AREA, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); EXPECT_EQ(DrmMockResources::registerResourceReturnHandle, bo.bindExtHandles[0]); @@ -4189,7 +4189,7 @@ TEST(DrmAllocationTest, givenResourceRegistrationEnabledWhenAllocationTypeShould { MockBufferObject bo(&drm, 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::DEBUG_SBA_TRACKING_BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation allocation(AllocationType::DEBUG_SBA_TRACKING_BUFFER, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); EXPECT_EQ(DrmMockResources::registerResourceReturnHandle, bo.bindExtHandles[0]); @@ -4199,7 +4199,7 @@ TEST(DrmAllocationTest, givenResourceRegistrationEnabledWhenAllocationTypeShould { MockBufferObject bo(&drm, 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); + MockDrmAllocation allocation(AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); EXPECT_EQ(DrmMockResources::registerResourceReturnHandle, bo.bindExtHandles[0]); @@ -4209,7 +4209,7 @@ TEST(DrmAllocationTest, givenResourceRegistrationEnabledWhenAllocationTypeShould { MockBufferObject bo(&drm, 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA, MemoryPool::System4KBPages); + MockDrmAllocation allocation(AllocationType::DEBUG_MODULE_AREA, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); EXPECT_EQ(DrmMockResources::registerResourceReturnHandle, bo.bindExtHandles[0]); @@ -4220,7 +4220,7 @@ TEST(DrmAllocationTest, givenResourceRegistrationEnabledWhenAllocationTypeShould { MockBufferObject bo(&drm, 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, MemoryPool::System4KBPages); + MockDrmAllocation allocation(AllocationType::BUFFER_HOST_MEMORY, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); EXPECT_EQ(0u, bo.bindExtHandles.size()); @@ -4242,7 +4242,7 @@ TEST(DrmAllocationTest, givenResourceRegistrationEnabledWhenAllocationTypeShould { MockBufferObject bo(&drm, 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL, MemoryPool::System4KBPages); + MockDrmAllocation allocation(AllocationType::KERNEL_ISA_INTERNAL, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); EXPECT_EQ(0u, bo.bindExtHandles.size()); @@ -4257,7 +4257,7 @@ TEST(DrmAllocationTest, givenResourceRegistrationNotEnabledWhenRegisteringBindEx EXPECT_EQ(0u, drm.classHandles.size()); MockBufferObject bo(&drm, 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA, MemoryPool::System4KBPages); + MockDrmAllocation allocation(AllocationType::DEBUG_CONTEXT_SAVE_AREA, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); EXPECT_EQ(0u, bo.bindExtHandles.size()); @@ -4277,7 +4277,7 @@ TEST(DrmMemoryManager, givenTrackedAllocationTypeAndDisabledRegistrationInDrmWhe mockDrm->registeredDataSize = 0; - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA, MemoryPool::System4KBPages); + MockDrmAllocation allocation(AllocationType::DEBUG_CONTEXT_SAVE_AREA, MemoryPool::System4KBPages); memoryManager->registerAllocationInOs(&allocation); @@ -4298,13 +4298,13 @@ TEST(DrmMemoryManager, givenResourceRegistrationEnabledAndAllocTypeToCaptureWhen mockDrm->classHandles.push_back(1); MockBufferObject bo(mockDrm, 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::SCRATCH_SURFACE, MemoryPool::System4KBPages); + MockDrmAllocation allocation(AllocationType::SCRATCH_SURFACE, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; memoryManager->registerAllocationInOs(&allocation); EXPECT_TRUE(allocation.markedForCapture); - MockDrmAllocation allocation2(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::System4KBPages); + MockDrmAllocation allocation2(AllocationType::BUFFER, MemoryPool::System4KBPages); allocation2.bufferObjects[0] = &bo; memoryManager->registerAllocationInOs(&allocation2); @@ -4327,7 +4327,7 @@ TEST(DrmMemoryManager, givenTrackedAllocationTypeWhenAllocatingThenAllocationIsR EXPECT_TRUE(mockDrm->resourceRegistrationEnabled()); NEO::AllocationProperties properties{0, true, MemoryConstants::pageSize, - NEO::GraphicsAllocation::AllocationType::DEBUG_SBA_TRACKING_BUFFER, + NEO::AllocationType::DEBUG_SBA_TRACKING_BUFFER, false, 1}; properties.gpuAddress = 0x20000; @@ -4357,7 +4357,7 @@ TEST(DrmMemoryManager, givenTrackedAllocationTypeWhenFreeingThenRegisteredHandle EXPECT_TRUE(mockDrm->resourceRegistrationEnabled()); NEO::AllocationProperties properties{0, true, MemoryConstants::pageSize, - NEO::GraphicsAllocation::AllocationType::DEBUG_SBA_TRACKING_BUFFER, + NEO::AllocationType::DEBUG_SBA_TRACKING_BUFFER, false, 1}; properties.gpuAddress = 0x20000; @@ -4383,7 +4383,7 @@ TEST(DrmMemoryManager, givenNullBoWhenRegisteringBindExtHandleThenEarlyReturn) { EXPECT_TRUE(mockDrm->resourceRegistrationEnabled()); - MockDrmAllocation gfxAllocation(GraphicsAllocation::AllocationType::DEBUG_SBA_TRACKING_BUFFER, MemoryPool::MemoryNull); + MockDrmAllocation gfxAllocation(AllocationType::DEBUG_SBA_TRACKING_BUFFER, MemoryPool::MemoryNull); gfxAllocation.registerBOBindExtHandle(mockDrm.get()); EXPECT_EQ(1u, gfxAllocation.registeredBoBindHandles.size()); @@ -4399,7 +4399,7 @@ TEST(DrmAllocationTest, givenResourceRegistrationEnabledWhenAllocationIsRegister drm.classHandles.push_back(1); MockBufferObject bo(&drm, 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA, MemoryPool::System4KBPages); + MockDrmAllocation allocation(AllocationType::DEBUG_CONTEXT_SAVE_AREA, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); @@ -4420,7 +4420,7 @@ TEST(DrmAllocationTest, givenResourceRegistrationEnabledWhenIsaIsRegisteredThenC drm.registeredClass = Drm::ResourceClass::MaxSize; MockBufferObject bo(&drm, 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); + MockDrmAllocation allocation(AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); allocation.bufferObjects[0] = &bo; allocation.registerBOBindExtHandle(&drm); EXPECT_EQ(2u, bo.bindExtHandles.size()); @@ -4438,7 +4438,7 @@ TEST(DrmAllocationTest, givenDrmAllocationWhenSetCacheRegionIsCalledForDefaultRe DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::LocalMemory); EXPECT_TRUE(allocation.setCacheRegion(&drm, CacheRegion::Default)); } @@ -4449,7 +4449,7 @@ TEST(DrmAllocationTest, givenDrmAllocationWhenCacheInfoIsNotAvailableThenCacheRe DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::LocalMemory); EXPECT_FALSE(allocation.setCacheRegion(&drm, CacheRegion::Region1)); } @@ -4461,7 +4461,7 @@ TEST(DrmAllocationTest, givenDrmAllocationWhenDefaultCacheInfoIsAvailableThenCac DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]); drm.setupCacheInfo(*defaultHwInfo.get()); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::LocalMemory); EXPECT_FALSE(allocation.setCacheRegion(&drm, CacheRegion::Region1)); } @@ -4473,7 +4473,7 @@ TEST(DrmAllocationTest, givenDrmAllocationWhenCacheRegionIsNotSetThenReturnFalse DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]); drm.cacheInfo.reset(new MockCacheInfo()); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::LocalMemory); EXPECT_FALSE(allocation.setCacheAdvice(&drm, 1024, CacheRegion::None)); } @@ -4485,7 +4485,7 @@ TEST(DrmAllocationTest, givenDrmAllocationWhenCacheRegionIsSetSuccessfullyThenRe DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]); drm.cacheInfo.reset(new MockCacheInfo()); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::LocalMemory); EXPECT_TRUE(allocation.setCacheAdvice(&drm, 1024, CacheRegion::Region1)); } @@ -4498,7 +4498,7 @@ TEST(DrmAllocationTest, givenDrmAllocationWhenCacheRegionIsSetSuccessfullyThenSe drm.cacheInfo.reset(new MockCacheInfo()); MockBufferObject bo(&drm, 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; EXPECT_TRUE(allocation.setCacheAdvice(&drm, 1024, CacheRegion::Region1)); @@ -4517,7 +4517,7 @@ TEST(DrmAllocationTest, givenDrmAllocationWhenBufferObjectIsCreatedThenApplyDefa DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]); MockBufferObject bo(&drm, 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; for (auto bo : allocation.bufferObjects) { @@ -4534,7 +4534,7 @@ TEST(DrmAllocationTest, givenDrmAllocationWhenSetCachePolicyIsCalledThenUpdatePo DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]); MockBufferObject bo(&drm, 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; allocation.setCachePolicy(CachePolicy::Uncached); @@ -4553,7 +4553,7 @@ TEST(DrmAllocationTest, givenDrmAllocationWhenSetMemAdviseWithCachePolicyIsCalle DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]); MockBufferObject bo(&drm, 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; EXPECT_EQ(CachePolicy::WriteBack, bo.peekCachePolicy()); @@ -4579,7 +4579,7 @@ TEST(DrmAllocationTest, givenBoWhenMarkingForCaptureThenBosAreMarked) { DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]); MockBufferObject bo(&drm, 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::SCRATCH_SURFACE, MemoryPool::System4KBPages); + MockDrmAllocation allocation(AllocationType::SCRATCH_SURFACE, MemoryPool::System4KBPages); allocation.markForCapture(); allocation.bufferObjects[0] = &bo; @@ -4603,7 +4603,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmAllocationWithHostPtrWhenItIsCreatedWithCac memoryManager->populateOsHandles(storage, rootDeviceIndex); - auto allocation = std::make_unique(rootDeviceIndex, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, + auto allocation = std::make_unique(rootDeviceIndex, AllocationType::BUFFER_HOST_MEMORY, nullptr, ptr, castToUint64(ptr), size, MemoryPool::System4KBPages); allocation->fragmentsStorage = storage; @@ -4648,7 +4648,7 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmAllocationWithWithAlignmentFromUserptrWhe } TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenAllocateGraphicsMemoryWithPropertiesCalledWithDebugSurfaceTypeThenDebugSurfaceIsCreated) { - AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, 0b1011}; + AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, 0b1011}; 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, GraphicsAllocation::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(mock, 1, 1024, 0); - DrmAllocation drmAllocation(0, GraphicsAllocation::AllocationType::WRITE_COMBINED, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(0, AllocationType::WRITE_COMBINED, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); EXPECT_EQ(&bo, drmAllocation.getBO()); auto ptr = memoryManager.lockResourceInLocalMemoryImpl(drmAllocation); @@ -4770,7 +4770,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmManagerWithoutLocalMemoryWhenLockResourceIs TestedDrmMemoryManager memoryManager(false, false, false, *executionEnvironment); BufferObject bo(mock, 1, 1024, 0); - DrmAllocation drmAllocation(0, GraphicsAllocation::AllocationType::WRITE_COMBINED, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(0, AllocationType::WRITE_COMBINED, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); EXPECT_EQ(&bo, drmAllocation.getBO()); auto ptr = memoryManager.lockResourceInLocalMemoryImpl(drmAllocation); @@ -4788,7 +4788,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWithoutLocalMemoryWhenCopyMemo std::vector dataToCopy(MemoryConstants::pageSize, 1u); - auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({rootDeviceIndex, dataToCopy.size(), GraphicsAllocation::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()); @@ -4807,7 +4807,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWithoutLocalMemoryAndCpuPtrWhe std::vector dataToCopy(MemoryConstants::pageSize, 1u); - auto allocation = memoryManager.allocateGraphicsMemoryWithProperties({rootDeviceIndex, dataToCopy.size(), GraphicsAllocation::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()); @@ -4841,7 +4841,7 @@ TEST(DrmMemoryManagerSimpleTest, givenDrmMemoryManagerWhenLockResourceIsCalledOn executionEnvironment.rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(drm)); executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*drm, 0u); TestedDrmMemoryManager memoryManager(executionEnvironment); - DrmAllocation drmAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory); auto ptr = memoryManager.lockResourceInLocalMemoryImpl(drmAllocation.getBO()); EXPECT_EQ(nullptr, ptr); @@ -4857,7 +4857,7 @@ TEST(DrmMemoryManagerSimpleTest, givenDrmMemoryManagerWhenFreeGraphicsMemoryIsCa executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*drm, 0u); TestedDrmMemoryManager memoryManager(executionEnvironment); - auto drmAllocation = new DrmAllocation(0, GraphicsAllocation::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); @@ -4874,7 +4874,7 @@ TEST(DrmMemoryManagerSimpleTest, WhenDrmIsCreatedThenQueryPageFaultSupportIsCall using DrmMemoryManagerWithLocalMemoryTest = Test; TEST_F(DrmMemoryManagerWithLocalMemoryTest, givenDrmMemoryManagerWithLocalMemoryWhenLockResourceIsCalledOnAllocationInLocalMemoryThenReturnNullPtr) { - DrmAllocation drmAllocation(rootDeviceIndex, GraphicsAllocation::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); @@ -4891,7 +4891,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenCopyMemoryToAllocationThen std::vector dataToCopy(MemoryConstants::pageSize, 1u); - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({rootDeviceIndex, dataToCopy.size(), GraphicsAllocation::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()); @@ -4910,7 +4910,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetMemAdviseIsCalledThenUp TestedDrmMemoryManager memoryManager(false, false, false, *executionEnvironment); BufferObject bo(mock, 1, 1024, 0); - DrmAllocation drmAllocation(0, GraphicsAllocation::AllocationType::UNIFIED_SHARED_MEMORY, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); + DrmAllocation drmAllocation(0, AllocationType::UNIFIED_SHARED_MEMORY, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); EXPECT_EQ(&bo, drmAllocation.getBO()); for (auto isCached : {false, true}) { @@ -4936,7 +4936,7 @@ TEST_F(DrmMemoryManagerTest, givenPageFaultIsUnSupportedWhenCallingBindBoOnBuffe uint32_t vmHandleId = 0; MockBufferObject bo(&drm, 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; std::vector bufferObjects; @@ -4960,7 +4960,7 @@ TEST_F(DrmMemoryManagerTest, givenPageFaultIsSupportedWhenCallingBindBoOnAllocat uint32_t vmHandleId = 0; struct MockDrmAllocationToTestPageFault : MockDrmAllocation { - MockDrmAllocationToTestPageFault() : MockDrmAllocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::LocalMemory){}; + MockDrmAllocationToTestPageFault() : MockDrmAllocation(AllocationType::BUFFER, MemoryPool::LocalMemory){}; bool shouldAllocationPageFault(const Drm *drm) override { return shouldPageFault; } @@ -5005,7 +5005,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenUseSyste allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.useSystemMemory = true; - allocData.type = GraphicsAllocation::AllocationType::BUFFER; + allocData.type = AllocationType::BUFFER; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -5015,7 +5015,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenUseSyste TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenSvmGpuAllocationWhenHostPtrProvidedThenUseHostPtrAsGpuVa) { size_t size = 2 * MemoryConstants::megaByte; - AllocationProperties properties{rootDeviceIndex, false, size, GraphicsAllocation::AllocationType::SVM_GPU, false, mockDeviceBitfield}; + AllocationProperties properties{rootDeviceIndex, false, size, AllocationType::SVM_GPU, false, mockDeviceBitfield}; properties.alignment = size; void *svmPtr = reinterpret_cast(2 * size); @@ -5042,7 +5042,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenAllowed3 allocData.size = MemoryConstants::pageSize; allocData.flags.allow32Bit = true; allocData.flags.allocateMemory = true; - allocData.type = GraphicsAllocation::AllocationType::BUFFER; + allocData.type = AllocationType::BUFFER; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -5059,7 +5059,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenAllowed3 allocData.size = MemoryConstants::pageSize; allocData.flags.allow32Bit = true; allocData.flags.allocateMemory = true; - allocData.type = GraphicsAllocation::AllocationType::BUFFER; + allocData.type = AllocationType::BUFFER; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -5080,7 +5080,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenAllocati allocData.storageInfo.multiStorage = false; allocData.rootDeviceIndex = rootDeviceIndex; - GraphicsAllocation::AllocationType isaTypes[] = {GraphicsAllocation::AllocationType::KERNEL_ISA, GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL}; + AllocationType isaTypes[] = {AllocationType::KERNEL_ISA, AllocationType::KERNEL_ISA_INTERNAL}; for (uint32_t i = 0; i < 2; i++) { allocData.type = isaTypes[i]; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -5112,7 +5112,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenAllocati allocData.allFlags = 0; allocData.size = 18 * MemoryConstants::pageSize64k; allocData.flags.allocateMemory = true; - allocData.type = GraphicsAllocation::AllocationType::BUFFER; + allocData.type = AllocationType::BUFFER; allocData.storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3)); allocData.storageInfo.multiStorage = true; allocData.rootDeviceIndex = rootDeviceIndex; @@ -5145,7 +5145,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenAllocati allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.allocateMemory = true; - allocData.type = GraphicsAllocation::AllocationType::KERNEL_ISA; + allocData.type = AllocationType::KERNEL_ISA; allocData.storageInfo.memoryBanks = 0b1011; allocData.storageInfo.multiStorage = false; allocData.rootDeviceIndex = rootDeviceIndex; @@ -5196,7 +5196,7 @@ TEST_F(DrmMemoryManagerLocalMemoryAlignmentTest, given2MbAlignmentAllowedWhenAll allocationData.size = MemoryConstants::pageSize; allocationData.flags.allocateMemory = true; allocationData.rootDeviceIndex = rootDeviceIndex; - allocationData.type = GraphicsAllocation::AllocationType::BUFFER; + allocationData.type = AllocationType::BUFFER; allocationData.flags.resource48Bit = true; MemoryManager::AllocationStatus allocationStatus; @@ -5235,7 +5235,7 @@ TEST_F(DrmMemoryManagerLocalMemoryAlignmentTest, given2MbAlignmentAllowedWhenAll allocationData.size = 2 * MemoryConstants::megaByte; allocationData.flags.allocateMemory = true; allocationData.rootDeviceIndex = rootDeviceIndex; - allocationData.type = GraphicsAllocation::AllocationType::BUFFER; + allocationData.type = AllocationType::BUFFER; allocationData.flags.resource48Bit = true; MemoryManager::AllocationStatus allocationStatus; @@ -5279,7 +5279,7 @@ TEST_F(DrmMemoryManagerLocalMemoryAlignmentTest, givenExtendedHeapPreferredAnd2M allocationData.size = 2 * MemoryConstants::megaByte; allocationData.flags.allocateMemory = true; allocationData.rootDeviceIndex = rootDeviceIndex; - allocationData.type = GraphicsAllocation::AllocationType::BUFFER; + allocationData.type = AllocationType::BUFFER; allocationData.flags.resource48Bit = false; MemoryManager::AllocationStatus allocationStatus; @@ -5319,7 +5319,7 @@ TEST_F(DrmMemoryManagerLocalMemoryAlignmentTest, givenCustomAlignmentWhenAllocat allocationData.allFlags = 0; allocationData.flags.allocateMemory = true; allocationData.rootDeviceIndex = rootDeviceIndex; - allocationData.type = GraphicsAllocation::AllocationType::BUFFER; + allocationData.type = AllocationType::BUFFER; allocationData.flags.resource48Bit = true; MemoryManager::AllocationStatus allocationStatus; @@ -5369,7 +5369,7 @@ TEST_F(DrmMemoryManagerLocalMemoryAlignmentTest, givenCustomAlignmentWhenAllocat allocationData.size = 3 * MemoryConstants::megaByte; allocationData.flags.allocateMemory = true; allocationData.rootDeviceIndex = rootDeviceIndex; - allocationData.type = GraphicsAllocation::AllocationType::BUFFER; + allocationData.type = AllocationType::BUFFER; allocationData.flags.resource48Bit = true; MemoryManager::AllocationStatus allocationStatus; @@ -5404,7 +5404,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenNotSetUs allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.allocateMemory = true; - allocData.type = GraphicsAllocation::AllocationType::BUFFER; + allocData.type = AllocationType::BUFFER; allocData.rootDeviceIndex = rootDeviceIndex; auto sizeAligned = alignUp(allocData.size, MemoryConstants::pageSize64k); @@ -5463,7 +5463,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenNotSetUs AllocationData allocData; allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; - allocData.type = GraphicsAllocation::AllocationType::IMAGE; + allocData.type = AllocationType::IMAGE; allocData.flags.resource48Bit = true; allocData.imgInfo = &imgInfo; allocData.rootDeviceIndex = rootDeviceIndex; @@ -5514,7 +5514,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenNotSetUs allocData.rootDeviceIndex = rootDeviceIndex; auto sizeAligned = alignUp(allocData.size, MemoryConstants::pageSize64k); - GraphicsAllocation::AllocationType isaTypes[] = {GraphicsAllocation::AllocationType::KERNEL_ISA, GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL}; + AllocationType isaTypes[] = {AllocationType::KERNEL_ISA, AllocationType::KERNEL_ISA_INTERNAL}; for (uint32_t i = 0; i < 2; i++) { allocData.type = isaTypes[i]; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); @@ -5548,7 +5548,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenUnsuppor allocData.flags.allocateMemory = true; allocData.rootDeviceIndex = rootDeviceIndex; - GraphicsAllocation::AllocationType unsupportedTypes[] = {GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY}; + AllocationType unsupportedTypes[] = {AllocationType::SHARED_RESOURCE_COPY}; for (auto unsupportedType : unsupportedTypes) { allocData.type = unsupportedType; @@ -5582,7 +5582,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenOversize auto status = MemoryManager::AllocationStatus::Error; AllocationData allocData; allocData.size = 5 * MemoryConstants::megaByte; - allocData.type = GraphicsAllocation::AllocationType::BUFFER; + allocData.type = AllocationType::BUFFER; allocData.rootDeviceIndex = rootDeviceIndex; auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); memoryManager->getGfxPartition(rootDeviceIndex)->heapFree(heap, gpuAddress2, largerSize); @@ -5626,7 +5626,7 @@ TEST(DrmMemoryManagerCopyMemoryToAllocationBanksTest, givenDrmMemoryManagerWhenC DrmMemoryManagerToTestCopyMemoryToAllocationBanks drmMemoryManger(executionEnvironment, destinationAllocationSize); std::vector dataToCopy(sourceAllocationSize, 1u); - MockDrmAllocation mockAllocation(GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE, MemoryPool::LocalMemory); + MockDrmAllocation mockAllocation(AllocationType::WORK_PARTITION_SURFACE, MemoryPool::LocalMemory); mockAllocation.storageInfo.memoryBanks = 0b1111; DeviceBitfield memoryBanksToCopy = 0b1010; @@ -5725,7 +5725,7 @@ TEST_F(DrmMemoryManagerTest, whenCallPaddedAllocationWithoutMmapPtrThenOnlyUserp void *cpuPtr = (void *)0x30000; size_t size = 0x1000; - DrmAllocation gfxAllocation(rootDeviceIndex, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, cpuPtr, size, (osHandle)1u, MemoryPool::MemoryNull); + DrmAllocation gfxAllocation(rootDeviceIndex, AllocationType::UNKNOWN, nullptr, cpuPtr, size, (osHandle)1u, MemoryPool::MemoryNull); auto gfxPaddedAllocation = memoryManager->createPaddedAllocation(&gfxAllocation, size); ASSERT_NE(nullptr, gfxPaddedAllocation); memoryManager->freeGraphicsMemoryImpl(gfxPaddedAllocation); @@ -5739,7 +5739,7 @@ TEST_F(DrmMemoryManagerTest, whenCallPaddedAllocationWithMmapPtrThenMmapCalled) void *cpuPtr = (void *)0x30000; size_t size = 0x1000; - DrmAllocation gfxAllocation(rootDeviceIndex, GraphicsAllocation::AllocationType::UNKNOWN, &bo, cpuPtr, size, (osHandle)1u, MemoryPool::MemoryNull); + DrmAllocation gfxAllocation(rootDeviceIndex, AllocationType::UNKNOWN, &bo, cpuPtr, size, (osHandle)1u, MemoryPool::MemoryNull); gfxAllocation.setMmapPtr(cpuPtr); gfxAllocation.setMmapSize(size); auto gfxPaddedAllocation = memoryManager->createPaddedAllocation(&gfxAllocation, size); @@ -5756,7 +5756,7 @@ TEST_F(DrmMemoryManagerTest, whenCallPaddedAllocationWithMmapPtrAndFailedMmapCal void *cpuPtr = (void *)0x30000; size_t size = 0x1000; - DrmAllocation gfxAllocation(rootDeviceIndex, GraphicsAllocation::AllocationType::UNKNOWN, &bo, cpuPtr, size, (osHandle)1u, MemoryPool::MemoryNull); + DrmAllocation gfxAllocation(rootDeviceIndex, AllocationType::UNKNOWN, &bo, cpuPtr, size, (osHandle)1u, MemoryPool::MemoryNull); gfxAllocation.setMmapPtr(cpuPtr); gfxAllocation.setMmapSize(size); auto gfxPaddedAllocation = memoryManager->createPaddedAllocation(&gfxAllocation, size); @@ -5797,11 +5797,11 @@ TEST(DistanceInfoTest, givenDistanceInfosWhenAssignRegionsFromDistancesThenCorre } TEST_F(DrmMemoryManagerTest, GivenEligbleAllocationTypeWhenCheckingAllocationEligbleForCompletionFenceThenReturnTrue) { - GraphicsAllocation::AllocationType validAllocations[] = { - GraphicsAllocation::AllocationType::COMMAND_BUFFER, - GraphicsAllocation::AllocationType::RING_BUFFER, - GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER, - GraphicsAllocation::AllocationType::TAG_BUFFER}; + AllocationType validAllocations[] = { + AllocationType::COMMAND_BUFFER, + AllocationType::RING_BUFFER, + AllocationType::SEMAPHORE_BUFFER, + AllocationType::TAG_BUFFER}; for (size_t i = 0; i < 4; i++) { EXPECT_TRUE(memoryManager->allocationTypeForCompletionFence(validAllocations[i])); @@ -5809,11 +5809,11 @@ TEST_F(DrmMemoryManagerTest, GivenEligbleAllocationTypeWhenCheckingAllocationEli } TEST_F(DrmMemoryManagerTest, GivenNotEligbleAllocationTypeWhenCheckingAllocationEligbleForCompletionFenceThenReturnFalse) { - GraphicsAllocation::AllocationType invalidAllocations[] = { - GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, - GraphicsAllocation::AllocationType::CONSTANT_SURFACE, - GraphicsAllocation::AllocationType::FILL_PATTERN, - GraphicsAllocation::AllocationType::GLOBAL_SURFACE}; + AllocationType invalidAllocations[] = { + AllocationType::BUFFER_HOST_MEMORY, + AllocationType::CONSTANT_SURFACE, + AllocationType::FILL_PATTERN, + AllocationType::GLOBAL_SURFACE}; for (size_t i = 0; i < 4; i++) { EXPECT_FALSE(memoryManager->allocationTypeForCompletionFence(invalidAllocations[i])); @@ -5824,11 +5824,11 @@ TEST_F(DrmMemoryManagerTest, GivenNotEligbleAllocationTypeAndDebugFlagOverriding DebugManagerStateRestore dbgState; DebugManager.flags.UseDrmCompletionFenceForAllAllocations.set(1); - GraphicsAllocation::AllocationType invalidAllocations[] = { - GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, - GraphicsAllocation::AllocationType::CONSTANT_SURFACE, - GraphicsAllocation::AllocationType::FILL_PATTERN, - GraphicsAllocation::AllocationType::GLOBAL_SURFACE}; + AllocationType invalidAllocations[] = { + AllocationType::BUFFER_HOST_MEMORY, + AllocationType::CONSTANT_SURFACE, + AllocationType::FILL_PATTERN, + AllocationType::GLOBAL_SURFACE}; for (size_t i = 0; i < 4; i++) { EXPECT_TRUE(memoryManager->allocationTypeForCompletionFence(invalidAllocations[i])); @@ -5842,7 +5842,7 @@ TEST_F(DrmMemoryManagerTest, givenCompletionFenceEnabledWhenHandlingCompletionOf VariableBackup backupVmBindCallParent{&mock->isVmBindAvailableCall.callParent, false}; VariableBackup backupVmBindReturnValue{&mock->isVmBindAvailableCall.returnValue, true}; - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 1024, GraphicsAllocation::AllocationType::COMMAND_BUFFER}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 1024, AllocationType::COMMAND_BUFFER}); auto engine = memoryManager->getRegisteredEngines()[0]; allocation->updateTaskCount(2, engine.osContext->getContextId()); @@ -5865,7 +5865,7 @@ TEST_F(DrmMemoryManagerTest, givenCompletionFenceEnabledWhenHandlingCompletionOf VariableBackup backupVmBindCallParent{&mock->isVmBindAvailableCall.callParent, false}; VariableBackup backupVmBindReturnValue{&mock->isVmBindAvailableCall.returnValue, true}; - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 1024, GraphicsAllocation::AllocationType::COMMAND_BUFFER}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 1024, AllocationType::COMMAND_BUFFER}); memoryManager->handleFenceCompletion(allocation); @@ -5881,7 +5881,7 @@ TEST_F(DrmMemoryManagerTest, givenCompletionFenceEnabledWhenHandlingCompletionOf VariableBackup backupVmBindCallParent{&mock->isVmBindAvailableCall.callParent, false}; VariableBackup backupVmBindReturnValue{&mock->isVmBindAvailableCall.returnValue, true}; - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 1024, GraphicsAllocation::AllocationType::GLOBAL_SURFACE}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 1024, AllocationType::GLOBAL_SURFACE}); auto engine = memoryManager->getRegisteredEngines()[0]; allocation->updateTaskCount(2, engine.osContext->getContextId()); @@ -5899,7 +5899,7 @@ HWTEST_F(DrmMemoryManagerTest, givenCompletionFenceEnabledWhenHandlingCompletion VariableBackup backupVmBindCallParent{&mock->isVmBindAvailableCall.callParent, false}; VariableBackup backupVmBindReturnValue{&mock->isVmBindAvailableCall.returnValue, true}; - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 1024, GraphicsAllocation::AllocationType::COMMAND_BUFFER}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 1024, AllocationType::COMMAND_BUFFER}); auto engine = memoryManager->getRegisteredEngines()[0]; allocation->updateTaskCount(2, engine.osContext->getContextId()); diff --git a/opencl/test/unit_test/os_interface/linux/file_logger_linux_tests.cpp b/opencl/test/unit_test/os_interface/linux/file_logger_linux_tests.cpp index 5164646376..cac2bc9987 100644 --- a/opencl/test/unit_test/os_interface/linux/file_logger_linux_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/file_logger_linux_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -27,7 +27,7 @@ TEST(FileLogger, GivenLogAllocationMemoryPoolFlagThenLogsCorrectInfo) { executionEnvironment->prepareRootDeviceEnvironments(1); DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::System64KBPages); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::System64KBPages); allocation.setCpuPtrAndGpuAddress(&allocation, 0x12345); @@ -77,7 +77,7 @@ TEST(FileLogger, givenLogAllocationStdoutWhenLogAllocationThenLogToStdoutInstead executionEnvironment->prepareRootDeviceEnvironments(1); DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::System64KBPages); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::System64KBPages); allocation.setCpuPtrAndGpuAddress(&allocation, 0x12345); @@ -125,7 +125,7 @@ TEST(FileLogger, GivenDrmAllocationWithoutBOThenNoHandleLogged) { // Log file not created bool logFileCreated = fileExists(fileLogger.getLogFileName()); EXPECT_FALSE(logFileCreated); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::System64KBPages); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::System64KBPages); fileLogger.logAllocation(&allocation); @@ -156,7 +156,7 @@ TEST(FileLogger, GivenLogAllocationMemoryPoolFlagSetFalseThenAllocationIsNotLogg bool logFileCreated = fileExists(fileLogger.getLogFileName()); EXPECT_FALSE(logFileCreated); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::System64KBPages); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::System64KBPages); fileLogger.logAllocation(&allocation); diff --git a/opencl/test/unit_test/os_interface/linux/ioctl_helper_tests_prelim.cpp b/opencl/test/unit_test/os_interface/linux/ioctl_helper_tests_prelim.cpp index 6fb088e39a..922acfc33d 100644 --- a/opencl/test/unit_test/os_interface/linux/ioctl_helper_tests_prelim.cpp +++ b/opencl/test/unit_test/os_interface/linux/ioctl_helper_tests_prelim.cpp @@ -180,7 +180,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseFailsThenDont drm->ioctlRetVal = -1; MockBufferObject bo(drm.get(), 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; MemAdviseFlags memAdviseFlags{}; @@ -194,7 +194,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseFailsThenDont TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithNonAtomicIsCalledThenUpdateTheCorrespondingVmAdviceForBufferObject) { MockBufferObject bo(drm.get(), 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; MemAdviseFlags memAdviseFlags{}; @@ -210,7 +210,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithNonAtomic TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithDevicePreferredLocationIsCalledThenUpdateTheCorrespondingVmAdviceForBufferObject) { MockBufferObject bo(drm.get(), 0, 0, 1); - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::LocalMemory); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::LocalMemory); allocation.bufferObjects[0] = &bo; MemAdviseFlags memAdviseFlags{}; diff --git a/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp b/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp index 36ca61406f..8ec9c1e716 100644 --- a/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp @@ -465,7 +465,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafDisabledWhenFlushIsCalledWithAll LinearStream cs(commandBuffer); BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, cs.getUsed(), &cs, nullptr, false}; - auto linearStreamAllocation = memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::LINEAR_STREAM, device->getDeviceBitfield()}); + auto linearStreamAllocation = memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::LINEAR_STREAM, device->getDeviceBitfield()}); ASSERT_NE(nullptr, linearStreamAllocation); ResidencyContainer allocationsForResidency = {linearStreamAllocation}; @@ -500,7 +500,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithResi LinearStream cs(commandBuffer); BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, cs.getUsed(), &cs, nullptr, false}; - auto linearStreamAllocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::LINEAR_STREAM, device->getDeviceBitfield()})); + auto linearStreamAllocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::LINEAR_STREAM, device->getDeviceBitfield()})); ASSERT_NE(nullptr, linearStreamAllocation); csr->makeResident(*linearStreamAllocation); @@ -524,7 +524,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo LinearStream cs(commandBuffer); BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, cs.getUsed(), &cs, nullptr, false}; - auto linearStreamAllocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::LINEAR_STREAM, device->getDeviceBitfield()})); + auto linearStreamAllocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::LINEAR_STREAM, device->getDeviceBitfield()})); ASSERT_NE(nullptr, linearStreamAllocation); ResidencyContainer allocationsForResidency = {linearStreamAllocation}; @@ -545,7 +545,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo LinearStream cs(commandBuffer); BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, cs.getUsed(), &cs, nullptr, false}; - auto fillPatternAllocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::FILL_PATTERN, device->getDeviceBitfield()})); + auto fillPatternAllocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::FILL_PATTERN, device->getDeviceBitfield()})); ASSERT_NE(nullptr, fillPatternAllocation); ResidencyContainer allocationsForResidency = {fillPatternAllocation}; @@ -566,7 +566,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo LinearStream cs(commandBuffer); BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, cs.getUsed(), &cs, nullptr, false}; - auto commandBufferAllocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); + auto commandBufferAllocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()})); ASSERT_NE(nullptr, commandBufferAllocation); ResidencyContainer allocationsForResidency = {commandBufferAllocation}; diff --git a/opencl/test/unit_test/os_interface/windows/file_logger_win_tests.cpp b/opencl/test/unit_test/os_interface/windows/file_logger_win_tests.cpp index 7bf59f7a78..14b3bd2e0d 100644 --- a/opencl/test/unit_test/os_interface/windows/file_logger_win_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/file_logger_win_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -30,7 +30,7 @@ TEST_F(FileLoggerTests, GivenLogAllocationMemoryPoolFlagThenLogsCorrectInfo) { MockWddmAllocation allocation(getGmmClientContext()); allocation.handle = 4; - allocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER); + allocation.setAllocationType(AllocationType::BUFFER); allocation.memoryPool = MemoryPool::System64KBPages; allocation.getDefaultGmm()->resourceParams.Flags.Info.NonLocalOnly = 0; allocation.setGpuAddress(0x12345); @@ -76,7 +76,7 @@ TEST_F(FileLoggerTests, GivenLogAllocationMemoryPoolFlagSetFalseThenAllocationIs executionEnvironment->rootDeviceEnvironments[0]->initGmm(); MockWddmAllocation allocation(executionEnvironment->rootDeviceEnvironments[0]->getGmmClientContext()); allocation.handle = 4; - allocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER); + allocation.setAllocationType(AllocationType::BUFFER); allocation.memoryPool = MemoryPool::System64KBPages; allocation.getDefaultGmm()->resourceParams.Flags.Info.NonLocalOnly = 0; diff --git a/opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h b/opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h index 6f9e69b2de..5552bfb9c2 100644 --- a/opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h +++ b/opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,7 +15,7 @@ namespace NEO { class MockWddmAllocation : public WddmAllocation { public: MockWddmAllocation(GmmClientContext *gmmClientContext) : MockWddmAllocation(gmmClientContext, EngineLimits::maxHandleCount) {} - MockWddmAllocation(GmmClientContext *gmmClientContext, uint32_t numGmms) : WddmAllocation(0, numGmms, GraphicsAllocation::AllocationType::UNKNOWN, + MockWddmAllocation(GmmClientContext *gmmClientContext, uint32_t numGmms) : WddmAllocation(0, numGmms, AllocationType::UNKNOWN, nullptr, 0, nullptr, MemoryPool::MemoryNull, 0u, 3u), gpuPtr(gpuAddress), handle(handles[0]) { for (uint32_t i = 0; i < numGmms; i++) { diff --git a/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp index 5039b06ccc..b2e4ee0278 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp @@ -92,7 +92,7 @@ TEST_F(Wddm20Tests, givenNullPageTableManagerAndCompressedResourceWhenMappingGpu mockGmmRes->setUnifiedAuxTranslationCapable(); void *fakePtr = reinterpret_cast(0x100); - WddmAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, fakePtr, 0x2100, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::UNKNOWN, fakePtr, 0x2100, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocation.setDefaultGmm(gmm.get()); allocation.getHandleToModify(0u) = ALLOCATION_HANDLE; @@ -245,7 +245,7 @@ TEST_F(Wddm20Tests, whenInitPrivateDataThenDefaultValuesAreSet) { TEST_F(Wddm20Tests, WhenCreatingAllocationAndDestroyingAllocationThenCorrectResultReturned) { OsAgnosticMemoryManager mm(*executionEnvironment); - WddmAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, mm.allocateSystemMemory(100, 0), 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::UNKNOWN, mm.allocateSystemMemory(100, 0), 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); Gmm *gmm = GmmHelperFunctions::getGmm(allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize(), getGmmClientContext()); allocation.setDefaultGmm(gmm); @@ -269,7 +269,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenAllocationSmallerUnderlyingThanAlignedSiz size_t underlyingPages = underlyingSize / MemoryConstants::pageSize; size_t alignedPages = alignedSize / MemoryConstants::pageSize; - WddmAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, ptr, 0x2100, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::UNKNOWN, ptr, 0x2100, nullptr, MemoryPool::MemoryNull, 0u, 1u); Gmm *gmm = GmmHelperFunctions::getGmm(allocation.getAlignedCpuPtr(), allocation.getAlignedSize(), getGmmClientContext()); allocation.setDefaultGmm(gmm); @@ -311,7 +311,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenReserveCallWhenItIsCalledWithProperParamt TEST_F(Wddm20WithMockGdiDllTests, givenWddmAllocationWhenMappingGpuVaThenUseGmmSize) { void *fakePtr = reinterpret_cast(0x123); - WddmAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, fakePtr, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::UNKNOWN, fakePtr, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); std::unique_ptr gmm(GmmHelperFunctions::getGmm(allocation.getAlignedCpuPtr(), allocation.getAlignedSize(), getGmmClientContext())); allocation.setDefaultGmm(gmm.get()); @@ -378,7 +378,7 @@ TEST_F(Wddm20WithMockGdiDllTests, GivenThreeOsHandlesWhenAskedForDestroyAllocati TEST_F(Wddm20Tests, WhenMappingAndFreeingGpuVaThenReturnIsCorrect) { OsAgnosticMemoryManager mm(*executionEnvironment); - WddmAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, mm.allocateSystemMemory(100, 0), 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::UNKNOWN, mm.allocateSystemMemory(100, 0), 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); Gmm *gmm = GmmHelperFunctions::getGmm(allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize(), getGmmClientContext()); allocation.setDefaultGmm(gmm); @@ -404,7 +404,7 @@ TEST_F(Wddm20Tests, WhenMappingAndFreeingGpuVaThenReturnIsCorrect) { TEST_F(Wddm20Tests, givenNullAllocationWhenCreateThenAllocateAndMap) { OsAgnosticMemoryManager mm(*executionEnvironment); - WddmAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::UNKNOWN, nullptr, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); auto gmm = std::unique_ptr(GmmHelperFunctions::getGmm(allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize(), getGmmClientContext())); allocation.setDefaultGmm(gmm.get()); @@ -422,7 +422,7 @@ TEST_F(Wddm20Tests, givenNullAllocationWhenCreateThenAllocateAndMap) { TEST_F(WddmTestWithMockGdiDll, givenShareableAllocationWhenCreateThenCreateResourceFlagIsEnabled) { init(); - WddmAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, MemoryConstants::pageSize, nullptr, MemoryPool::MemoryNull, true, 1u); + WddmAllocation allocation(0, AllocationType::UNKNOWN, nullptr, MemoryConstants::pageSize, nullptr, MemoryPool::MemoryNull, true, 1u); auto gmm = std::unique_ptr(GmmHelperFunctions::getGmm(nullptr, MemoryConstants::pageSize, getGmmClientContext())); allocation.setDefaultGmm(gmm.get()); auto status = wddm->createAllocation(&allocation); @@ -439,7 +439,7 @@ TEST_F(WddmTestWithMockGdiDll, givenShareableAllocationWhenCreateThenSharedHandl using WddmMemoryManager::WddmMemoryManager; }; MemoryManagerCreate memoryManager(false, false, *executionEnvironment); - WddmAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, MemoryConstants::pageSize, nullptr, MemoryPool::MemoryNull, true, 1u); + WddmAllocation allocation(0, AllocationType::UNKNOWN, nullptr, MemoryConstants::pageSize, nullptr, MemoryPool::MemoryNull, true, 1u); auto gmm = std::unique_ptr(GmmHelperFunctions::getGmm(nullptr, MemoryConstants::pageSize, getGmmClientContext())); allocation.setDefaultGmm(gmm.get()); auto status = memoryManager.createGpuAllocationsWithRetry(&allocation); @@ -448,7 +448,7 @@ TEST_F(WddmTestWithMockGdiDll, givenShareableAllocationWhenCreateThenSharedHandl } TEST(WddmAllocationTest, whenAllocationIsShareableThenSharedHandleToModifyIsSharedHandleOfAllocation) { - WddmAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, MemoryConstants::pageSize, nullptr, MemoryPool::MemoryNull, true, 1u); + WddmAllocation allocation(0, AllocationType::UNKNOWN, nullptr, MemoryConstants::pageSize, nullptr, MemoryPool::MemoryNull, true, 1u); auto sharedHandleToModify = allocation.getSharedHandleToModify(); EXPECT_NE(nullptr, sharedHandleToModify); *sharedHandleToModify = 1234u; @@ -456,14 +456,14 @@ TEST(WddmAllocationTest, whenAllocationIsShareableThenSharedHandleToModifyIsShar } TEST(WddmAllocationTest, whenAllocationIsNotShareableThenItDoesntReturnSharedHandleToModify) { - WddmAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, MemoryConstants::pageSize, nullptr, MemoryPool::MemoryNull, false, 1u); + WddmAllocation allocation(0, AllocationType::UNKNOWN, nullptr, MemoryConstants::pageSize, nullptr, MemoryPool::MemoryNull, false, 1u); auto sharedHandleToModify = allocation.getSharedHandleToModify(); EXPECT_EQ(nullptr, sharedHandleToModify); } TEST_F(Wddm20Tests, WhenMakingResidentAndEvictingThenReturnIsCorrect) { OsAgnosticMemoryManager mm(*executionEnvironment); - WddmAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, mm.allocateSystemMemory(100, 0), 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::UNKNOWN, mm.allocateSystemMemory(100, 0), 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); Gmm *gmm = GmmHelperFunctions::getGmm(allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize(), getGmmClientContext()); allocation.setDefaultGmm(gmm); @@ -502,7 +502,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenSharedHandleWhenCreateGraphicsAllocationF EXPECT_EQ(0u, status); MemoryManagerCreate mm(false, false, *executionEnvironment); - AllocationProperties properties(0, false, 4096u, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(0, false, 4096u, AllocationType::SHARED_BUFFER, false, {}); auto graphicsAllocation = mm.createGraphicsAllocationFromSharedHandle(ALLOCATION_HANDLE, properties, false, false); auto wddmAllocation = (WddmAllocation *)graphicsAllocation; @@ -539,7 +539,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenSharedHandleWhenCreateGraphicsAllocationF EXPECT_EQ(0u, status); MemoryManagerCreate mm(false, false, *executionEnvironment); - AllocationProperties properties(0, false, 4096, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(0, false, 4096, AllocationType::SHARED_BUFFER, false, {}); auto graphicsAllocation = mm.createGraphicsAllocationFromSharedHandle(ALLOCATION_HANDLE, properties, false, false); auto wddmAllocation = (WddmAllocation *)graphicsAllocation; @@ -831,7 +831,7 @@ TEST_F(Wddm20Tests, whenCreateAllocation64kFailsThenReturnFalse) { void *fakePtr = reinterpret_cast(0x123); auto gmm = std::make_unique(rootDeviceEnvironment->getGmmClientContext(), fakePtr, 100, 0, false); - WddmAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, fakePtr, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::UNKNOWN, fakePtr, 100, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocation.setDefaultGmm(gmm.get()); EXPECT_FALSE(wddm->createAllocation64k(&allocation)); diff --git a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_allocate_in_device_pool_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_allocate_in_device_pool_tests.cpp index 44b012d5fd..993416c8ac 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_allocate_in_device_pool_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_allocate_in_device_pool_tests.cpp @@ -60,7 +60,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenShareableAllocationWhenAllocateInDevice MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Error; AllocationData allocData; allocData.allFlags = 0; - allocData.type = GraphicsAllocation::AllocationType::SVM_GPU; + allocData.type = AllocationType::SVM_GPU; allocData.storageInfo.localOnlyRequired = true; allocData.size = MemoryConstants::pageSize; allocData.flags.allocateMemory = true; @@ -87,7 +87,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenShareableAllocationWhenAllocateGraphics executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(&hwInfo); memoryManager = std::make_unique(false, localMemoryEnabled, *executionEnvironment); - AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SVM_GPU, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::SVM_GPU, mockDeviceBitfield}; properties.allFlags = 0; properties.size = MemoryConstants::pageSize; properties.flags.allocateMemory = true; @@ -222,7 +222,7 @@ TEST_F(WddmMemoryManagerDevicePoolAlignmentTests, givenAtLeast2MbAllocationWhenA HWTEST_F(WddmMemoryManagerSimpleTest, givenLinearStreamWhenItIsAllocatedThenItIsInLocalMemoryHasCpuPointerAndHasStandardHeap64kbAsGpuAddress) { memoryManager = std::make_unique(false, true, *executionEnvironment); - auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, 4096u, GraphicsAllocation::AllocationType::LINEAR_STREAM, mockDeviceBitfield}); + auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, 4096u, AllocationType::LINEAR_STREAM, mockDeviceBitfield}); ASSERT_NE(nullptr, graphicsAllocation); EXPECT_EQ(MemoryPool::LocalMemory, graphicsAllocation->getMemoryPool()); @@ -250,7 +250,7 @@ HWTEST_F(WddmMemoryManagerSimpleTest, givenLinearStreamWhenItIsAllocatedThenItIs } } - EXPECT_EQ(graphicsAllocation->getAllocationType(), GraphicsAllocation::AllocationType::LINEAR_STREAM); + EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::LINEAR_STREAM); memoryManager->freeGraphicsMemory(graphicsAllocation); } @@ -362,7 +362,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, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield}, cpuPtr)); + auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, size, AllocationType::BUFFER, mockDeviceBitfield}, cpuPtr)); ASSERT_NE(nullptr, allocation); EXPECT_FALSE(MemoryPool::isSystemMemoryPool(allocation->getMemoryPool())); @@ -401,12 +401,12 @@ TEST_F(WddmMemoryManagerSimpleTest, givenAllocationWithHighPriorityWhenMemoryIsA auto executionEnvironment = platform()->peekExecutionEnvironment(); memoryManager = std::make_unique(false, localMemoryEnabled, *executionEnvironment); - GraphicsAllocation::AllocationType highPriorityTypes[] = { - GraphicsAllocation::AllocationType::KERNEL_ISA, - GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL, - GraphicsAllocation::AllocationType::COMMAND_BUFFER, - GraphicsAllocation::AllocationType::INTERNAL_HEAP, - GraphicsAllocation::AllocationType::LINEAR_STREAM + AllocationType highPriorityTypes[] = { + AllocationType::KERNEL_ISA, + AllocationType::KERNEL_ISA_INTERNAL, + AllocationType::COMMAND_BUFFER, + AllocationType::INTERNAL_HEAP, + AllocationType::LINEAR_STREAM }; for (auto &allocationType : highPriorityTypes) { @@ -439,7 +439,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenAllocationWithoutHighPriorityWhenMemory allocData.allFlags = 0; allocData.size = MemoryConstants::pageSize; allocData.flags.allocateMemory = true; - allocData.type = GraphicsAllocation::AllocationType::BUFFER; + allocData.type = AllocationType::BUFFER; auto allocation = static_cast(memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status)); ASSERT_NE(nullptr, allocation); @@ -501,8 +501,8 @@ TEST_F(WddmMemoryManagerSimpleTestWithLocalMemory, givenLocalMemoryAndImageOrSha imgDesc.imageType = ImageType::Image2D; auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr); - GraphicsAllocation::AllocationType types[] = {GraphicsAllocation::AllocationType::IMAGE, - GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY}; + AllocationType types[] = {AllocationType::IMAGE, + AllocationType::SHARED_RESOURCE_COPY}; AllocationData allocData; allocData.allFlags = 0; @@ -526,7 +526,7 @@ using WddmMemoryManagerMultiHandleAllocationTest = WddmMemoryManagerSimpleTest; TEST_F(WddmMemoryManagerSimpleTest, givenSvmGpuAllocationWhenHostPtrProvidedThenUseHostPtrAsGpuVa) { size_t size = 2 * MemoryConstants::megaByte; - AllocationProperties properties{mockRootDeviceIndex, false, size, GraphicsAllocation::AllocationType::SVM_GPU, false, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, false, size, AllocationType::SVM_GPU, false, mockDeviceBitfield}; properties.alignment = size; void *svmPtr = reinterpret_cast(2 * size); memoryManager->localMemorySupported[properties.rootDeviceIndex] = true; @@ -601,10 +601,10 @@ TEST_F(WddmMemoryManagerSimpleTest, given32BitAllocationOfBufferWhenItIsAllocate GTEST_SKIP(); } REQUIRE_SVM_OR_SKIP(defaultHwInfo); - GraphicsAllocation::AllocationType allocationTypes[] = {GraphicsAllocation::AllocationType::BUFFER, - GraphicsAllocation::AllocationType::SHARED_BUFFER, - GraphicsAllocation::AllocationType::SCRATCH_SURFACE, - GraphicsAllocation::AllocationType::PRIVATE_SURFACE}; + AllocationType allocationTypes[] = {AllocationType::BUFFER, + AllocationType::SHARED_BUFFER, + AllocationType::SCRATCH_SURFACE, + AllocationType::PRIVATE_SURFACE}; for (auto &allocationType : allocationTypes) { size_t size = 2 * MemoryConstants::kiloByte; diff --git a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp index ebffecb2a7..a97906932e 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp @@ -121,15 +121,15 @@ TEST(WddmAllocationTest, givenRequestedContextIdTooLargeWhenGettingTrimCandidate } TEST(WddmAllocationTest, givenAllocationTypeWhenPassedToWddmAllocationConstructorThenAllocationTypeIsStored) { - WddmAllocation allocation{0, GraphicsAllocation::AllocationType::COMMAND_BUFFER, nullptr, 0, nullptr, MemoryPool::MemoryNull, 0u, 1u}; - EXPECT_EQ(GraphicsAllocation::AllocationType::COMMAND_BUFFER, allocation.getAllocationType()); + WddmAllocation allocation{0, AllocationType::COMMAND_BUFFER, nullptr, 0, nullptr, MemoryPool::MemoryNull, 0u, 1u}; + EXPECT_EQ(AllocationType::COMMAND_BUFFER, allocation.getAllocationType()); } TEST(WddmAllocationTest, givenMemoryPoolWhenPassedToWddmAllocationConstructorThenMemoryPoolIsStored) { - WddmAllocation allocation{0, GraphicsAllocation::AllocationType::COMMAND_BUFFER, nullptr, 0, nullptr, MemoryPool::System64KBPages, 0u, 1u}; + WddmAllocation allocation{0, AllocationType::COMMAND_BUFFER, nullptr, 0, nullptr, MemoryPool::System64KBPages, 0u, 1u}; EXPECT_EQ(MemoryPool::System64KBPages, allocation.getMemoryPool()); - WddmAllocation allocation2{0, GraphicsAllocation::AllocationType::COMMAND_BUFFER, nullptr, 0, 0u, MemoryPool::SystemCpuInaccessible, 0u, 1u}; + WddmAllocation allocation2{0, AllocationType::COMMAND_BUFFER, nullptr, 0, 0u, MemoryPool::SystemCpuInaccessible, 0u, 1u}; EXPECT_EQ(MemoryPool::SystemCpuInaccessible, allocation2.getMemoryPool()); } @@ -256,7 +256,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMemoryManagerWhenAllocate32BitGraphicsM void *ptr = reinterpret_cast(0x1001); auto size = MemoryConstants::pageSize; - auto allocation = memoryManager->allocate32BitGraphicsMemory(csr->getRootDeviceIndex(), size, ptr, GraphicsAllocation::AllocationType::BUFFER); + auto allocation = memoryManager->allocate32BitGraphicsMemory(csr->getRootDeviceIndex(), size, ptr, AllocationType::BUFFER); ASSERT_NE(nullptr, allocation); EXPECT_EQ(MemoryPool::System4KBPagesWith32BitGpuAddressing, allocation->getMemoryPool()); @@ -272,7 +272,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMemoryManagerWith64KBPagesDisabledWhenA } auto size = MemoryConstants::pageSize; - auto svmAllocation = memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), size, GraphicsAllocation::AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}); + auto svmAllocation = memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), size, AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}); EXPECT_NE(nullptr, svmAllocation); EXPECT_EQ(MemoryPool::System4KBPages, svmAllocation->getMemoryPool()); EXPECT_TRUE(svmAllocation->getDefaultGmm()->useSystemMemoryPool); @@ -286,7 +286,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMemoryManagerWith64KBPagesEnabledWhenAl } auto size = MemoryConstants::pageSize; - auto svmAllocation = memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), size, GraphicsAllocation::AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}); + auto svmAllocation = memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), size, AllocationType::SVM_ZERO_COPY, mockDeviceBitfield}); EXPECT_NE(nullptr, svmAllocation); EXPECT_EQ(MemoryPool::System64KBPages, svmAllocation->getMemoryPool()); memoryManager->freeGraphicsMemory(svmAllocation); @@ -305,7 +305,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMemoryManagerWhenCreateAllocationFromHa gdi->getOpenResourceArgOut().pOpenAllocationInfo = &allocationInfo; - AllocationProperties properties(0, false, 0, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties properties(0, false, 0, AllocationType::SHARED_BUFFER, false, false, 0); auto allocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, false, false); EXPECT_NE(nullptr, allocation); EXPECT_EQ(MemoryPool::SystemCpuInaccessible, allocation->getMemoryPool()); @@ -325,8 +325,8 @@ TEST_F(WddmMemoryManagerSimpleTest, givenAllocationPropertiesWhenCreateAllocatio gdi->getOpenResourceArgOut().pOpenAllocationInfo = &allocationInfo; - AllocationProperties propertiesBuffer(0, false, 0, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, false, 0); - AllocationProperties propertiesImage(0, false, 0, GraphicsAllocation::AllocationType::SHARED_IMAGE, false, false, 0); + AllocationProperties propertiesBuffer(0, false, 0, AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties propertiesImage(0, false, 0, AllocationType::SHARED_IMAGE, false, false, 0); AllocationProperties *propertiesArray[2] = {&propertiesBuffer, &propertiesImage}; @@ -354,7 +354,7 @@ TEST_F(WddmMemoryManagerSimpleTest, whenCreateAllocationFromHandleAndMapCallFail gdi->getOpenResourceArgOut().pOpenAllocationInfo = &allocationInfo; EXPECT_EQ(0u, memoryManager->freeGraphicsMemoryImplCalled); - AllocationProperties properties(0, false, 0, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties properties(0, false, 0, AllocationType::SHARED_BUFFER, false, false, 0); auto allocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, false, false); EXPECT_EQ(nullptr, allocation); @@ -417,7 +417,7 @@ TEST_F(WddmMemoryManagerSimpleTest, GivenShareableEnabledAndHugeSizeWhenAskedToC TEST_F(WddmMemoryManagerSimpleTest, givenZeroFenceValueOnSingleEngineRegisteredWhenHandleFenceCompletionIsCalledThenDoNotWaitOnCpu) { ASSERT_EQ(1u, memoryManager->getRegisteredEnginesCount()); - auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0, 32, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield})); + auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0, 32, AllocationType::BUFFER, mockDeviceBitfield})); allocation->getResidencyData().updateCompletionData(0u, 0u); memoryManager->handleFenceCompletion(allocation); @@ -429,7 +429,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenZeroFenceValueOnSingleEngineRegisteredW TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValueOnSingleEngineRegisteredWhenHandleFenceCompletionIsCalledThenWaitOnCpuOnce) { ASSERT_EQ(1u, memoryManager->getRegisteredEnginesCount()); - auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0, 32, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield})); + auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0, 32, AllocationType::BUFFER, mockDeviceBitfield})); auto fence = &static_cast(memoryManager->getRegisteredEngines()[0].osContext)->getResidencyController().getMonitoredFence(); allocation->getResidencyData().updateCompletionData(129u, 0u); @@ -461,7 +461,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValuesOnMultipleEnginesRegi osContext->ensureContextInitialized(); ASSERT_EQ(2u, memoryManager->getRegisteredEnginesCount()); - auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0u, 32, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield})); + auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0u, 32, AllocationType::BUFFER, mockDeviceBitfield})); auto lastEngineFence = &static_cast(osContext)->getResidencyController().getMonitoredFence(); allocation->getResidencyData().updateCompletionData(129u, 0u); allocation->getResidencyData().updateCompletionData(152u, 1u); @@ -494,7 +494,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValueOnSomeOfMultipleEngine PreemptionHelper::getDefaultPreemptionMode(*hwInfo), deviceBitfield)); ASSERT_EQ(2u, memoryManager->getRegisteredEnginesCount()); - auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0u, 32, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield})); + auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0u, 32, AllocationType::BUFFER, mockDeviceBitfield})); auto lastEngineFence = &static_cast(memoryManager->getRegisteredEngines()[0].osContext)->getResidencyController().getMonitoredFence(); allocation->getResidencyData().updateCompletionData(129u, 0u); allocation->getResidencyData().updateCompletionData(0, 1u); @@ -604,7 +604,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromSharedHandleIs std::unique_ptr gmm(new Gmm(rootDeviceEnvironment->getGmmClientContext(), pSysMem, 4096u, 0, false)); setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); - AllocationProperties properties(0, false, 4096u, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, false, mockDeviceBitfield); + AllocationProperties properties(0, false, 4096u, AllocationType::SHARED_BUFFER, false, false, mockDeviceBitfield); auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, false, false); auto wddmAlloc = static_cast(gpuAllocation); @@ -626,7 +626,7 @@ TEST_F(WddmMemoryManagerSimpleTest, whenAllocationCreatedFromSharedHandleIsDestr gdi->getOpenResourceArgOut().pOpenAllocationInfo = &allocationInfo; - AllocationProperties properties(0, false, 0, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties properties(0, false, 0, AllocationType::SHARED_BUFFER, false, false, 0); auto allocation = memoryManager->createGraphicsAllocationFromSharedHandle(1, properties, false, false); EXPECT_NE(nullptr, allocation); @@ -647,12 +647,12 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromNTHandleIsCall std::unique_ptr gmm(new Gmm(rootDeviceEnvironment->getGmmClientContext(), pSysMem, 4096u, 0, false)); setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); - auto *gpuAllocation = memoryManager->createGraphicsAllocationFromNTHandle(reinterpret_cast(1), 0, GraphicsAllocation::AllocationType::SHARED_IMAGE); + auto *gpuAllocation = memoryManager->createGraphicsAllocationFromNTHandle(reinterpret_cast(1), 0, AllocationType::SHARED_IMAGE); 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(GraphicsAllocation::AllocationType::SHARED_IMAGE, wddmAlloc->getAllocationType()); + EXPECT_EQ(AllocationType::SHARED_IMAGE, wddmAlloc->getAllocationType()); memoryManager->freeGraphicsMemory(gpuAllocation); } @@ -681,7 +681,7 @@ TEST_F(WddmMemoryManagerTest, GivenForce32bitAddressingAndRequireSpecificBitness memoryManager->setForce32BitAllocations(true); - AllocationProperties properties(0, false, 4096u, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties properties(0, false, 4096u, AllocationType::SHARED_BUFFER, false, false, 0); auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, true, false); ASSERT_NE(nullptr, gpuAllocation); @@ -704,7 +704,7 @@ TEST_F(WddmMemoryManagerTest, GivenForce32bitAddressingAndNotRequiredSpecificBit memoryManager->setForce32BitAllocations(true); - AllocationProperties properties(0, false, 4096u, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties properties(0, false, 4096u, AllocationType::SHARED_BUFFER, false, false, 0); auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, false, false); ASSERT_NE(nullptr, gpuAllocation); @@ -724,7 +724,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenFreeAllocFromSharedHandl std::unique_ptr gmm(new Gmm(rootDeviceEnvironment->getGmmClientContext(), pSysMem, 4096u, 0, false)); setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); - AllocationProperties properties(0, false, 4096u, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties properties(0, false, 4096u, AllocationType::SHARED_BUFFER, false, false, 0); auto gpuAllocation = (WddmAllocation *)memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, false, false); EXPECT_NE(nullptr, gpuAllocation); auto expectedDestroyHandle = gpuAllocation->resourceHandle; @@ -746,7 +746,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerSizeZeroWhenCreateFromShared std::unique_ptr gmm(new Gmm(rootDeviceEnvironment->getGmmClientContext(), pSysMem, size, 0, false)); setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); - AllocationProperties properties(0, false, size, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties properties(0, false, size, AllocationType::SHARED_BUFFER, false, false, 0); auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, false, false); ASSERT_NE(nullptr, gpuAllocation); EXPECT_EQ(size, gpuAllocation->getUnderlyingBufferSize()); @@ -767,7 +767,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenAllocateGraphicsMemory rootDeviceEnvironment->executionEnvironment.initializeMemoryManager(); memoryManager->allocateGraphicsMemoryInNonDevicePool = true; - MockAllocationProperties properties = {mockRootDeviceIndex, true, size, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield}; + MockAllocationProperties properties = {mockRootDeviceIndex, true, size, AllocationType::BUFFER, mockDeviceBitfield}; properties.flags.preferCompressed = true; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, ptr); @@ -797,7 +797,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenAllocateGraphicsMemory auto memoryManager = std::make_unique(false, false, *executionEnvironment); memoryManager->allocateGraphicsMemoryInNonDevicePool = true; - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{mockRootDeviceIndex, true, size, GraphicsAllocation::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); @@ -824,7 +824,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromSharedHandleFa wddm->failOpenSharedHandle = true; - AllocationProperties properties(0, false, size, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, false, 0); + AllocationProperties properties(0, false, size, AllocationType::SHARED_BUFFER, false, false, 0); auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, properties, false, false); EXPECT_EQ(nullptr, gpuAllocation); } @@ -1043,7 +1043,7 @@ TEST_F(WddmMemoryManagerTest, GivenAlignedPointerWhenAllocate32BitMemoryThenGmmC MockWddmAllocation allocation(rootDeviceEnvironment->getGmmClientContext()); uint32_t size = 4096; void *ptr = reinterpret_cast(4096); - auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, ptr, GraphicsAllocation::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); @@ -1053,7 +1053,7 @@ TEST_F(WddmMemoryManagerTest, GivenUnAlignedPointerAndSizeWhenAllocate32BitMemor MockWddmAllocation allocation(rootDeviceEnvironment->getGmmClientContext()); uint32_t size = 0x1001; void *ptr = reinterpret_cast(0x1001); - auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, ptr, GraphicsAllocation::AllocationType::BUFFER); + auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, ptr, AllocationType::BUFFER); EXPECT_EQ(reinterpret_cast(0x1000), reinterpret_cast(gpuAllocation->getDefaultGmm()->resourceParams.pExistingSysMem)); EXPECT_EQ(0x2000, gpuAllocation->getDefaultGmm()->resourceParams.ExistingSysMemSize); memoryManager->freeGraphicsMemory(gpuAllocation); @@ -1081,7 +1081,7 @@ TEST_F(WddmMemoryManagerTest, GivenBitnessWhenGettingMaxAddressThenCorrectAddres } TEST_F(WddmMemoryManagerTest, GivenNullptrWhenAllocating32BitMemoryThenAddressIsCorrect) { - auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, 3 * MemoryConstants::pageSize, nullptr, GraphicsAllocation::AllocationType::BUFFER); + auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, 3 * MemoryConstants::pageSize, nullptr, AllocationType::BUFFER); ASSERT_NE(nullptr, gpuAllocation); EXPECT_LT(GmmHelper::canonize(memoryManager->getGfxPartition(0)->getHeapBase(HeapIndex::HEAP_EXTERNAL)), gpuAllocation->getGpuAddress()); @@ -1092,7 +1092,7 @@ TEST_F(WddmMemoryManagerTest, GivenNullptrWhenAllocating32BitMemoryThenAddressIs } TEST_F(WddmMemoryManagerTest, given32BitAllocationWhenItIsCreatedThenItHasNonZeroGpuAddressToPatch) { - auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, 3 * MemoryConstants::pageSize, nullptr, GraphicsAllocation::AllocationType::BUFFER); + auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, 3 * MemoryConstants::pageSize, nullptr, AllocationType::BUFFER); ASSERT_NE(nullptr, gpuAllocation); EXPECT_NE(0llu, gpuAllocation->getGpuAddressToPatch()); @@ -1105,7 +1105,7 @@ TEST_F(WddmMemoryManagerTest, GivenMisalignedHostPtrWhenAllocating32BitMemoryThe size_t misalignedSize = 0x2500; void *misalignedPtr = reinterpret_cast(0x12500); - auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, misalignedSize, misalignedPtr, GraphicsAllocation::AllocationType::BUFFER); + auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, misalignedSize, misalignedPtr, AllocationType::BUFFER); ASSERT_NE(nullptr, gpuAllocation); @@ -1124,7 +1124,7 @@ TEST_F(WddmMemoryManagerTest, GivenMisalignedHostPtrWhenAllocating32BitMemoryThe } TEST_F(WddmMemoryManagerTest, WhenAllocating32BitMemoryThenGpuBaseAddressIsCannonized) { - auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, 3 * MemoryConstants::pageSize, nullptr, GraphicsAllocation::AllocationType::BUFFER); + auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, 3 * MemoryConstants::pageSize, nullptr, AllocationType::BUFFER); ASSERT_NE(nullptr, gpuAllocation); @@ -1212,7 +1212,7 @@ TEST_F(WddmMemoryManagerTest, givenManagerWithDisabledDeferredDeleterWhenMapGpuV memoryManager->setDeferredDeleter(nullptr); setMapGpuVaFailConfigFcn(0, 1); - WddmAllocation allocation(0, GraphicsAllocation::AllocationType::BUFFER, ptr, size, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::BUFFER, ptr, size, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocation.setDefaultGmm(gmm.get()); bool ret = memoryManager->createWddmAllocation(&allocation, allocation.getAlignedCpuPtr()); EXPECT_FALSE(ret); @@ -1228,7 +1228,7 @@ TEST_F(WddmMemoryManagerTest, givenManagerWithEnabledDeferredDeleterWhenFirstMap setMapGpuVaFailConfigFcn(0, 1); - WddmAllocation allocation(0, GraphicsAllocation::AllocationType::BUFFER, ptr, size, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::BUFFER, ptr, size, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocation.setDefaultGmm(gmm.get()); bool ret = memoryManager->createWddmAllocation(&allocation, allocation.getAlignedCpuPtr()); EXPECT_TRUE(ret); @@ -1244,14 +1244,14 @@ TEST_F(WddmMemoryManagerTest, givenManagerWithEnabledDeferredDeleterWhenFirstAnd setMapGpuVaFailConfigFcn(0, 2); - WddmAllocation allocation(0, GraphicsAllocation::AllocationType::BUFFER, ptr, size, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation(0, AllocationType::BUFFER, ptr, size, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocation.setDefaultGmm(gmm.get()); bool ret = memoryManager->createWddmAllocation(&allocation, allocation.getAlignedCpuPtr()); EXPECT_FALSE(ret); } TEST_F(WddmMemoryManagerTest, givenNullPtrAndSizePassedToCreateInternalAllocationWhenCallIsMadeThenAllocationIsCreatedIn32BitHeapInternal) { - auto wddmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, MemoryConstants::pageSize, nullptr, GraphicsAllocation::AllocationType::INTERNAL_HEAP)); + auto wddmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, MemoryConstants::pageSize, nullptr, AllocationType::INTERNAL_HEAP)); ASSERT_NE(nullptr, wddmAllocation); EXPECT_EQ(wddmAllocation->getGpuBaseAddress(), GmmHelper::canonize(memoryManager->getInternalHeapBaseAddress(wddmAllocation->getRootDeviceIndex(), wddmAllocation->isAllocatedInLocalMemoryPool()))); EXPECT_NE(nullptr, wddmAllocation->getUnderlyingBuffer()); @@ -1270,7 +1270,7 @@ TEST_F(WddmMemoryManagerTest, givenNullPtrAndSizePassedToCreateInternalAllocatio TEST_F(WddmMemoryManagerTest, givenPtrAndSizePassedToCreateInternalAllocationWhenCallIsMadeThenAllocationIsCreatedIn32BitHeapInternal) { auto ptr = reinterpret_cast(0x1000000); - auto wddmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, MemoryConstants::pageSize, ptr, GraphicsAllocation::AllocationType::INTERNAL_HEAP)); + auto wddmAllocation = static_cast(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, MemoryConstants::pageSize, ptr, AllocationType::INTERNAL_HEAP)); ASSERT_NE(nullptr, wddmAllocation); EXPECT_EQ(wddmAllocation->getGpuBaseAddress(), GmmHelper::canonize(memoryManager->getInternalHeapBaseAddress(rootDeviceIndex, wddmAllocation->isAllocatedInLocalMemoryPool()))); EXPECT_EQ(ptr, wddmAllocation->getUnderlyingBuffer()); @@ -1637,7 +1637,7 @@ TEST_F(MockWddmMemoryManagerTest, givenEnabled64kbpagesWhenCreatingGraphicsMemor } EXPECT_EQ(0U, wddm->createAllocationResult.called); - GraphicsAllocation *galloc = memoryManager64k.allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize64k, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield}); + GraphicsAllocation *galloc = memoryManager64k.allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize64k, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield}); EXPECT_NE(0U, wddm->createAllocationResult.called); EXPECT_NE(nullptr, galloc); EXPECT_EQ(true, galloc->isLocked()); @@ -1704,7 +1704,7 @@ TEST_F(MockWddmMemoryManagerTest, givenAllocateGraphicsMemoryForBufferAndRequest memoryManager.hugeGfxMemoryChunkSize = MemoryConstants::pageSize64k - MemoryConstants::pageSize; - WddmAllocation *wddmAlloc = static_cast(memoryManager.allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize64k * 3, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield})); + WddmAllocation *wddmAlloc = static_cast(memoryManager.allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize64k * 3, AllocationType::BUFFER, mockDeviceBitfield})); EXPECT_NE(nullptr, wddmAlloc); EXPECT_EQ(4, wddmAlloc->getNumGmms()); EXPECT_EQ(4, wddm->createAllocationResult.called); @@ -1737,7 +1737,7 @@ TEST_F(MockWddmMemoryManagerTest, givenAllocateGraphicsMemoryForHostBufferAndReq memoryManager.hugeGfxMemoryChunkSize = MemoryConstants::pageSize64k - MemoryConstants::pageSize; std::vector hostPtr(MemoryConstants::pageSize64k * 3); - AllocationProperties allocProps{rootDeviceIndex, MemoryConstants::pageSize64k * 3, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield}; + AllocationProperties allocProps{rootDeviceIndex, MemoryConstants::pageSize64k * 3, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield}; allocProps.flags.allocateMemory = false; WddmAllocation *wddmAlloc = static_cast(memoryManager.allocateGraphicsMemoryWithProperties(allocProps, hostPtr.data())); @@ -1855,7 +1855,7 @@ TEST_F(MockWddmMemoryManagerTest, givenPageTableManagerWhenMapAuxGpuVaCalledThen engine.commandStreamReceiver->pageTableManager.reset(mockMngr); } - auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(AllocationProperties(1, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, mockDeviceBitfield)); + auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(AllocationProperties(1, MemoryConstants::pageSize, AllocationType::INTERNAL_HOST_MEMORY, mockDeviceBitfield)); GMM_DDI_UPDATEAUXTABLE expectedDdiUpdateAuxTable = {}; expectedDdiUpdateAuxTable.BaseGpuVA = allocation->getGpuAddress(); @@ -1966,7 +1966,7 @@ TEST_F(MockWddmMemoryManagerTest, givenCompressedAllocationAndPageTableSupported engine.commandStreamReceiver->pageTableManager.reset(mockMngr); } - auto wddmAlloc = static_cast(memoryManager.allocateGraphicsMemoryWithProperties(AllocationProperties(1, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, mockDeviceBitfield))); + auto wddmAlloc = static_cast(memoryManager.allocateGraphicsMemoryWithProperties(AllocationProperties(1, MemoryConstants::pageSize, AllocationType::INTERNAL_HOST_MEMORY, mockDeviceBitfield))); wddmAlloc->setGpuAddress(gpuVa); wddmAlloc->getDefaultGmm()->isCompressionEnabled = true; @@ -2223,7 +2223,7 @@ TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingAllocationWithReservedGpuVirtu TEST_F(WddmMemoryManagerSimpleTest, givenAllocationWithReservedGpuVirtualAddressWhenMapCallFailsDuringCreateWddmAllocationThenReleasePreferredAddress) { MockWddmAllocation allocation(rootDeviceEnvironment->getGmmClientContext(), 1); - allocation.setAllocationType(GraphicsAllocation::AllocationType::KERNEL_ISA); + allocation.setAllocationType(AllocationType::KERNEL_ISA); uint64_t gpuAddress = 0x123; uint64_t sizeForFree = 0x1234; allocation.reservedGpuVirtualAddress = gpuAddress; @@ -2245,7 +2245,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMultiHandleAllocationAndPreferredGpuVaI uint32_t numGmms = 10; MockWddmAllocation allocation(rootDeviceEnvironment->getGmmClientContext(), numGmms); - allocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER); + allocation.setAllocationType(AllocationType::BUFFER); allocation.storageInfo.multiStorage = true; wddm->callBaseMapGpuVa = true; @@ -2269,7 +2269,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenSvmCpuAllocationWhenSizeAndAlignmentPro } size_t size = 2 * MemoryConstants::megaByte; - MockAllocationProperties properties{csr->getRootDeviceIndex(), true, size, GraphicsAllocation::AllocationType::SVM_CPU, mockDeviceBitfield}; + MockAllocationProperties properties{csr->getRootDeviceIndex(), true, size, AllocationType::SVM_CPU, mockDeviceBitfield}; properties.alignment = size; auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties(properties)); ASSERT_NE(nullptr, allocation); @@ -2291,7 +2291,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, GraphicsAllocation::AllocationType::WRITE_COMBINED, mockDeviceBitfield})); + auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0, size, AllocationType::WRITE_COMBINED, mockDeviceBitfield})); ASSERT_NE(nullptr, allocation); EXPECT_EQ(size, allocation->getUnderlyingBufferSize()); EXPECT_NE(nullptr, allocation->getUnderlyingBuffer()); @@ -2328,7 +2328,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, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield})); + auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0, size, AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield})); ASSERT_NE(nullptr, allocation); EXPECT_EQ(size, allocation->getUnderlyingBufferSize()); EXPECT_NE(nullptr, allocation->getUnderlyingBuffer()); @@ -2346,7 +2346,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenDebugModuleAreaTypeWhenCreatingAllocati const auto size = MemoryConstants::pageSize64k; NEO::AllocationProperties properties{0, true, size, - NEO::GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA, + NEO::AllocationType::DEBUG_MODULE_AREA, false, mockDeviceBitfield}; @@ -2583,7 +2583,7 @@ class WddmMemoryManagerMock : public MockWddmMemoryManagerFixture, public ::test TEST_F(WddmMemoryManagerMock, givenAllocationWithReservedGpuVirtualAddressWhenMapCallFailsDuringCreateWddmAllocationThenReleasePreferredAddress) { MockWddmAllocation allocation(rootDeviceEnvironment->getGmmClientContext(), 4); - allocation.setAllocationType(GraphicsAllocation::AllocationType::KERNEL_ISA); + allocation.setAllocationType(AllocationType::KERNEL_ISA); uint64_t gpuAddress = 0x123; uint64_t sizeForFree = 0x1234; allocation.reservedGpuVirtualAddress = gpuAddress; @@ -2639,7 +2639,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, GraphicsAllocation::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); @@ -2660,7 +2660,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, GraphicsAllocation::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); @@ -2699,7 +2699,7 @@ TEST_F(PlatformWithFourDevicesTest, givenDifferentAllocationSizesWhenColourAlloc TEST_F(PlatformWithFourDevicesTest, whenCreateScratchSpaceInSingleTileQueueThenTheAllocationHasOneHandle) { MemoryManagerCreate memoryManager(true, true, *platform()->peekExecutionEnvironment()); - AllocationProperties properties{mockRootDeviceIndex, true, 1u, GraphicsAllocation::AllocationType::SCRATCH_SURFACE, false, false, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, true, 1u, AllocationType::SCRATCH_SURFACE, 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/os_interface/windows/wddm_residency_controller_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp index 3ac54990c2..05b91fabc7 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp @@ -714,9 +714,9 @@ TEST_F(WddmResidencyControllerWithGdiTest, GivenNumBytesToTrimIsNotZeroWhenTrimm } TEST_F(WddmResidencyControllerWithGdiTest, GivenNumBytesToTrimIsZeroWhenTrimmingToBudgetThenEvictingStops) { - WddmAllocation allocation1(0, GraphicsAllocation::AllocationType::UNKNOWN, reinterpret_cast(0x1000), 0x1000, nullptr, MemoryPool::MemoryNull, 0u, 1u); - WddmAllocation allocation2(0, GraphicsAllocation::AllocationType::UNKNOWN, reinterpret_cast(0x1000), 0x3000, nullptr, MemoryPool::MemoryNull, 0u, 1u); - WddmAllocation allocation3(0, GraphicsAllocation::AllocationType::UNKNOWN, reinterpret_cast(0x1000), 0x1000, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation1(0, AllocationType::UNKNOWN, reinterpret_cast(0x1000), 0x1000, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation2(0, AllocationType::UNKNOWN, reinterpret_cast(0x1000), 0x3000, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation3(0, AllocationType::UNKNOWN, reinterpret_cast(0x1000), 0x1000, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocation1.getResidencyData().resident[osContextId] = true; allocation1.getResidencyData().updateCompletionData(0, osContextId); @@ -814,8 +814,8 @@ TEST_F(WddmResidencyControllerWithGdiAndMemoryManagerTest, WhenTrimmingToBudgetT } gdi->setNonZeroNumBytesToTrimInEvict(); void *ptr = reinterpret_cast(wddm->virtualAllocAddress + 0x1000); - WddmAllocation allocation1(0, GraphicsAllocation::AllocationType::UNKNOWN, ptr, 0x1000, nullptr, MemoryPool::MemoryNull, 0u, 1u); - WddmAllocation allocation2(0, GraphicsAllocation::AllocationType::UNKNOWN, ptr, 0x1000, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation1(0, AllocationType::UNKNOWN, ptr, 0x1000, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation2(0, AllocationType::UNKNOWN, ptr, 0x1000, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocation1.getResidencyData().resident[osContextId] = true; allocation1.getResidencyData().updateCompletionData(0, osContextId); @@ -873,9 +873,9 @@ TEST_F(WddmResidencyControllerWithGdiTest, givenThreeAllocationsAlignedSizeBigge void *ptr2 = reinterpret_cast(wddm->virtualAllocAddress + 0x3000); void *ptr3 = reinterpret_cast(wddm->virtualAllocAddress + 0x5000); - WddmAllocation allocation1(0, GraphicsAllocation::AllocationType::UNKNOWN, ptr1, underlyingSize, nullptr, MemoryPool::MemoryNull, 0u, 1u); - WddmAllocation allocation2(0, GraphicsAllocation::AllocationType::UNKNOWN, ptr2, underlyingSize, nullptr, MemoryPool::MemoryNull, 0u, 1u); - WddmAllocation allocation3(0, GraphicsAllocation::AllocationType::UNKNOWN, ptr3, underlyingSize, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation1(0, AllocationType::UNKNOWN, ptr1, underlyingSize, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation2(0, AllocationType::UNKNOWN, ptr2, underlyingSize, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocation3(0, AllocationType::UNKNOWN, ptr3, underlyingSize, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocation1.getResidencyData().resident[osContextId] = true; allocation1.getResidencyData().updateCompletionData(0, osContextId); @@ -1086,7 +1086,7 @@ TEST_F(WddmResidencyControllerWithMockWddmTest, givenMakeResidentFailsAndTrimToB MockWddmAllocation allocation1(gmmClientContext); void *cpuPtr = reinterpret_cast(wddm->getWddmMinAddress() + 0x1000); size_t allocationSize = 0x1000; - WddmAllocation allocationToTrim(0, GraphicsAllocation::AllocationType::UNKNOWN, cpuPtr, allocationSize, nullptr, MemoryPool::MemoryNull, 0u, 1u); + WddmAllocation allocationToTrim(0, AllocationType::UNKNOWN, cpuPtr, allocationSize, nullptr, MemoryPool::MemoryNull, 0u, 1u); allocationToTrim.getResidencyData().updateCompletionData(residencyController->getMonitoredFence().lastSubmittedFence, osContext->getContextId()); diff --git a/opencl/test/unit_test/program/kernel_info_tests.cpp b/opencl/test/unit_test/program/kernel_info_tests.cpp index 660c596274..82c2b34918 100644 --- a/opencl/test/unit_test/program/kernel_info_tests.cpp +++ b/opencl/test/unit_test/program/kernel_info_tests.cpp @@ -62,7 +62,7 @@ TEST(KernelInfoTest, givenKernelInfoWhenCreatingKernelAllocationWithInternalIsaF auto retVal = kernelInfo.createKernelAllocation(*device, false); EXPECT_TRUE(retVal); auto allocation = kernelInfo.kernelAllocation; - EXPECT_EQ(GraphicsAllocation::AllocationType::KERNEL_ISA, allocation->getAllocationType()); + EXPECT_EQ(AllocationType::KERNEL_ISA, allocation->getAllocationType()); device->getMemoryManager()->checkGpuUsageAndDestroyGraphicsAllocations(allocation); } @@ -78,7 +78,7 @@ TEST(KernelInfoTest, givenKernelInfoWhenCreatingKernelAllocationWithInternalIsaT auto retVal = kernelInfo.createKernelAllocation(*device, true); EXPECT_TRUE(retVal); auto allocation = kernelInfo.kernelAllocation; - EXPECT_EQ(GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL, allocation->getAllocationType()); + EXPECT_EQ(AllocationType::KERNEL_ISA_INTERNAL, 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 d29538511a..179b5a231f 100644 --- a/opencl/test/unit_test/program/program_tests.cpp +++ b/opencl/test/unit_test/program/program_tests.cpp @@ -1972,9 +1972,9 @@ TEST_F(ProgramTests, givenExistingConstantSurfacesWhenProcessGenBinaryThenCleanu program->buildInfos.resize(2); program->buildInfos[0].constantSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::cacheLineSize, - GraphicsAllocation::AllocationType::CONSTANT_SURFACE, pDevice->getDeviceBitfield()}); + AllocationType::CONSTANT_SURFACE, pDevice->getDeviceBitfield()}); program->buildInfos[1].constantSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::cacheLineSize, - GraphicsAllocation::AllocationType::CONSTANT_SURFACE, pDevice->getDeviceBitfield()}); + AllocationType::CONSTANT_SURFACE, pDevice->getDeviceBitfield()}); program->buildInfos[rootDeviceIndex].unpackedDeviceBinary = makeCopy(patchtokensProgram.storage.data(), patchtokensProgram.storage.size()); program->buildInfos[rootDeviceIndex].unpackedDeviceBinarySize = patchtokensProgram.storage.size(); @@ -1998,9 +1998,9 @@ TEST_F(ProgramTests, givenExistingGlobalSurfacesWhenProcessGenBinaryThenCleanupT program->buildInfos.resize(2); program->buildInfos[0].globalSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::cacheLineSize, - GraphicsAllocation::AllocationType::GLOBAL_SURFACE, pDevice->getDeviceBitfield()}); + AllocationType::GLOBAL_SURFACE, pDevice->getDeviceBitfield()}); program->buildInfos[1].globalSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::cacheLineSize, - GraphicsAllocation::AllocationType::GLOBAL_SURFACE, pDevice->getDeviceBitfield()}); + AllocationType::GLOBAL_SURFACE, 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 1e5a6ece55..725b9ee5c5 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -342,6 +342,6 @@ TEST_F(CreateFromGlTextureTests, GivenGlTextureWhenCreateIsCalledThenAllocationT auto graphicsAllocation = glImage->getGraphicsAllocation(clContext.getDevice(0)->getRootDeviceIndex()); ASSERT_NE(nullptr, graphicsAllocation); - EXPECT_EQ(GraphicsAllocation::AllocationType::SHARED_IMAGE, graphicsAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::SHARED_IMAGE, 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 dbbffa1fcf..a31934d6af 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -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(GraphicsAllocation::AllocationType::SHARED_BUFFER, buffer->getGraphicsAllocation(rootDeviceIndex)->getAllocationType()); + EXPECT_EQ(AllocationType::SHARED_BUFFER, 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 07c4240766..f7e49e79e7 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-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -58,12 +58,12 @@ struct UnifiedSharingContextFixture : ::testing::Test { template struct UnifiedSharingMockMemoryManager : MockMemoryManager { using MockMemoryManager::MockMemoryManager; - GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) override { + GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override { if (!validMemoryManager) { return nullptr; } - auto graphicsAllocation = createMemoryAllocation(GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, nullptr, reinterpret_cast(1), 1, + auto graphicsAllocation = createMemoryAllocation(AllocationType::INTERNAL_HOST_MEMORY, 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 9568d6847d..fcb89ade0a 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -105,8 +105,8 @@ class MockHwInfoConfig : public HwInfoConfigHw { }; struct MemoryManagerReturningCompressedAllocations : UnifiedSharingMockMemoryManager { - GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) override { - auto allocation = UnifiedSharingMockMemoryManager::createGraphicsAllocationFromNTHandle(handle, rootDeviceIndex, GraphicsAllocation::AllocationType::SHARED_IMAGE); + GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override { + auto allocation = UnifiedSharingMockMemoryManager::createGraphicsAllocationFromNTHandle(handle, rootDeviceIndex, AllocationType::SHARED_IMAGE); 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 d7a1492ec5..6c74a198d4 100644 --- a/opencl/test/unit_test/sharings/unified/unified_sharing_tests.cpp +++ b/opencl/test/unit_test/sharings/unified/unified_sharing_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -164,7 +164,7 @@ struct UnifiedSharingCreateAllocationTests : UnifiedSharingTestsWithMemoryManage struct MemoryManagerCheckingAllocationMethod : MockMemoryManager { using MockMemoryManager::MockMemoryManager; - GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) override { + GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override { this->createFromNTHandleCalled = true; this->handle = toOsHandle(handle); return nullptr; @@ -200,7 +200,7 @@ TEST_F(UnifiedSharingCreateAllocationTests, givenWindowsNtHandleWhenCreateGraphi UnifiedSharingMemoryDescription desc{}; desc.handle = reinterpret_cast(0x1234); desc.type = UnifiedSharingHandleType::Win32Nt; - GraphicsAllocation::AllocationType allocationType = GraphicsAllocation::AllocationType::SHARED_IMAGE; + AllocationType allocationType = AllocationType::SHARED_IMAGE; 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; - GraphicsAllocation::AllocationType allocationType = GraphicsAllocation::AllocationType::SHARED_IMAGE; + AllocationType allocationType = AllocationType::SHARED_IMAGE; 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; - GraphicsAllocation::AllocationType allocationType = GraphicsAllocation::AllocationType::SHARED_IMAGE; + AllocationType allocationType = AllocationType::SHARED_IMAGE; MockSharingHandler::createGraphicsAllocation(this->context.get(), desc, allocationType); EXPECT_FALSE(memoryManager->createFromNTHandleCalled); diff --git a/opencl/test/unit_test/utilities/file_logger_tests.cpp b/opencl/test/unit_test/utilities/file_logger_tests.cpp index 4ff099f494..66f383e35b 100644 --- a/opencl/test/unit_test/utilities/file_logger_tests.cpp +++ b/opencl/test/unit_test/utilities/file_logger_tests.cpp @@ -894,52 +894,52 @@ TEST(FileLogger, whenFullyEnabledThenAllDebugFunctionalityIsAvailableAtCompileTi } struct AllocationTypeTestCase { - GraphicsAllocation::AllocationType type; + AllocationType type; const char *str; }; AllocationTypeTestCase allocationTypeValues[] = { - {GraphicsAllocation::AllocationType::BUFFER, "BUFFER"}, - {GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, "BUFFER_HOST_MEMORY"}, - {GraphicsAllocation::AllocationType::COMMAND_BUFFER, "COMMAND_BUFFER"}, - {GraphicsAllocation::AllocationType::CONSTANT_SURFACE, "CONSTANT_SURFACE"}, - {GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, "EXTERNAL_HOST_PTR"}, - {GraphicsAllocation::AllocationType::FILL_PATTERN, "FILL_PATTERN"}, - {GraphicsAllocation::AllocationType::GLOBAL_SURFACE, "GLOBAL_SURFACE"}, - {GraphicsAllocation::AllocationType::IMAGE, "IMAGE"}, - {GraphicsAllocation::AllocationType::INDIRECT_OBJECT_HEAP, "INDIRECT_OBJECT_HEAP"}, - {GraphicsAllocation::AllocationType::INSTRUCTION_HEAP, "INSTRUCTION_HEAP"}, - {GraphicsAllocation::AllocationType::INTERNAL_HEAP, "INTERNAL_HEAP"}, - {GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, "INTERNAL_HOST_MEMORY"}, - {GraphicsAllocation::AllocationType::KERNEL_ISA, "KERNEL_ISA"}, - {GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL, "KERNEL_ISA_INTERNAL"}, - {GraphicsAllocation::AllocationType::LINEAR_STREAM, "LINEAR_STREAM"}, - {GraphicsAllocation::AllocationType::MAP_ALLOCATION, "MAP_ALLOCATION"}, - {GraphicsAllocation::AllocationType::MCS, "MCS"}, - {GraphicsAllocation::AllocationType::PIPE, "PIPE"}, - {GraphicsAllocation::AllocationType::PREEMPTION, "PREEMPTION"}, - {GraphicsAllocation::AllocationType::PRINTF_SURFACE, "PRINTF_SURFACE"}, - {GraphicsAllocation::AllocationType::PRIVATE_SURFACE, "PRIVATE_SURFACE"}, - {GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER, "PROFILING_TAG_BUFFER"}, - {GraphicsAllocation::AllocationType::SCRATCH_SURFACE, "SCRATCH_SURFACE"}, - {GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE, "WORK_PARTITION_SURFACE"}, - {GraphicsAllocation::AllocationType::SHARED_BUFFER, "SHARED_BUFFER"}, - {GraphicsAllocation::AllocationType::SHARED_CONTEXT_IMAGE, "SHARED_CONTEXT_IMAGE"}, - {GraphicsAllocation::AllocationType::SHARED_IMAGE, "SHARED_IMAGE"}, - {GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY, "SHARED_RESOURCE_COPY"}, - {GraphicsAllocation::AllocationType::SURFACE_STATE_HEAP, "SURFACE_STATE_HEAP"}, - {GraphicsAllocation::AllocationType::SVM_CPU, "SVM_CPU"}, - {GraphicsAllocation::AllocationType::SVM_GPU, "SVM_GPU"}, - {GraphicsAllocation::AllocationType::SVM_ZERO_COPY, "SVM_ZERO_COPY"}, - {GraphicsAllocation::AllocationType::TAG_BUFFER, "TAG_BUFFER"}, - {GraphicsAllocation::AllocationType::GLOBAL_FENCE, "GLOBAL_FENCE"}, - {GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, "TIMESTAMP_PACKET_TAG_BUFFER"}, - {GraphicsAllocation::AllocationType::UNKNOWN, "UNKNOWN"}, - {GraphicsAllocation::AllocationType::WRITE_COMBINED, "WRITE_COMBINED"}, - {GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA, "DEBUG_CONTEXT_SAVE_AREA"}, - {GraphicsAllocation::AllocationType::DEBUG_SBA_TRACKING_BUFFER, "DEBUG_SBA_TRACKING_BUFFER"}, - {GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA, "DEBUG_MODULE_AREA"}, - {GraphicsAllocation::AllocationType::SW_TAG_BUFFER, "SW_TAG_BUFFER"}}; + {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_CONTEXT_IMAGE, "SHARED_CONTEXT_IMAGE"}, + {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"}}; class AllocationTypeLogging : public ::testing::TestWithParam {}; @@ -965,7 +965,7 @@ TEST(AllocationTypeLoggingSingle, givenGraphicsAllocationTypeWhenConvertingToStr DebugVariables flags; FullyEnabledFileLogger fileLogger(testFile, flags); - GraphicsAllocation graphicsAllocation(0, static_cast(999), nullptr, 0ull, 0ull, 0, MemoryPool::MemoryNull); + GraphicsAllocation graphicsAllocation(0, static_cast(999), nullptr, 0ull, 0ull, 0, MemoryPool::MemoryNull); auto result = getAllocationTypeString(&graphicsAllocation); @@ -977,10 +977,10 @@ TEST(AllocationTypeLoggingSingle, givenAllocationTypeWhenConvertingToStringThenS DebugVariables flags; FullyEnabledFileLogger fileLogger(testFile, flags); - GraphicsAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0ull, 0ull, 0, MemoryPool::MemoryNull); + GraphicsAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, 0ull, 0ull, 0, MemoryPool::MemoryNull); - for (uint32_t i = 0; i < static_cast(GraphicsAllocation::AllocationType::COUNT); i++) { - graphicsAllocation.setAllocationType(static_cast(i)); + for (uint32_t i = 0; i < static_cast(AllocationType::COUNT); i++) { + graphicsAllocation.setAllocationType(static_cast(i)); auto result = getAllocationTypeString(&graphicsAllocation); @@ -995,7 +995,7 @@ TEST(AllocationTypeLoggingSingle, givenDebugVariableToCaptureAllocationTypeWhenF FullyEnabledFileLogger fileLogger(testFile, flags); - GraphicsAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::COMMAND_BUFFER, nullptr, 0ull, 0ull, 0, MemoryPool::MemoryNull); + GraphicsAllocation graphicsAllocation(0, AllocationType::COMMAND_BUFFER, nullptr, 0ull, 0ull, 0, MemoryPool::MemoryNull); testing::internal::CaptureStdout(); fileLogger.logAllocation(&graphicsAllocation); @@ -1013,7 +1013,7 @@ TEST(AllocationTypeLoggingSingle, givenLogAllocationTypeWhenLoggingAllocationThe FullyEnabledFileLogger fileLogger(testFile, flags); - GraphicsAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::COMMAND_BUFFER, nullptr, 0ull, 0ull, 0, MemoryPool::MemoryNull); + GraphicsAllocation graphicsAllocation(0, AllocationType::COMMAND_BUFFER, nullptr, 0ull, 0ull, 0, MemoryPool::MemoryNull); // Log file not created bool logFileCreated = fileExists(fileLogger.getLogFileName()); diff --git a/opencl/test/unit_test/utilities/tag_allocator_tests.cpp b/opencl/test/unit_test/utilities/tag_allocator_tests.cpp index 0d2de7c174..09c971b288 100644 --- a/opencl/test/unit_test/utilities/tag_allocator_tests.cpp +++ b/opencl/test/unit_test/utilities/tag_allocator_tests.cpp @@ -53,8 +53,8 @@ struct TimeStamps { start = 1; end = 2; } - static constexpr GraphicsAllocation::AllocationType getAllocationType() { - return GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER; + static constexpr AllocationType getAllocationType() { + return AllocationType::PROFILING_TAG_BUFFER; } static constexpr TagNodeType getTagNodeType() { return TagNodeType::HwTimeStamps; } @@ -462,9 +462,9 @@ TEST_F(TagAllocatorTest, givenTagAllocatorWhenGraphicsAllocationIsCreatedThenSet auto hwTimeStampsTag = hwTimeStampsAllocator.getTag(); auto hwPerfCounterTag = hwPerfCounterAllocator.getTag(); - EXPECT_EQ(GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, timestampPacketTag->getBaseGraphicsAllocation()->getAllocationType()); - EXPECT_EQ(GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER, hwTimeStampsTag->getBaseGraphicsAllocation()->getAllocationType()); - EXPECT_EQ(GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER, hwPerfCounterTag->getBaseGraphicsAllocation()->getAllocationType()); + 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()); } TEST_F(TagAllocatorTest, givenMultipleRootDevicesWhenPopulatingTagsThenCreateMultiGraphicsAllocation) { diff --git a/opencl/test/unit_test/xe_hp_core/copy_engine_tests_xe_hp_core.cpp b/opencl/test/unit_test/xe_hp_core/copy_engine_tests_xe_hp_core.cpp index 4289b5f057..fbdc1b9a26 100644 --- a/opencl/test/unit_test/xe_hp_core/copy_engine_tests_xe_hp_core.cpp +++ b/opencl/test/unit_test/xe_hp_core/copy_engine_tests_xe_hp_core.cpp @@ -565,7 +565,7 @@ XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenDebugFlagSetWhenCompressionIsUsedThe auto gmm = std::make_unique(clDevice->getGmmClientContext()); gmm->isCompressionEnabled = true; - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocation.setGmm(gmm.get(), 0); diff --git a/opencl/test/unit_test/xe_hp_core/hw_helper_tests_xe_hp_core.cpp b/opencl/test/unit_test/xe_hp_core/hw_helper_tests_xe_hp_core.cpp index 643f8ced83..03c0c969ce 100644 --- a/opencl/test/unit_test/xe_hp_core/hw_helper_tests_xe_hp_core.cpp +++ b/opencl/test/unit_test/xe_hp_core/hw_helper_tests_xe_hp_core.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -83,7 +83,7 @@ XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenStatelessCompressionEnabledWhenSe HardwareInfo hwInfo = *defaultHwInfo; auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); - for (auto allocType : {GraphicsAllocation::AllocationType::CONSTANT_SURFACE, GraphicsAllocation::AllocationType::GLOBAL_SURFACE, GraphicsAllocation::AllocationType::PRINTF_SURFACE}) { + for (auto allocType : {AllocationType::CONSTANT_SURFACE, AllocationType::GLOBAL_SURFACE, AllocationType::PRINTF_SURFACE}) { AllocationData allocData; AllocationProperties allocProperties(mockRootDeviceIndex, true, allocType, mockDeviceBitfield); diff --git a/opencl/test/unit_test/xe_hp_core/xehp/memory_manager_tests_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/memory_manager_tests_xehp.inl index 7c64585754..0f5e073622 100644 --- a/opencl/test/unit_test/xe_hp_core/xehp/memory_manager_tests_xehp.inl +++ b/opencl/test/unit_test/xe_hp_core/xehp/memory_manager_tests_xehp.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -22,7 +22,7 @@ XEHPTEST_F(MemoryManagerTestsXeHP, givenEnabledLocalMemoryWhenLinearStreamIsAllo MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::LINEAR_STREAM, mockDeviceBitfield}, nullptr); + auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::LINEAR_STREAM, mockDeviceBitfield}, nullptr); EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool()); EXPECT_TRUE(memoryManager.allocationInDevicePoolCreated); diff --git a/opencl/test/unit_test/xe_hpc_core/hw_helper_tests_xe_hpc_core.cpp b/opencl/test/unit_test/xe_hpc_core/hw_helper_tests_xe_hpc_core.cpp index c627a42178..0b57172bd9 100644 --- a/opencl/test/unit_test/xe_hpc_core/hw_helper_tests_xe_hpc_core.cpp +++ b/opencl/test/unit_test/xe_hpc_core/hw_helper_tests_xe_hpc_core.cpp @@ -37,7 +37,7 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenHwHelperwhenAskingForDcFlushThenR XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenCommandBufferAllocationTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { AllocationData allocData; - AllocationProperties properties(mockRootDeviceIndex, true, 10, GraphicsAllocation::AllocationType::COMMAND_BUFFER, false, mockDeviceBitfield); + AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::COMMAND_BUFFER, false, mockDeviceBitfield); MockMemoryManager mockMemoryManager; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); @@ -65,15 +65,15 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenSingleTileCsrWhenAllocatingCsrSpe auto &heap = commandStreamReceiver->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, MemoryConstants::pageSize64k); auto heapAllocation = heap.getGraphicsAllocation(); if (commandStreamReceiver->canUse4GbHeaps) { - EXPECT_EQ(GraphicsAllocation::AllocationType::INTERNAL_HEAP, heapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::INTERNAL_HEAP, heapAllocation->getAllocationType()); } else { - EXPECT_EQ(GraphicsAllocation::AllocationType::LINEAR_STREAM, heapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::LINEAR_STREAM, heapAllocation->getAllocationType()); } EXPECT_EQ(singleTileMask, heapAllocation->storageInfo.memoryBanks); commandStreamReceiver->ensureCommandBufferAllocation(heap, heap.getAvailableSpace() + 1, 0u); auto commandBufferAllocation = heap.getGraphicsAllocation(); - EXPECT_EQ(GraphicsAllocation::AllocationType::COMMAND_BUFFER, commandBufferAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::COMMAND_BUFFER, commandBufferAllocation->getAllocationType()); EXPECT_NE(heapAllocation, commandBufferAllocation); EXPECT_EQ(commandBufferAllocation->getMemoryPool(), MemoryPool::System4KBPages); } @@ -97,15 +97,15 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenMultiTileCsrWhenAllocatingCsrSpec auto &heap = commandStreamReceiver->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, MemoryConstants::pageSize64k); auto heapAllocation = heap.getGraphicsAllocation(); if (commandStreamReceiver->canUse4GbHeaps) { - EXPECT_EQ(GraphicsAllocation::AllocationType::INTERNAL_HEAP, heapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::INTERNAL_HEAP, heapAllocation->getAllocationType()); } else { - EXPECT_EQ(GraphicsAllocation::AllocationType::LINEAR_STREAM, heapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::LINEAR_STREAM, heapAllocation->getAllocationType()); } EXPECT_EQ(tile0Mask, heapAllocation->storageInfo.memoryBanks); commandStreamReceiver->ensureCommandBufferAllocation(heap, heap.getAvailableSpace() + 1, 0u); auto commandBufferAllocation = heap.getGraphicsAllocation(); - EXPECT_EQ(GraphicsAllocation::AllocationType::COMMAND_BUFFER, commandBufferAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::COMMAND_BUFFER, commandBufferAllocation->getAllocationType()); EXPECT_NE(heapAllocation, commandBufferAllocation); EXPECT_EQ(commandBufferAllocation->getMemoryPool(), MemoryPool::LocalMemory); } @@ -130,15 +130,15 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenSingleTileBdA0CsrWhenAllocatingCs auto &heap = commandStreamReceiver->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, MemoryConstants::pageSize64k); auto heapAllocation = heap.getGraphicsAllocation(); if (commandStreamReceiver->canUse4GbHeaps) { - EXPECT_EQ(GraphicsAllocation::AllocationType::INTERNAL_HEAP, heapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::INTERNAL_HEAP, heapAllocation->getAllocationType()); } else { - EXPECT_EQ(GraphicsAllocation::AllocationType::LINEAR_STREAM, heapAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::LINEAR_STREAM, heapAllocation->getAllocationType()); } EXPECT_EQ(tile0Mask, heapAllocation->storageInfo.memoryBanks); commandStreamReceiver->ensureCommandBufferAllocation(heap, heap.getAvailableSpace() + 1, 0u); auto commandBufferAllocation = heap.getGraphicsAllocation(); - EXPECT_EQ(GraphicsAllocation::AllocationType::COMMAND_BUFFER, commandBufferAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::COMMAND_BUFFER, commandBufferAllocation->getAllocationType()); EXPECT_NE(heapAllocation, commandBufferAllocation); EXPECT_EQ(commandBufferAllocation->getMemoryPool(), MemoryPool::System4KBPages); } @@ -717,7 +717,7 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenDefaultHwHelperHwWhenGettingIsBli auto &helper = HwHelper::get(renderCoreFamily); MockGraphicsAllocation allocation; allocation.overrideMemoryPool(MemoryPool::LocalMemory); - allocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + allocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(*defaultHwInfo, allocation)); } @@ -726,7 +726,7 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenNonTile0AccessWhenGettingIsBlitCo HardwareInfo hwInfo = *defaultHwInfo; hwInfo.capabilityTable.blitterOperationsSupported = true; MockGraphicsAllocation graphicsAllocation; - graphicsAllocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + graphicsAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); EXPECT_TRUE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType())); graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); @@ -971,7 +971,7 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenBdA0WhenAllocatingOnNonTileZeroTh constexpr DeviceBitfield tile0Mask = 1; constexpr DeviceBitfield allTilesMask = 0b1111; - const AllocationProperties allocProperties(0, 1, GraphicsAllocation::AllocationType::UNKNOWN, allTilesMask); + const AllocationProperties allocProperties(0, 1, AllocationType::UNKNOWN, allTilesMask); for (int32_t debugFlag : {-1, 0, 1}) { DebugManager.flags.ForceTile0PlacementForTile1ResourcesWaActive.set(debugFlag); @@ -1009,8 +1009,8 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenCommandBufferAllocationWhenSetExt constexpr DeviceBitfield singleTileBitfield = 0b0100; constexpr DeviceBitfield allTilesBitfield = 0b1111; - const AllocationProperties singleTileAllocProperties(0, 1, GraphicsAllocation::AllocationType::COMMAND_BUFFER, singleTileBitfield); - const AllocationProperties allTilesAllocProperties(0, 1, GraphicsAllocation::AllocationType::COMMAND_BUFFER, allTilesBitfield); + const AllocationProperties singleTileAllocProperties(0, 1, AllocationType::COMMAND_BUFFER, singleTileBitfield); + const AllocationProperties allTilesAllocProperties(0, 1, AllocationType::COMMAND_BUFFER, 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 3692ed0cc8..c6c38417b2 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -42,7 +42,7 @@ XE_HPC_CORETEST_F(CmdsProgrammingTestsXeHpcCore, givenL3ToL1DebugFlagWhenStatele XE_HPC_CORETEST_F(CmdsProgrammingTestsXeHpcCore, givenSpecificProductFamilyWhenAppendingSbaThenProgramWtL1CachePolicy) { auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); - AllocationProperties properties(pDevice->getRootDeviceIndex(), 1, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), 1, AllocationType::BUFFER, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); IndirectHeap indirectHeap(allocation, 1); @@ -62,7 +62,7 @@ XE_HPC_CORETEST_F(CmdsProgrammingTestsXeHpcCore, givenL1CachingOverrideWhenState DebugManagerStateRestore restorer; DebugManager.flags.ForceStatelessL1CachingPolicy.set(0u); auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); - AllocationProperties properties(pDevice->getRootDeviceIndex(), 1, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), 1, AllocationType::BUFFER, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); IndirectHeap indirectHeap(allocation, 1); @@ -89,7 +89,7 @@ XE_HPC_CORETEST_F(CmdsProgrammingTestsXeHpcCore, givenL1CachingOverrideWhenState XE_HPC_CORETEST_F(CmdsProgrammingTestsXeHpcCore, whenAppendingRssThenProgramWtL1CachePolicy) { auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); size_t allocationSize = MemoryConstants::pageSize; - AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, GraphicsAllocation::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/dg2/memory_manager_tests_dg2.cpp b/opencl/test/unit_test/xe_hpg_core/dg2/memory_manager_tests_dg2.cpp index 7ba869124c..027a16cd80 100644 --- a/opencl/test/unit_test/xe_hpg_core/dg2/memory_manager_tests_dg2.cpp +++ b/opencl/test/unit_test/xe_hpg_core/dg2/memory_manager_tests_dg2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -34,7 +34,7 @@ DG2TEST_F(MemoryManagerTestsDg2, givenEnabledLocalMemoryWhenLinearStreamIsAlloca MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); MockMemoryManager memoryManager(false, true, executionEnvironment); - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::LINEAR_STREAM, mockDeviceBitfield}, nullptr); + auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::LINEAR_STREAM, 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, GraphicsAllocation::AllocationType::LINEAR_STREAM, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::LINEAR_STREAM, 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, GraphicsAllocation::AllocationType::LINEAR_STREAM, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::LINEAR_STREAM, 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, GraphicsAllocation::AllocationType::KERNEL_ISA, mockDeviceBitfield}, nullptr); + auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::KERNEL_ISA, 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, GraphicsAllocation::AllocationType::KERNEL_ISA, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::KERNEL_ISA, 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, GraphicsAllocation::AllocationType::RING_BUFFER, 1}; + AllocationProperties properties{0, 0x10000u, AllocationType::RING_BUFFER, 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, GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER, 1}; + AllocationProperties properties{0, 0x1000u, AllocationType::SEMAPHORE_BUFFER, 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, GraphicsAllocation::AllocationType::CONSTANT_SURFACE, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::CONSTANT_SURFACE, 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, GraphicsAllocation::AllocationType::PRINTF_SURFACE, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::PRINTF_SURFACE, 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, GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, mockDeviceBitfield}; + AllocationProperties properties{mockRootDeviceIndex, 1, AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); EXPECT_TRUE(allocData.flags.useSystemMemory); } 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 4a68b16c13..9ce54b922b 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -43,7 +43,7 @@ DG2TEST_F(CmdsProgrammingTestsDg2, givenL3ToL1DebugFlagWhenStatelessMocsIsProgra DG2TEST_F(CmdsProgrammingTestsDg2, givenSpecificProductFamilyWhenAppendingSbaThenProgramWtL1CachePolicy) { auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); - AllocationProperties properties(pDevice->getRootDeviceIndex(), 1, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), 1, AllocationType::BUFFER, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); IndirectHeap indirectHeap(allocation, 1); @@ -63,7 +63,7 @@ DG2TEST_F(CmdsProgrammingTestsDg2, givenL1CachingOverrideWhenStateBaseAddressIsP DebugManagerStateRestore restorer; DebugManager.flags.ForceStatelessL1CachingPolicy.set(0u); auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); - AllocationProperties properties(pDevice->getRootDeviceIndex(), 1, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), 1, AllocationType::BUFFER, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); IndirectHeap indirectHeap(allocation, 1); @@ -90,7 +90,7 @@ DG2TEST_F(CmdsProgrammingTestsDg2, givenL1CachingOverrideWhenStateBaseAddressIsP DG2TEST_F(CmdsProgrammingTestsDg2, whenAppendingRssThenProgramWtL1CachePolicy) { auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); size_t allocationSize = MemoryConstants::pageSize; - AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, GraphicsAllocation::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 5c923bcb12..af98b0da4d 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -45,7 +45,7 @@ XE_HPG_CORETEST_F(CmdsProgrammingTestsXeHpgCore, givenL3ToL1DebugFlagWhenStatele XE_HPG_CORETEST_F(CmdsProgrammingTestsXeHpgCore, givenSpecificProductFamilyWhenAppendingSbaThenProgramWtL1CachePolicy) { auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); - AllocationProperties properties(pDevice->getRootDeviceIndex(), 1, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), 1, AllocationType::BUFFER, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); IndirectHeap indirectHeap(allocation, 1); @@ -65,7 +65,7 @@ XE_HPG_CORETEST_F(CmdsProgrammingTestsXeHpgCore, givenL1CachingOverrideWhenState DebugManagerStateRestore restorer; DebugManager.flags.ForceStatelessL1CachingPolicy.set(0u); auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); - AllocationProperties properties(pDevice->getRootDeviceIndex(), 1, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), 1, AllocationType::BUFFER, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); IndirectHeap indirectHeap(allocation, 1); @@ -92,7 +92,7 @@ XE_HPG_CORETEST_F(CmdsProgrammingTestsXeHpgCore, givenL1CachingOverrideWhenState XE_HPG_CORETEST_F(CmdsProgrammingTestsXeHpgCore, whenAppendingRssThenProgramWtL1CachePolicy) { auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); size_t allocationSize = MemoryConstants::pageSize; - AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, GraphicsAllocation::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/aub/aub_helper.h b/shared/source/aub/aub_helper.h index 490a7e2c54..7042085af9 100644 --- a/shared/source/aub/aub_helper.h +++ b/shared/source/aub/aub_helper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,23 +15,23 @@ namespace NEO { class AubHelper : public NonCopyableOrMovableClass { public: - static bool isOneTimeAubWritableAllocationType(const GraphicsAllocation::AllocationType &type) { + static bool isOneTimeAubWritableAllocationType(const AllocationType &type) { switch (type) { - case GraphicsAllocation::AllocationType::PIPE: - case GraphicsAllocation::AllocationType::CONSTANT_SURFACE: - case GraphicsAllocation::AllocationType::GLOBAL_SURFACE: - case GraphicsAllocation::AllocationType::KERNEL_ISA: - case GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL: - case GraphicsAllocation::AllocationType::PRIVATE_SURFACE: - case GraphicsAllocation::AllocationType::SCRATCH_SURFACE: - case GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE: - case GraphicsAllocation::AllocationType::BUFFER: - case GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY: - case GraphicsAllocation::AllocationType::IMAGE: - case GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: - case GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR: - case GraphicsAllocation::AllocationType::MAP_ALLOCATION: - case GraphicsAllocation::AllocationType::SVM_GPU: + 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: 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 145f0ae60e..e54f0169d4 100644 --- a/shared/source/aub_mem_dump/aub_alloc_dump.h +++ b/shared/source/aub_mem_dump/aub_alloc_dump.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -29,16 +29,16 @@ enum DumpFormat { }; inline bool isWritableBuffer(GraphicsAllocation &gfxAllocation) { - return (gfxAllocation.getAllocationType() == GraphicsAllocation::AllocationType::BUFFER || - gfxAllocation.getAllocationType() == GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY || - gfxAllocation.getAllocationType() == GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR || - gfxAllocation.getAllocationType() == GraphicsAllocation::AllocationType::MAP_ALLOCATION || - gfxAllocation.getAllocationType() == GraphicsAllocation::AllocationType::SVM_GPU) && + 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) && gfxAllocation.isMemObjectsAllocationWithWritableFlags(); } inline bool isWritableImage(GraphicsAllocation &gfxAllocation) { - return (gfxAllocation.getAllocationType() == GraphicsAllocation::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 effd787b10..d3f0cea75f 100644 --- a/shared/source/built_ins/built_ins.cpp +++ b/shared/source/built_ins/built_ins.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -43,7 +43,7 @@ const SipKernel &BuiltIns::getSipKernel(SipKernelType type, Device &device) { UNRECOVERABLE_IF(ret != TranslationOutput::ErrorCode::Success); UNRECOVERABLE_IF(sipBinary.size() == 0); - const auto allocType = GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL; + const auto allocType = AllocationType::KERNEL_ISA_INTERNAL; AllocationProperties properties = {device.getRootDeviceIndex(), sipBinary.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 ec8e60d2ad..83e0d42721 100644 --- a/shared/source/built_ins/sip.cpp +++ b/shared/source/built_ins/sip.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -124,7 +124,7 @@ bool SipKernel::initRawBinaryFromFileKernel(SipKernelType type, Device &device, void *alignedBuffer = alignedMalloc(bytesRead, MemoryConstants::pageSize); memcpy_s(alignedBuffer, bytesRead, fileData.data(), bytesRead); - const auto allocType = GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL; + const auto allocType = AllocationType::KERNEL_ISA_INTERNAL; AllocationProperties properties = {rootDeviceIndex, bytesRead, allocType, device.getDeviceBitfield()}; properties.flags.use32BitFrontWindow = false; @@ -188,7 +188,7 @@ bool SipKernel::initHexadecimalArraySipKernel(SipKernelType type, Device &device auto &hwInfo = device.getHardwareInfo(); auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); hwHelper.setSipKernelData(sipKernelBinary, kernelBinarySize); - const auto allocType = GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL; + const auto allocType = AllocationType::KERNEL_ISA_INTERNAL; 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 af44372761..3cd36de76b 100644 --- a/shared/source/command_container/cmdcontainer.cpp +++ b/shared/source/command_container/cmdcontainer.cpp @@ -35,7 +35,7 @@ CommandContainer::~CommandContainer() { } } for (auto deallocation : deallocationContainer) { - if (((deallocation->getAllocationType() == GraphicsAllocation::AllocationType::INTERNAL_HEAP) || (deallocation->getAllocationType() == GraphicsAllocation::AllocationType::LINEAR_STREAM))) { + if (((deallocation->getAllocationType() == AllocationType::INTERNAL_HEAP) || (deallocation->getAllocationType() == AllocationType::LINEAR_STREAM))) { getHeapHelper()->storeHeapAllocation(deallocation); } } @@ -243,13 +243,13 @@ GraphicsAllocation *CommandContainer::obtainNextCommandBufferAllocation() { GraphicsAllocation *cmdBufferAllocation = nullptr; if (this->reusableAllocationList) { - cmdBufferAllocation = this->reusableAllocationList->detachAllocation(alignedSize, nullptr, nullptr, GraphicsAllocation::AllocationType::COMMAND_BUFFER).release(); + cmdBufferAllocation = this->reusableAllocationList->detachAllocation(alignedSize, nullptr, nullptr, AllocationType::COMMAND_BUFFER).release(); } if (!cmdBufferAllocation) { AllocationProperties properties{device->getRootDeviceIndex(), true /* allocateMemory*/, alignedSize, - GraphicsAllocation::AllocationType::COMMAND_BUFFER, + AllocationType::COMMAND_BUFFER, (device->getNumGenericSubDevices() > 1u) /* multiOsContextCapable */, false, device->getDeviceBitfield()}; 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 ecec97504f..6d0b3c90da 100644 --- a/shared/source/command_container/command_encoder_xehp_and_later.inl +++ b/shared/source/command_container/command_encoder_xehp_and_later.inl @@ -588,7 +588,7 @@ void EncodeSurfaceState::encodeExtraBufferParams(EncodeSurfaceStateArgs uint32_t compressionFormat = 0; bool setConstCachePolicy = false; - if (args.allocation && args.allocation->getAllocationType() == GraphicsAllocation::AllocationType::CONSTANT_SURFACE) { + if (args.allocation && args.allocation->getAllocationType() == AllocationType::CONSTANT_SURFACE) { 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 8c33abcd65..16a7466fff 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 @@ -687,7 +687,7 @@ bool AUBCommandStreamReceiverHw::writeMemory(GraphicsAllocation &gfxA template bool AUBCommandStreamReceiverHw::writeMemory(AllocationView &allocationView) { - GraphicsAllocation gfxAllocation(this->rootDeviceIndex, GraphicsAllocation::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 c02c87b00a..40769b860e 100644 --- a/shared/source/command_stream/command_stream_receiver.cpp +++ b/shared/source/command_stream/command_stream_receiver.cpp @@ -180,7 +180,7 @@ void CommandStreamReceiver::ensureCommandBufferAllocation(LinearStream &commandS } const auto allocationSize = alignUp(minimumRequiredSize + additionalAllocationSize, MemoryConstants::pageSize64k); - constexpr static auto allocationType = GraphicsAllocation::AllocationType::COMMAND_BUFFER; + constexpr static auto allocationType = AllocationType::COMMAND_BUFFER; auto allocation = this->getInternalAllocationStorage()->obtainReusableAllocation(allocationSize, allocationType).release(); if (allocation == nullptr) { const AllocationProperties commandStreamAllocationProperties{rootDeviceIndex, true, allocationSize, allocationType, @@ -368,7 +368,7 @@ MultiGraphicsAllocation &CommandStreamReceiver::createTagsMultiAllocation() { auto maxRootDeviceIndex = *std::max_element(rootDeviceIndices.begin(), rootDeviceIndices.end(), std::less()); auto allocations = new MultiGraphicsAllocation(maxRootDeviceIndex); - AllocationProperties unifiedMemoryProperties{rootDeviceIndices.at(0), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::TAG_BUFFER, systemMemoryBitfield}; + AllocationProperties unifiedMemoryProperties{rootDeviceIndices.at(0), MemoryConstants::pageSize, AllocationType::TAG_BUFFER, systemMemoryBitfield}; this->getMemoryManager()->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, unifiedMemoryProperties, *allocations); return *allocations; @@ -437,7 +437,7 @@ void CommandStreamReceiver::startControllingDirectSubmissions() { GraphicsAllocation *CommandStreamReceiver::allocateDebugSurface(size_t size) { UNRECOVERABLE_IF(debugSurface != nullptr); - debugSurface = getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, size, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, getOsContext().getDeviceBitfield()}); + debugSurface = getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, size, AllocationType::INTERNAL_HOST_MEMORY, getOsContext().getDeviceBitfield()}); return debugSurface; } @@ -478,9 +478,9 @@ void CommandStreamReceiver::allocateHeapMemory(IndirectHeap::Type heapType, minRequiredSize += reservedSize; finalHeapSize = alignUp(std::max(finalHeapSize, minRequiredSize), MemoryConstants::pageSize); - auto allocationType = GraphicsAllocation::AllocationType::LINEAR_STREAM; + auto allocationType = AllocationType::LINEAR_STREAM; if (requireInternalHeap) { - allocationType = GraphicsAllocation::AllocationType::INTERNAL_HEAP; + allocationType = AllocationType::INTERNAL_HEAP; } auto heapMemory = internalAllocationStorage->obtainReusableAllocation(finalHeapSize, allocationType).release(); @@ -608,7 +608,7 @@ bool CommandStreamReceiver::createWorkPartitionAllocation(const Device &device) } UNRECOVERABLE_IF(device.getNumGenericSubDevices() < 2); - AllocationProperties properties{this->rootDeviceIndex, true, 4096u, GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE, true, false, deviceBitfield}; + AllocationProperties properties{this->rootDeviceIndex, true, 4096u, AllocationType::WORK_PARTITION_SURFACE, true, false, deviceBitfield}; this->workPartitionAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); if (this->workPartitionAllocation == nullptr) { return false; @@ -640,7 +640,7 @@ bool CommandStreamReceiver::createGlobalFenceAllocation() { } DEBUG_BREAK_IF(this->globalFenceAllocation != nullptr); - this->globalFenceAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::GLOBAL_FENCE, osContext->getDeviceBitfield()}); + this->globalFenceAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize, AllocationType::GLOBAL_FENCE, osContext->getDeviceBitfield()}); return this->globalFenceAllocation != nullptr; } @@ -650,7 +650,7 @@ bool CommandStreamReceiver::createPreemptionAllocation() { if (DebugManager.flags.OverrideCsrAllocationSize.get() > 0) { preemptionSurfaceSize = DebugManager.flags.OverrideCsrAllocationSize.get(); } - AllocationProperties properties{rootDeviceIndex, true, preemptionSurfaceSize, GraphicsAllocation::AllocationType::PREEMPTION, isMultiOsContextCapable(), false, deviceBitfield}; + AllocationProperties properties{rootDeviceIndex, true, preemptionSurfaceSize, AllocationType::PREEMPTION, isMultiOsContextCapable(), false, deviceBitfield}; properties.flags.uncacheable = hwInfo->workaroundTable.flags.waCSRUncachable; properties.alignment = HwHelper::get(hwInfo->platform.eRenderCoreFamily).getPreemptionAllocationAlignment(); this->preemptionAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); @@ -668,13 +668,13 @@ AllocationsList &CommandStreamReceiver::getAllocationsForReuse() { return intern bool CommandStreamReceiver::createAllocationForHostSurface(HostPtrSurface &surface, bool requiresL3Flush) { std::unique_lock lock = this->obtainHostPtrSurfaceCreationLock(); - auto allocation = internalAllocationStorage->obtainTemporaryAllocationWithPtr(surface.getSurfaceSize(), surface.getMemoryPointer(), GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR); + auto allocation = internalAllocationStorage->obtainTemporaryAllocationWithPtr(surface.getSurfaceSize(), surface.getMemoryPointer(), AllocationType::EXTERNAL_HOST_PTR); if (allocation == nullptr) { auto memoryManager = getMemoryManager(); AllocationProperties properties{rootDeviceIndex, false, // allocateMemory - surface.getSurfaceSize(), GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, + surface.getSurfaceSize(), AllocationType::EXTERNAL_HOST_PTR, false, // isMultiStorageAllocation osContext->getDeviceBitfield()}; properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = requiresL3Flush; 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 a60e0e9b62..2fed6d39e9 100644 --- a/shared/source/command_stream/command_stream_receiver_simulated_hw.h +++ b/shared/source/command_stream/command_stream_receiver_simulated_hw.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -100,7 +100,7 @@ class CommandStreamReceiverSimulatedHw : public CommandStreamReceiverSimulatedCo void *cpuAddress; size_t size; this->getParametersForWriteMemory(graphicsAllocation, gpuAddress, cpuAddress, size); - int hint = graphicsAllocation.getAllocationType() == GraphicsAllocation::AllocationType::COMMAND_BUFFER + int hint = graphicsAllocation.getAllocationType() == AllocationType::COMMAND_BUFFER ? 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 33b3fd755e..8ffe4c0382 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-2020 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -26,9 +26,9 @@ ExperimentalCommandBuffer::ExperimentalCommandBuffer(CommandStreamReceiver *csr, defaultPrint(true), timerResolution(profilingTimerResolution) { auto rootDeviceIndex = csr->getRootDeviceIndex(); - timestamps = csr->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, csr->getOsContext().getDeviceBitfield()}); + timestamps = csr->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize, AllocationType::INTERNAL_HOST_MEMORY, csr->getOsContext().getDeviceBitfield()}); memset(timestamps->getUnderlyingBuffer(), 0, timestamps->getUnderlyingBufferSize()); - experimentalAllocation = csr->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, csr->getOsContext().getDeviceBitfield()}); + experimentalAllocation = csr->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize, AllocationType::INTERNAL_HOST_MEMORY, 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 9c86e88633..d77d20de3e 100644 --- a/shared/source/command_stream/scratch_space_controller_base.cpp +++ b/shared/source/command_stream/scratch_space_controller_base.cpp @@ -47,7 +47,7 @@ void ScratchSpaceControllerBase::setRequiredScratchSpace(void *sshBaseAddress, } void ScratchSpaceControllerBase::createScratchSpaceAllocation() { - scratchAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, scratchSizeBytes, GraphicsAllocation::AllocationType::SCRATCH_SURFACE, this->csrAllocationStorage.getDeviceBitfield()}); + scratchAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, scratchSizeBytes, AllocationType::SCRATCH_SURFACE, 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 b8300d31f8..78d1ad92e7 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 @@ -169,7 +169,7 @@ void ScratchSpaceControllerXeHPAndLater::prepareScratchAllocation(uint32_t requi scratchSurfaceDirty = true; scratchSizeBytes = requiredScratchSizeInBytes; perThreadScratchSize = requiredPerThreadScratchSizeAlignedUp; - AllocationProperties properties{this->rootDeviceIndex, true, scratchSizeBytes, GraphicsAllocation::AllocationType::SCRATCH_SURFACE, multiTileCapable, false, osContext.getDeviceBitfield()}; + AllocationProperties properties{this->rootDeviceIndex, true, scratchSizeBytes, AllocationType::SCRATCH_SURFACE, multiTileCapable, false, osContext.getDeviceBitfield()}; scratchAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); } if (privateScratchSpaceSupported) { @@ -183,7 +183,7 @@ void ScratchSpaceControllerXeHPAndLater::prepareScratchAllocation(uint32_t requi privateScratchSizeBytes = requiredPrivateScratchSizeInBytes; perThreadPrivateScratchSize = requiredPerThreadPrivateScratchSizeAlignedUp; scratchSurfaceDirty = true; - AllocationProperties properties{this->rootDeviceIndex, true, privateScratchSizeBytes, GraphicsAllocation::AllocationType::PRIVATE_SURFACE, multiTileCapable, false, osContext.getDeviceBitfield()}; + AllocationProperties properties{this->rootDeviceIndex, true, privateScratchSizeBytes, AllocationType::PRIVATE_SURFACE, multiTileCapable, false, osContext.getDeviceBitfield()}; privateScratchAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); } } diff --git a/shared/source/device/device.cpp b/shared/source/device/device.cpp index e015803b81..86b6d9b063 100644 --- a/shared/source/device/device.cpp +++ b/shared/source/device/device.cpp @@ -632,7 +632,7 @@ GraphicsAllocation *Device::getRTDispatchGlobals(uint32_t maxBvhLevels) { void Device::initializeRayTracing(uint32_t maxBvhLevels) { if (rtMemoryBackedBuffer == nullptr) { auto size = RayTracingHelper::getTotalMemoryBackedFifoSize(*this); - rtMemoryBackedBuffer = getMemoryManager()->allocateGraphicsMemoryWithProperties({getRootDeviceIndex(), size, GraphicsAllocation::AllocationType::BUFFER, getDeviceBitfield()}); + rtMemoryBackedBuffer = getMemoryManager()->allocateGraphicsMemoryWithProperties({getRootDeviceIndex(), size, AllocationType::BUFFER, getDeviceBitfield()}); } while (rtDispatchGlobals.size() <= maxBvhLevels) { diff --git a/shared/source/direct_submission/direct_submission_hw.inl b/shared/source/direct_submission/direct_submission_hw.inl index 116ff4a9f0..e69db14440 100644 --- a/shared/source/direct_submission/direct_submission_hw.inl +++ b/shared/source/direct_submission/direct_submission_hw.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -65,7 +65,7 @@ bool DirectSubmissionHw::allocateResources() { const auto allocationSize = alignUp(minimumRequiredSize + additionalAllocationSize, MemoryConstants::pageSize64k); const AllocationProperties commandStreamAllocationProperties{device.getRootDeviceIndex(), true, allocationSize, - GraphicsAllocation::AllocationType::RING_BUFFER, + AllocationType::RING_BUFFER, isMultiOsContextCapable, osContext.getDeviceBitfield()}; ringBuffer = memoryManager->allocateGraphicsMemoryWithProperties(commandStreamAllocationProperties); UNRECOVERABLE_IF(ringBuffer == nullptr); @@ -77,7 +77,7 @@ bool DirectSubmissionHw::allocateResources() { const AllocationProperties semaphoreAllocationProperties{device.getRootDeviceIndex(), true, MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER, + AllocationType::SEMAPHORE_BUFFER, isMultiOsContextCapable, osContext.getDeviceBitfield()}; semaphores = memoryManager->allocateGraphicsMemoryWithProperties(semaphoreAllocationProperties); UNRECOVERABLE_IF(semaphores == nullptr); diff --git a/shared/source/gen12lp/command_encoder_gen12lp.cpp b/shared/source/gen12lp/command_encoder_gen12lp.cpp index c121a997d5..2d48cc3e3d 100644 --- a/shared/source/gen12lp/command_encoder_gen12lp.cpp +++ b/shared/source/gen12lp/command_encoder_gen12lp.cpp @@ -67,7 +67,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() == GraphicsAllocation::AllocationType::CONSTANT_SURFACE; + const bool isConstantSurface = args.allocation && args.allocation->getAllocationType() == AllocationType::CONSTANT_SURFACE; bool useL1 = args.isReadOnly || isConstantSurface; if (DebugManager.flags.ForceL1Caching.get() != 1) { diff --git a/shared/source/gen12lp/hw_helper_gen12lp.cpp b/shared/source/gen12lp/hw_helper_gen12lp.cpp index 01553de6a8..1fdeb6ca0d 100644 --- a/shared/source/gen12lp/hw_helper_gen12lp.cpp +++ b/shared/source/gen12lp/hw_helper_gen12lp.cpp @@ -180,7 +180,7 @@ void HwHelperHw::setExtraAllocationData(AllocationData &allocationData, } } if (HwInfoConfig::get(hwInfo.platform.eProductFamily)->isStorageInfoAdjustmentRequired()) { - if (properties.allocationType == GraphicsAllocation::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/helpers/app_resource_helper.cpp b/shared/source/helpers/app_resource_helper.cpp index ccabb80540..200d1f3fed 100644 --- a/shared/source/helpers/app_resource_helper.cpp +++ b/shared/source/helpers/app_resource_helper.cpp @@ -13,104 +13,104 @@ namespace NEO { -void AppResourceHelper::copyResourceTagStr(char *dst, GraphicsAllocation::AllocationType type, size_t size) { +void AppResourceHelper::copyResourceTagStr(char *dst, AllocationType type, size_t size) { if (DebugManager.flags.EnableResourceTags.get()) { auto tag = getResourceTagStr(type); strcpy_s(dst, size, tag); } } -const char *AppResourceHelper::getResourceTagStr(GraphicsAllocation::AllocationType type) { +const char *AppResourceHelper::getResourceTagStr(AllocationType type) { switch (type) { - case GraphicsAllocation::AllocationType::UNKNOWN: + case AllocationType::UNKNOWN: return "UNKNOWN"; - case GraphicsAllocation::AllocationType::BUFFER: + case AllocationType::BUFFER: return "BUFFER"; - case GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY: + case AllocationType::BUFFER_HOST_MEMORY: return "BFHSTMEM"; - case GraphicsAllocation::AllocationType::COMMAND_BUFFER: + case AllocationType::COMMAND_BUFFER: return "CMNDBUFF"; - case GraphicsAllocation::AllocationType::CONSTANT_SURFACE: + case AllocationType::CONSTANT_SURFACE: return "CSNTSRFC"; - case GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR: + case AllocationType::EXTERNAL_HOST_PTR: return "EXHSTPTR"; - case GraphicsAllocation::AllocationType::FILL_PATTERN: + case AllocationType::FILL_PATTERN: return "FILPATRN"; - case GraphicsAllocation::AllocationType::GLOBAL_SURFACE: + case AllocationType::GLOBAL_SURFACE: return "GLBLSRFC"; - case GraphicsAllocation::AllocationType::IMAGE: + case AllocationType::IMAGE: return "IMAGE"; - case GraphicsAllocation::AllocationType::INDIRECT_OBJECT_HEAP: + case AllocationType::INDIRECT_OBJECT_HEAP: return "INOBHEAP"; - case GraphicsAllocation::AllocationType::INSTRUCTION_HEAP: + case AllocationType::INSTRUCTION_HEAP: return "INSTHEAP"; - case GraphicsAllocation::AllocationType::INTERNAL_HEAP: + case AllocationType::INTERNAL_HEAP: return "INTLHEAP"; - case GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY: + case AllocationType::INTERNAL_HOST_MEMORY: return "INHSTMEM"; - case GraphicsAllocation::AllocationType::KERNEL_ISA: + case AllocationType::KERNEL_ISA: return "KERNLISA"; - case GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL: + case AllocationType::KERNEL_ISA_INTERNAL: return "KRLISAIN"; - case GraphicsAllocation::AllocationType::LINEAR_STREAM: + case AllocationType::LINEAR_STREAM: return "LINRSTRM"; - case GraphicsAllocation::AllocationType::MAP_ALLOCATION: + case AllocationType::MAP_ALLOCATION: return "MAPALLOC"; - case GraphicsAllocation::AllocationType::MCS: + case AllocationType::MCS: return "MCS"; - case GraphicsAllocation::AllocationType::PIPE: + case AllocationType::PIPE: return "PIPE"; - case GraphicsAllocation::AllocationType::PREEMPTION: + case AllocationType::PREEMPTION: return "PRMPTION"; - case GraphicsAllocation::AllocationType::PRINTF_SURFACE: + case AllocationType::PRINTF_SURFACE: return "PRNTSRFC"; - case GraphicsAllocation::AllocationType::PRIVATE_SURFACE: + case AllocationType::PRIVATE_SURFACE: return "PRVTSRFC"; - case GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER: + case AllocationType::PROFILING_TAG_BUFFER: return "PROFTGBF"; - case GraphicsAllocation::AllocationType::SCRATCH_SURFACE: + case AllocationType::SCRATCH_SURFACE: return "SCRHSRFC"; - case GraphicsAllocation::AllocationType::SHARED_BUFFER: + case AllocationType::SHARED_BUFFER: return "SHRDBUFF"; - case GraphicsAllocation::AllocationType::SHARED_CONTEXT_IMAGE: + case AllocationType::SHARED_CONTEXT_IMAGE: return "SRDCXIMG"; - case GraphicsAllocation::AllocationType::SHARED_IMAGE: + case AllocationType::SHARED_IMAGE: return "SHERDIMG"; - case GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY: + case AllocationType::SHARED_RESOURCE_COPY: return "SRDRSCCP"; - case GraphicsAllocation::AllocationType::SURFACE_STATE_HEAP: + case AllocationType::SURFACE_STATE_HEAP: return "SRFCSTHP"; - case GraphicsAllocation::AllocationType::SVM_CPU: + case AllocationType::SVM_CPU: return "SVM_CPU"; - case GraphicsAllocation::AllocationType::SVM_GPU: + case AllocationType::SVM_GPU: return "SVM_GPU"; - case GraphicsAllocation::AllocationType::SVM_ZERO_COPY: + case AllocationType::SVM_ZERO_COPY: return "SVM0COPY"; - case GraphicsAllocation::AllocationType::TAG_BUFFER: + case AllocationType::TAG_BUFFER: return "TAGBUFER"; - case GraphicsAllocation::AllocationType::GLOBAL_FENCE: + case AllocationType::GLOBAL_FENCE: return "GLBLFENC"; - case GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: + case AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: return "TSPKTGBF"; - case GraphicsAllocation::AllocationType::WRITE_COMBINED: + case AllocationType::WRITE_COMBINED: return "WRTCMBND"; - case GraphicsAllocation::AllocationType::RING_BUFFER: + case AllocationType::RING_BUFFER: return "RINGBUFF"; - case GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER: + case AllocationType::SEMAPHORE_BUFFER: return "SMPHRBUF"; - case GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA: + case AllocationType::DEBUG_CONTEXT_SAVE_AREA: return "DBCXSVAR"; - case GraphicsAllocation::AllocationType::DEBUG_SBA_TRACKING_BUFFER: + case AllocationType::DEBUG_SBA_TRACKING_BUFFER: return "DBSBATRB"; - case GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA: + case AllocationType::DEBUG_MODULE_AREA: return "DBMDLARE"; - case GraphicsAllocation::AllocationType::UNIFIED_SHARED_MEMORY: + case AllocationType::UNIFIED_SHARED_MEMORY: return "USHRDMEM"; - case GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE: + case AllocationType::WORK_PARTITION_SURFACE: return "WRPRTSRF"; - case GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: + case AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: return "GPUTSDBF"; - case GraphicsAllocation::AllocationType::SW_TAG_BUFFER: + case AllocationType::SW_TAG_BUFFER: return "SWTAGBF"; default: return "NOTFOUND"; diff --git a/shared/source/helpers/app_resource_helper.h b/shared/source/helpers/app_resource_helper.h index 3e393ee0ef..657ab3b1da 100644 --- a/shared/source/helpers/app_resource_helper.h +++ b/shared/source/helpers/app_resource_helper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -10,8 +10,8 @@ namespace NEO { struct AppResourceHelper { public: - static const char *getResourceTagStr(GraphicsAllocation::AllocationType type); - static void copyResourceTagStr(char *dst, GraphicsAllocation::AllocationType type, size_t size); + static const char *getResourceTagStr(AllocationType type); + static void copyResourceTagStr(char *dst, AllocationType type, size_t size); }; } // namespace NEO diff --git a/shared/source/helpers/bindless_heaps_helper.cpp b/shared/source/helpers/bindless_heaps_helper.cpp index 8b99906d67..5114db535a 100644 --- a/shared/source/helpers/bindless_heaps_helper.cpp +++ b/shared/source/helpers/bindless_heaps_helper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -43,7 +43,7 @@ BindlessHeapsHelper::~BindlessHeapsHelper() { } GraphicsAllocation *BindlessHeapsHelper::getHeapAllocation(size_t heapSize, size_t alignment, bool allocInFrontWindow) { - auto allocationType = GraphicsAllocation::AllocationType::LINEAR_STREAM; + auto allocationType = AllocationType::LINEAR_STREAM; NEO::AllocationProperties properties{rootDeviceIndex, true, heapSize, allocationType, isMultiOsContextCapable, deviceBitfield}; properties.flags.use32BitFrontWindow = allocInFrontWindow; properties.alignment = alignment; diff --git a/shared/source/helpers/extra_allocation_data_xehp_and_later.inl b/shared/source/helpers/extra_allocation_data_xehp_and_later.inl index eabd24ef70..f748f3d569 100644 --- a/shared/source/helpers/extra_allocation_data_xehp_and_later.inl +++ b/shared/source/helpers/extra_allocation_data_xehp_and_later.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -16,12 +16,12 @@ void HwHelperHw::setExtraAllocationData(AllocationData &allocationData, const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); if (LocalMemoryAccessMode::CpuAccessDisallowed == hwInfoConfig.getLocalMemoryAccessMode(hwInfo)) { - if (properties.allocationType == GraphicsAllocation::AllocationType::LINEAR_STREAM || - properties.allocationType == GraphicsAllocation::AllocationType::INTERNAL_HEAP || - properties.allocationType == GraphicsAllocation::AllocationType::PRINTF_SURFACE || - properties.allocationType == GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER || - properties.allocationType == GraphicsAllocation::AllocationType::RING_BUFFER || - properties.allocationType == GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER) { + if (properties.allocationType == AllocationType::LINEAR_STREAM || + properties.allocationType == AllocationType::INTERNAL_HEAP || + properties.allocationType == AllocationType::PRINTF_SURFACE || + properties.allocationType == AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER || + properties.allocationType == AllocationType::RING_BUFFER || + properties.allocationType == AllocationType::SEMAPHORE_BUFFER) { allocationData.flags.useSystemMemory = true; } if (!allocationData.flags.useSystemMemory) { @@ -31,9 +31,9 @@ void HwHelperHw::setExtraAllocationData(AllocationData &allocationData, } if (hwInfoConfig.allowStatelessCompression(hwInfo)) { - if (properties.allocationType == GraphicsAllocation::AllocationType::GLOBAL_SURFACE || - properties.allocationType == GraphicsAllocation::AllocationType::CONSTANT_SURFACE || - properties.allocationType == GraphicsAllocation::AllocationType::PRINTF_SURFACE) { + if (properties.allocationType == AllocationType::GLOBAL_SURFACE || + properties.allocationType == AllocationType::CONSTANT_SURFACE || + properties.allocationType == AllocationType::PRINTF_SURFACE) { allocationData.flags.requiresCpuAccess = false; allocationData.storageInfo.isLockable = false; } diff --git a/shared/source/helpers/flat_batch_buffer_helper_hw.inl b/shared/source/helpers/flat_batch_buffer_helper_hw.inl index f7d3eb58ea..48f0184642 100644 --- a/shared/source/helpers/flat_batch_buffer_helper_hw.inl +++ b/shared/source/helpers/flat_batch_buffer_helper_hw.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -33,7 +33,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, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, deviceBitfield); + AllocationProperties flatBatchBufferProperties(rootDeviceIndex, alignedMainBatchBufferSize, AllocationType::INTERNAL_HOST_MEMORY, deviceBitfield); flatBatchBufferProperties.alignment = MemoryConstants::pageSize; flatBatchBuffer = getMemoryManager()->allocateGraphicsMemoryWithProperties(flatBatchBufferProperties); @@ -111,7 +111,7 @@ GraphicsAllocation *FlatBatchBufferHelperHw::flattenBatchBuffer(uint3 flatBatchBufferSize = alignUp(flatBatchBufferSize, MemoryConstants::pageSize); flatBatchBufferSize += CSRequirements::csOverfetchSize; - AllocationProperties flatBatchBufferProperties(rootDeviceIndex, static_cast(flatBatchBufferSize), GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, deviceBitfield); + AllocationProperties flatBatchBufferProperties(rootDeviceIndex, static_cast(flatBatchBufferSize), AllocationType::INTERNAL_HOST_MEMORY, 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 fb1edaa2b2..dc2ab0decb 100644 --- a/shared/source/helpers/heap_assigner.cpp +++ b/shared/source/helpers/heap_assigner.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -16,22 +16,22 @@ namespace NEO { HeapAssigner::HeapAssigner() { apiAllowExternalHeapForSshAndDsh = ApiSpecificConfig::getHeapConfiguration(); } -bool HeapAssigner::useInternal32BitHeap(GraphicsAllocation::AllocationType allocType) { +bool HeapAssigner::useInternal32BitHeap(AllocationType allocType) { return GraphicsAllocation::isIsaAllocationType(allocType) || - allocType == GraphicsAllocation::AllocationType::INTERNAL_HEAP; + allocType == AllocationType::INTERNAL_HEAP; } -bool HeapAssigner::use32BitHeap(GraphicsAllocation::AllocationType allocType) { +bool HeapAssigner::use32BitHeap(AllocationType allocType) { return useExternal32BitHeap(allocType) || useInternal32BitHeap(allocType); } -HeapIndex HeapAssigner::get32BitHeapIndex(GraphicsAllocation::AllocationType allocType, bool useLocalMem, const HardwareInfo &hwInfo, bool useFrontWindow) { +HeapIndex HeapAssigner::get32BitHeapIndex(AllocationType allocType, bool useLocalMem, const HardwareInfo &hwInfo, bool useFrontWindow) { if (useInternal32BitHeap(allocType)) { return useFrontWindow ? mapInternalWindowIndex(MemoryManager::selectInternalHeap(useLocalMem)) : MemoryManager::selectInternalHeap(useLocalMem); } return useFrontWindow ? mapExternalWindowIndex(MemoryManager::selectExternalHeap(useLocalMem)) : MemoryManager::selectExternalHeap(useLocalMem); } -bool HeapAssigner::useExternal32BitHeap(GraphicsAllocation::AllocationType allocType) { +bool HeapAssigner::useExternal32BitHeap(AllocationType allocType) { if (apiAllowExternalHeapForSshAndDsh) { - return allocType == GraphicsAllocation::AllocationType::LINEAR_STREAM; + return allocType == AllocationType::LINEAR_STREAM; } return false; } diff --git a/shared/source/helpers/heap_assigner.h b/shared/source/helpers/heap_assigner.h index 04cb2dec3a..3b50892df5 100644 --- a/shared/source/helpers/heap_assigner.h +++ b/shared/source/helpers/heap_assigner.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -13,10 +13,10 @@ struct HardwareInfo; struct HeapAssigner { HeapAssigner(); ~HeapAssigner() = default; - bool useExternal32BitHeap(GraphicsAllocation::AllocationType allocType); - bool useInternal32BitHeap(GraphicsAllocation::AllocationType allocType); - bool use32BitHeap(GraphicsAllocation::AllocationType allocType); - HeapIndex get32BitHeapIndex(GraphicsAllocation::AllocationType allocType, bool useLocalMem, const HardwareInfo &hwInfo, bool useFrontWindow); + bool useExternal32BitHeap(AllocationType allocType); + bool useInternal32BitHeap(AllocationType allocType); + bool use32BitHeap(AllocationType allocType); + HeapIndex get32BitHeapIndex(AllocationType allocType, bool useLocalMem, const HardwareInfo &hwInfo, bool useFrontWindow); static bool heapTypeExternalWithFrontWindowPool(HeapIndex heap); static bool isInternalHeap(HeapIndex heap); diff --git a/shared/source/helpers/heap_helper.cpp b/shared/source/helpers/heap_helper.cpp index 5656b02010..f5d9a1f87c 100644 --- a/shared/source/helpers/heap_helper.cpp +++ b/shared/source/helpers/heap_helper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2020 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,9 +15,9 @@ namespace NEO { GraphicsAllocation *HeapHelper::getHeapAllocation(uint32_t heapType, size_t heapSize, size_t alignment, uint32_t rootDeviceIndex) { - auto allocationType = GraphicsAllocation::AllocationType::LINEAR_STREAM; + auto allocationType = AllocationType::LINEAR_STREAM; if (IndirectHeap::Type::INDIRECT_OBJECT == heapType) { - allocationType = GraphicsAllocation::AllocationType::INTERNAL_HEAP; + allocationType = AllocationType::INTERNAL_HEAP; } auto allocation = this->storageForReuse->obtainReusableAllocation(heapSize, allocationType); diff --git a/shared/source/helpers/memory_properties_helpers.h b/shared/source/helpers/memory_properties_helpers.h index 063825847c..1697c18ca8 100644 --- a/shared/source/helpers/memory_properties_helpers.h +++ b/shared/source/helpers/memory_properties_helpers.h @@ -23,7 +23,7 @@ class MemoryPropertiesHelper { static AllocationProperties getAllocationProperties( uint32_t rootDeviceIndex, MemoryProperties memoryProperties, bool allocateMemory, size_t size, - GraphicsAllocation::AllocationType type, bool multiStorageResource, const HardwareInfo &hwInfo, + AllocationType type, bool multiStorageResource, const HardwareInfo &hwInfo, DeviceBitfield subDevicesBitfieldParam, bool deviceOnlyVisibilty); static DeviceBitfield adjustDeviceBitfield(uint32_t rootDeviceIndex, const MemoryProperties &memoryProperties, diff --git a/shared/source/helpers/memory_properties_helpers_base.inl b/shared/source/helpers/memory_properties_helpers_base.inl index 48d1c60ff9..5595c488b0 100644 --- a/shared/source/helpers/memory_properties_helpers_base.inl +++ b/shared/source/helpers/memory_properties_helpers_base.inl @@ -12,7 +12,7 @@ namespace NEO { AllocationProperties MemoryPropertiesHelper::getAllocationProperties( uint32_t rootDeviceIndex, MemoryProperties memoryProperties, bool allocateMemory, size_t size, - GraphicsAllocation::AllocationType type, bool multiStorageResource, const HardwareInfo &hwInfo, + AllocationType type, bool multiStorageResource, const HardwareInfo &hwInfo, DeviceBitfield subDevicesBitfieldParam, bool deviceOnlyVisibilty) { auto deviceBitfield = adjustDeviceBitfield(rootDeviceIndex, memoryProperties, subDevicesBitfieldParam); diff --git a/shared/source/helpers/timestamp_packet.h b/shared/source/helpers/timestamp_packet.h index 250eec9760..997812fde5 100644 --- a/shared/source/helpers/timestamp_packet.h +++ b/shared/source/helpers/timestamp_packet.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -39,8 +39,8 @@ class TimestampPackets : public TagTypeBase { }; public: - static constexpr GraphicsAllocation::AllocationType getAllocationType() { - return GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER; + static constexpr AllocationType getAllocationType() { + return AllocationType::TIMESTAMP_PACKET_TAG_BUFFER; } static constexpr TagNodeType getTagNodeType() { return TagNodeType::TimestampPacket; } diff --git a/shared/source/memory_manager/CMakeLists.txt b/shared/source/memory_manager/CMakeLists.txt index 2bdbdc69f1..8f7323b0e3 100644 --- a/shared/source/memory_manager/CMakeLists.txt +++ b/shared/source/memory_manager/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2021 Intel Corporation +# Copyright (C) 2019-2022 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -10,6 +10,7 @@ set(NEO_CORE_MEMORY_MANAGER ${CMAKE_CURRENT_SOURCE_DIR}/address_mapper.h ${CMAKE_CURRENT_SOURCE_DIR}/allocations_list.h ${CMAKE_CURRENT_SOURCE_DIR}/allocations_list.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/allocation_type.h ${CMAKE_CURRENT_SOURCE_DIR}/alignment_selector.cpp ${CMAKE_CURRENT_SOURCE_DIR}/alignment_selector.h ${CMAKE_CURRENT_SOURCE_DIR}/allocation_properties.h diff --git a/shared/source/memory_manager/allocation_properties.h b/shared/source/memory_manager/allocation_properties.h index 2c59400299..b41e90ca9a 100644 --- a/shared/source/memory_manager/allocation_properties.h +++ b/shared/source/memory_manager/allocation_properties.h @@ -37,7 +37,7 @@ struct AllocationProperties { uint32_t rootDeviceIndex = std::numeric_limits::max(); size_t size = 0; size_t alignment = 0; - GraphicsAllocation::AllocationType allocationType = GraphicsAllocation::AllocationType::UNKNOWN; + AllocationType allocationType = AllocationType::UNKNOWN; GraphicsAllocation::UsmInitialPlacement usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::DEFAULT; ImageInfo *imgInfo = nullptr; bool multiStorageResource = false; @@ -50,12 +50,12 @@ struct AllocationProperties { uint32_t cacheRegion = 0; AllocationProperties(uint32_t rootDeviceIndex, size_t size, - GraphicsAllocation::AllocationType allocationType, DeviceBitfield subDevicesBitfieldParam) + AllocationType allocationType, DeviceBitfield subDevicesBitfieldParam) : AllocationProperties(rootDeviceIndex, true, size, allocationType, false, subDevicesBitfieldParam) {} AllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, ImageInfo &imgInfo, - GraphicsAllocation::AllocationType allocationType, + AllocationType allocationType, DeviceBitfield subDevicesBitfieldParam) : AllocationProperties(rootDeviceIndex, allocateMemory, 0u, allocationType, false, subDevicesBitfieldParam) { this->imgInfo = &imgInfo; @@ -64,7 +64,7 @@ struct AllocationProperties { AllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size, - GraphicsAllocation::AllocationType allocationType, + AllocationType allocationType, bool isMultiStorageAllocation, DeviceBitfield subDevicesBitfieldParam) : AllocationProperties(rootDeviceIndex, allocateMemory, size, allocationType, false, isMultiStorageAllocation, subDevicesBitfieldParam) {} @@ -72,7 +72,7 @@ struct AllocationProperties { AllocationProperties(uint32_t rootDeviceIndexParam, bool allocateMemoryParam, size_t sizeParam, - GraphicsAllocation::AllocationType allocationTypeParam, + AllocationType allocationTypeParam, bool multiOsContextCapable, bool isMultiStorageAllocationParam, DeviceBitfield subDevicesBitfieldParam) @@ -114,7 +114,7 @@ struct AllocationData { uint32_t allFlags = 0; }; static_assert(sizeof(AllocationData::flags) == sizeof(AllocationData::allFlags), ""); - GraphicsAllocation::AllocationType type = GraphicsAllocation::AllocationType::UNKNOWN; + AllocationType type = AllocationType::UNKNOWN; GraphicsAllocation::UsmInitialPlacement usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::DEFAULT; const void *hostPtr = nullptr; uint64_t gpuAddress = 0; diff --git a/shared/source/memory_manager/allocation_type.h b/shared/source/memory_manager/allocation_type.h new file mode 100644 index 0000000000..baee8c7970 --- /dev/null +++ b/shared/source/memory_manager/allocation_type.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once + +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_ISA, + KERNEL_ISA_INTERNAL, + LINEAR_STREAM, + MAP_ALLOCATION, + MCS, + PIPE, + PREEMPTION, + PRINTF_SURFACE, + PRIVATE_SURFACE, + PROFILING_TAG_BUFFER, + SCRATCH_SURFACE, + SHARED_BUFFER, + SHARED_CONTEXT_IMAGE, + 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, + COUNT +}; +} // namespace NEO diff --git a/shared/source/memory_manager/allocations_list.cpp b/shared/source/memory_manager/allocations_list.cpp index f2dc5de1aa..10affea38f 100644 --- a/shared/source/memory_manager/allocations_list.cpp +++ b/shared/source/memory_manager/allocations_list.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,7 +15,7 @@ struct ReusableAllocationRequirements { const void *requiredPtr; size_t requiredMinimalSize; volatile uint32_t *csrTagAddress; - GraphicsAllocation::AllocationType allocationType; + AllocationType allocationType; uint32_t contextId; uint32_t activeTileCount; uint32_t tagOffset; @@ -27,7 +27,7 @@ AllocationsList::AllocationsList(AllocationUsage allocationUsage) AllocationsList::AllocationsList() : allocationUsage(REUSABLE_ALLOCATION) {} -std::unique_ptr AllocationsList::detachAllocation(size_t requiredMinimalSize, const void *requiredPtr, CommandStreamReceiver *commandStreamReceiver, GraphicsAllocation::AllocationType allocationType) { +std::unique_ptr AllocationsList::detachAllocation(size_t requiredMinimalSize, const void *requiredPtr, CommandStreamReceiver *commandStreamReceiver, AllocationType allocationType) { ReusableAllocationRequirements req; req.requiredMinimalSize = requiredMinimalSize; req.csrTagAddress = (commandStreamReceiver == nullptr) ? nullptr : commandStreamReceiver->getTagAddress(); diff --git a/shared/source/memory_manager/allocations_list.h b/shared/source/memory_manager/allocations_list.h index c31bf5b505..589e5c8d9c 100644 --- a/shared/source/memory_manager/allocations_list.h +++ b/shared/source/memory_manager/allocations_list.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -19,7 +19,7 @@ class AllocationsList : public IDList { public: AllocationsList(AllocationUsage allocationUsage); AllocationsList(); - std::unique_ptr detachAllocation(size_t requiredMinimalSize, const void *requiredPtr, CommandStreamReceiver *commandStreamReceiver, GraphicsAllocation::AllocationType allocationType); + std::unique_ptr detachAllocation(size_t requiredMinimalSize, const void *requiredPtr, CommandStreamReceiver *commandStreamReceiver, AllocationType allocationType); void freeAllGraphicsAllocations(Device *neoDevice); private: diff --git a/shared/source/memory_manager/definitions/storage_info.cpp b/shared/source/memory_manager/definitions/storage_info.cpp index a701bfc280..f21aff2e87 100644 --- a/shared/source/memory_manager/definitions/storage_info.cpp +++ b/shared/source/memory_manager/definitions/storage_info.cpp @@ -42,9 +42,9 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope sizeof(storageInfo.resourceTag)); switch (properties.allocationType) { - case GraphicsAllocation::AllocationType::KERNEL_ISA: - case GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL: - case GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA: { + case AllocationType::KERNEL_ISA: + case AllocationType::KERNEL_ISA_INTERNAL: + case AllocationType::DEBUG_MODULE_AREA: { auto placeIsaOnMultiTile = (properties.subDevicesBitfield.count() != 1); if (executionEnvironment.isDebuggingEnabled()) { @@ -64,13 +64,13 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope storageInfo.tileInstanced = false; } } break; - case GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA: - case GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE: + case AllocationType::DEBUG_CONTEXT_SAVE_AREA: + case AllocationType::WORK_PARTITION_SURFACE: storageInfo.cloningOfPageTables = false; storageInfo.memoryBanks = allTilesValue; storageInfo.tileInstanced = true; break; - case GraphicsAllocation::AllocationType::PRIVATE_SURFACE: + case AllocationType::PRIVATE_SURFACE: storageInfo.cloningOfPageTables = false; if (properties.subDevicesBitfield.count() == 1) { @@ -81,17 +81,17 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope storageInfo.tileInstanced = true; } break; - case GraphicsAllocation::AllocationType::COMMAND_BUFFER: - case GraphicsAllocation::AllocationType::INTERNAL_HEAP: - case GraphicsAllocation::AllocationType::LINEAR_STREAM: + case AllocationType::COMMAND_BUFFER: + case AllocationType::INTERNAL_HEAP: + case AllocationType::LINEAR_STREAM: storageInfo.cloningOfPageTables = properties.flags.multiOsContextCapable; storageInfo.memoryBanks = preferredTile; if (!properties.flags.multiOsContextCapable) { storageInfo.pageTablesVisibility = preferredTile; } break; - case GraphicsAllocation::AllocationType::SCRATCH_SURFACE: - case GraphicsAllocation::AllocationType::PREEMPTION: + case AllocationType::SCRATCH_SURFACE: + case AllocationType::PREEMPTION: if (properties.flags.multiOsContextCapable) { storageInfo.cloningOfPageTables = false; storageInfo.memoryBanks = allTilesValue; @@ -101,7 +101,7 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope storageInfo.pageTablesVisibility = preferredTile; } break; - case GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: + case AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: if (properties.flags.multiOsContextCapable) { storageInfo.cloningOfPageTables = true; } else { @@ -109,8 +109,8 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope storageInfo.cloningOfPageTables = false; } break; - case GraphicsAllocation::AllocationType::BUFFER: - case GraphicsAllocation::AllocationType::SVM_GPU: { + case AllocationType::BUFFER: + case AllocationType::SVM_GPU: { auto colouringPolicy = properties.colouringPolicy; auto granularity = properties.colouringGranularity; @@ -149,7 +149,7 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope } break; } - case GraphicsAllocation::AllocationType::UNIFIED_SHARED_MEMORY: + case AllocationType::UNIFIED_SHARED_MEMORY: storageInfo.memoryBanks = allTilesValue; break; default: diff --git a/shared/source/memory_manager/graphics_allocation.h b/shared/source/memory_manager/graphics_allocation.h index b1a0683c32..b299ad5a77 100644 --- a/shared/source/memory_manager/graphics_allocation.h +++ b/shared/source/memory_manager/graphics_allocation.h @@ -11,6 +11,7 @@ #include "shared/source/helpers/constants.h" #include "shared/source/helpers/debug_helpers.h" #include "shared/source/helpers/ptr_math.h" +#include "shared/source/memory_manager/allocation_type.h" #include "shared/source/memory_manager/definitions/engine_limits.h" #include "shared/source/memory_manager/definitions/storage_info.h" #include "shared/source/memory_manager/host_ptr_defines.h" @@ -53,55 +54,6 @@ struct AubInfo { class GraphicsAllocation : public IDNode { public: - 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_ISA, - KERNEL_ISA_INTERNAL, - LINEAR_STREAM, - MAP_ALLOCATION, - MCS, - PIPE, - PREEMPTION, - PRINTF_SURFACE, - PRIVATE_SURFACE, - PROFILING_TAG_BUFFER, - SCRATCH_SURFACE, - SHARED_BUFFER, - SHARED_CONTEXT_IMAGE, - 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, - COUNT - }; - enum UsmInitialPlacement { DEFAULT, CPU, @@ -245,9 +197,9 @@ class GraphicsAllocation : public IDNode { allocationType == AllocationType::SHARED_RESOURCE_COPY; } - static bool isIsaAllocationType(GraphicsAllocation::AllocationType type) { - return type == GraphicsAllocation::AllocationType::KERNEL_ISA || - type == GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL || + static bool isIsaAllocationType(AllocationType type) { + return type == AllocationType::KERNEL_ISA || + type == AllocationType::KERNEL_ISA_INTERNAL || type == AllocationType::DEBUG_MODULE_AREA; } diff --git a/shared/source/memory_manager/internal_allocation_storage.cpp b/shared/source/memory_manager/internal_allocation_storage.cpp index 57b562953a..66503e0565 100644 --- a/shared/source/memory_manager/internal_allocation_storage.cpp +++ b/shared/source/memory_manager/internal_allocation_storage.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -65,12 +65,12 @@ void InternalAllocationStorage::freeAllocationsList(uint32_t waitTaskCount, Allo } } -std::unique_ptr InternalAllocationStorage::obtainReusableAllocation(size_t requiredSize, GraphicsAllocation::AllocationType allocationType) { +std::unique_ptr InternalAllocationStorage::obtainReusableAllocation(size_t requiredSize, AllocationType allocationType) { auto allocation = allocationsForReuse.detachAllocation(requiredSize, nullptr, &commandStreamReceiver, allocationType); return allocation; } -std::unique_ptr InternalAllocationStorage::obtainTemporaryAllocationWithPtr(size_t requiredSize, const void *requiredPtr, GraphicsAllocation::AllocationType allocationType) { +std::unique_ptr InternalAllocationStorage::obtainTemporaryAllocationWithPtr(size_t requiredSize, const void *requiredPtr, AllocationType allocationType) { auto allocation = temporaryAllocations.detachAllocation(requiredSize, requiredPtr, &commandStreamReceiver, allocationType); return allocation; } diff --git a/shared/source/memory_manager/internal_allocation_storage.h b/shared/source/memory_manager/internal_allocation_storage.h index 44fced44d9..4fd29dd1ab 100644 --- a/shared/source/memory_manager/internal_allocation_storage.h +++ b/shared/source/memory_manager/internal_allocation_storage.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -18,8 +18,8 @@ class InternalAllocationStorage { MOCKABLE_VIRTUAL void cleanAllocationList(uint32_t waitTaskCount, uint32_t allocationUsage); void storeAllocation(std::unique_ptr &&gfxAllocation, uint32_t allocationUsage); void storeAllocationWithTaskCount(std::unique_ptr &&gfxAllocation, uint32_t allocationUsage, uint32_t taskCount); - std::unique_ptr obtainReusableAllocation(size_t requiredSize, GraphicsAllocation::AllocationType allocationType); - std::unique_ptr obtainTemporaryAllocationWithPtr(size_t requiredSize, const void *requiredPtr, GraphicsAllocation::AllocationType allocationType); + std::unique_ptr obtainReusableAllocation(size_t requiredSize, AllocationType allocationType); + std::unique_ptr obtainTemporaryAllocationWithPtr(size_t requiredSize, const void *requiredPtr, AllocationType allocationType); AllocationsList &getTemporaryAllocations() { return temporaryAllocations; } AllocationsList &getAllocationsForReuse() { return allocationsForReuse; } DeviceBitfield getDeviceBitfield() const; diff --git a/shared/source/memory_manager/memory_manager.cpp b/shared/source/memory_manager/memory_manager.cpp index 17b0e4f49a..f2f527b0b8 100644 --- a/shared/source/memory_manager/memory_manager.cpp +++ b/shared/source/memory_manager/memory_manager.cpp @@ -144,7 +144,7 @@ GraphicsAllocation *MemoryManager::createGraphicsAllocationWithPadding(GraphicsA } GraphicsAllocation *MemoryManager::createPaddedAllocation(GraphicsAllocation *inputGraphicsAllocation, size_t sizeWithPadding) { - return allocateGraphicsMemoryWithProperties({inputGraphicsAllocation->getRootDeviceIndex(), sizeWithPadding, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, systemMemoryBitfield}); + return allocateGraphicsMemoryWithProperties({inputGraphicsAllocation->getRootDeviceIndex(), sizeWithPadding, AllocationType::INTERNAL_HOST_MEMORY, systemMemoryBitfield}); } void *MemoryManager::createMultiGraphicsAllocationInSystemMemoryPool(std::vector &rootDeviceIndices, AllocationProperties &properties, MultiGraphicsAllocation &multiGraphicsAllocation) { @@ -289,7 +289,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 == GraphicsAllocation::AllocationType::UNKNOWN); + UNRECOVERABLE_IF(properties.allocationType == AllocationType::UNKNOWN); auto hwInfo = executionEnvironment.rootDeviceEnvironments[properties.rootDeviceIndex]->getHardwareInfo(); auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); @@ -300,16 +300,16 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo bool mayRequireL3Flush = false; switch (properties.allocationType) { - case GraphicsAllocation::AllocationType::BUFFER: - case GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY: - case GraphicsAllocation::AllocationType::CONSTANT_SURFACE: - case GraphicsAllocation::AllocationType::GLOBAL_SURFACE: - case GraphicsAllocation::AllocationType::PIPE: - case GraphicsAllocation::AllocationType::PRINTF_SURFACE: - case GraphicsAllocation::AllocationType::PRIVATE_SURFACE: - case GraphicsAllocation::AllocationType::SCRATCH_SURFACE: - case GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE: - case GraphicsAllocation::AllocationType::WRITE_COMBINED: + 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: allow64KbPages = true; allow32Bit = true; default: @@ -317,64 +317,64 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo } switch (properties.allocationType) { - case GraphicsAllocation::AllocationType::SVM_GPU: - case GraphicsAllocation::AllocationType::SVM_ZERO_COPY: - case GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: - case GraphicsAllocation::AllocationType::PREEMPTION: + case AllocationType::SVM_GPU: + case AllocationType::SVM_ZERO_COPY: + case AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: + case AllocationType::PREEMPTION: allow64KbPages = true; default: break; } switch (properties.allocationType) { - case GraphicsAllocation::AllocationType::BUFFER: - case GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY: - case GraphicsAllocation::AllocationType::WRITE_COMBINED: + case AllocationType::BUFFER: + case AllocationType::BUFFER_HOST_MEMORY: + case AllocationType::WRITE_COMBINED: forcePin = true; default: break; } switch (properties.allocationType) { - case GraphicsAllocation::AllocationType::BUFFER: - case GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY: - case GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR: - case GraphicsAllocation::AllocationType::GLOBAL_SURFACE: - case GraphicsAllocation::AllocationType::IMAGE: - case GraphicsAllocation::AllocationType::MAP_ALLOCATION: - case GraphicsAllocation::AllocationType::PIPE: - case GraphicsAllocation::AllocationType::SHARED_BUFFER: - case GraphicsAllocation::AllocationType::SHARED_IMAGE: - case GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY: - case GraphicsAllocation::AllocationType::SVM_CPU: - case GraphicsAllocation::AllocationType::SVM_GPU: - case GraphicsAllocation::AllocationType::SVM_ZERO_COPY: - case GraphicsAllocation::AllocationType::WRITE_COMBINED: + 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: mayRequireL3Flush = true; default: break; } switch (properties.allocationType) { - case GraphicsAllocation::AllocationType::COMMAND_BUFFER: - case GraphicsAllocation::AllocationType::RING_BUFFER: - case GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER: - case GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY: - case GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR: - case GraphicsAllocation::AllocationType::FILL_PATTERN: - case GraphicsAllocation::AllocationType::MAP_ALLOCATION: - case GraphicsAllocation::AllocationType::MCS: - case GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER: - case GraphicsAllocation::AllocationType::SHARED_CONTEXT_IMAGE: - case GraphicsAllocation::AllocationType::SVM_CPU: - case GraphicsAllocation::AllocationType::SVM_ZERO_COPY: - case GraphicsAllocation::AllocationType::TAG_BUFFER: - case GraphicsAllocation::AllocationType::GLOBAL_FENCE: - case GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY: - case GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: - case GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA: - case GraphicsAllocation::AllocationType::DEBUG_SBA_TRACKING_BUFFER: - case GraphicsAllocation::AllocationType::SW_TAG_BUFFER: + 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::SHARED_CONTEXT_IMAGE: + 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: allocationData.flags.useSystemMemory = true; default: break; @@ -385,25 +385,25 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo } switch (properties.allocationType) { - case GraphicsAllocation::AllocationType::COMMAND_BUFFER: - case GraphicsAllocation::AllocationType::IMAGE: - case GraphicsAllocation::AllocationType::INDIRECT_OBJECT_HEAP: - case GraphicsAllocation::AllocationType::INSTRUCTION_HEAP: - case GraphicsAllocation::AllocationType::INTERNAL_HEAP: - case GraphicsAllocation::AllocationType::KERNEL_ISA: - case GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL: - case GraphicsAllocation::AllocationType::LINEAR_STREAM: - case GraphicsAllocation::AllocationType::MCS: - case GraphicsAllocation::AllocationType::PREEMPTION: - case GraphicsAllocation::AllocationType::SCRATCH_SURFACE: - case GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE: - case GraphicsAllocation::AllocationType::SHARED_CONTEXT_IMAGE: - case GraphicsAllocation::AllocationType::SHARED_IMAGE: - case GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY: - case GraphicsAllocation::AllocationType::SURFACE_STATE_HEAP: - case GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: - case GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA: - case GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: + 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_CONTEXT_IMAGE: + 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: allocationData.flags.resource48Bit = true; break; default: @@ -425,19 +425,19 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo allocationData.flags.multiOsContextCapable = properties.flags.multiOsContextCapable; allocationData.usmInitialPlacement = properties.usmInitialPlacement; - if (properties.allocationType == GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA) { + if (properties.allocationType == AllocationType::DEBUG_CONTEXT_SAVE_AREA) { allocationData.flags.zeroMemory = 1; } - if (properties.allocationType == GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA) { + if (properties.allocationType == AllocationType::DEBUG_MODULE_AREA) { allocationData.flags.use32BitFrontWindow = true; } else { allocationData.flags.use32BitFrontWindow = properties.flags.use32BitFrontWindow; } allocationData.hostPtr = hostPtr; - if (properties.allocationType == GraphicsAllocation::AllocationType::KERNEL_ISA || - properties.allocationType == GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL) { + if (properties.allocationType == AllocationType::KERNEL_ISA || + properties.allocationType == AllocationType::KERNEL_ISA_INTERNAL) { allocationData.size = properties.size + hwHelper.getPaddingForISAAllocation(); } else { allocationData.size = properties.size; @@ -494,7 +494,7 @@ GraphicsAllocation *MemoryManager::allocateInternalGraphicsMemoryWithHostCopy(ui size_t size) { NEO::AllocationProperties copyProperties{rootDeviceIndex, size, - NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + NEO::AllocationType::INTERNAL_HOST_MEMORY, bitField}; copyProperties.alignment = MemoryConstants::pageSize; auto allocation = this->allocateGraphicsMemoryWithProperties(copyProperties); @@ -518,7 +518,7 @@ bool MemoryManager::mapAuxGpuVA(GraphicsAllocation *graphicsAllocation) { } GraphicsAllocation *MemoryManager::allocateGraphicsMemory(const AllocationData &allocationData) { - if (allocationData.type == GraphicsAllocation::AllocationType::IMAGE || allocationData.type == GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY) { + if (allocationData.type == AllocationType::IMAGE || allocationData.type == AllocationType::SHARED_RESOURCE_COPY) { UNRECOVERABLE_IF(allocationData.imgInfo == nullptr); return allocateGraphicsMemoryForImage(allocationData); } @@ -578,29 +578,29 @@ EngineControlContainer &MemoryManager::getRegisteredEngines() { return registeredEngines; } -bool MemoryManager::isExternalAllocation(GraphicsAllocation::AllocationType allocationType) { - if (allocationType == GraphicsAllocation::AllocationType::BUFFER || - allocationType == GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY || - allocationType == GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR || - allocationType == GraphicsAllocation::AllocationType::FILL_PATTERN || - allocationType == GraphicsAllocation::AllocationType::IMAGE || - allocationType == GraphicsAllocation::AllocationType::MAP_ALLOCATION || - allocationType == GraphicsAllocation::AllocationType::PIPE || - allocationType == GraphicsAllocation::AllocationType::SHARED_BUFFER || - allocationType == GraphicsAllocation::AllocationType::SHARED_CONTEXT_IMAGE || - allocationType == GraphicsAllocation::AllocationType::SHARED_IMAGE || - allocationType == GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY || - allocationType == GraphicsAllocation::AllocationType::SVM_CPU || - allocationType == GraphicsAllocation::AllocationType::SVM_GPU || - allocationType == GraphicsAllocation::AllocationType::SVM_ZERO_COPY || - allocationType == GraphicsAllocation::AllocationType::UNIFIED_SHARED_MEMORY || - allocationType == GraphicsAllocation::AllocationType::WRITE_COMBINED) { +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_CONTEXT_IMAGE || + 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) { return true; } return false; } -LocalMemoryUsageBankSelector *MemoryManager::getLocalMemoryUsageBankSelector(GraphicsAllocation::AllocationType allocationType, uint32_t rootDeviceIndex) { +LocalMemoryUsageBankSelector *MemoryManager::getLocalMemoryUsageBankSelector(AllocationType allocationType, uint32_t rootDeviceIndex) { if (isExternalAllocation(allocationType)) { return externalLocalMemoryUsageBankSelector[rootDeviceIndex].get(); } @@ -681,7 +681,7 @@ bool MemoryManager::copyMemoryToAllocation(GraphicsAllocation *graphicsAllocatio for (auto i = 0u; i < graphicsAllocation->storageInfo.getNumBanks(); ++i) { memcpy_s(ptrOffset(static_cast(graphicsAllocation->getUnderlyingBuffer()) + i * graphicsAllocation->getUnderlyingBufferSize(), destinationOffset), (graphicsAllocation->getUnderlyingBufferSize() - destinationOffset), memoryToCopy, sizeToCopy); - if (graphicsAllocation->getAllocationType() != GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA) { + if (graphicsAllocation->getAllocationType() != AllocationType::DEBUG_CONTEXT_SAVE_AREA) { break; } } @@ -731,9 +731,9 @@ bool MemoryManager::isHostPointerTrackingEnabled(uint32_t rootDeviceIndex) { return (peekExecutionEnvironment().rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo()->capabilityTable.hostPtrTrackingEnabled | is32bit); } -bool MemoryManager::useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType allocationType, uint32_t rootDeviceIndex) { - bool isExternalHostPtrAlloc = (allocationType == GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR); - bool isMapAlloc = (allocationType == GraphicsAllocation::AllocationType::MAP_ALLOCATION); +bool MemoryManager::useNonSvmHostPtrAlloc(AllocationType allocationType, uint32_t rootDeviceIndex) { + bool isExternalHostPtrAlloc = (allocationType == AllocationType::EXTERNAL_HOST_PTR); + bool isMapAlloc = (allocationType == AllocationType::MAP_ALLOCATION); if (forceNonSvmForExternalHostPtr && isExternalHostPtrAlloc) { return true; @@ -798,7 +798,7 @@ void MemoryManager::overrideAllocationData(AllocationData &allocationData, const int32_t directRingPlacement = DebugManager.flags.DirectSubmissionBufferPlacement.get(); int32_t directRingAddressing = DebugManager.flags.DirectSubmissionBufferAddressing.get(); - if (properties.allocationType == GraphicsAllocation::AllocationType::RING_BUFFER) { + if (properties.allocationType == AllocationType::RING_BUFFER) { if (directRingPlacement != -1) { if (directRingPlacement == 0) { allocationData.flags.requiresCpuAccess = true; @@ -819,7 +819,7 @@ void MemoryManager::overrideAllocationData(AllocationData &allocationData, const } int32_t directSemaphorePlacement = DebugManager.flags.DirectSubmissionSemaphorePlacement.get(); int32_t directSemaphoreAddressing = DebugManager.flags.DirectSubmissionSemaphoreAddressing.get(); - if (properties.allocationType == GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER) { + if (properties.allocationType == AllocationType::SEMAPHORE_BUFFER) { if (directSemaphorePlacement != -1) { if (directSemaphorePlacement == 0) { allocationData.flags.requiresCpuAccess = true; @@ -839,10 +839,10 @@ void MemoryManager::overrideAllocationData(AllocationData &allocationData, const } } -bool MemoryManager::isAllocationTypeToCapture(GraphicsAllocation::AllocationType type) const { +bool MemoryManager::isAllocationTypeToCapture(AllocationType type) const { switch (type) { - case GraphicsAllocation::AllocationType::SCRATCH_SURFACE: - case GraphicsAllocation::AllocationType::PRIVATE_SURFACE: + case AllocationType::SCRATCH_SURFACE: + case AllocationType::PRIVATE_SURFACE: return true; default: break; @@ -852,7 +852,7 @@ bool MemoryManager::isAllocationTypeToCapture(GraphicsAllocation::AllocationType bool MemoryManager::isLocalMemoryUsedForIsa(uint32_t rootDeviceIndex) { std::call_once(checkIsaPlacementOnceFlags[rootDeviceIndex], [&] { - AllocationProperties properties = {rootDeviceIndex, 0x1000, GraphicsAllocation::AllocationType::KERNEL_ISA, 1}; + AllocationProperties properties = {rootDeviceIndex, 0x1000, AllocationType::KERNEL_ISA, 1}; AllocationData data; getAllocationData(data, properties, nullptr, StorageInfo()); isaInLocalMemory[rootDeviceIndex] = !data.flags.useSystemMemory; diff --git a/shared/source/memory_manager/memory_manager.h b/shared/source/memory_manager/memory_manager.h index 47d3e05b40..ccf929c4ab 100644 --- a/shared/source/memory_manager/memory_manager.h +++ b/shared/source/memory_manager/memory_manager.h @@ -94,7 +94,7 @@ class MemoryManager { virtual bool isNTHandle(osHandle handle, uint32_t rootDeviceIndex) { return false; } virtual GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation) = 0; virtual void closeSharedHandle(GraphicsAllocation *graphicsAllocation){}; - virtual GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) = 0; + virtual GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) = 0; virtual bool mapAuxGpuVA(GraphicsAllocation *graphicsAllocation); @@ -106,10 +106,10 @@ class MemoryManager { MOCKABLE_VIRTUAL bool isLimitedGPU(uint32_t rootDeviceIndex) { return peek32bit() && !peekExecutionEnvironment().rootDeviceEnvironments[rootDeviceIndex]->isFullRangeSvm(); } - MOCKABLE_VIRTUAL bool isLimitedGPUOnType(uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType type) { + MOCKABLE_VIRTUAL bool isLimitedGPUOnType(uint32_t rootDeviceIndex, AllocationType type) { return isLimitedGPU(rootDeviceIndex) && - (type != GraphicsAllocation::AllocationType::MAP_ALLOCATION) && - (type != GraphicsAllocation::AllocationType::IMAGE); + (type != AllocationType::MAP_ALLOCATION) && + (type != AllocationType::IMAGE); } void cleanGraphicsMemoryCreatedFromHostPtr(GraphicsAllocation *); @@ -215,12 +215,12 @@ class MemoryManager { virtual bool setMemAdvise(GraphicsAllocation *gfxAllocation, MemAdviseFlags flags, uint32_t rootDeviceIndex) { return true; } - bool isExternalAllocation(GraphicsAllocation::AllocationType allocationType); - LocalMemoryUsageBankSelector *getLocalMemoryUsageBankSelector(GraphicsAllocation::AllocationType allocationType, uint32_t rootDeviceIndex); + bool isExternalAllocation(AllocationType allocationType); + LocalMemoryUsageBankSelector *getLocalMemoryUsageBankSelector(AllocationType allocationType, uint32_t rootDeviceIndex); bool isLocalMemoryUsedForIsa(uint32_t rootDeviceIndex); - MOCKABLE_VIRTUAL bool isNonSvmBuffer(const void *hostPtr, GraphicsAllocation::AllocationType allocationType, uint32_t rootDeviceIndex) { - return !force32bitAllocations && hostPtr && !isHostPointerTrackingEnabled(rootDeviceIndex) && (allocationType == GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + MOCKABLE_VIRTUAL bool isNonSvmBuffer(const void *hostPtr, AllocationType allocationType, uint32_t rootDeviceIndex) { + return !force32bitAllocations && hostPtr && !isHostPointerTrackingEnabled(rootDeviceIndex) && (allocationType == AllocationType::BUFFER_HOST_MEMORY); } virtual void releaseDeviceSpecificMemResources(uint32_t rootDeviceIndex){}; @@ -239,7 +239,7 @@ class MemoryManager { static bool isCopyRequired(ImageInfo &imgInfo, const void *hostPtr); - bool useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType allocationType, uint32_t rootDeviceIndex); + bool useNonSvmHostPtrAlloc(AllocationType allocationType, uint32_t rootDeviceIndex); StorageInfo createStorageInfoFromProperties(const AllocationProperties &properties); virtual GraphicsAllocation *createGraphicsAllocation(OsHandleStorage &handleStorage, const AllocationData &allocationData) = 0; @@ -261,7 +261,7 @@ class MemoryManager { virtual void unlockResourceImpl(GraphicsAllocation &graphicsAllocation) = 0; virtual void freeAssociatedResourceImpl(GraphicsAllocation &graphicsAllocation) { return unlockResourceImpl(graphicsAllocation); }; virtual void registerAllocationInOs(GraphicsAllocation *allocation) {} - bool isAllocationTypeToCapture(GraphicsAllocation::AllocationType type) const; + bool isAllocationTypeToCapture(AllocationType type) const; void zeroCpuMemoryIfRequested(const AllocationData &allocationData, void *cpuPtr, size_t size) { if (allocationData.flags.zeroMemory) { memset(cpuPtr, 0, size); diff --git a/shared/source/memory_manager/multi_graphics_allocation.cpp b/shared/source/memory_manager/multi_graphics_allocation.cpp index 25c909d2b7..191e8f5903 100644 --- a/shared/source/memory_manager/multi_graphics_allocation.cpp +++ b/shared/source/memory_manager/multi_graphics_allocation.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -59,7 +59,7 @@ GraphicsAllocation *MultiGraphicsAllocation::getGraphicsAllocation(uint32_t root return graphicsAllocations[rootDeviceIndex]; } -GraphicsAllocation::AllocationType MultiGraphicsAllocation::getAllocationType() const { +AllocationType MultiGraphicsAllocation::getAllocationType() const { return getDefaultGraphicsAllocation()->getAllocationType(); } diff --git a/shared/source/memory_manager/multi_graphics_allocation.h b/shared/source/memory_manager/multi_graphics_allocation.h index 5881cfa110..100ba364a3 100644 --- a/shared/source/memory_manager/multi_graphics_allocation.h +++ b/shared/source/memory_manager/multi_graphics_allocation.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -29,7 +29,7 @@ class MultiGraphicsAllocation { GraphicsAllocation *getGraphicsAllocation(uint32_t rootDeviceIndex) const; - GraphicsAllocation::AllocationType getAllocationType() const; + AllocationType getAllocationType() const; bool isCoherent() const; diff --git a/shared/source/memory_manager/os_agnostic_memory_manager.cpp b/shared/source/memory_manager/os_agnostic_memory_manager.cpp index de41deedfb..42a1ede910 100644 --- a/shared/source/memory_manager/os_agnostic_memory_manager.cpp +++ b/shared/source/memory_manager/os_agnostic_memory_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -71,12 +71,12 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryWithAlignment } auto alignment = allocationData.alignment; - if (allocationData.type == GraphicsAllocation::AllocationType::SVM_CPU) { + if (allocationData.type == AllocationType::SVM_CPU) { alignment = MemoryConstants::pageSize2Mb; sizeAligned = alignUp(allocationData.size, MemoryConstants::pageSize2Mb); } - if (allocationData.type == GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA) { + if (allocationData.type == AllocationType::DEBUG_CONTEXT_SAVE_AREA) { sizeAligned *= allocationData.storageInfo.getNumBanks(); } @@ -85,7 +85,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 == GraphicsAllocation::AllocationType::SVM_CPU) { + if (allocationData.type == AllocationType::SVM_CPU) { //add padding in case mapPtr is not aligned size_t reserveSize = sizeAligned + alignment; void *gpuPtr = reserveCpuAddressRange(reserveSize, allocationData.rootDeviceIndex); @@ -99,7 +99,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryWithAlignment memoryAllocation->setCpuPtrAndGpuAddress(ptr, reinterpret_cast(gpuPtr)); } - if (allocationData.type == GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA) { + if (allocationData.type == AllocationType::DEBUG_CONTEXT_SAVE_AREA) { memoryAllocation->storageInfo = allocationData.storageInfo; } @@ -401,7 +401,7 @@ void OsAgnosticMemoryManager::releaseReservedCpuAddressRange(void *reserved, siz alignedFreeWrapper(reserved); } -MemoryAllocation *OsAgnosticMemoryManager::createMemoryAllocation(GraphicsAllocation::AllocationType allocationType, void *driverAllocatedCpuPointer, +MemoryAllocation *OsAgnosticMemoryManager::createMemoryAllocation(AllocationType allocationType, void *driverAllocatedCpuPointer, void *pMem, uint64_t gpuAddress, size_t memSize, uint64_t count, MemoryPool::Type pool, uint32_t rootDeviceIndex, bool uncacheable, bool flushL3Required, bool requireSpecificBitness) { @@ -459,7 +459,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryInDevicePool( adjustedAllocationData.size = alignUp(allocationData.size, MemoryConstants::pageSize64k); adjustedAllocationData.alignment = MemoryConstants::pageSize64k; allocation = static_cast(allocate32BitGraphicsMemoryImpl(adjustedAllocationData, true)); - } else if (allocationData.type == GraphicsAllocation::AllocationType::SVM_GPU) { + } else if (allocationData.type == AllocationType::SVM_GPU) { auto storage = allocateSystemMemory(allocationData.size, MemoryConstants::pageSize2Mb); allocation = new MemoryAllocation(allocationData.rootDeviceIndex, numHandles, allocationData.type, storage, storage, reinterpret_cast(allocationData.hostPtr), allocationData.size, counter, MemoryPool::LocalMemory, false, allocationData.flags.flushL3, maxOsContextCount); @@ -467,8 +467,8 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryInDevicePool( } else { std::unique_ptr gmm; size_t sizeAligned64k = 0; - if (allocationData.type == GraphicsAllocation::AllocationType::IMAGE || - allocationData.type == GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY) { + if (allocationData.type == AllocationType::IMAGE || + allocationData.type == AllocationType::SHARED_RESOURCE_COPY) { allocationData.imgInfo->useLocalMemory = true; gmm = std::make_unique(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(), *allocationData.imgInfo, allocationData.storageInfo, allocationData.flags.preferCompressed); @@ -496,7 +496,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryInDevicePool( } auto systemMemory = allocateSystemMemory(sizeAligned64k, MemoryConstants::pageSize64k); - if (allocationData.type == GraphicsAllocation::AllocationType::PREEMPTION) { + if (allocationData.type == AllocationType::PREEMPTION) { memset(systemMemory, 0, sizeAligned64k); } auto sizeOfHeapChunk = sizeAligned64k; diff --git a/shared/source/memory_manager/os_agnostic_memory_manager.h b/shared/source/memory_manager/os_agnostic_memory_manager.h index da76f6b963..7319a6ef22 100644 --- a/shared/source/memory_manager/os_agnostic_memory_manager.h +++ b/shared/source/memory_manager/os_agnostic_memory_manager.h @@ -70,7 +70,7 @@ class OsAgnosticMemoryManager : public MemoryManager { void initialize(bool aubUsage); ~OsAgnosticMemoryManager() override; GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation) override; - GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) override { return nullptr; } + GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override { return nullptr; } void addAllocationToHostPtrManager(GraphicsAllocation *gfxAllocation) override; void removeAllocationFromHostPtrManager(GraphicsAllocation *gfxAllocation) override; @@ -106,7 +106,7 @@ class OsAgnosticMemoryManager : public MemoryManager { void unlockResourceImpl(GraphicsAllocation &graphicsAllocation) override {} GraphicsAllocation *allocate32BitGraphicsMemoryImpl(const AllocationData &allocationData, bool useLocalMemory) override; GraphicsAllocation *allocateGraphicsMemoryInDevicePool(const AllocationData &allocationData, AllocationStatus &status) override; - MemoryAllocation *createMemoryAllocation(GraphicsAllocation::AllocationType allocationType, void *driverAllocatedCpuPointer, void *pMem, uint64_t gpuAddress, size_t memSize, + MemoryAllocation *createMemoryAllocation(AllocationType allocationType, void *driverAllocatedCpuPointer, void *pMem, uint64_t gpuAddress, size_t memSize, uint64_t count, MemoryPool::Type pool, uint32_t rootDeviceIndex, bool uncacheable, bool flushL3Required, bool requireSpecificBitness); bool fakeBigAllocations = false; diff --git a/shared/source/memory_manager/unified_memory_manager.cpp b/shared/source/memory_manager/unified_memory_manager.cpp index db6f10be78..dce022750b 100644 --- a/shared/source/memory_manager/unified_memory_manager.cpp +++ b/shared/source/memory_manager/unified_memory_manager.cpp @@ -127,7 +127,7 @@ void *SVMAllocsManager::createHostUnifiedMemoryAllocation(size_t size, size_t alignedSize = alignUp(size, pageSizeForAlignment); bool compressionEnabled = false; - GraphicsAllocation::AllocationType allocationType = getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, compressionEnabled); + AllocationType allocationType = getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, compressionEnabled); std::vector rootDeviceIndicesVector(memoryProperties.rootDeviceIndices.begin(), memoryProperties.rootDeviceIndices.end()); @@ -179,7 +179,7 @@ void *SVMAllocsManager::createUnifiedMemoryAllocation(size_t size, size_t alignedSize = alignUp(size, pageSizeForAlignment); bool compressionEnabled = false; - GraphicsAllocation::AllocationType allocationType = getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, compressionEnabled); + AllocationType allocationType = getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, compressionEnabled); bool multiStorageAllocation = (deviceBitfield.count() > 1) && multiOsContextSupport; if ((deviceBitfield.count() > 1) && !multiOsContextSupport) { @@ -285,7 +285,7 @@ void *SVMAllocsManager::createUnifiedKmdMigratedAllocation(size_t size, const Sv AllocationProperties gpuProperties{rootDeviceIndex, true, alignedSize, - GraphicsAllocation::AllocationType::UNIFIED_SHARED_MEMORY, + AllocationType::UNIFIED_SHARED_MEMORY, false, false, deviceBitfield}; @@ -356,7 +356,7 @@ bool SVMAllocsManager::freeSVMAlloc(void *ptr, bool blocking) { pageFaultManager->removeAllocation(ptr); } std::unique_lock lock(mtx); - if (svmData->gpuAllocations.getAllocationType() == GraphicsAllocation::AllocationType::SVM_ZERO_COPY) { + if (svmData->gpuAllocations.getAllocationType() == AllocationType::SVM_ZERO_COPY) { freeZeroCopySvmAllocation(svmData); } else { freeSvmAllocationWithDeviceStorage(svmData); @@ -375,7 +375,7 @@ void *SVMAllocsManager::createZeroCopySvmAllocation(size_t size, const SvmAlloca AllocationProperties properties{rootDeviceIndex, true, // allocateMemory size, - GraphicsAllocation::AllocationType::SVM_ZERO_COPY, + AllocationType::SVM_ZERO_COPY, false, // isMultiStorageAllocation deviceBitfield}; MemoryPropertiesHelper::fillCachePolicyInProperties(properties, false, svmProperties.readOnly, false, properties.cacheRegion); @@ -411,7 +411,7 @@ void *SVMAllocsManager::createUnifiedAllocationWithDeviceStorage(size_t size, co DeviceBitfield subDevices = unifiedMemoryProperties.subdeviceBitfields.at(rootDeviceIndex); AllocationProperties cpuProperties{rootDeviceIndex, true, // allocateMemory - alignedSizeCpu, GraphicsAllocation::AllocationType::SVM_CPU, + alignedSizeCpu, AllocationType::SVM_CPU, false, // isMultiStorageAllocation subDevices}; cpuProperties.alignment = MemoryConstants::pageSize2Mb; @@ -438,7 +438,7 @@ void *SVMAllocsManager::createUnifiedAllocationWithDeviceStorage(size_t size, co AllocationProperties gpuProperties{rootDeviceIndex, false, alignedSizeGpu, - GraphicsAllocation::AllocationType::SVM_GPU, + AllocationType::SVM_GPU, false, multiStorageAllocation, subDevices}; @@ -563,20 +563,20 @@ void SVMAllocsManager::removeSvmMapOperation(const void *regionSvmPtr) { svmMapOperations.remove(regionSvmPtr); } -GraphicsAllocation::AllocationType SVMAllocsManager::getGraphicsAllocationTypeAndCompressionPreference(const UnifiedMemoryProperties &unifiedMemoryProperties, bool &compressionEnabled) const { +AllocationType SVMAllocsManager::getGraphicsAllocationTypeAndCompressionPreference(const UnifiedMemoryProperties &unifiedMemoryProperties, bool &compressionEnabled) const { compressionEnabled = false; - GraphicsAllocation::AllocationType allocationType = GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY; + AllocationType allocationType = AllocationType::BUFFER_HOST_MEMORY; if (unifiedMemoryProperties.memoryType == InternalMemoryType::DEVICE_UNIFIED_MEMORY) { if (unifiedMemoryProperties.allocationFlags.allocFlags.allocWriteCombined) { - allocationType = GraphicsAllocation::AllocationType::WRITE_COMBINED; + allocationType = AllocationType::WRITE_COMBINED; } else { UNRECOVERABLE_IF(nullptr == unifiedMemoryProperties.device); const auto &hwInfoConfig = *HwInfoConfig::get(unifiedMemoryProperties.device->getHardwareInfo().platform.eProductFamily); if (hwInfoConfig.allowStatelessCompression(unifiedMemoryProperties.device->getHardwareInfo())) { compressionEnabled = true; } - allocationType = GraphicsAllocation::AllocationType::BUFFER; + allocationType = AllocationType::BUFFER; } } return allocationType; diff --git a/shared/source/memory_manager/unified_memory_manager.h b/shared/source/memory_manager/unified_memory_manager.h index bf7b905846..d51af96646 100644 --- a/shared/source/memory_manager/unified_memory_manager.h +++ b/shared/source/memory_manager/unified_memory_manager.h @@ -165,7 +165,7 @@ class SVMAllocsManager { void *createZeroCopySvmAllocation(size_t size, const SvmAllocationProperties &svmProperties, const std::set &rootDeviceIndices, const std::map &subdeviceBitfields); - GraphicsAllocation::AllocationType getGraphicsAllocationTypeAndCompressionPreference(const UnifiedMemoryProperties &unifiedMemoryProperties, bool &compressionEnabled) const; + AllocationType getGraphicsAllocationTypeAndCompressionPreference(const UnifiedMemoryProperties &unifiedMemoryProperties, bool &compressionEnabled) const; void freeZeroCopySvmAllocation(SvmAllocationData *svmData); diff --git a/shared/source/os_interface/linux/drm_allocation.cpp b/shared/source/os_interface/linux/drm_allocation.cpp index 172138425b..be78a3f34c 100644 --- a/shared/source/os_interface/linux/drm_allocation.cpp +++ b/shared/source/os_interface/linux/drm_allocation.cpp @@ -123,16 +123,16 @@ void DrmAllocation::registerBOBindExtHandle(Drm *drm) { Drm::ResourceClass resourceClass = Drm::ResourceClass::MaxSize; switch (this->allocationType) { - case GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA: + case AllocationType::DEBUG_CONTEXT_SAVE_AREA: resourceClass = Drm::ResourceClass::ContextSaveArea; break; - case GraphicsAllocation::AllocationType::DEBUG_SBA_TRACKING_BUFFER: + case AllocationType::DEBUG_SBA_TRACKING_BUFFER: resourceClass = Drm::ResourceClass::SbaTrackingBuffer; break; - case GraphicsAllocation::AllocationType::KERNEL_ISA: + case AllocationType::KERNEL_ISA: resourceClass = Drm::ResourceClass::Isa; break; - case GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA: + case AllocationType::DEBUG_MODULE_AREA: resourceClass = Drm::ResourceClass::ModuleHeapDebugArea; break; default: diff --git a/shared/source/os_interface/linux/drm_memory_manager.cpp b/shared/source/os_interface/linux/drm_memory_manager.cpp index f98cbd54e6..335be23868 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.cpp +++ b/shared/source/os_interface/linux/drm_memory_manager.cpp @@ -267,7 +267,7 @@ DrmAllocation *DrmMemoryManager::createGraphicsAllocation(OsHandleStorage &handl } DrmAllocation *DrmMemoryManager::allocateGraphicsMemoryWithAlignment(const AllocationData &allocationData) { - if (allocationData.type == NEO::GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA) { + if (allocationData.type == NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA) { return createMultiHostAllocation(allocationData); } @@ -285,7 +285,7 @@ DrmAllocation *DrmMemoryManager::allocateGraphicsMemoryWithAlignmentImpl(const A uint64_t alignedGpuAddress = 0; size_t alignedStorageSize = cSize; size_t alignedVirtualAdressRangeSize = cSize; - auto svmCpuAllocation = allocationData.type == GraphicsAllocation::AllocationType::SVM_CPU; + auto svmCpuAllocation = allocationData.type == AllocationType::SVM_CPU; if (svmCpuAllocation) { //add padding in case reserved addr is not aligned alignedStorageSize = alignUp(cSize, cAlignment); @@ -343,7 +343,7 @@ DrmAllocation *DrmMemoryManager::createAllocWithAlignmentFromUserptr(const Alloc } void DrmMemoryManager::obtainGpuAddress(const AllocationData &allocationData, BufferObject *bo, uint64_t gpuAddress) { - if ((isLimitedRange(allocationData.rootDeviceIndex) || allocationData.type == GraphicsAllocation::AllocationType::SVM_CPU) && + if ((isLimitedRange(allocationData.rootDeviceIndex) || allocationData.type == AllocationType::SVM_CPU) && !allocationData.flags.isUSMHostAllocation) { bo->setAddress(gpuAddress); } @@ -1111,7 +1111,7 @@ void *DrmMemoryManager::lockResourceInLocalMemoryImpl(GraphicsAllocation &graphi return nullptr; } auto bo = static_cast(graphicsAllocation).getBO(); - if (graphicsAllocation.getAllocationType() == GraphicsAllocation::AllocationType::WRITE_COMBINED) { + if (graphicsAllocation.getAllocationType() == AllocationType::WRITE_COMBINED) { auto addr = lockResourceInLocalMemoryImpl(bo); auto alignedAddr = alignUp(addr, MemoryConstants::pageSize64k); auto notUsedSize = ptrDiff(alignedAddr, addr); @@ -1213,22 +1213,22 @@ void fillGmmsInAllocation(GmmClientContext *clientContext, DrmAllocation *alloca } } -uint64_t getGpuAddress(const AlignmentSelector &alignmentSelector, HeapAssigner &heapAssigner, const HardwareInfo &hwInfo, GraphicsAllocation::AllocationType allocType, GfxPartition *gfxPartition, +uint64_t getGpuAddress(const AlignmentSelector &alignmentSelector, HeapAssigner &heapAssigner, const HardwareInfo &hwInfo, AllocationType allocType, GfxPartition *gfxPartition, size_t &sizeAllocated, const void *hostPtr, bool resource48Bit, bool useFrontWindow) { uint64_t gpuAddress = 0; switch (allocType) { - case GraphicsAllocation::AllocationType::SVM_GPU: + case AllocationType::SVM_GPU: gpuAddress = reinterpret_cast(hostPtr); sizeAllocated = 0; break; - case GraphicsAllocation::AllocationType::KERNEL_ISA: - case GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL: - case GraphicsAllocation::AllocationType::INTERNAL_HEAP: - case GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA: { + case AllocationType::KERNEL_ISA: + case AllocationType::KERNEL_ISA_INTERNAL: + case AllocationType::INTERNAL_HEAP: + case AllocationType::DEBUG_MODULE_AREA: { auto heap = heapAssigner.get32BitHeapIndex(allocType, true, hwInfo, useFrontWindow); gpuAddress = GmmHelper::canonize(gfxPartition->heapAllocate(heap, sizeAllocated)); } break; - case GraphicsAllocation::AllocationType::WRITE_COMBINED: + case AllocationType::WRITE_COMBINED: sizeAllocated = 0; break; default: @@ -1247,11 +1247,11 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryInDevicePool(const A if (!this->localMemorySupported[allocationData.rootDeviceIndex] || allocationData.flags.useSystemMemory || (allocationData.flags.allow32Bit && this->force32bitAllocations) || - allocationData.type == GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY) { + allocationData.type == AllocationType::SHARED_RESOURCE_COPY) { return nullptr; } - if (allocationData.type == GraphicsAllocation::AllocationType::UNIFIED_SHARED_MEMORY) { + if (allocationData.type == AllocationType::UNIFIED_SHARED_MEMORY) { auto allocation = this->createSharedUnifiedMemoryAllocation(allocationData); status = allocation ? AllocationStatus::Success : AllocationStatus::Error; return allocation; @@ -1261,13 +1261,13 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryInDevicePool(const A size_t sizeAligned = 0; auto numHandles = allocationData.storageInfo.getNumBanks(); bool createSingleHandle = 1 == numHandles; - if (allocationData.type == GraphicsAllocation::AllocationType::IMAGE) { + if (allocationData.type == AllocationType::IMAGE) { allocationData.imgInfo->useLocalMemory = true; gmm = std::make_unique(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(), *allocationData.imgInfo, allocationData.storageInfo, allocationData.flags.preferCompressed); sizeAligned = alignUp(allocationData.imgInfo->size, MemoryConstants::pageSize64k); } else { - if (allocationData.type == GraphicsAllocation::AllocationType::WRITE_COMBINED) { + if (allocationData.type == AllocationType::WRITE_COMBINED) { sizeAligned = alignUp(allocationData.size + MemoryConstants::pageSize64k, 2 * MemoryConstants::megaByte) + 2 * MemoryConstants::megaByte; } else { sizeAligned = alignUp(allocationData.size, MemoryConstants::pageSize64k); @@ -1315,7 +1315,7 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryInDevicePool(const A status = AllocationStatus::Error; return nullptr; } - if (allocationData.type == GraphicsAllocation::AllocationType::WRITE_COMBINED) { + if (allocationData.type == AllocationType::WRITE_COMBINED) { auto cpuAddress = lockResource(allocation.get()); auto alignedCpuAddress = alignDown(cpuAddress, 2 * MemoryConstants::megaByte); auto offset = ptrDiff(cpuAddress, alignedCpuAddress); @@ -1465,16 +1465,16 @@ bool DrmMemoryManager::retrieveMmapOffsetForBufferObject(uint32_t rootDeviceInde return true; } -bool DrmMemoryManager::allocationTypeForCompletionFence(GraphicsAllocation::AllocationType allocationType) { +bool DrmMemoryManager::allocationTypeForCompletionFence(AllocationType allocationType) { int32_t overrideAllowAllAllocations = DebugManager.flags.UseDrmCompletionFenceForAllAllocations.get(); bool allowAllAllocations = overrideAllowAllAllocations == -1 ? false : !!overrideAllowAllAllocations; if (allowAllAllocations) { return true; } - if (allocationType == GraphicsAllocation::AllocationType::COMMAND_BUFFER || - allocationType == GraphicsAllocation::AllocationType::RING_BUFFER || - allocationType == GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER || - allocationType == GraphicsAllocation::AllocationType::TAG_BUFFER) { + if (allocationType == AllocationType::COMMAND_BUFFER || + allocationType == AllocationType::RING_BUFFER || + allocationType == AllocationType::SEMAPHORE_BUFFER || + allocationType == AllocationType::TAG_BUFFER) { return true; } return false; diff --git a/shared/source/os_interface/linux/drm_memory_manager.h b/shared/source/os_interface/linux/drm_memory_manager.h index f3d7403926..afd5eda5a5 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.h +++ b/shared/source/os_interface/linux/drm_memory_manager.h @@ -38,7 +38,7 @@ class DrmMemoryManager : public MemoryManager { GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation) override; void closeSharedHandle(GraphicsAllocation *gfxAllocation) override; GraphicsAllocation *createPaddedAllocation(GraphicsAllocation *inputGraphicsAllocation, size_t sizeWithPadding) override; - GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) override { return nullptr; } + GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override { return nullptr; } uint64_t getSystemSharedMemory(uint32_t rootDeviceIndex) override; uint64_t getLocalMemorySize(uint32_t rootDeviceIndex, uint32_t deviceBitfield) override; @@ -122,7 +122,7 @@ class DrmMemoryManager : public MemoryManager { bool createDrmAllocation(Drm *drm, DrmAllocation *allocation, uint64_t gpuAddress, size_t maxOsContextCount); void registerAllocationInOs(GraphicsAllocation *allocation) override; void waitOnCompletionFence(GraphicsAllocation *allocation); - bool allocationTypeForCompletionFence(GraphicsAllocation::AllocationType allocationType); + bool allocationTypeForCompletionFence(AllocationType allocationType); Drm &getDrm(uint32_t rootDeviceIndex) const; uint32_t getRootDeviceIndex(const Drm *drm); 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 02ef024e63..b4fc8f6d39 100644 --- a/shared/source/os_interface/windows/wddm_device_command_stream.inl +++ b/shared/source/os_interface/windows/wddm_device_command_stream.inl @@ -167,9 +167,9 @@ GmmPageTableMngr *WddmCommandStreamReceiver::createPageTableManager() template void WddmCommandStreamReceiver::kmDafLockAllocations(ResidencyContainer &allocationsForResidency) { for (auto &graphicsAllocation : allocationsForResidency) { - if ((GraphicsAllocation::AllocationType::LINEAR_STREAM == graphicsAllocation->getAllocationType()) || - (GraphicsAllocation::AllocationType::FILL_PATTERN == graphicsAllocation->getAllocationType()) || - (GraphicsAllocation::AllocationType::COMMAND_BUFFER == graphicsAllocation->getAllocationType())) { + if ((AllocationType::LINEAR_STREAM == graphicsAllocation->getAllocationType()) || + (AllocationType::FILL_PATTERN == graphicsAllocation->getAllocationType()) || + (AllocationType::COMMAND_BUFFER == 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 32212b0dc7..9fde7c0b89 100644 --- a/shared/source/os_interface/windows/wddm_memory_manager.cpp +++ b/shared/source/os_interface/windows/wddm_memory_manager.cpp @@ -244,7 +244,7 @@ GraphicsAllocation *WddmMemoryManager::allocateSystemMemoryAndCreateGraphicsAllo wddmAllocation->setDefaultGmm(gmm); void *mapPtr = wddmAllocation->getAlignedCpuPtr(); - if (allocationData.type == GraphicsAllocation::AllocationType::SVM_CPU) { + if (allocationData.type == AllocationType::SVM_CPU) { //add padding in case mapPtr is not aligned size_t reserveSizeAligned = sizeAligned + allocationData.alignment; bool ret = getWddm(wddmAllocation->getRootDeviceIndex()).reserveValidAddressRange(reserveSizeAligned, mapPtr); @@ -395,7 +395,7 @@ bool WddmMemoryManager::isNTHandle(osHandle handle, uint32_t rootDeviceIndex) { return status; } -GraphicsAllocation *WddmMemoryManager::createAllocationFromHandle(osHandle handle, bool requireSpecificBitness, bool ntHandle, GraphicsAllocation::AllocationType allocationType, uint32_t rootDeviceIndex) { +GraphicsAllocation *WddmMemoryManager::createAllocationFromHandle(osHandle handle, bool requireSpecificBitness, bool ntHandle, AllocationType allocationType, uint32_t rootDeviceIndex) { auto allocation = std::make_unique(rootDeviceIndex, allocationType, nullptr, 0, handle, MemoryPool::SystemCpuInaccessible, maxOsContextCount); bool status = ntHandle ? getWddm(rootDeviceIndex).openNTHandle(reinterpret_cast(static_cast(handle)), allocation.get()) @@ -434,7 +434,7 @@ GraphicsAllocation *WddmMemoryManager::createGraphicsAllocationFromSharedHandle( return createAllocationFromHandle(handle, requireSpecificBitness, false, properties.allocationType, properties.rootDeviceIndex); } -GraphicsAllocation *WddmMemoryManager::createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) { +GraphicsAllocation *WddmMemoryManager::createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) { return createAllocationFromHandle(toOsHandle(handle), false, true, allocType, rootDeviceIndex); } @@ -946,11 +946,11 @@ void splitGmmsInAllocation(GmmClientContext *clientContext, WddmAllocation *wddm storageInfo.multiStorage = true; } -uint32_t getPriorityForAllocation(GraphicsAllocation::AllocationType allocationType) { +uint32_t getPriorityForAllocation(AllocationType allocationType) { if (GraphicsAllocation::isIsaAllocationType(allocationType) || - allocationType == GraphicsAllocation::AllocationType::COMMAND_BUFFER || - allocationType == GraphicsAllocation::AllocationType::INTERNAL_HEAP || - allocationType == GraphicsAllocation::AllocationType::LINEAR_STREAM) { + allocationType == AllocationType::COMMAND_BUFFER || + allocationType == AllocationType::INTERNAL_HEAP || + allocationType == AllocationType::LINEAR_STREAM) { return DXGI_RESOURCE_PRIORITY_HIGH; } return DXGI_RESOURCE_PRIORITY_NORMAL; @@ -972,8 +972,8 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryInDevicePool(const size_t alignment = 0; auto numBanks = allocationData.storageInfo.getNumBanks(); bool singleBankAllocation = numBanks == 1; - if (allocationData.type == GraphicsAllocation::AllocationType::IMAGE || - allocationData.type == GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY) { + if (allocationData.type == AllocationType::IMAGE || + allocationData.type == AllocationType::SHARED_RESOURCE_COPY) { allocationData.imgInfo->useLocalMemory = true; gmm = std::make_unique(gmmClientContext, *allocationData.imgInfo, allocationData.storageInfo, allocationData.flags.preferCompressed); alignment = MemoryConstants::pageSize64k; @@ -1015,18 +1015,18 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryInDevicePool(const wddmAllocation->needsMakeResidentBeforeLock = true; void *requiredGpuVa = nullptr; - if (allocationData.type == GraphicsAllocation::AllocationType::SVM_GPU) { + if (allocationData.type == AllocationType::SVM_GPU) { requiredGpuVa = const_cast(allocationData.hostPtr); } auto &wddm = getWddm(allocationData.rootDeviceIndex); if (is32bit && executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->isFullRangeSvm()) { - if (allocationData.type == GraphicsAllocation::AllocationType::BUFFER || - allocationData.type == GraphicsAllocation::AllocationType::SHARED_BUFFER || - allocationData.type == GraphicsAllocation::AllocationType::SCRATCH_SURFACE || - allocationData.type == GraphicsAllocation::AllocationType::LINEAR_STREAM || - allocationData.type == GraphicsAllocation::AllocationType::PRIVATE_SURFACE) { + if (allocationData.type == AllocationType::BUFFER || + allocationData.type == AllocationType::SHARED_BUFFER || + allocationData.type == AllocationType::SCRATCH_SURFACE || + allocationData.type == AllocationType::LINEAR_STREAM || + allocationData.type == AllocationType::PRIVATE_SURFACE) { //TODO : FOR DG2 device make sure that scratch doesn't go here //add 2MB padding to make sure there are no overlaps between system and local memory size_t reserveSizeAligned = sizeAligned + 2 * MemoryConstants::megaByte; @@ -1077,7 +1077,7 @@ bool WddmMemoryManager::mapGpuVirtualAddress(WddmAllocation *allocation, const v } else if (allocation->storageInfo.multiStorage) { return mapMultiHandleAllocationWithRetry(allocation, requiredPtr); } - } else if (allocation->getAllocationType() == GraphicsAllocation::AllocationType::WRITE_COMBINED) { + } else if (allocation->getAllocationType() == AllocationType::WRITE_COMBINED) { requiredPtr = lockResource(allocation); allocation->setCpuAddress(const_cast(requiredPtr)); } diff --git a/shared/source/os_interface/windows/wddm_memory_manager.h b/shared/source/os_interface/windows/wddm_memory_manager.h index 7cfa2762af..fdc46107ce 100644 --- a/shared/source/os_interface/windows/wddm_memory_manager.h +++ b/shared/source/os_interface/windows/wddm_memory_manager.h @@ -44,7 +44,7 @@ class WddmMemoryManager : public MemoryManager { void handleFenceCompletion(GraphicsAllocation *allocation) override; GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation) override; - GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) override; + GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override; void addAllocationToHostPtrManager(GraphicsAllocation *memory) override; void removeAllocationFromHostPtrManager(GraphicsAllocation *memory) override; @@ -100,7 +100,7 @@ class WddmMemoryManager : public MemoryManager { MOCKABLE_VIRTUAL size_t getHugeGfxMemoryChunkSize(GfxMemoryAllocationMethod allocationMethod) const; MOCKABLE_VIRTUAL GraphicsAllocation *allocateHugeGraphicsMemory(const AllocationData &allocationData, bool sharedVirtualAddress); - GraphicsAllocation *createAllocationFromHandle(osHandle handle, bool requireSpecificBitness, bool ntHandle, GraphicsAllocation::AllocationType allocationType, uint32_t rootDeviceIndex); + GraphicsAllocation *createAllocationFromHandle(osHandle handle, bool requireSpecificBitness, bool ntHandle, AllocationType allocationType, uint32_t rootDeviceIndex); static bool validateAllocation(WddmAllocation *alloc); MOCKABLE_VIRTUAL bool createWddmAllocation(WddmAllocation *allocation, void *requiredGpuPtr); bool mapGpuVirtualAddress(WddmAllocation *graphicsAllocation, const void *requiredGpuPtr); diff --git a/shared/source/program/kernel_info.cpp b/shared/source/program/kernel_info.cpp index 86cfac7a75..f3c0fb309c 100644 --- a/shared/source/program/kernel_info.cpp +++ b/shared/source/program/kernel_info.cpp @@ -118,7 +118,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 ? GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL : GraphicsAllocation::AllocationType::KERNEL_ISA; + const auto allocType = internalIsa ? AllocationType::KERNEL_ISA_INTERNAL : AllocationType::KERNEL_ISA; kernelAllocation = device.getMemoryManager()->allocateGraphicsMemoryWithProperties({device.getRootDeviceIndex(), kernelIsaSize, allocType, device.getDeviceBitfield()}); if (!kernelAllocation) { return false; diff --git a/shared/source/program/program_initialization.cpp b/shared/source/program/program_initialization.cpp index bab2767f41..df4ac4f0aa 100644 --- a/shared/source/program/program_initialization.cpp +++ b/shared/source/program/program_initialization.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -48,7 +48,7 @@ GraphicsAllocation *allocateGlobalsSurface(NEO::SVMAllocsManager *const svmAlloc UNRECOVERABLE_IF(svmAlloc == nullptr); gpuAllocation = svmAlloc->gpuAllocations.getGraphicsAllocation(rootDeviceIndex); } else { - auto allocationType = constant ? GraphicsAllocation::AllocationType::CONSTANT_SURFACE : GraphicsAllocation::AllocationType::GLOBAL_SURFACE; + auto allocationType = constant ? AllocationType::CONSTANT_SURFACE : AllocationType::GLOBAL_SURFACE; gpuAllocation = device.getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, true, // allocateMemory size, allocationType, diff --git a/shared/source/program/sync_buffer_handler.cpp b/shared/source/program/sync_buffer_handler.cpp index 48d644cdb4..14c4eb6175 100644 --- a/shared/source/program/sync_buffer_handler.cpp +++ b/shared/source/program/sync_buffer_handler.cpp @@ -28,7 +28,7 @@ void SyncBufferHandler::makeResident(CommandStreamReceiver &csr) { void SyncBufferHandler::allocateNewBuffer() { AllocationProperties allocationProperties{device.getRootDeviceIndex(), true, bufferSize, - GraphicsAllocation::AllocationType::LINEAR_STREAM, + AllocationType::LINEAR_STREAM, (device.getNumGenericSubDevices() > 1u), /* multiOsContextCapable */ false, device.getDeviceBitfield()}; graphicsAllocation = memoryManager.allocateGraphicsMemoryWithProperties(allocationProperties); diff --git a/shared/source/utilities/hw_timestamps.h b/shared/source/utilities/hw_timestamps.h index 4988061f9e..d8b241d3f2 100644 --- a/shared/source/utilities/hw_timestamps.h +++ b/shared/source/utilities/hw_timestamps.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -23,8 +23,8 @@ class HwTimeStamps : public TagTypeBase { ContextCompleteTS = 0; } - static constexpr GraphicsAllocation::AllocationType getAllocationType() { - return GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER; + static constexpr AllocationType getAllocationType() { + return AllocationType::PROFILING_TAG_BUFFER; } static constexpr TagNodeType getTagNodeType() { return TagNodeType::HwTimeStamps; } diff --git a/shared/source/utilities/logger.cpp b/shared/source/utilities/logger.cpp index b5f5c52efb..be9a2cd0eb 100644 --- a/shared/source/utilities/logger.cpp +++ b/shared/source/utilities/logger.cpp @@ -139,95 +139,95 @@ const char *getAllocationTypeString(GraphicsAllocation const *graphicsAllocation auto type = graphicsAllocation->getAllocationType(); switch (type) { - case GraphicsAllocation::AllocationType::BUFFER: + case AllocationType::BUFFER: return "BUFFER"; - case GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY: + case AllocationType::BUFFER_HOST_MEMORY: return "BUFFER_HOST_MEMORY"; - case GraphicsAllocation::AllocationType::COMMAND_BUFFER: + case AllocationType::COMMAND_BUFFER: return "COMMAND_BUFFER"; - case GraphicsAllocation::AllocationType::CONSTANT_SURFACE: + case AllocationType::CONSTANT_SURFACE: return "CONSTANT_SURFACE"; - case GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR: + case AllocationType::EXTERNAL_HOST_PTR: return "EXTERNAL_HOST_PTR"; - case GraphicsAllocation::AllocationType::FILL_PATTERN: + case AllocationType::FILL_PATTERN: return "FILL_PATTERN"; - case GraphicsAllocation::AllocationType::GLOBAL_SURFACE: + case AllocationType::GLOBAL_SURFACE: return "GLOBAL_SURFACE"; - case GraphicsAllocation::AllocationType::IMAGE: + case AllocationType::IMAGE: return "IMAGE"; - case GraphicsAllocation::AllocationType::INDIRECT_OBJECT_HEAP: + case AllocationType::INDIRECT_OBJECT_HEAP: return "INDIRECT_OBJECT_HEAP"; - case GraphicsAllocation::AllocationType::INSTRUCTION_HEAP: + case AllocationType::INSTRUCTION_HEAP: return "INSTRUCTION_HEAP"; - case GraphicsAllocation::AllocationType::INTERNAL_HEAP: + case AllocationType::INTERNAL_HEAP: return "INTERNAL_HEAP"; - case GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY: + case AllocationType::INTERNAL_HOST_MEMORY: return "INTERNAL_HOST_MEMORY"; - case GraphicsAllocation::AllocationType::KERNEL_ISA: + case AllocationType::KERNEL_ISA: return "KERNEL_ISA"; - case GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL: + case AllocationType::KERNEL_ISA_INTERNAL: return "KERNEL_ISA_INTERNAL"; - case GraphicsAllocation::AllocationType::LINEAR_STREAM: + case AllocationType::LINEAR_STREAM: return "LINEAR_STREAM"; - case GraphicsAllocation::AllocationType::MAP_ALLOCATION: + case AllocationType::MAP_ALLOCATION: return "MAP_ALLOCATION"; - case GraphicsAllocation::AllocationType::MCS: + case AllocationType::MCS: return "MCS"; - case GraphicsAllocation::AllocationType::PIPE: + case AllocationType::PIPE: return "PIPE"; - case GraphicsAllocation::AllocationType::PREEMPTION: + case AllocationType::PREEMPTION: return "PREEMPTION"; - case GraphicsAllocation::AllocationType::PRINTF_SURFACE: + case AllocationType::PRINTF_SURFACE: return "PRINTF_SURFACE"; - case GraphicsAllocation::AllocationType::PRIVATE_SURFACE: + case AllocationType::PRIVATE_SURFACE: return "PRIVATE_SURFACE"; - case GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER: + case AllocationType::PROFILING_TAG_BUFFER: return "PROFILING_TAG_BUFFER"; - case GraphicsAllocation::AllocationType::SCRATCH_SURFACE: + case AllocationType::SCRATCH_SURFACE: return "SCRATCH_SURFACE"; - case GraphicsAllocation::AllocationType::SHARED_BUFFER: + case AllocationType::SHARED_BUFFER: return "SHARED_BUFFER"; - case GraphicsAllocation::AllocationType::SHARED_CONTEXT_IMAGE: + case AllocationType::SHARED_CONTEXT_IMAGE: return "SHARED_CONTEXT_IMAGE"; - case GraphicsAllocation::AllocationType::SHARED_IMAGE: + case AllocationType::SHARED_IMAGE: return "SHARED_IMAGE"; - case GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY: + case AllocationType::SHARED_RESOURCE_COPY: return "SHARED_RESOURCE_COPY"; - case GraphicsAllocation::AllocationType::SURFACE_STATE_HEAP: + case AllocationType::SURFACE_STATE_HEAP: return "SURFACE_STATE_HEAP"; - case GraphicsAllocation::AllocationType::SVM_CPU: + case AllocationType::SVM_CPU: return "SVM_CPU"; - case GraphicsAllocation::AllocationType::SVM_GPU: + case AllocationType::SVM_GPU: return "SVM_GPU"; - case GraphicsAllocation::AllocationType::SVM_ZERO_COPY: + case AllocationType::SVM_ZERO_COPY: return "SVM_ZERO_COPY"; - case GraphicsAllocation::AllocationType::TAG_BUFFER: + case AllocationType::TAG_BUFFER: return "TAG_BUFFER"; - case GraphicsAllocation::AllocationType::GLOBAL_FENCE: + case AllocationType::GLOBAL_FENCE: return "GLOBAL_FENCE"; - case GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: + case AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: return "TIMESTAMP_PACKET_TAG_BUFFER"; - case GraphicsAllocation::AllocationType::UNKNOWN: + case AllocationType::UNKNOWN: return "UNKNOWN"; - case GraphicsAllocation::AllocationType::WRITE_COMBINED: + case AllocationType::WRITE_COMBINED: return "WRITE_COMBINED"; - case GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA: + case AllocationType::DEBUG_CONTEXT_SAVE_AREA: return "DEBUG_CONTEXT_SAVE_AREA"; - case GraphicsAllocation::AllocationType::DEBUG_SBA_TRACKING_BUFFER: + case AllocationType::DEBUG_SBA_TRACKING_BUFFER: return "DEBUG_SBA_TRACKING_BUFFER"; - case GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA: + case AllocationType::DEBUG_MODULE_AREA: return "DEBUG_MODULE_AREA"; - case GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE: + case AllocationType::WORK_PARTITION_SURFACE: return "WORK_PARTITION_SURFACE"; - case GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: + case AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: return "GPU_TIMESTAMP_DEVICE_BUFFER"; - case GraphicsAllocation::AllocationType::RING_BUFFER: + case AllocationType::RING_BUFFER: return "RING_BUFFER"; - case GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER: + case AllocationType::SEMAPHORE_BUFFER: return "SEMAPHORE_BUFFER"; - case GraphicsAllocation::AllocationType::UNIFIED_SHARED_MEMORY: + case AllocationType::UNIFIED_SHARED_MEMORY: return "UNIFIED_SHARED_MEMORY"; - case GraphicsAllocation::AllocationType::SW_TAG_BUFFER: + case AllocationType::SW_TAG_BUFFER: return "SW_TAG_BUFFER"; default: return "ILLEGAL_VALUE"; diff --git a/shared/source/utilities/perf_counter.h b/shared/source/utilities/perf_counter.h index 7c0ca50028..a6c687f4ad 100644 --- a/shared/source/utilities/perf_counter.h +++ b/shared/source/utilities/perf_counter.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -20,8 +20,8 @@ class HwPerfCounter : public TagTypeBase { report[0] = 0; } - static constexpr GraphicsAllocation::AllocationType getAllocationType() { - return GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER; + static constexpr AllocationType getAllocationType() { + return AllocationType::PROFILING_TAG_BUFFER; } 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 e3e545ad30..38555ad043 100644 --- a/shared/source/utilities/software_tags_manager.cpp +++ b/shared/source/utilities/software_tags_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -31,7 +31,7 @@ void SWTagsManager::allocateBXMLHeap(Device &device) { const AllocationProperties properties{ device.getRootDeviceIndex(), heapSizeInBytes, - GraphicsAllocation::AllocationType::SW_TAG_BUFFER, + AllocationType::SW_TAG_BUFFER, device.getDeviceBitfield()}; bxmlHeap = memoryManager->allocateGraphicsMemoryWithProperties(properties); @@ -44,7 +44,7 @@ void SWTagsManager::allocateSWTagHeap(Device &device) { const AllocationProperties properties{ device.getRootDeviceIndex(), MAX_TAG_HEAP_SIZE, - GraphicsAllocation::AllocationType::SW_TAG_BUFFER, + AllocationType::SW_TAG_BUFFER, device.getDeviceBitfield()}; tagHeap = memoryManager->allocateGraphicsMemoryWithProperties(properties); diff --git a/shared/source/xe_hp_core/command_stream_receiver_hw_xe_hp_core.cpp b/shared/source/xe_hp_core/command_stream_receiver_hw_xe_hp_core.cpp index 225e9de39a..db1a20b5fa 100644 --- a/shared/source/xe_hp_core/command_stream_receiver_hw_xe_hp_core.cpp +++ b/shared/source/xe_hp_core/command_stream_receiver_hw_xe_hp_core.cpp @@ -49,7 +49,7 @@ GraphicsAllocation *CommandStreamReceiverHw::getClearColorAllocation() { if (clearColorAllocation == nullptr) { auto lock = this->obtainUniqueOwnership(); if (clearColorAllocation == nullptr) { - AllocationProperties properties{rootDeviceIndex, clearColorSize, GraphicsAllocation::AllocationType::BUFFER, osContext->getDeviceBitfield()}; + AllocationProperties properties{rootDeviceIndex, clearColorSize, AllocationType::BUFFER, osContext->getDeviceBitfield()}; properties.flags.readOnlyMultiStorage = true; properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = false; clearColorAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties(properties, clearColorBuffer); diff --git a/shared/source/xe_hpc_core/hw_helper_xe_hpc_core.cpp b/shared/source/xe_hpc_core/hw_helper_xe_hpc_core.cpp index 922e47d0ef..1dce876071 100644 --- a/shared/source/xe_hpc_core/hw_helper_xe_hpc_core.cpp +++ b/shared/source/xe_hpc_core/hw_helper_xe_hpc_core.cpp @@ -232,10 +232,10 @@ void HwHelperHw::setL1CachePolicy(bool useL1Cache, typename Family::REND template <> void HwHelperHw::setExtraAllocationData(AllocationData &allocationData, const AllocationProperties &properties, const HardwareInfo &hwInfo) const { - if (properties.allocationType == GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER || properties.allocationType == GraphicsAllocation::AllocationType::COMMAND_BUFFER) { + if (properties.allocationType == AllocationType::TIMESTAMP_PACKET_TAG_BUFFER || properties.allocationType == AllocationType::COMMAND_BUFFER) { allocationData.flags.useSystemMemory = false; } - if (properties.allocationType == GraphicsAllocation::AllocationType::COMMAND_BUFFER && properties.subDevicesBitfield.count() == 1) { + if (properties.allocationType == AllocationType::COMMAND_BUFFER && properties.subDevicesBitfield.count() == 1) { allocationData.flags.useSystemMemory = true; } allocationData.cacheRegion = properties.cacheRegion; diff --git a/shared/test/common/debug_settings/debug_settings_manager_tests.cpp b/shared/test/common/debug_settings/debug_settings_manager_tests.cpp index ba26baa0e2..8692ec4180 100644 --- a/shared/test/common/debug_settings/debug_settings_manager_tests.cpp +++ b/shared/test/common/debug_settings/debug_settings_manager_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -154,7 +154,7 @@ TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledOnDisabledDebugManagerW } TEST(AllocationInfoLogging, givenBaseGraphicsAllocationWhenGettingImplementationSpecificAllocationInfoThenReturnEmptyInfoString) { - GraphicsAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0ull, 0ull, 0, MemoryPool::MemoryNull); + GraphicsAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, 0ull, 0ull, 0, MemoryPool::MemoryNull); EXPECT_STREQ(graphicsAllocation.getAllocationInfoString().c_str(), ""); } diff --git a/shared/test/common/fixtures/direct_submission_fixture.h b/shared/test/common/fixtures/direct_submission_fixture.h index 474de30919..f314c089c5 100644 --- a/shared/test/common/fixtures/direct_submission_fixture.h +++ b/shared/test/common/fixtures/direct_submission_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -36,7 +36,7 @@ struct DirectSubmissionDispatchBufferFixture : public DirectSubmissionFixture { DirectSubmissionFixture::SetUp(); MemoryManager *memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); const AllocationProperties commandBufferProperties{pDevice->getRootDeviceIndex(), 0x1000, - GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}; + AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}; commandBuffer = memoryManager->allocateGraphicsMemoryWithProperties(commandBufferProperties); batchBuffer.endCmdPtr = &bbStart[0]; diff --git a/shared/test/common/helpers/blit_commands_helper_tests.cpp b/shared/test/common/helpers/blit_commands_helper_tests.cpp index 3ce396552f..1ad99e1116 100644 --- a/shared/test/common/helpers/blit_commands_helper_tests.cpp +++ b/shared/test/common/helpers/blit_commands_helper_tests.cpp @@ -236,7 +236,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, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -253,7 +253,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, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth) - 1, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); @@ -275,7 +275,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, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); @@ -303,7 +303,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, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth * sizeof(uint32_t)), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -331,7 +331,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, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, ((BlitterConstants::maxBlitWidth + 1) * sizeof(uint32_t)), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -363,7 +363,7 @@ HWTEST2_F(BlitTests, givenMemoryWhenFillPatternSizeIs4BytesThen32BitMaskISSetCor uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); diff --git a/shared/test/common/helpers/blit_commands_helper_tests.inl b/shared/test/common/helpers/blit_commands_helper_tests.inl index 25049cd2bc..00cfdb85e3 100644 --- a/shared/test/common/helpers/blit_commands_helper_tests.inl +++ b/shared/test/common/helpers/blit_commands_helper_tests.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -32,7 +32,7 @@ class GivenLinearStreamWhenCallDispatchBlitMemoryColorFillThenCorrectDepthIsProg void TestBodyImpl(size_t patternSize, COLOR_DEPTH expectedDepth) { uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); uint32_t patternToCommand[4]; diff --git a/shared/test/common/helpers/blit_commands_helper_tests_gen12lp.cpp b/shared/test/common/helpers/blit_commands_helper_tests_gen12lp.cpp index 1df98b96b6..9530d6c97b 100644 --- a/shared/test/common/helpers/blit_commands_helper_tests_gen12lp.cpp +++ b/shared/test/common/helpers/blit_commands_helper_tests_gen12lp.cpp @@ -77,10 +77,10 @@ HWTEST2_F(BlitTests, givenIncorrectBytePerPixelWhenAppendColorDepthThenAbortIsTh HWTEST2_F(BlitTests, givenSrcAndDestinationImagesWhenAppendSliceOffsetsThenAdressAreCorectOffseted, IsGen12LP) { using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT; auto gmm = std::make_unique(pDevice->getGmmClientContext()); - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); mockAllocationSrc.setGmm(gmm.get(), 0); @@ -115,10 +115,10 @@ HWTEST2_F(BlitTests, givenSrcAndDestinationImagesWhenAppendSliceOffsetsThenAdres HWTEST2_F(BlitTests, givenInputAndDefaultSlicePitchWhenAppendBlitCommandsForImagesThenSlicePitchesAreCorrect, IsGen12LP) { using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT; - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); auto bltCmd = FamilyType::cmdInitXyCopyBlt; @@ -179,10 +179,10 @@ HWTEST2_F(BlitTests, givenTiledSrcAndDestinationImagesWhenAppendImageCommandsThe myResourecInfo->pitch = 0x100; myResourecInfo->flags.Info.TiledY = 1; gmm->gmmResourceInfo.reset(myResourecInfo.release()); - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); mockAllocationSrc.setGmm(gmm.get(), 0); @@ -210,10 +210,10 @@ HWTEST2_F(BlitTests, givenLinearSrcAndDestinationImagesWhenAppendImageCommandsTh myResourecInfo->pitch = 0x100; myResourecInfo->flags.Info.Linear = 1; gmm->gmmResourceInfo.reset(myResourecInfo.release()); - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages); mockAllocationSrc.setGmm(gmm.get(), 0); diff --git a/shared/test/common/helpers/test_blit_commands_helper_pvc_and_later.cpp b/shared/test/common/helpers/test_blit_commands_helper_pvc_and_later.cpp index da03ce3436..0ee2aab1c0 100644 --- a/shared/test/common/helpers/test_blit_commands_helper_pvc_and_later.cpp +++ b/shared/test/common/helpers/test_blit_commands_helper_pvc_and_later.cpp @@ -19,7 +19,7 @@ HWTEST2_F(BlitTests, givenOneBytePatternWhenFillPatternWithBlitThenCommandIsProg uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -35,7 +35,7 @@ HWTEST2_F(BlitTests, givenDeviceWithoutDefaultGmmWhenAppendBlitCommandsForVillBu uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -58,7 +58,7 @@ HWTEST2_F(BlitTests, givenGmmWithDisabledCompresionWhenAppendBlitCommandsForVill uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocation.setGmm(gmm.get(), 0u); @@ -82,7 +82,7 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionWhenAppendBlitCommandsForVillB uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocation.setGmm(gmm.get(), 0u); @@ -112,7 +112,7 @@ HWTEST2_F(BlitTests, givenOverridedMocksValueWhenAppendBlitCommandsForVillBuffer uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -135,7 +135,7 @@ HWTEST2_F(BlitTests, givenEnableStatelessCompressionWithUnifiedMemoryAndSystemMe uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -158,7 +158,7 @@ HWTEST2_F(BlitTests, givenEnableStatelessCompressionWithUnifiedMemoryAndLocalMem uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -179,7 +179,7 @@ HWTEST2_F(BlitTests, givenMemorySizeBiggerThanMaxWidthButLessThanTwiceMaxWidthWh uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitSetWidth) - 1, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -199,7 +199,7 @@ HWTEST2_F(BlitTests, givenMemorySizeTwiceBiggerThanMaxWidthWhenFillPatternWithBl uint32_t pattern = 1; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitSetWidth), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); diff --git a/shared/test/common/helpers/test_blit_commands_helper_xehp_and_later.cpp b/shared/test/common/helpers/test_blit_commands_helper_xehp_and_later.cpp index 88dacf3de2..702f60dc5a 100644 --- a/shared/test/common/helpers/test_blit_commands_helper_xehp_and_later.cpp +++ b/shared/test/common/helpers/test_blit_commands_helper_xehp_and_later.cpp @@ -35,7 +35,7 @@ struct CompressionParamsSupportedMatcher { HWTEST2_F(BlitTests, givenDeviceWithoutDefaultGmmWhenAppendBlitCommandsForFillBufferThenDstCompressionDisabled, CompressionParamsSupportedMatcher) { using XY_COLOR_BLT = typename FamilyType::XY_COLOR_BLT; auto blitCmd = FamilyType::cmdInitXyColorBlt; - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -48,7 +48,7 @@ HWTEST2_F(BlitTests, givenGmmWithDisabledCompresionWhenAppendBlitCommandsForFill auto blitCmd = FamilyType::cmdInitXyColorBlt; auto gmm = std::make_unique(pDevice->getGmmClientContext()); gmm->isCompressionEnabled = false; - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocation.setGmm(gmm.get(), 0); @@ -62,7 +62,7 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionWhenAppendBlitCommandsForFillB auto blitCmd = FamilyType::cmdInitXyColorBlt; auto gmm = std::make_unique(pDevice->getGmmClientContext()); gmm->isCompressionEnabled = true; - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocation.setGmm(gmm.get(), 0); @@ -78,7 +78,7 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionWhenAppendBlitCommandsForFillB auto gmmContext = pDevice->getGmmClientContext(); auto gmm = std::make_unique(gmmContext); gmm->isCompressionEnabled = true; - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::LocalMemory); mockAllocation.setGmm(gmm.get(), 0); @@ -98,7 +98,7 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionAndDebugFlagSetWhenAppendBlitC auto gmm = std::make_unique(pDevice->getGmmClientContext()); gmm->isCompressionEnabled = true; - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::LocalMemory); mockAllocation.setGmm(gmm.get(), 0); @@ -112,7 +112,7 @@ HWTEST2_F(BlitTests, givenA0StepWhenAppendBlitCommandsForFillBufferWithLocalAcce DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::CpuAccessAllowed)); auto blitCmd = FamilyType::cmdInitXyColorBlt; - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo(); @@ -129,7 +129,7 @@ HWTEST2_F(BlitTests, givenA0StepWhenAppendBlitCommandsForFillBufferWithLocalAcce DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::CpuAccessDisallowed)); auto blitCmd = FamilyType::cmdInitXyColorBlt; - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo(); @@ -146,7 +146,7 @@ HWTEST2_F(BlitTests, givenBStepWhenAppendBlitCommandsForFillBufferWithLocalAcces DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::CpuAccessAllowed)); auto blitCmd = FamilyType::cmdInitXyColorBlt; - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo(); @@ -163,7 +163,7 @@ HWTEST2_F(BlitTests, givenBStepWhenAppendBlitCommandsForFillBufferWithLocalAcces DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::CpuAccessDisallowed)); auto blitCmd = FamilyType::cmdInitXyColorBlt; - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo(); @@ -180,7 +180,7 @@ HWTEST2_F(BlitTests, givenAllocationInSystemMemWhenAppendBlitCommandsForFillBuff using XY_COLOR_BLT = typename FamilyType::XY_COLOR_BLT; auto blitCmd = FamilyType::cmdInitXyColorBlt; - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo(); @@ -197,7 +197,7 @@ HWTEST2_F(BlitTests, givenAllocationInSystemMemWhenAppendBlitCommandsForFillBuff using XY_COLOR_BLT = typename FamilyType::XY_COLOR_BLT; auto blitCmd = FamilyType::cmdInitXyColorBlt; - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo(); @@ -215,7 +215,7 @@ HWTEST2_F(BlitTests, givenOverridedMocksValueWhenAppendBlitCommandsForFillBuffer DebugManager.flags.OverrideBlitterMocs.set(mockValue); auto blitCmd = FamilyType::cmdInitXyColorBlt; - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -228,7 +228,7 @@ HWTEST2_F(BlitTests, givenOverridedBliterTargetToZeroWhenAppendBlitCommandsForFi DebugManager.flags.OverrideBlitterTargetMemory.set(0); auto blitCmd = FamilyType::cmdInitXyColorBlt; - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -242,7 +242,7 @@ HWTEST2_F(BlitTests, givenOverridedBliterTargetToOneWhenAppendBlitCommandsForFil DebugManager.flags.OverrideBlitterTargetMemory.set(1); auto blitCmd = FamilyType::cmdInitXyColorBlt; - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -256,7 +256,7 @@ HWTEST2_F(BlitTests, givenOverridedBliterTargetToTwoWhenAppendBlitCommandsForFil DebugManager.flags.OverrideBlitterTargetMemory.set(2); auto blitCmd = FamilyType::cmdInitXyColorBlt; - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); @@ -420,10 +420,10 @@ HWTEST2_F(BlitTests, givenTiled4SrcAndDestinationAppendImageCommandsThenCorrectT auto gmm = std::make_unique(pDevice->getGmmClientContext()); auto flags = gmm->gmmResourceInfo->getResourceFlags(); flags->Info.Tile4 = true; - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor(reinterpret_cast(0x1234), sizeof(uint32_t)); @@ -446,10 +446,10 @@ HWTEST2_F(BlitTests, givenNotTiled64SrcAndDestinationAppendImageCommandsThenCorr auto gmm = std::make_unique(pDevice->getGmmClientContext()); auto flags = gmm->gmmResourceInfo->getResourceFlags(); flags->Info.Tile64 = true; - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor(reinterpret_cast(0x1234), sizeof(uint32_t)); @@ -472,10 +472,10 @@ HWTEST2_F(BlitTests, givenNotTiledSrcAndDestinationAppendImageCommandsThenCorrec auto gmm = std::make_unique(pDevice->getGmmClientContext()); auto flags = gmm->gmmResourceInfo->getResourceFlags(); flags->Info.Tile64 = false; - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor(reinterpret_cast(0x1234), sizeof(uint32_t)); @@ -507,10 +507,10 @@ HWTEST2_F(BlitTests, givenGmmParamsWhenAppendSurfaceTypeThenCorrectSurfaceTypeIs auto resourceInfo = static_cast(gmm->gmmResourceInfo.get()); resourceInfo->mockResourceCreateParams.Type = resourceType; resourceInfo->mockResourceCreateParams.ArraySize = arraySize; - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocationSrc.setGmm(gmm.get(), 0); @@ -532,10 +532,10 @@ HWTEST2_F(BlitTests, givenInvalidResourceWhenAppendSurfaceTypeThenSurfaceTypeDoe auto resourceInfo = static_cast(gmm->gmmResourceInfo.get()); resourceInfo->mockResourceCreateParams.Type = GMM_RESOURCE_TYPE::RESOURCE_INVALID; - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocationSrc.setGmm(gmm.get(), 0); @@ -556,10 +556,10 @@ HWTEST2_F(BlitTests, givenInvalidResourceWhenAppendSurfaceTypeThenSurfaceTypeDoe HWTEST2_F(BlitTests, givenResourcesWithoutGmmsWhenAppendSurfaceTypeThenSurfaceTypeDoesNotChange, IsXeHpCore) { using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT; - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); auto bltCmd = FamilyType::cmdInitXyCopyBlt; @@ -589,7 +589,7 @@ HWTEST2_F(BlitTests, givenGmmParamsWhenGetBlitAllocationPropertiesIsCalledThenCo auto &resInfo = resourceInfo->getResourceFlags()->Info; resInfo.MediaCompressed = mediaCompressed; resInfo.RenderCompressed = renderCompressed; - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocationSrc.setGmm(gmm.get(), 0); @@ -655,10 +655,10 @@ struct MyMockResourecInfo : public GmmResourceInfo { }; HWTEST2_F(BlitTests, givenResourceWithoutGmmWhenAppendImageCommandsThenPitchEqualPropertiesValue, IsXeHpCore) { using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT; - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor(reinterpret_cast(0x1234), sizeof(uint32_t)); @@ -679,10 +679,10 @@ HWTEST2_F(BlitTests, givenResourceWithoutGmmWhenAppendImageCommandsThenPitchEqua } HWTEST2_F(BlitTests, givenInputAndDefaultSlicePitchWhenAppendBlitCommandsForImagesIsCalledThenSlicePitchIsCorrect, IsXeHpCore) { using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT; - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor; @@ -720,10 +720,10 @@ HWTEST2_F(BlitTests, givenResourceInfoWithZeroPitchWhenAppendImageCommandsThenPi auto gmm = std::make_unique(pDevice->getGmmClientContext()); GMM_RESCREATE_PARAMS gmmParams = {}; gmm->gmmResourceInfo.reset(new MyMockResourecInfo(pDevice->getRootDeviceEnvironment().getGmmClientContext(), &gmmParams)); - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor(reinterpret_cast(0x1234), sizeof(uint32_t)); @@ -753,10 +753,10 @@ HWTEST2_F(BlitTests, givenTiledAllocationWhenAppendBlitCommandsForImagesThenBlit gmm->gmmResourceInfo.reset(myResourecInfo.release()); auto flags = gmm->gmmResourceInfo->getResourceFlags(); flags->Info.Tile64 = true; - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor(reinterpret_cast(0x1234), sizeof(uint32_t)); @@ -782,10 +782,10 @@ HWTEST2_F(BlitTests, givenTiledAllocationWhenAppendBlitCommandsForImagesThenBlit HWTEST2_F(BlitTests, givenAlocationsWhenAppendBlitCommandsForImagesThenSurfaceSizesAreProgrammedCorrectly, IsXeHpCore) { using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT; auto gmm = std::make_unique(pDevice->getGmmClientContext()); - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor; @@ -820,10 +820,10 @@ HWTEST2_F(BlitTests, givenLinearResourceInfoWithNotZeroPitchWhenAppendImageComma myResourecInfo->pitch = 0x100; myResourecInfo->flags.Info.Linear = 1; gmm->gmmResourceInfo.reset(myResourecInfo.release()); - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor(reinterpret_cast(0x1234), sizeof(uint32_t)); @@ -850,10 +850,10 @@ HWTEST2_F(BlitTests, givenLinearResorcesWhenAppendSliceOffsetsThenAdressAreOffse using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT; auto bltCmd = FamilyType::cmdInitXyCopyBlt; BlitProperties properties = {}; - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor(reinterpret_cast(0x1234), sizeof(uint32_t)); @@ -880,10 +880,10 @@ HWTEST2_F(BlitTests, givenTiledResorcesWhenAppendSliceOffsetsThenIndexsAreSet, I using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT; auto bltCmd = FamilyType::cmdInitXyCopyBlt; BlitProperties properties = {}; - MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); - MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); bltCmd.setSourceTiling(XY_COPY_BLT::TILING::TILING_TILE64); @@ -902,7 +902,7 @@ HWTEST2_F(BlitTests, givenMemorySizeTwiceBiggerThanMaxWidthWhenFillPatternWithBl uint32_t pattern[4] = {1, 0, 0, 0}; uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); - MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, + MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth * sizeof(uint32_t)), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); diff --git a/shared/test/common/libult/ult_command_stream_receiver.h b/shared/test/common/libult/ult_command_stream_receiver.h index 4346332eb7..44fdc73e43 100644 --- a/shared/test/common/libult/ult_command_stream_receiver.h +++ b/shared/test/common/libult/ult_command_stream_receiver.h @@ -253,7 +253,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw, publ createPerDssBackedBufferCalled++; bool result = BaseClass::createPerDssBackedBuffer(device); if (!perDssBackedBuffer) { - AllocationProperties properties{device.getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::INTERNAL_HEAP, device.getDeviceBitfield()}; + AllocationProperties properties{device.getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP, device.getDeviceBitfield()}; perDssBackedBuffer = executionEnvironment.memoryManager->allocateGraphicsMemoryWithProperties(properties); } return result; 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 099a83771b..245ed80660 100644 --- a/shared/test/common/mocks/linux/mock_drm_memory_manager.cpp +++ b/shared/test/common/mocks/linux/mock_drm_memory_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -70,7 +70,7 @@ void TestedDrmMemoryManager::forceLimitedRangeAllocator(uint64_t range) { } void TestedDrmMemoryManager::overrideGfxPartition(GfxPartition *newGfxPartition) { gfxPartitions[0].reset(newGfxPartition); } -DrmAllocation *TestedDrmMemoryManager::allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, GraphicsAllocation::AllocationType allocationType) { +DrmAllocation *TestedDrmMemoryManager::allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, AllocationType allocationType) { bool allocateMemory = ptr == nullptr; AllocationData allocationData; MockAllocationProperties properties(rootDeviceIndex, allocateMemory, size, allocationType); diff --git a/shared/test/common/mocks/linux/mock_drm_memory_manager.h b/shared/test/common/mocks/linux/mock_drm_memory_manager.h index 828835245d..d573cb80fa 100644 --- a/shared/test/common/mocks/linux/mock_drm_memory_manager.h +++ b/shared/test/common/mocks/linux/mock_drm_memory_manager.h @@ -112,7 +112,7 @@ class TestedDrmMemoryManager : public MemoryManagerCreate { void forceLimitedRangeAllocator(uint64_t range); void overrideGfxPartition(GfxPartition *newGfxPartition); - DrmAllocation *allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, GraphicsAllocation::AllocationType allocationType); + DrmAllocation *allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, AllocationType allocationType); ~TestedDrmMemoryManager() override; size_t peekSharedBosSize() { size_t size = 0; diff --git a/shared/test/common/mocks/mock_allocation_properties.h b/shared/test/common/mocks/mock_allocation_properties.h index 67a658720c..c4a13df3bc 100644 --- a/shared/test/common/mocks/mock_allocation_properties.h +++ b/shared/test/common/mocks/mock_allocation_properties.h @@ -11,12 +11,12 @@ namespace NEO { struct MockAllocationProperties : public AllocationProperties { - MockAllocationProperties(uint32_t rootDeviceIndex, size_t size) : AllocationProperties(rootDeviceIndex, true, size, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, false, mockDeviceBitfield) {} - MockAllocationProperties(uint32_t rootDeviceIndex, size_t size, GraphicsAllocation::AllocationType type) : AllocationProperties(rootDeviceIndex, true, size, type, false, mockDeviceBitfield) {} - MockAllocationProperties(uint32_t rootDeviceIndex, size_t size, DeviceBitfield deviceBitfield) : AllocationProperties(rootDeviceIndex, true, size, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, false, deviceBitfield) {} - MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size) : AllocationProperties(rootDeviceIndex, allocateMemory, size, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, false, mockDeviceBitfield) {} - MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size, DeviceBitfield deviceBitfield) : AllocationProperties(rootDeviceIndex, allocateMemory, size, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, false, deviceBitfield) {} - MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size, GraphicsAllocation::AllocationType allocationType) : AllocationProperties(rootDeviceIndex, allocateMemory, size, allocationType, false, mockDeviceBitfield) {} - MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size, GraphicsAllocation::AllocationType allocationType, DeviceBitfield deviceBitfield) : AllocationProperties(rootDeviceIndex, allocateMemory, size, allocationType, false, deviceBitfield) {} + MockAllocationProperties(uint32_t rootDeviceIndex, size_t size) : AllocationProperties(rootDeviceIndex, true, size, AllocationType::INTERNAL_HOST_MEMORY, 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, 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) {} }; } // namespace NEO diff --git a/shared/test/common/mocks/mock_gmm.h b/shared/test/common/mocks/mock_gmm.h index 7fe9a51250..7b5aac903d 100644 --- a/shared/test/common/mocks/mock_gmm.h +++ b/shared/test/common/mocks/mock_gmm.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -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, GraphicsAllocation::AllocationType::IMAGE, mockDeviceBitfield}); + return memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, true, imgInfo, AllocationType::IMAGE, mockDeviceBitfield}); } }; } // namespace NEO diff --git a/shared/test/common/mocks/mock_memory_manager.cpp b/shared/test/common/mocks/mock_memory_manager.cpp index c377d9c3a6..6c2366f8be 100644 --- a/shared/test/common/mocks/mock_memory_manager.cpp +++ b/shared/test/common/mocks/mock_memory_manager.cpp @@ -128,7 +128,7 @@ GraphicsAllocation *MockMemoryManager::allocateGraphicsMemoryWithAlignment(const return OsAgnosticMemoryManager::allocateGraphicsMemoryWithAlignment(allocationData); } -GraphicsAllocation *MockMemoryManager::allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, GraphicsAllocation::AllocationType allocationType) { +GraphicsAllocation *MockMemoryManager::allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, AllocationType allocationType) { bool allocateMemory = ptr == nullptr; AllocationData allocationData{}; MockAllocationProperties properties(rootDeviceIndex, allocateMemory, size, allocationType); diff --git a/shared/test/common/mocks/mock_memory_manager.h b/shared/test/common/mocks/mock_memory_manager.h index 837bafdfe8..bcd11b3eef 100644 --- a/shared/test/common/mocks/mock_memory_manager.h +++ b/shared/test/common/mocks/mock_memory_manager.h @@ -133,7 +133,7 @@ class MockMemoryManager : public MemoryManagerCreate { bool isCpuCopyRequired(const void *ptr) override { return cpuCopyRequired; } - GraphicsAllocation *allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, GraphicsAllocation::AllocationType allocationType); + GraphicsAllocation *allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, AllocationType allocationType); GraphicsAllocation *allocate32BitGraphicsMemoryImpl(const AllocationData &allocationData, bool useLocalMemory) override; bool isLimitedGPU(uint32_t rootDeviceIndex) override { @@ -290,7 +290,7 @@ class FailMemoryManager : public MockMemoryManager { GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation) override { return nullptr; } - GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) override { + GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override { return nullptr; } diff --git a/shared/test/common/mocks/mock_sip.cpp b/shared/test/common/mocks/mock_sip.cpp index 916e74e4bf..16a7f17c8d 100644 --- a/shared/test/common/mocks/mock_sip.cpp +++ b/shared/test/common/mocks/mock_sip.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -41,7 +41,7 @@ const std::vector &MockSipKernel::getStateSaveAreaHeader() const { void MockSipKernel::createMockSipAllocation() { this->mockSipMemoryAllocation = std::make_unique(0u, - GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL, + AllocationType::KERNEL_ISA_INTERNAL, nullptr, MemoryConstants::pageSize * 10u, 0u, diff --git a/shared/test/common/os_interface/windows/mock_wddm_memory_manager.h b/shared/test/common/os_interface/windows/mock_wddm_memory_manager.h index 7a9b1a6599..64d0f95082 100644 --- a/shared/test/common/os_interface/windows/mock_wddm_memory_manager.h +++ b/shared/test/common/os_interface/windows/mock_wddm_memory_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -59,7 +59,7 @@ class MockWddmMemoryManager : public MemoryManagerCreate { bool validateAllocationMock(WddmAllocation *graphicsAllocation) { return this->validateAllocation(graphicsAllocation); } - GraphicsAllocation *allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, GraphicsAllocation::AllocationType allocationType) { + GraphicsAllocation *allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, AllocationType allocationType) { bool allocateMemory = ptr == nullptr; AllocationData allocationData; MockAllocationProperties properties(rootDeviceIndex, allocateMemory, size, allocationType); diff --git a/shared/test/common/xe_hpc_core/test_encode_xe_hpc_core.cpp b/shared/test/common/xe_hpc_core/test_encode_xe_hpc_core.cpp index 3a8d02d19a..cea7db4ed4 100644 --- a/shared/test/common/xe_hpc_core/test_encode_xe_hpc_core.cpp +++ b/shared/test/common/xe_hpc_core/test_encode_xe_hpc_core.cpp @@ -52,7 +52,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenOffsetWhenProgrammingStatePre constexpr uint64_t gpuVa = 0x100000; constexpr uint32_t gpuVaOffset = 0x10000; - const GraphicsAllocation allocation(0, GraphicsAllocation::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)); @@ -82,7 +82,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenDebugVariableSetwhenProgramin constexpr uint32_t mocsIndexForL3 = (2 << 1); constexpr size_t numCachelines = 3; - const GraphicsAllocation allocation(0, GraphicsAllocation::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, @@ -137,7 +137,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenIsaAllocationWhenProgrammingP EXPECT_EQ(sizeof(STATE_PREFETCH), EncodeMemoryPrefetch::getSizeForMemoryPrefetch(1)); - GraphicsAllocation::AllocationType isaTypes[] = {GraphicsAllocation::AllocationType::KERNEL_ISA, GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL}; + AllocationType isaTypes[] = {AllocationType::KERNEL_ISA, AllocationType::KERNEL_ISA_INTERNAL}; for (uint32_t i = 0; i < 2; i++) { memset(buffer, 0, sizeof(STATE_PREFETCH)); @@ -162,7 +162,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenDebugFlagSetWhenProgramPrefet uint8_t buffer[sizeof(STATE_PREFETCH)] = {}; - GraphicsAllocation::AllocationType isaTypes[] = {GraphicsAllocation::AllocationType::KERNEL_ISA, GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL}; + AllocationType isaTypes[] = {AllocationType::KERNEL_ISA, AllocationType::KERNEL_ISA_INTERNAL}; for (uint32_t i = 0; i < 2; i++) { memset(buffer, 0, sizeof(STATE_PREFETCH)); @@ -190,7 +190,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenSteppingWhenProgrammingPrefet HardwareInfo hwInfo = *defaultHwInfo; hwInfo.platform.usRevId = 0b0100'0111; // [3:5] - BaseDie == A0; - const GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::KERNEL_ISA, + const GraphicsAllocation allocation(0, AllocationType::KERNEL_ISA, nullptr, 1234, 0, 4096, MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); uint8_t buffer[sizeof(STATE_PREFETCH)] = {}; @@ -213,7 +213,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenDebugFlagSetWhenProgrammingPr HardwareInfo hwInfo = *defaultHwInfo; hwInfo.platform.usRevId = 0b0010'1000; // [3:5] - BaseDie != A0 - const GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::BUFFER, + const GraphicsAllocation allocation(0, AllocationType::BUFFER, nullptr, 1234, 0, 4096, MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); uint8_t buffer[sizeof(STATE_PREFETCH)] = {}; @@ -405,7 +405,7 @@ XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenCleanHeapsAndSlmNotChangedAndU XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenStreamWhenEncodingSystemMemoryFenceThenCorrectFenceAddressIsSet) { using STATE_SYSTEM_MEM_FENCE_ADDRESS = typename FamilyType::STATE_SYSTEM_MEM_FENCE_ADDRESS; - const GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, + const GraphicsAllocation allocation(0, AllocationType::UNKNOWN, nullptr, 1234, 0, 4096, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); auto before = cmdContainer->getCommandStream()->getUsed(); 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 21fdcf2429..fff1aefe25 100644 --- a/shared/test/unit_test/command_container/command_container_tests.cpp +++ b/shared/test/unit_test/command_container/command_container_tests.cpp @@ -91,12 +91,12 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenCreatingCommandBufferThenCorre cmdContainer.initialize(pDevice, nullptr); ASSERT_NE(0u, cmdContainer.getCmdBufferAllocations().size()); - EXPECT_EQ(GraphicsAllocation::AllocationType::COMMAND_BUFFER, cmdContainer.getCmdBufferAllocations()[0]->getAllocationType()); + EXPECT_EQ(AllocationType::COMMAND_BUFFER, cmdContainer.getCmdBufferAllocations()[0]->getAllocationType()); cmdContainer.allocateNextCommandBuffer(); ASSERT_LE(2u, cmdContainer.getCmdBufferAllocations().size()); - EXPECT_EQ(GraphicsAllocation::AllocationType::COMMAND_BUFFER, cmdContainer.getCmdBufferAllocations()[1]->getAllocationType()); + EXPECT_EQ(AllocationType::COMMAND_BUFFER, cmdContainer.getCmdBufferAllocations()[1]->getAllocationType()); } TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingHeapsThenSetCorrectAllocationTypes) { @@ -108,10 +108,10 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingHeapsThenSetCorrectA auto heap = cmdContainer.getIndirectHeap(heapType); if (HeapType::INDIRECT_OBJECT == heapType) { - EXPECT_EQ(GraphicsAllocation::AllocationType::INTERNAL_HEAP, heap->getGraphicsAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::INTERNAL_HEAP, heap->getGraphicsAllocation()->getAllocationType()); EXPECT_NE(0u, heap->getHeapGpuStartOffset()); } else { - EXPECT_EQ(GraphicsAllocation::AllocationType::LINEAR_STREAM, heap->getGraphicsAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::LINEAR_STREAM, heap->getGraphicsAllocation()->getAllocationType()); EXPECT_EQ(0u, heap->getHeapGpuStartOffset()); } } @@ -144,7 +144,7 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenEverythingIs TEST_F(CommandContainerTest, givenEnabledLocalMemoryAndIsaInSystemMemoryWhenCmdContainerIsInitializedThenInstructionBaseAddressIsSetToInternalHeap) { DebugManagerStateRestore dbgRestore; - DebugManager.flags.ForceSystemMemoryPlacement.set(1 << (static_cast(GraphicsAllocation::AllocationType::KERNEL_ISA) - 1)); + DebugManager.flags.ForceSystemMemoryPlacement.set(1 << (static_cast(AllocationType::KERNEL_ISA) - 1)); auto executionEnvironment = new NEO::ExecutionEnvironment(); const size_t numDevices = 1; 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 cd6bd076ae..7bfa8babfa 100644 --- a/shared/test/unit_test/command_container/command_encoder_tests.cpp +++ b/shared/test/unit_test/command_container/command_encoder_tests.cpp @@ -51,7 +51,7 @@ HWTEST_F(CommandEncoderTests, whenEncodeMemoryPrefetchCalledThenDoNothing) { uint8_t buffer[MemoryConstants::pageSize] = {}; LinearStream linearStream(buffer, sizeof(buffer)); - GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 123, 456, 789, MemoryPool::LocalMemory); + GraphicsAllocation allocation(0, AllocationType::UNKNOWN, nullptr, 123, 456, 789, MemoryPool::LocalMemory); EncodeMemoryPrefetch::programMemoryPrefetch(linearStream, allocation, 2, 0, *defaultHwInfo); 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 54da77aba9..12ad7f1589 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -18,7 +18,7 @@ HWTEST2_F(CommandEncoderXeHpgCorePlusTests, givenSpecifiedL1CacheControlWhenAppe DebugManagerStateRestore restorer; auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); size_t allocationSize = MemoryConstants::pageSize; - AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, GraphicsAllocation::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 e190d8ede7..4e8f30c05f 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 @@ -718,22 +718,22 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenWriteMe auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{pDevice->getRootDeviceIndex(), MemoryConstants::pageSize}); - const GraphicsAllocation::AllocationType onlyOneTimeAubWritableTypes[] = { - GraphicsAllocation::AllocationType::PIPE, - GraphicsAllocation::AllocationType::CONSTANT_SURFACE, - GraphicsAllocation::AllocationType::GLOBAL_SURFACE, - GraphicsAllocation::AllocationType::KERNEL_ISA, - GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL, - GraphicsAllocation::AllocationType::PRIVATE_SURFACE, - GraphicsAllocation::AllocationType::SCRATCH_SURFACE, - GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE, - GraphicsAllocation::AllocationType::BUFFER, - GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, - GraphicsAllocation::AllocationType::IMAGE, - GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, - GraphicsAllocation::AllocationType::MAP_ALLOCATION, - GraphicsAllocation::AllocationType::SVM_GPU, - GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR}; + 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}; for (auto allocationType : onlyOneTimeAubWritableTypes) { gfxAllocation->setAubWritable(true, GraphicsAllocation::defaultBank); @@ -752,7 +752,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcess aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); aubCsr->initializeEngine(); - auto gfxBufferAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxBufferAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); auto gfxImageAllocation = MockGmm::allocateImage2d(*memoryManager); @@ -773,7 +773,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); - auto gfxBufferAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::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); @@ -798,7 +798,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcess memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); - auto gfxBufferAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::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 1c5b2deeda..6e1815d7e7 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 @@ -274,7 +274,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenNoCpuPtrAndNotLockableAllocationWhe constexpr uint64_t initGpuAddress = 1234; constexpr size_t initSize = 10; MockGraphicsAllocation allocation(nullptr, initGpuAddress, initSize); - allocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER); + allocation.setAllocationType(AllocationType::BUFFER); allocation.overrideMemoryPool(MemoryPool::LocalMemory); aubExecutionEnvironment->executionEnvironment->rootDeviceEnvironments[0]->initGmm(); @@ -309,7 +309,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenNoCpuPtrAndLockableAllocationWhenGe constexpr uint64_t initGpuAddress = 1234; constexpr size_t initSize = 10; MockGraphicsAllocation allocation(nullptr, initGpuAddress, initSize); - allocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + allocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); allocation.overrideMemoryPool(MemoryPool::LocalMemory); aubExecutionEnvironment->executionEnvironment->rootDeviceEnvironments[0]->initGmm(); @@ -595,7 +595,7 @@ HWTEST_F(AubCommandStreamReceiverNoHostPtrTests, givenAubCommandStreamReceiverWh auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr); AllocationProperties allocProperties{0u /* rootDeviceIndex */, true /* allocateMemory */, - imgInfo, GraphicsAllocation::AllocationType::IMAGE, deviceBitfield}; + imgInfo, AllocationType::IMAGE, deviceBitfield}; auto imageAllocation = memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr); ASSERT_NE(nullptr, imageAllocation); 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 228debb466..aa38f9f707 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -100,7 +100,7 @@ HWTEST_F(AubCsrTest, WhenWriteWithAubManagerIsCalledThenAubManagerIsInvokedWithC executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->aubCenter.reset(new AubCenter()); executionEnvironment->initializeMemoryManager(); - auto allocation = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::COMMAND_BUFFER}); + auto allocation = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize, AllocationType::COMMAND_BUFFER}); MockAubManager aubManager; std::unique_ptr> aubCsr(new MockAubCsr("", false, *executionEnvironment, rootDeviceIndex, deviceBitfield)); @@ -116,7 +116,7 @@ HWTEST_F(AubCsrTest, WhenWriteWithAubManagerIsCalledThenAubManagerIsInvokedWithC aubManager.writeMemory2Called = false; - auto allocation2 = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::LINEAR_STREAM}); + auto allocation2 = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize, AllocationType::LINEAR_STREAM}); aubCsr->writeMemoryWithAubManager(*allocation2); EXPECT_TRUE(aubManager.writeMemory2Called); @@ -272,7 +272,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, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); @@ -294,7 +294,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, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); @@ -322,7 +322,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenCompressedGraphicsAllocationWritabl auto mockHardwareContext = static_cast(aubCsr.hardwareContextController->hardwareContexts[0].get()); auto memoryManager = pDevice->getMemoryManager(); - AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()); properties.flags.preferCompressed = true; auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); @@ -346,7 +346,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, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); @@ -369,7 +369,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, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(false); EXPECT_FALSE(AubAllocDump::isWritableBuffer(*gfxAllocation)); @@ -393,7 +393,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, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); gfxAllocation->setAllocDumpable(false, false); @@ -418,7 +418,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, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); @@ -486,7 +486,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, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); gfxAllocation->setAllocDumpable(false, false); @@ -515,7 +515,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, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); 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 2a0c5eeb7d..c894bcc15e 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 @@ -265,7 +265,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenDumpAllocationIsCa auto mockAubFileStream = std::make_unique(); auto aubExecutionEnvironment = getEnvironment>(true, true, true); auto aubCsr = aubExecutionEnvironment->template getCsr>(); - GraphicsAllocation allocation{0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; + GraphicsAllocation allocation{0, AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; 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 39e01e737a..6b04f707f7 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -35,7 +35,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndAllocationWithStorageIn executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo); executionEnvironment.initializeMemoryManager(); - MemoryAllocation allocation(0, GraphicsAllocation::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; @@ -54,7 +54,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndNonLocalMemoryAllocatio executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo); executionEnvironment.initializeMemoryManager(); - MemoryAllocation allocation(0, GraphicsAllocation::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; @@ -70,7 +70,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndAllocationWithStorageIn executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo); executionEnvironment.initializeMemoryManager(); - MemoryAllocation allocation(0, GraphicsAllocation::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; @@ -89,7 +89,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndNonLocalMemoryAllocatio executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo); executionEnvironment.initializeMemoryManager(); - MemoryAllocation allocation(0, GraphicsAllocation::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; @@ -108,7 +108,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryNoncloneableAllocationWith executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo); executionEnvironment.initializeMemoryManager(); - MemoryAllocation allocation(0, GraphicsAllocation::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; @@ -132,7 +132,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryCloneableAllocationWithMan executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo); executionEnvironment.initializeMemoryManager(); - MemoryAllocation allocation(0, GraphicsAllocation::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; @@ -156,7 +156,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryNoncloneableAllocationWith executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo); executionEnvironment.initializeMemoryManager(); - MemoryAllocation allocation(0, GraphicsAllocation::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; @@ -181,7 +181,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndAllocationWithStorageIn executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo); executionEnvironment.initializeMemoryManager(); - MemoryAllocation allocation(0, GraphicsAllocation::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; @@ -308,7 +308,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenSimulatedCommandStreamReceiverWhenClo auto mockHardwareContext = static_cast(csr->hardwareContextController->hardwareContexts[0].get()); int dummy = 1; - GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::UNKNOWN, + GraphicsAllocation graphicsAllocation{0, AllocationType::UNKNOWN, &dummy, 0, 0, sizeof(dummy), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = true; csr->writeMemoryWithAubManager(graphicsAllocation); @@ -331,7 +331,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenCompressedAllocationWhenCloningPageTa gmm.isCompressionEnabled = true; int dummy = 1; - GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::UNKNOWN, + GraphicsAllocation graphicsAllocation{0, AllocationType::UNKNOWN, &dummy, 0, 0, sizeof(dummy), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = true; @@ -358,7 +358,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenTileInstancedAllocationWhenWriteMemor csr->multiOsContextCapable = true; int dummy = 1; - GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::UNKNOWN, + GraphicsAllocation graphicsAllocation{0, AllocationType::UNKNOWN, &dummy, 0, 0, sizeof(dummy), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = false; graphicsAllocation.storageInfo.tileInstanced = true; @@ -390,7 +390,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenCompressedTileInstancedAllocationWhen gmm.isCompressionEnabled = true; int dummy = 1; - GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::UNKNOWN, + GraphicsAllocation graphicsAllocation{0, AllocationType::UNKNOWN, &dummy, 0, 0, sizeof(dummy), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = false; graphicsAllocation.storageInfo.tileInstanced = true; @@ -421,7 +421,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenTileInstancedAllocationWithMissingMem csr->multiOsContextCapable = true; int dummy = 1; - GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::UNKNOWN, + GraphicsAllocation graphicsAllocation{0, AllocationType::UNKNOWN, &dummy, 0, 0, sizeof(dummy), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = false; graphicsAllocation.storageInfo.tileInstanced = true; @@ -437,7 +437,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenCommandBufferAllocationWhenWriteMemor csr->aubManager = mockManager.get(); int dummy = 1; - GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::COMMAND_BUFFER, + GraphicsAllocation graphicsAllocation{0, AllocationType::COMMAND_BUFFER, &dummy, 0, 0, sizeof(dummy), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = true; csr->writeMemoryWithAubManager(graphicsAllocation); @@ -471,7 +471,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenSpecificMemoryPoolAllocationWhenWrite mockHardwareContext->writeMemoryPageSizePassed = 0; mockHardwareContext->writeMemory2Called = false; - GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::COMMAND_BUFFER, + GraphicsAllocation graphicsAllocation{0, AllocationType::COMMAND_BUFFER, &dummy, 0, 0, sizeof(dummy), poolsWith4kPages[i], MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = true; csr->writeMemoryWithAubManager(graphicsAllocation); @@ -504,7 +504,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenSpecificMemoryPoolAllocationWhenWrite mockHardwareContext->writeMemoryPageSizePassed = 0; mockHardwareContext->writeMemory2Called = false; - GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::COMMAND_BUFFER, + GraphicsAllocation graphicsAllocation{0, AllocationType::COMMAND_BUFFER, &dummy, 0, 0, sizeof(dummy), poolsWith64kPages[i], MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = true; csr->writeMemoryWithAubManager(graphicsAllocation); 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 1613e3c3cb..30423836f3 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 @@ -155,7 +155,7 @@ TEST_F(CommandStreamReceiverTest, givenCommandStreamReceiverWhenGetCSIsCalledThe auto commandStreamAllocation = commandStream.getGraphicsAllocation(); ASSERT_NE(nullptr, commandStreamAllocation); - EXPECT_EQ(GraphicsAllocation::AllocationType::COMMAND_BUFFER, commandStreamAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::COMMAND_BUFFER, commandStreamAllocation->getAllocationType()); } HWTEST_F(CommandStreamReceiverTest, whenStoreAllocationThenStoredAllocationHasTaskCountFromCsr) { @@ -909,7 +909,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenInitializeTa uint32_t numRootDevices = 10u; UltDeviceFactory deviceFactory{numRootDevices, 0}; EXPECT_NE(nullptr, deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAllocation()); - EXPECT_EQ(GraphicsAllocation::AllocationType::TAG_BUFFER, deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::TAG_BUFFER, deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAllocation()->getAllocationType()); EXPECT_TRUE(deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAddress() != nullptr); EXPECT_EQ(*deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAddress(), initialHardwareTag); auto tagsMultiAllocation = deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagsMultiAllocation(); @@ -928,7 +928,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenInitializeTa uint32_t numRootDevices = 10u; UltDeviceFactory deviceFactory{numRootDevices, 0}; EXPECT_NE(nullptr, deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAllocation()); - EXPECT_EQ(GraphicsAllocation::AllocationType::TAG_BUFFER, deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::TAG_BUFFER, deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAllocation()->getAllocationType()); EXPECT_TRUE(deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAddress() != nullptr); EXPECT_EQ(*deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAddress(), initialHardwareTag); auto tagsMultiAllocation = deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagsMultiAllocation(); @@ -945,7 +945,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenItIsDestroye bool destructorCalled = false; int gpuTag = 0; - auto mockGraphicsAllocation = new MockGraphicsAllocationWithDestructorTracing(0, GraphicsAllocation::AllocationType::UNKNOWN, &gpuTag, 0llu, 0llu, 1u, MemoryPool::MemoryNull); + auto mockGraphicsAllocation = new MockGraphicsAllocationWithDestructorTracing(0, AllocationType::UNKNOWN, &gpuTag, 0llu, 0llu, 1u, MemoryPool::MemoryNull); mockGraphicsAllocation->destructorCalled = &destructorCalled; MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); auto csr = std::make_unique(executionEnvironment, 0, 1); @@ -971,7 +971,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenInitializeTa EXPECT_EQ(nullptr, csr->getTagAllocation()); csr->initializeTagAllocation(); EXPECT_NE(nullptr, csr->getTagAllocation()); - EXPECT_EQ(GraphicsAllocation::AllocationType::TAG_BUFFER, csr->getTagAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::TAG_BUFFER, csr->getTagAllocation()->getAllocationType()); EXPECT_EQ(csr->getTagAllocation()->getUnderlyingBuffer(), csr->getTagAddress()); auto tagAddress = csr->getTagAddress(); for (uint32_t i = 0; i < 2; i++) { @@ -991,7 +991,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenInitializeTa csr->initializeTagAllocation(); EXPECT_NE(nullptr, csr->getTagAllocation()); - EXPECT_EQ(GraphicsAllocation::AllocationType::TAG_BUFFER, csr->getTagAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::TAG_BUFFER, csr->getTagAllocation()->getAllocationType()); EXPECT_EQ(csr->getTagAllocation()->getUnderlyingBuffer(), csr->getTagAddress()); auto tagAddress = csr->getTagAddress(); @@ -1085,7 +1085,7 @@ TEST(CommandStreamReceiverSimpleTest, givenNewResourceFlushEnabledWhenProvidingN DeviceBitfield deviceBitfield(1); MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield); MockGraphicsAllocation mockAllocation; - mockAllocation.setAllocationType(GraphicsAllocation::AllocationType::KERNEL_ISA); + mockAllocation.setAllocationType(AllocationType::KERNEL_ISA); csr.useNewResourceImplicitFlush = true; csr.newResources = false; @@ -1216,7 +1216,7 @@ TEST(CommandStreamReceiverSimpleTest, givenMultipleActivePartitionsWhenWaitingFo auto hostPtr = reinterpret_cast(0x1234); size_t size = 100; - auto temporaryAllocation = std::make_unique(0, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, hostPtr, size, 0, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); + auto temporaryAllocation = std::make_unique(0, AllocationType::EXTERNAL_HOST_PTR, hostPtr, size, 0, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); temporaryAllocation->updateTaskCount(0u, 0u); csr.getInternalAllocationStorage()->storeAllocationWithTaskCount(std::move(temporaryAllocation), TEMPORARY_ALLOCATION, 2u); @@ -1320,7 +1320,7 @@ TEST_F(CreateAllocationForHostSurfaceTest, givenTemporaryAllocationWhenCreateAll auto hostPtr = reinterpret_cast(0x1234); size_t size = 100; auto temporaryAllocation = std::make_unique(0, - GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, hostPtr, size, 0, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); + AllocationType::EXTERNAL_HOST_PTR, hostPtr, size, 0, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); auto allocationPtr = temporaryAllocation.get(); temporaryAllocation->updateTaskCount(0u, 0u); commandStreamReceiver->getInternalAllocationStorage()->storeAllocation(std::move(temporaryAllocation), TEMPORARY_ALLOCATION); @@ -1358,7 +1358,7 @@ TEST_F(CreateAllocationForHostSurfaceTest, givenReadOnlyHostPointerWhenAllocatio bool runPopulateOsHandlesExpects = false; bool runAllocateGraphicsMemoryForNonSvmHostPtrExpects = false; - if (!mockMemoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, device->getRootDeviceIndex())) { + if (!mockMemoryManager->useNonSvmHostPtrAlloc(AllocationType::EXTERNAL_HOST_PTR, device->getRootDeviceIndex())) { runPopulateOsHandlesExpects = true; mockMemoryManager->populateOsHandlesResult = MemoryManager::AllocationStatus::InvalidHostPointer; } else { @@ -1394,7 +1394,7 @@ TEST_F(CreateAllocationForHostSurfaceTest, givenReadOnlyHostPointerWhenAllocatio bool runPopulateOsHandlesExpects = false; bool runAllocateGraphicsMemoryForNonSvmHostPtrExpects = false; - if (!mockMemoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, device->getRootDeviceIndex())) { + if (!mockMemoryManager->useNonSvmHostPtrAlloc(AllocationType::EXTERNAL_HOST_PTR, device->getRootDeviceIndex())) { runPopulateOsHandlesExpects = true; mockMemoryManager->populateOsHandlesResult = MemoryManager::AllocationStatus::InvalidHostPointer; } else { @@ -1439,7 +1439,7 @@ TEST_F(ReducedAddrSpaceCommandStreamReceiverTest, } TEST_F(CommandStreamReceiverTest, givenMinimumSizeDoesNotExceedCurrentWhenCallingEnsureCommandBufferAllocationThenDoNotReallocate) { - GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); LinearStream commandStream{allocation}; commandStreamReceiver->ensureCommandBufferAllocation(commandStream, 100u, 0u); @@ -1454,7 +1454,7 @@ TEST_F(CommandStreamReceiverTest, givenMinimumSizeDoesNotExceedCurrentWhenCallin } TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentWhenCallingEnsureCommandBufferAllocationThenReallocate) { - GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); LinearStream commandStream{allocation}; commandStreamReceiver->ensureCommandBufferAllocation(commandStream, 129u, 0u); @@ -1463,7 +1463,7 @@ TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentWhenCallingEnsur } TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentWhenCallingEnsureCommandBufferAllocationThenReallocateAndAlignSizeTo64kb) { - GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); LinearStream commandStream{allocation}; commandStreamReceiver->ensureCommandBufferAllocation(commandStream, 129u, 0u); @@ -1478,7 +1478,7 @@ TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentWhenCallingEnsur } TEST_F(CommandStreamReceiverTest, givenAdditionalAllocationSizeWhenCallingEnsureCommandBufferAllocationThenSizesOfAllocationAndCommandBufferAreCorrect) { - GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); LinearStream commandStream{allocation}; commandStreamReceiver->ensureCommandBufferAllocation(commandStream, 129u, 350u); @@ -1500,7 +1500,7 @@ TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentAndNoAllocations } TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentAndAllocationsForReuseWhenCallingEnsureCommandBufferAllocationThenObtainAllocationFromInternalAllocationStorage) { - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize64k, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize64k, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); internalAllocationStorage->storeAllocation(std::unique_ptr{allocation}, REUSABLE_ALLOCATION); LinearStream commandStream; @@ -1513,7 +1513,7 @@ TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentAndAllocationsFo } TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentAndNoSuitableReusableAllocationWhenCallingEnsureCommandBufferAllocationThenObtainAllocationMemoryManager) { - auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize64k, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()}); + auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize64k, AllocationType::COMMAND_BUFFER, 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 519a024e2f..47375989d0 100644 --- a/shared/test/unit_test/command_stream/compute_mode_tests.h +++ b/shared/test/unit_test/command_stream/compute_mode_tests.h @@ -78,7 +78,7 @@ struct ComputeModeRequirements : public ::testing::Test { csr = new myCsr(*device->executionEnvironment, device->getDeviceBitfield()); device->resetCommandStreamReceiver(csr); - AllocationProperties properties(device->getRootDeviceIndex(), false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, {}); + AllocationProperties properties(device->getRootDeviceIndex(), false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); alloc = device->getMemoryManager()->createGraphicsAllocationFromSharedHandle(static_cast(123), properties, false, false); } 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 4ad8296248..59fb9fd371 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -170,7 +170,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenWriteMemoryIsCa MemoryManager *memoryManager = tbxCsr->getMemoryManager(); ASSERT_NE(nullptr, memoryManager); - auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pCommandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::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)); @@ -186,7 +186,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenWriteMemoryIsCa MemoryManager *memoryManager = tbxCsr->getMemoryManager(); ASSERT_NE(nullptr, memoryManager); - auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pCommandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pCommandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); ASSERT_NE(nullptr, graphicsAllocation); tbxCsr->setTbxWritable(false, *graphicsAllocation); @@ -777,7 +777,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenProcessResidencyIsCalledWithDumpT memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); tbxCsr->setTbxWritable(false, *gfxAllocation); tbxCsr->dumpTbxNonWritable = true; @@ -797,7 +797,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenProcessResidencyIsCalledWithoutDu memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext); - auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); tbxCsr->setTbxWritable(false, *gfxAllocation); EXPECT_FALSE(tbxCsr->dumpTbxNonWritable); @@ -890,7 +890,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, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); tbxCsr.dumpAllocation(*gfxAllocation); EXPECT_FALSE(mockHardwareContext->dumpSurfaceCalled); @@ -906,7 +906,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, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); @@ -928,7 +928,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, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); @@ -950,7 +950,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, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); gfxAllocation->setAllocDumpable(false, false); @@ -1022,7 +1022,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, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); gfxAllocation->setAllocDumpable(false, false); @@ -1052,7 +1052,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, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()}); tbxCsr.dumpAllocation(*gfxAllocation); EXPECT_TRUE(tbxCsr.dumpAllocationCalled); diff --git a/shared/test/unit_test/device/neo_device_tests.cpp b/shared/test/unit_test/device/neo_device_tests.cpp index 4811b40061..bbcab884e7 100644 --- a/shared/test/unit_test/device/neo_device_tests.cpp +++ b/shared/test/unit_test/device/neo_device_tests.cpp @@ -247,7 +247,7 @@ TEST_F(DeviceGetCapsTest, givenFlagEnabled64kbPagesWhenCallConstructorMemoryMana void addAllocationToHostPtrManager(GraphicsAllocation *memory) override{}; void removeAllocationFromHostPtrManager(GraphicsAllocation *memory) override{}; GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation) override { return nullptr; }; - GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) override { return nullptr; }; + GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override { return nullptr; }; AllocationStatus populateOsHandles(OsHandleStorage &handleStorage, uint32_t rootDeviceIndex) override { return AllocationStatus::Success; }; void cleanOsHandles(OsHandleStorage &handleStorage, uint32_t rootDeviceIndex) override{}; void freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation) override{}; 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 2914a404ef..15f27ddc2a 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 @@ -143,7 +143,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenAllocateOsResourcesFenceCreation MemoryManager *memoryManager = device->getExecutionEnvironment()->memoryManager.get(); const auto allocationSize = MemoryConstants::pageSize; const AllocationProperties commandStreamAllocationProperties{device->getRootDeviceIndex(), allocationSize, - GraphicsAllocation::AllocationType::RING_BUFFER, device->getDeviceBitfield()}; + AllocationType::RING_BUFFER, device->getDeviceBitfield()}; GraphicsAllocation *ringBuffer = memoryManager->allocateGraphicsMemoryWithProperties(commandStreamAllocationProperties); ASSERT_NE(nullptr, ringBuffer); diff --git a/shared/test/unit_test/encoders/command_encoder_tests_xehp_and_later.cpp b/shared/test/unit_test/encoders/command_encoder_tests_xehp_and_later.cpp index e59066a9e9..f39a22f40c 100644 --- a/shared/test/unit_test/encoders/command_encoder_tests_xehp_and_later.cpp +++ b/shared/test/unit_test/encoders/command_encoder_tests_xehp_and_later.cpp @@ -102,7 +102,7 @@ HWTEST2_F(XeHPAndLaterCommandEncoderTest, auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get(); size_t allocationSize = MemoryConstants::pageSize; - AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()); + AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); auto outSurfaceState = FamilyType::cmdInitRenderSurfaceState; diff --git a/shared/test/unit_test/encoders/test_encode_states.cpp b/shared/test/unit_test/encoders/test_encode_states.cpp index c2b54b1d80..8b7dfe1631 100644 --- a/shared/test/unit_test/encoders/test_encode_states.cpp +++ b/shared/test/unit_test/encoders/test_encode_states.cpp @@ -193,7 +193,7 @@ HWTEST_F(CommandEncodeStatesTest, givenCreatedSurfaceStateBufferWhenAllocationPr uint64_t gpuAddr = 0x4000u; size_t allocSize = size; length.Length = static_cast(allocSize - 1); - GraphicsAllocation allocation(0, GraphicsAllocation::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/heap_assigner/heap_assigner_tests.cpp b/shared/test/unit_test/heap_assigner/heap_assigner_tests.cpp index 6e6d3100eb..3ee26ba247 100644 --- a/shared/test/unit_test/heap_assigner/heap_assigner_tests.cpp +++ b/shared/test/unit_test/heap_assigner/heap_assigner_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -18,34 +18,34 @@ class AlocationHelperTests : public Test { HWTEST_F(AlocationHelperTests, givenKernelIsaTypeWhenUse32BitHeapCalledThenTrueReturned) { - EXPECT_TRUE(heapAssigner.use32BitHeap(GraphicsAllocation::AllocationType::KERNEL_ISA)); - EXPECT_TRUE(heapAssigner.use32BitHeap(GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL)); + EXPECT_TRUE(heapAssigner.use32BitHeap(AllocationType::KERNEL_ISA)); + EXPECT_TRUE(heapAssigner.use32BitHeap(AllocationType::KERNEL_ISA_INTERNAL)); } HWTEST_F(AlocationHelperTests, givenKernelIsaTypeWhenUseIternalAllocatorThenUseHeapInternal) { - auto heapIndex = heapAssigner.get32BitHeapIndex(GraphicsAllocation::AllocationType::KERNEL_ISA, true, *defaultHwInfo, false); + auto heapIndex = heapAssigner.get32BitHeapIndex(AllocationType::KERNEL_ISA, true, *defaultHwInfo, false); EXPECT_EQ(heapIndex, NEO::HeapIndex::HEAP_INTERNAL_DEVICE_MEMORY); - heapIndex = heapAssigner.get32BitHeapIndex(GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL, true, *defaultHwInfo, false); + heapIndex = heapAssigner.get32BitHeapIndex(AllocationType::KERNEL_ISA_INTERNAL, true, *defaultHwInfo, false); EXPECT_EQ(heapIndex, NEO::HeapIndex::HEAP_INTERNAL_DEVICE_MEMORY); } HWTEST_F(AlocationHelperTests, givenNotInternalTypeWhenUseIternalAllocatorThenUseHeapExternal) { - auto heapIndex = heapAssigner.get32BitHeapIndex(GraphicsAllocation::AllocationType::LINEAR_STREAM, true, *defaultHwInfo, false); + auto heapIndex = heapAssigner.get32BitHeapIndex(AllocationType::LINEAR_STREAM, true, *defaultHwInfo, false); EXPECT_EQ(heapIndex, NEO::HeapIndex::HEAP_EXTERNAL_DEVICE_MEMORY); } HWTEST_F(AlocationHelperTests, givenKernelIsaTypesWhenUseInternalAllocatorCalledThenTrueReturned) { - EXPECT_TRUE(heapAssigner.useInternal32BitHeap(GraphicsAllocation::AllocationType::KERNEL_ISA)); - EXPECT_TRUE(heapAssigner.useInternal32BitHeap(GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL)); + EXPECT_TRUE(heapAssigner.useInternal32BitHeap(AllocationType::KERNEL_ISA)); + EXPECT_TRUE(heapAssigner.useInternal32BitHeap(AllocationType::KERNEL_ISA_INTERNAL)); } HWTEST_F(AlocationHelperTests, givenInternalHeapTypeWhenUseInternalAllocatorCalledThenTrueReturned) { - EXPECT_TRUE(heapAssigner.useInternal32BitHeap(GraphicsAllocation::AllocationType::INTERNAL_HEAP)); + EXPECT_TRUE(heapAssigner.useInternal32BitHeap(AllocationType::INTERNAL_HEAP)); } HWTEST_F(AlocationHelperTests, givenNotInternalHeapTypeWhenUseInternalAllocatorCalledThenFalseReturned) { - EXPECT_FALSE(heapAssigner.useInternal32BitHeap(GraphicsAllocation::AllocationType::BUFFER)); + EXPECT_FALSE(heapAssigner.useInternal32BitHeap(AllocationType::BUFFER)); } } // namespace NEO \ No newline at end of file diff --git a/shared/test/unit_test/helpers/app_resource_tests.cpp b/shared/test/unit_test/helpers/app_resource_tests.cpp index 9fda3087a8..8db8fc9b7f 100644 --- a/shared/test/unit_test/helpers/app_resource_tests.cpp +++ b/shared/test/unit_test/helpers/app_resource_tests.cpp @@ -36,16 +36,16 @@ struct AppResourceTests : public MockExecutionEnvironmentTagTest { }; TEST_F(AppResourceTests, givenIncorrectGraphicsAllocationTypeWhenGettingResourceTagThenNOTFOUNDIsReturned) { - auto tag = AppResourceHelper::getResourceTagStr(static_cast(999)); + auto tag = AppResourceHelper::getResourceTagStr(static_cast(999)); EXPECT_STREQ(tag, "NOTFOUND"); } TEST_F(AppResourceTests, givenGraphicsAllocationTypeWhenGettingResourceTagThenForEveryDefinedTypeProperTagExist) { - auto firstTypeIdx = static_cast(GraphicsAllocation::AllocationType::UNKNOWN); - auto lastTypeIdx = static_cast(GraphicsAllocation::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); + auto allocationType = static_cast(typeIdx); auto tag = AppResourceHelper::getResourceTagStr(allocationType); EXPECT_LE(strlen(tag), AppResourceDefines::maxStrLen); @@ -54,56 +54,56 @@ TEST_F(AppResourceTests, givenGraphicsAllocationTypeWhenGettingResourceTagThenFo } struct AllocationTypeTagTestCase { - GraphicsAllocation::AllocationType type; + AllocationType type; const char *str; }; -AllocationTypeTagTestCase allocationTypeTagValues[static_cast(GraphicsAllocation::AllocationType::COUNT)] = { - {GraphicsAllocation::AllocationType::BUFFER, "BUFFER"}, - {GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, "BFHSTMEM"}, - {GraphicsAllocation::AllocationType::COMMAND_BUFFER, "CMNDBUFF"}, - {GraphicsAllocation::AllocationType::CONSTANT_SURFACE, "CSNTSRFC"}, - {GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, "EXHSTPTR"}, - {GraphicsAllocation::AllocationType::FILL_PATTERN, "FILPATRN"}, - {GraphicsAllocation::AllocationType::GLOBAL_SURFACE, "GLBLSRFC"}, - {GraphicsAllocation::AllocationType::IMAGE, "IMAGE"}, - {GraphicsAllocation::AllocationType::INDIRECT_OBJECT_HEAP, "INOBHEAP"}, - {GraphicsAllocation::AllocationType::INSTRUCTION_HEAP, "INSTHEAP"}, - {GraphicsAllocation::AllocationType::INTERNAL_HEAP, "INTLHEAP"}, - {GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, "INHSTMEM"}, - {GraphicsAllocation::AllocationType::KERNEL_ISA, "KERNLISA"}, - {GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL, "KRLISAIN"}, - {GraphicsAllocation::AllocationType::LINEAR_STREAM, "LINRSTRM"}, - {GraphicsAllocation::AllocationType::MAP_ALLOCATION, "MAPALLOC"}, - {GraphicsAllocation::AllocationType::MCS, "MCS"}, - {GraphicsAllocation::AllocationType::PIPE, "PIPE"}, - {GraphicsAllocation::AllocationType::PREEMPTION, "PRMPTION"}, - {GraphicsAllocation::AllocationType::PRINTF_SURFACE, "PRNTSRFC"}, - {GraphicsAllocation::AllocationType::PRIVATE_SURFACE, "PRVTSRFC"}, - {GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER, "PROFTGBF"}, - {GraphicsAllocation::AllocationType::SCRATCH_SURFACE, "SCRHSRFC"}, - {GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE, "WRPRTSRF"}, - {GraphicsAllocation::AllocationType::SHARED_BUFFER, "SHRDBUFF"}, - {GraphicsAllocation::AllocationType::SHARED_CONTEXT_IMAGE, "SRDCXIMG"}, - {GraphicsAllocation::AllocationType::SHARED_IMAGE, "SHERDIMG"}, - {GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY, "SRDRSCCP"}, - {GraphicsAllocation::AllocationType::SURFACE_STATE_HEAP, "SRFCSTHP"}, - {GraphicsAllocation::AllocationType::SVM_CPU, "SVM_CPU"}, - {GraphicsAllocation::AllocationType::SVM_GPU, "SVM_GPU"}, - {GraphicsAllocation::AllocationType::SVM_ZERO_COPY, "SVM0COPY"}, - {GraphicsAllocation::AllocationType::TAG_BUFFER, "TAGBUFER"}, - {GraphicsAllocation::AllocationType::GLOBAL_FENCE, "GLBLFENC"}, - {GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, "TSPKTGBF"}, - {GraphicsAllocation::AllocationType::UNKNOWN, "UNKNOWN"}, - {GraphicsAllocation::AllocationType::WRITE_COMBINED, "WRTCMBND"}, - {GraphicsAllocation::AllocationType::RING_BUFFER, "RINGBUFF"}, - {GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER, "SMPHRBUF"}, - {GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA, "DBCXSVAR"}, - {GraphicsAllocation::AllocationType::DEBUG_SBA_TRACKING_BUFFER, "DBSBATRB"}, - {GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA, "DBMDLARE"}, - {GraphicsAllocation::AllocationType::UNIFIED_SHARED_MEMORY, "USHRDMEM"}, - {GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, "GPUTSDBF"}, - {GraphicsAllocation::AllocationType::SW_TAG_BUFFER, "SWTAGBF"}}; +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_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_CONTEXT_IMAGE, "SRDCXIMG"}, + {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"}}; class AllocationTypeTagString : public ::testing::TestWithParam {}; TEST_P(AllocationTypeTagString, givenGraphicsAllocationTypeWhenCopyTagToStorageInfoThenCorrectTagIsReturned) { 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 d1fe366cc9..bf6f9f0af6 100644 --- a/shared/test/unit_test/memory_manager/graphics_allocation_tests.cpp +++ b/shared/test/unit_test/memory_manager/graphics_allocation_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -13,15 +13,15 @@ using namespace NEO; TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenIsCreatedThenAllInspectionIdsAreSetToZero) { - MockGraphicsAllocation graphicsAllocation(0, GraphicsAllocation::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, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); - GraphicsAllocation graphicsAllocation2(0, GraphicsAllocation::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)); @@ -116,51 +116,51 @@ TEST(GraphicsAllocationTest, givenResidentGraphicsAllocationWhenCheckIfResidency } TEST(GraphicsAllocationTest, whenAllocationTypeIsCommandBufferThenCpuAccessIsRequired) { - EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::COMMAND_BUFFER)); + EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::COMMAND_BUFFER)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsConstantSurfaceThenCpuAccessIsRequired) { - EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::CONSTANT_SURFACE)); + EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::CONSTANT_SURFACE)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsGlobalSurfaceThenCpuAccessIsRequired) { - EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::GLOBAL_SURFACE)); + EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::GLOBAL_SURFACE)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsInternalHeapThenCpuAccessIsRequired) { - EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::INTERNAL_HEAP)); + EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::INTERNAL_HEAP)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsKernelIsaThenCpuAccessIsNotRequired) { - EXPECT_FALSE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::KERNEL_ISA)); + EXPECT_FALSE(GraphicsAllocation::isCpuAccessRequired(AllocationType::KERNEL_ISA)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsKernelIsaInternalThenCpuAccessIsNotRequired) { - EXPECT_FALSE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL)); + EXPECT_FALSE(GraphicsAllocation::isCpuAccessRequired(AllocationType::KERNEL_ISA_INTERNAL)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsLinearStreamThenCpuAccessIsRequired) { - EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::LINEAR_STREAM)); + EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::LINEAR_STREAM)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsPipeThenCpuAccessIsRequired) { - EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::PIPE)); + EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::PIPE)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsTimestampPacketThenCpuAccessIsRequired) { - EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER)); + EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::TIMESTAMP_PACKET_TAG_BUFFER)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsGpuTimestampDeviceBufferThenCpuAccessIsRequired) { - EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER)); + EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER)); } TEST(GraphicsAllocationTest, whenAllocationRequiresCpuAccessThenAllocationIsLockable) { - auto firstAllocationIdx = static_cast(GraphicsAllocation::AllocationType::UNKNOWN); - auto lastAllocationIdx = static_cast(GraphicsAllocation::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); + auto allocationType = static_cast(allocationIdx); if (GraphicsAllocation::isCpuAccessRequired(allocationType)) { EXPECT_TRUE(GraphicsAllocation::isLockable(allocationType)); } @@ -168,32 +168,32 @@ TEST(GraphicsAllocationTest, whenAllocationRequiresCpuAccessThenAllocationIsLock } TEST(GraphicsAllocationTest, whenAllocationTypeIsISAThenAllocationIsLockable) { - EXPECT_TRUE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::KERNEL_ISA)); - EXPECT_TRUE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL)); + EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::KERNEL_ISA)); + EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::KERNEL_ISA_INTERNAL)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsBufferThenAllocationIsNotLockable) { - EXPECT_FALSE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::BUFFER)); + EXPECT_FALSE(GraphicsAllocation::isLockable(AllocationType::BUFFER)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsBufferHostMemoryThenAllocationIsLockable) { - EXPECT_TRUE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY)); + EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::BUFFER_HOST_MEMORY)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsGpuTimestampDeviceBufferThenAllocationIsLockable) { - EXPECT_TRUE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER)); + EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsSvmGpuThenAllocationIsNotLockable) { - EXPECT_FALSE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::SVM_GPU)); + EXPECT_FALSE(GraphicsAllocation::isLockable(AllocationType::SVM_GPU)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsSharedResourceCopyThenAllocationIsLockable) { - EXPECT_TRUE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY)); + EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::SHARED_RESOURCE_COPY)); } TEST(GraphicsAllocationTest, whenAllocationTypeIsImageThenAllocationIsNotLockable) { - EXPECT_FALSE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::IMAGE)); + EXPECT_FALSE(GraphicsAllocation::isLockable(AllocationType::IMAGE)); } TEST(GraphicsAllocationTest, givenDefaultAllocationWhenGettingNumHandlesThenOneIsReturned) { @@ -223,7 +223,7 @@ TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenQueryingUsedPageSizeThen MemoryPool::SystemCpuInaccessible}; for (auto pool : page4kPools) { - MockGraphicsAllocation graphicsAllocation(0, GraphicsAllocation::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()); } @@ -233,7 +233,7 @@ TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenQueryingUsedPageSizeThen MemoryPool::LocalMemory}; for (auto pool : page64kPools) { - MockGraphicsAllocation graphicsAllocation(0, GraphicsAllocation::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/multi_graphics_allocation_tests.cpp b/shared/test/unit_test/memory_manager/multi_graphics_allocation_tests.cpp index 1e34cb5046..ac2ec9b10b 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -20,7 +20,7 @@ using namespace NEO; TEST(MultiGraphicsAllocationTest, whenCreatingMultiGraphicsAllocationThenTheAllocationIsObtainableAsADefault) { GraphicsAllocation graphicsAllocation(1, // rootDeviceIndex - GraphicsAllocation::AllocationType::BUFFER, + AllocationType::BUFFER, nullptr, 0, 0, MemoryPool::System4KBPages, 0); MockMultiGraphicsAllocation multiGraphicsAllocation(1); @@ -36,10 +36,10 @@ TEST(MultiGraphicsAllocationTest, whenCreatingMultiGraphicsAllocationThenTheAllo TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenAddingMultipleGraphicsAllocationsThenTheyAreObtainableByRootDeviceIndex) { GraphicsAllocation graphicsAllocation0(0, // rootDeviceIndex - GraphicsAllocation::AllocationType::BUFFER, + AllocationType::BUFFER, nullptr, 0, 0, MemoryPool::System4KBPages, 0); GraphicsAllocation graphicsAllocation1(1, // rootDeviceIndex - GraphicsAllocation::AllocationType::BUFFER, + AllocationType::BUFFER, nullptr, 0, 0, MemoryPool::System4KBPages, 0); MockMultiGraphicsAllocation multiGraphicsAllocation(1); @@ -53,7 +53,7 @@ TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenAddingMultiple } TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenGettingAllocationTypeThenReturnAllocationTypeFromDefaultAllocation) { - auto expectedAllocationType = GraphicsAllocation::AllocationType::BUFFER; + auto expectedAllocationType = AllocationType::BUFFER; GraphicsAllocation graphicsAllocation(1, // rootDeviceIndex expectedAllocationType, nullptr, 0, 0, MemoryPool::System4KBPages, 0); @@ -66,7 +66,7 @@ TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenGettingAllocat } TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenGettingCoherencyStatusThenReturnCoherencyStatusFromDefaultAllocation) { - auto expectedAllocationType = GraphicsAllocation::AllocationType::BUFFER; + auto expectedAllocationType = AllocationType::BUFFER; GraphicsAllocation graphicsAllocation(1, // rootDeviceIndex expectedAllocationType, nullptr, 0, 0, MemoryPool::System4KBPages, 0); @@ -89,7 +89,7 @@ TEST(MultiGraphicsAllocationTest, WhenCreatingMultiGraphicsAllocationWithoutGrap TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenRemovingGraphicsAllocationThenTheAllocationIsNoLongerAvailable) { uint32_t rootDeviceIndex = 1u; GraphicsAllocation graphicsAllocation(rootDeviceIndex, - GraphicsAllocation::AllocationType::BUFFER, + AllocationType::BUFFER, nullptr, 0, 0, MemoryPool::System4KBPages, 0); MockMultiGraphicsAllocation multiGraphicsAllocation(rootDeviceIndex); @@ -126,7 +126,7 @@ TEST_F(MultiGraphicsAllocationTests, whenCreatingMultiGraphicsAllocationWithShar AllocationProperties allocationProperties{0u, true, //allocateMemory MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, + AllocationType::BUFFER_HOST_MEMORY, false, //multiOsContextCapable false, //isMultiStorageAllocationParam systemMemoryBitfield}; @@ -149,7 +149,7 @@ TEST_F(MultiGraphicsAllocationTests, whenCreatingMultiGraphicsAllocationWithExis AllocationProperties allocationProperties{0u, false, //allocateMemory MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, + AllocationType::BUFFER_HOST_MEMORY, false, //multiOsContextCapable false, //isMultiStorageAllocationParam systemMemoryBitfield}; @@ -170,7 +170,7 @@ TEST_F(MultiGraphicsAllocationTests, whenCreatingMultiGraphicsAllocationWithSepa AllocationProperties allocationProperties{0u, true, //allocateMemory MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, + AllocationType::BUFFER_HOST_MEMORY, false, //multiOsContextCapable false, //isMultiStorageAllocationParam systemMemoryBitfield}; @@ -190,7 +190,7 @@ TEST_F(MultiGraphicsAllocationTests, givenMultiGraphicsAllocationThatRequiresMig AllocationProperties allocationProperties{0u, true, //allocateMemory MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, + AllocationType::BUFFER_HOST_MEMORY, false, //multiOsContextCapable false, //isMultiStorageAllocationParam systemMemoryBitfield}; @@ -222,7 +222,7 @@ struct MigrationSyncDataTests : public MultiGraphicsAllocationTests { AllocationProperties allocationProperties{0u, true, //allocateMemory MemoryConstants::pageSize, - GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, + AllocationType::BUFFER_HOST_MEMORY, 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 3afad87237..7de2ff631d 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -71,7 +71,7 @@ TEST_F(FrontWindowAllocatorTests, givenInitializedHeapsWhenUseExternalAllocatorF } TEST_F(FrontWindowAllocatorTests, givenLinearStreamAllocWhenSelectingHeapWithFrontWindowThenCorrectIndexReturned) { - GraphicsAllocation allocation{0, GraphicsAllocation::AllocationType::LINEAR_STREAM, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; + GraphicsAllocation allocation{0, AllocationType::LINEAR_STREAM, nullptr, 0, 0, 0, MemoryPool::MemoryNull}; EXPECT_EQ(HeapIndex::HEAP_EXTERNAL_FRONT_WINDOW, memManager->selectHeap(&allocation, true, true, true)); } 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 2a52b068ea..66c46dbbe3 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 @@ -87,6 +87,6 @@ TEST(DrmQueryTest, givenDrmAllocationWhenShouldAllocationFaultIsCalledThenReturn executionEnvironment->prepareRootDeviceEnvironments(1); DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]}; - MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::MemoryNull); + MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::MemoryNull); EXPECT_FALSE(allocation.shouldAllocationPageFault(&drm)); } diff --git a/shared/test/unit_test/program/program_initialization_tests.cpp b/shared/test/unit_test/program/program_initialization_tests.cpp index 58c67d2621..9532131d47 100644 --- a/shared/test/unit_test/program/program_initialization_tests.cpp +++ b/shared/test/unit_test/program/program_initialization_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -35,7 +35,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(GraphicsAllocation::AllocationType::CONSTANT_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::CONSTANT_SURFACE, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); alloc = allocateGlobalsSurface(&svmAllocsManager, device, initData.size(), false /* constant */, nullptr /* linker input */, initData.data()); @@ -43,7 +43,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(GraphicsAllocation::AllocationType::GLOBAL_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::GLOBAL_SURFACE, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); alloc = allocateGlobalsSurface(&svmAllocsManager, device, initData.size(), true /* constant */, &emptyLinkerInput, initData.data()); @@ -51,7 +51,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(GraphicsAllocation::AllocationType::CONSTANT_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::CONSTANT_SURFACE, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); alloc = allocateGlobalsSurface(&svmAllocsManager, device, initData.size(), false /* constant */, &emptyLinkerInput, initData.data()); @@ -59,7 +59,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(GraphicsAllocation::AllocationType::GLOBAL_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::GLOBAL_SURFACE, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); } @@ -121,28 +121,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(GraphicsAllocation::AllocationType::CONSTANT_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::CONSTANT_SURFACE, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); alloc = allocateGlobalsSurface(nullptr, device, initData.size(), 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(GraphicsAllocation::AllocationType::CONSTANT_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::CONSTANT_SURFACE, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); alloc = allocateGlobalsSurface(nullptr, device, initData.size(), 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(GraphicsAllocation::AllocationType::GLOBAL_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::GLOBAL_SURFACE, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); alloc = allocateGlobalsSurface(nullptr, device, initData.size(), 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(GraphicsAllocation::AllocationType::GLOBAL_SURFACE, alloc->getAllocationType()); + EXPECT_EQ(AllocationType::GLOBAL_SURFACE, alloc->getAllocationType()); device.getMemoryManager()->freeGraphicsMemory(alloc); } @@ -236,7 +236,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(GraphicsAllocation::AllocationType::CONSTANT_SURFACE, pAllocation->getAllocationType()); + EXPECT_EQ(AllocationType::CONSTANT_SURFACE, pAllocation->getAllocationType()); if (pAllocation->isAllocatedInLocalMemoryPool() && (localMemoryAccessMode == LocalMemoryAccessMode::CpuAccessDisallowed)) { expectedBlitsCount++; 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 83bad7f4a6..a49fb56654 100644 --- a/shared/test/unit_test/utilities/software_tags_manager_tests.cpp +++ b/shared/test/unit_test/utilities/software_tags_manager_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -52,7 +52,7 @@ struct SoftwareTagsManagerTests : public DeviceFixture, public ::testing::Test { const AllocationProperties properties{ pDevice->getRootDeviceIndex(), SWTagsManager::estimateSpaceForSWTags(), - GraphicsAllocation::AllocationType::LINEAR_STREAM, + AllocationType::LINEAR_STREAM, pDevice->getDeviceBitfield()}; GraphicsAllocation *allocation = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); 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 737a9affa1..6de50646a2 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -24,7 +24,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, GraphicsAllocation::AllocationType::BUFFER, device->getDeviceBitfield()}); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, device->getDeviceBitfield()}); gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation));