From 48f01f28f54e2959a54a230f070e9cebab51323d Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Wed, 6 Oct 2021 17:00:24 +0000 Subject: [PATCH] Move core part of MemoryPropertiesHelpers to shared Signed-off-by: Mateusz Jablonski --- opencl/source/api/api.cpp | 22 +-- opencl/source/helpers/CMakeLists.txt | 6 +- ...s.cpp => cl_memory_properties_helpers.cpp} | 26 +--- .../helpers/cl_memory_properties_helpers.h | 27 ++++ ... => cl_memory_properties_helpers_base.inl} | 35 +---- opencl/source/mem_obj/buffer.cpp | 18 +-- opencl/source/mem_obj/image.cpp | 24 ++-- opencl/source/mem_obj/mem_obj_helper.h | 1 - .../source/mem_obj/mem_obj_helper_common.inl | 2 + opencl/source/mem_obj/pipe.cpp | 6 +- opencl/source/sharings/d3d/d3d_surface.cpp | 4 +- .../enqueue_copy_image_aub_tests.cpp | 4 +- .../enqueue_fill_image_aub_tests.cpp | 2 +- .../enqueue_kernel_aub_tests.cpp | 2 +- .../enqueue_map_image_aub_tests.cpp | 2 +- .../enqueue_read_buffer_aub_tests.cpp | 2 +- .../enqueue_read_image_aub_tests.cpp | 2 +- .../enqueue_read_write_image_aub_fixture.h | 4 +- .../enqueue_verify_memory_image_aub_tests.cpp | 2 +- .../enqueue_write_image_aub_tests.cpp | 2 +- .../enqueue_parent_kernel_tests_gen11.cpp | 2 +- .../enqueue_parent_kernel_tests_gen8.cpp | 2 +- .../enqueue_parent_kernel_tests_gen9.cpp | 2 +- .../run_kernel_aub_tests_skl.cpp | 4 +- .../mem_obj/create_image_aub_tests.cpp | 10 +- .../command_queue/enqueue_map_image_tests.cpp | 4 +- .../command_queue/enqueue_thread_tests.cpp | 16 +-- .../multiple_map_image_tests.cpp | 2 +- .../aub_command_stream_receiver_2_tests.cpp | 2 +- ...d_stream_receiver_tests_xehp_and_later.cpp | 2 +- .../context/driver_diagnostics_tests.cpp | 12 +- .../test/unit_test/fixtures/image_fixture.h | 4 +- .../unit_test/gen11/image_tests_gen11.cpp | 2 +- .../unit_test/helpers/base_object_tests.cpp | 2 +- .../memory_properties_helpers_tests.cpp | 136 +++++++++--------- .../kernel/kernel_image_arg_tests.cpp | 18 +-- opencl/test/unit_test/kernel/kernel_tests.cpp | 6 +- .../test/unit_test/mem_obj/buffer_tests.cpp | 30 ++-- .../mem_obj/buffer_tests_xehp_and_later.cpp | 4 +- .../mem_obj/create_image_format_tests.cpp | 8 +- .../create_image_in_local_memory_tests.cpp | 4 +- .../test/unit_test/mem_obj/image1d_tests.cpp | 4 +- .../mem_obj/image2d_from_buffer_tests.cpp | 26 ++-- .../test/unit_test/mem_obj/image2d_tests.cpp | 4 +- .../test/unit_test/mem_obj/image3d_tests.cpp | 6 +- .../mem_obj/image_array_size_tests.cpp | 6 +- .../mem_obj/image_from_subbuffer_tests.cpp | 4 +- .../mem_obj/image_redescribe_tests.cpp | 6 +- opencl/test/unit_test/mem_obj/image_tests.cpp | 34 ++--- .../mem_obj/image_tests_xehp_and_later.cpp | 18 +-- .../unit_test/mem_obj/image_tiled_tests.cpp | 2 +- .../mem_obj/mem_obj_destruction_tests.cpp | 6 +- .../mem_obj/mem_obj_helper_tests.cpp | 36 ++--- .../test/unit_test/mem_obj/mem_obj_tests.cpp | 56 ++++---- .../unit_test/mem_obj/nv12_image_tests.cpp | 22 +-- .../mem_obj/packed_yuv_image_tests.cpp | 6 +- ..._manager_allocate_in_device_pool_tests.cpp | 16 +-- ...nager_allocate_in_preferred_pool_tests.cpp | 3 +- opencl/test/unit_test/mocks/mock_buffer.h | 14 +- .../linux/drm_command_stream_tests_1.cpp | 1 - .../linux/drm_command_stream_tests_2.cpp | 6 +- .../linux/drm_memory_manager_tests.cpp | 18 +-- .../windows/wddm_memory_manager_tests.cpp | 16 +-- .../test/unit_test/sharings/sharing_tests.cpp | 8 +- shared/source/helpers/CMakeLists.txt | 3 + .../helpers/memory_properties_helpers.cpp | 24 ++++ .../helpers/memory_properties_helpers.h | 13 -- .../memory_properties_helpers_base.inl | 41 ++++++ .../memory_manager/unified_memory_manager.cpp | 1 + 69 files changed, 454 insertions(+), 411 deletions(-) rename opencl/source/helpers/{memory_properties_helpers.cpp => cl_memory_properties_helpers.cpp} (51%) create mode 100644 opencl/source/helpers/cl_memory_properties_helpers.h rename opencl/source/helpers/{memory_properties_helpers_base.inl => cl_memory_properties_helpers_base.inl} (62%) create mode 100644 shared/source/helpers/memory_properties_helpers.cpp rename {opencl => shared}/source/helpers/memory_properties_helpers.h (66%) create mode 100644 shared/source/helpers/memory_properties_helpers_base.inl diff --git a/opencl/source/api/api.cpp b/opencl/source/api/api.cpp index e823ebdb00..9a2ea4e0ba 100644 --- a/opencl/source/api/api.cpp +++ b/opencl/source/api/api.cpp @@ -33,8 +33,8 @@ #include "opencl/source/event/user_event.h" #include "opencl/source/execution_environment/cl_execution_environment.h" #include "opencl/source/gtpin/gtpin_notify.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/helpers/get_info_status_mapper.h" -#include "opencl/source/helpers/memory_properties_helpers.h" #include "opencl/source/helpers/queue_helpers.h" #include "opencl/source/helpers/validators.h" #include "opencl/source/kernel/kernel.h" @@ -1187,7 +1187,7 @@ cl_int CL_API_CALL clGetImageParamsINTEL(cl_context context, auto pClDevice = pContext->getDevice(0); surfaceFormat = Image::getSurfaceFormatFromTable(memFlags, imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features); - retVal = Image::validate(pContext, MemoryPropertiesHelper::createMemoryProperties(memFlags, 0, 0, &pClDevice->getDevice()), + retVal = Image::validate(pContext, ClMemoryPropertiesHelper::createMemoryProperties(memFlags, 0, 0, &pClDevice->getDevice()), surfaceFormat, imageDesc, nullptr); } if (CL_SUCCESS == retVal) { @@ -3809,9 +3809,9 @@ void *clHostMemAllocINTEL( cl_mem_flags flags = 0; cl_mem_flags_intel flagsIntel = 0; cl_mem_alloc_flags_intel allocflags = 0; - if (!MemoryPropertiesHelper::parseMemoryProperties(properties, unifiedMemoryProperties.allocationFlags, flags, flagsIntel, - allocflags, MemoryPropertiesHelper::ObjType::UNKNOWN, - *neoContext)) { + if (!ClMemoryPropertiesHelper::parseMemoryProperties(properties, unifiedMemoryProperties.allocationFlags, flags, flagsIntel, + allocflags, MemoryPropertiesHelper::ObjType::UNKNOWN, + *neoContext)) { err.set(CL_INVALID_VALUE); return nullptr; } @@ -3851,9 +3851,9 @@ void *clDeviceMemAllocINTEL( cl_mem_flags flags = 0; cl_mem_flags_intel flagsIntel = 0; cl_mem_alloc_flags_intel allocflags = 0; - if (!MemoryPropertiesHelper::parseMemoryProperties(properties, unifiedMemoryProperties.allocationFlags, flags, flagsIntel, - allocflags, MemoryPropertiesHelper::ObjType::UNKNOWN, - *neoContext)) { + if (!ClMemoryPropertiesHelper::parseMemoryProperties(properties, unifiedMemoryProperties.allocationFlags, flags, flagsIntel, + allocflags, MemoryPropertiesHelper::ObjType::UNKNOWN, + *neoContext)) { err.set(CL_INVALID_VALUE); return nullptr; } @@ -3905,9 +3905,9 @@ void *clSharedMemAllocINTEL( } SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::SHARED_UNIFIED_MEMORY, neoContext->getRootDeviceIndices(), subDeviceBitfields); unifiedMemoryProperties.device = unifiedMemoryPropertiesDevice; - if (!MemoryPropertiesHelper::parseMemoryProperties(properties, unifiedMemoryProperties.allocationFlags, flags, flagsIntel, - allocflags, MemoryPropertiesHelper::ObjType::UNKNOWN, - *neoContext)) { + if (!ClMemoryPropertiesHelper::parseMemoryProperties(properties, unifiedMemoryProperties.allocationFlags, flags, flagsIntel, + allocflags, MemoryPropertiesHelper::ObjType::UNKNOWN, + *neoContext)) { err.set(CL_INVALID_VALUE); return nullptr; } diff --git a/opencl/source/helpers/CMakeLists.txt b/opencl/source/helpers/CMakeLists.txt index 38b7845065..1bccb22831 100644 --- a/opencl/source/helpers/CMakeLists.txt +++ b/opencl/source/helpers/CMakeLists.txt @@ -16,6 +16,9 @@ set(RUNTIME_SRCS_HELPERS_BASE ${CMAKE_CURRENT_SOURCE_DIR}/cl_hw_helper.h ${CMAKE_CURRENT_SOURCE_DIR}/cl_hw_helper_base.inl ${CMAKE_CURRENT_SOURCE_DIR}/cl_hw_helper_bdw_and_later.inl + ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}cl_memory_properties_helpers.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/cl_memory_properties_helpers.h + ${CMAKE_CURRENT_SOURCE_DIR}/cl_memory_properties_helpers_base.inl ${CMAKE_CURRENT_SOURCE_DIR}/cl_preemption_helper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cl_preemption_helper.h ${CMAKE_CURRENT_SOURCE_DIR}/convert_color.h @@ -34,9 +37,6 @@ set(RUNTIME_SRCS_HELPERS_BASE ${CMAKE_CURRENT_SOURCE_DIR}/hardware_commands_helper_bdw_and_later.inl ${CMAKE_CURRENT_SOURCE_DIR}/helper_options.cpp ${CMAKE_CURRENT_SOURCE_DIR}/implicit_scaling_ocl.cpp - ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}memory_properties_helpers.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/memory_properties_helpers.h - ${CMAKE_CURRENT_SOURCE_DIR}/memory_properties_helpers_base.inl ${CMAKE_CURRENT_SOURCE_DIR}/mipmap.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mipmap.h ${CMAKE_CURRENT_SOURCE_DIR}/properties_helper.h diff --git a/opencl/source/helpers/memory_properties_helpers.cpp b/opencl/source/helpers/cl_memory_properties_helpers.cpp similarity index 51% rename from opencl/source/helpers/memory_properties_helpers.cpp rename to opencl/source/helpers/cl_memory_properties_helpers.cpp index 513495739c..ef6fbfd82f 100644 --- a/opencl/source/helpers/memory_properties_helpers.cpp +++ b/opencl/source/helpers/cl_memory_properties_helpers.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -7,17 +7,17 @@ #include "opencl/source/cl_device/cl_device.h" #include "opencl/source/context/context.h" -#include "opencl/source/helpers/memory_properties_helpers_base.inl" +#include "opencl/source/helpers/cl_memory_properties_helpers_base.inl" #include "opencl/source/mem_obj/mem_obj_helper.h" namespace NEO { -void MemoryPropertiesHelper::addExtraMemoryProperties(MemoryProperties &properties, cl_mem_flags flags, cl_mem_flags_intel flagsIntel) { +void ClMemoryPropertiesHelper::addExtraMemoryProperties(MemoryProperties &properties, cl_mem_flags flags, cl_mem_flags_intel flagsIntel) { } -bool MemoryPropertiesHelper::parseMemoryProperties(const cl_mem_properties_intel *properties, MemoryProperties &memoryProperties, - cl_mem_flags &flags, cl_mem_flags_intel &flagsIntel, - cl_mem_alloc_flags_intel &allocflags, ObjType objectType, Context &context) { +bool ClMemoryPropertiesHelper::parseMemoryProperties(const cl_mem_properties_intel *properties, MemoryProperties &memoryProperties, + cl_mem_flags &flags, cl_mem_flags_intel &flagsIntel, + cl_mem_alloc_flags_intel &allocflags, MemoryPropertiesHelper::ObjType objectType, Context &context) { Device *pDevice = &context.getDevice(0)->getDevice(); if (properties != nullptr) { @@ -38,7 +38,7 @@ bool MemoryPropertiesHelper::parseMemoryProperties(const cl_mem_properties_intel } } - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, allocflags, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, allocflags, pDevice); switch (objectType) { case MemoryPropertiesHelper::ObjType::BUFFER: @@ -53,16 +53,4 @@ bool MemoryPropertiesHelper::parseMemoryProperties(const cl_mem_properties_intel return true; } -void MemoryPropertiesHelper::fillPoliciesInProperties(AllocationProperties &allocationProperties, const MemoryProperties &memoryProperties, const HardwareInfo &hwInfo, bool deviceOnlyVisibilty) { - fillCachePolicyInProperties(allocationProperties, - memoryProperties.flags.locallyUncachedResource, - memoryProperties.flags.readOnly, - deviceOnlyVisibilty, - 0); -} - -uint32_t MemoryPropertiesHelper::getCacheRegion(const MemoryProperties &memoryProperties) { - return 0; -} - } // namespace NEO diff --git a/opencl/source/helpers/cl_memory_properties_helpers.h b/opencl/source/helpers/cl_memory_properties_helpers.h new file mode 100644 index 0000000000..201009adf8 --- /dev/null +++ b/opencl/source/helpers/cl_memory_properties_helpers.h @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2021 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once +#include "shared/source/helpers/memory_properties_helpers.h" + +#include "opencl/extensions/public/cl_ext_private.h" + +namespace NEO { + +class Context; + +class ClMemoryPropertiesHelper { + public: + static void addExtraMemoryProperties(MemoryProperties &properties, cl_mem_flags flags, cl_mem_flags_intel flagsIntel); + static MemoryProperties createMemoryProperties(cl_mem_flags flags, cl_mem_flags_intel flagsIntel, + cl_mem_alloc_flags_intel allocflags, const Device *pDevice); + + static bool parseMemoryProperties(const cl_mem_properties_intel *properties, MemoryProperties &memoryProperties, + cl_mem_flags &flags, cl_mem_flags_intel &flagsIntel, cl_mem_alloc_flags_intel &allocflags, + MemoryPropertiesHelper::ObjType objectType, Context &context); +}; +} // namespace NEO diff --git a/opencl/source/helpers/memory_properties_helpers_base.inl b/opencl/source/helpers/cl_memory_properties_helpers_base.inl similarity index 62% rename from opencl/source/helpers/memory_properties_helpers_base.inl rename to opencl/source/helpers/cl_memory_properties_helpers_base.inl index 61b980a132..6842caaa76 100644 --- a/opencl/source/helpers/memory_properties_helpers_base.inl +++ b/opencl/source/helpers/cl_memory_properties_helpers_base.inl @@ -8,14 +8,14 @@ #include "shared/source/helpers/bit_helpers.h" #include "opencl/extensions/public/cl_ext_private.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "CL/cl_ext_intel.h" namespace NEO { -MemoryProperties MemoryPropertiesHelper::createMemoryProperties(cl_mem_flags flags, cl_mem_flags_intel flagsIntel, - cl_mem_alloc_flags_intel allocflags, const Device *pDevice) { +MemoryProperties ClMemoryPropertiesHelper::createMemoryProperties(cl_mem_flags flags, cl_mem_flags_intel flagsIntel, + cl_mem_alloc_flags_intel allocflags, const Device *pDevice) { MemoryProperties memoryProperties; if (isValueSet(flags, CL_MEM_READ_WRITE)) { @@ -91,33 +91,4 @@ MemoryProperties MemoryPropertiesHelper::createMemoryProperties(cl_mem_flags fla return memoryProperties; } - -AllocationProperties MemoryPropertiesHelper::getAllocationProperties( - uint32_t rootDeviceIndex, MemoryProperties memoryProperties, bool allocateMemory, size_t size, - GraphicsAllocation::AllocationType type, bool multiStorageResource, const HardwareInfo &hwInfo, - DeviceBitfield subDevicesBitfieldParam, bool deviceOnlyVisibilty) { - - auto deviceBitfield = adjustDeviceBitfield(rootDeviceIndex, memoryProperties, subDevicesBitfieldParam); - AllocationProperties allocationProperties(rootDeviceIndex, allocateMemory, size, type, multiStorageResource, deviceBitfield); - fillPoliciesInProperties(allocationProperties, memoryProperties, hwInfo, deviceOnlyVisibilty); - return allocationProperties; -} - -void MemoryPropertiesHelper::fillCachePolicyInProperties(AllocationProperties &allocationProperties, bool uncached, bool readOnly, - bool deviceOnlyVisibilty, uint32_t cacheRegion) { - allocationProperties.flags.uncacheable = uncached; - auto cacheFlushRequired = !uncached && !readOnly && !deviceOnlyVisibilty; - allocationProperties.flags.flushL3RequiredForRead = cacheFlushRequired; - allocationProperties.flags.flushL3RequiredForWrite = cacheFlushRequired; - allocationProperties.cacheRegion = cacheRegion; -} - -DeviceBitfield MemoryPropertiesHelper::adjustDeviceBitfield(uint32_t rootDeviceIndex, const MemoryProperties &memoryProperties, - DeviceBitfield deviceBitfieldIn) { - if (rootDeviceIndex == memoryProperties.pDevice->getRootDeviceIndex()) { - return deviceBitfieldIn & memoryProperties.pDevice->getDeviceBitfield(); - } - return deviceBitfieldIn; -} - } // namespace NEO diff --git a/opencl/source/mem_obj/buffer.cpp b/opencl/source/mem_obj/buffer.cpp index 36e5597123..f4cd462f09 100644 --- a/opencl/source/mem_obj/buffer.cpp +++ b/opencl/source/mem_obj/buffer.cpp @@ -28,7 +28,7 @@ #include "opencl/source/cl_device/cl_device.h" #include "opencl/source/command_queue/command_queue.h" #include "opencl/source/context/context.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/helpers/validators.h" #include "opencl/source/mem_obj/mem_obj_helper.h" #include "opencl/source/os_interface/ocl_reg_path.h" @@ -108,15 +108,15 @@ cl_mem Buffer::validateInputAndCreateBuffer(cl_context context, MemoryProperties memoryProperties{}; cl_mem_alloc_flags_intel allocflags = 0; cl_mem_flags_intel emptyFlagsIntel = 0; - if ((false == MemoryPropertiesHelper::parseMemoryProperties(nullptr, memoryProperties, flags, emptyFlagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::BUFFER, *pContext)) || + if ((false == ClMemoryPropertiesHelper::parseMemoryProperties(nullptr, memoryProperties, flags, emptyFlagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::BUFFER, *pContext)) || (false == MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, emptyFlagsIntel, *pContext))) { retVal = CL_INVALID_VALUE; return nullptr; } - if ((false == MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::BUFFER, *pContext)) || + if ((false == ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::BUFFER, *pContext)) || (false == MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel, *pContext))) { retVal = CL_INVALID_PROPERTY; return nullptr; @@ -154,7 +154,7 @@ Buffer *Buffer::create(Context *context, size_t size, void *hostPtr, cl_int &errcodeRet) { - return create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + return create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, size, hostPtr, errcodeRet); } @@ -424,7 +424,7 @@ Buffer *Buffer::createSharedBuffer(Context *context, cl_mem_flags flags, Sharing auto rootDeviceIndex = context->getDevice(0)->getRootDeviceIndex(); auto size = multiGraphicsAllocation.getGraphicsAllocation(rootDeviceIndex)->getUnderlyingBufferSize(); auto sharedBuffer = createBufferHw( - context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, size, nullptr, nullptr, std::move(multiGraphicsAllocation), false, false, false); @@ -514,7 +514,7 @@ Buffer *Buffer::createSubBuffer(cl_mem_flags flags, cl_int &errcodeRet) { DEBUG_BREAK_IF(nullptr == createFunction); MemoryProperties memoryProperties = - MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, &this->context->getDevice(0)->getDevice()); + ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, &this->context->getDevice(0)->getDevice()); auto buffer = createFunction(this->context, memoryProperties, flags, 0, region->size, ptrOffset(this->memoryStorage, region->origin), this->hostPtr ? ptrOffset(this->hostPtr, region->origin) : nullptr, @@ -688,7 +688,7 @@ Buffer *Buffer::createBufferHwFromDevice(const Device *device, auto funcCreate = bufferFactory[hwInfo.platform.eRenderCoreFamily].createBufferFunction; DEBUG_BREAK_IF(nullptr == funcCreate); - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, device); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, device); auto pBuffer = funcCreate(nullptr, memoryProperties, flags, flagsIntel, size, memoryStorage, hostPtr, std::move(multiGraphicsAllocation), zeroCopy, isHostPtrSVM, isImageRedescribed); diff --git a/opencl/source/mem_obj/image.cpp b/opencl/source/mem_obj/image.cpp index 72c9708548..2a3f43ebaa 100644 --- a/opencl/source/mem_obj/image.cpp +++ b/opencl/source/mem_obj/image.cpp @@ -24,9 +24,9 @@ #include "opencl/source/cl_device/cl_device_get_cap.inl" #include "opencl/source/command_queue/command_queue.h" #include "opencl/source/context/context.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/helpers/get_info_status_mapper.h" #include "opencl/source/helpers/gmm_types_converter.h" -#include "opencl/source/helpers/memory_properties_helpers.h" #include "opencl/source/helpers/mipmap.h" #include "opencl/source/helpers/surface_formats.h" #include "opencl/source/mem_obj/buffer.h" @@ -498,7 +498,7 @@ Image *Image::createSharedImage(Context *context, SharingHandler *sharingHandler auto rootDeviceIndex = context->getDevice(0)->getRootDeviceIndex(); auto size = multiGraphicsAllocation.getGraphicsAllocation(rootDeviceIndex)->getUnderlyingBufferSize(); auto sharedImage = createImageHw( - context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, flagsIntel, size, nullptr, surfaceFormat->OCLImageFormat, Image::convertDescriptor(imgInfo.imgDesc), false, std::move(multiGraphicsAllocation), false, baseMipLevel, mipCount, surfaceFormat); @@ -971,8 +971,8 @@ Image *Image::redescribeFillImage() { imageFormatNew.image_channel_data_type = surfaceFormat->OCLImageFormat.image_channel_data_type; DEBUG_BREAK_IF(nullptr == createFunction); - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags | CL_MEM_USE_HOST_PTR, flagsIntel, 0, - &context->getDevice(0)->getDevice()); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags | CL_MEM_USE_HOST_PTR, flagsIntel, 0, + &context->getDevice(0)->getDevice()); auto image = createFunction(context, memoryProperties, flags | CL_MEM_USE_HOST_PTR, @@ -1028,8 +1028,8 @@ Image *Image::redescribe() { imageFormatNew.image_channel_data_type = surfaceFormat->OCLImageFormat.image_channel_data_type; DEBUG_BREAK_IF(nullptr == createFunction); - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags | CL_MEM_USE_HOST_PTR, flagsIntel, 0, - &context->getDevice(0)->getDevice()); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags | CL_MEM_USE_HOST_PTR, flagsIntel, 0, + &context->getDevice(0)->getDevice()); auto image = createFunction(context, memoryProperties, flags | CL_MEM_USE_HOST_PTR, @@ -1092,7 +1092,7 @@ cl_int Image::writeNV12Planes(const void *hostPtr, size_t hostPtrRowPitch, uint3 // Create NV12 UV Plane image std::unique_ptr imageYPlane(Image::create( context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -1116,7 +1116,7 @@ cl_int Image::writeNV12Planes(const void *hostPtr, size_t hostPtrRowPitch, uint3 // Create NV12 UV Plane image std::unique_ptr imageUVPlane(Image::create( context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -1185,16 +1185,16 @@ cl_mem Image::validateAndCreateImage(cl_context context, MemoryProperties memoryProperties{}; cl_mem_flags_intel emptyFlagsIntel = 0; cl_mem_alloc_flags_intel allocflags = 0; - if ((false == MemoryPropertiesHelper::parseMemoryProperties(nullptr, memoryProperties, flags, emptyFlagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::IMAGE, *pContext)) || + if ((false == ClMemoryPropertiesHelper::parseMemoryProperties(nullptr, memoryProperties, flags, emptyFlagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::IMAGE, *pContext)) || (false == MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, emptyFlagsIntel, imageDesc->mem_object, *pContext))) { errcodeRet = CL_INVALID_VALUE; return nullptr; } - if ((false == MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::IMAGE, *pContext)) || + if ((false == ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::IMAGE, *pContext)) || (false == MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, imageDesc->mem_object, *pContext))) { errcodeRet = CL_INVALID_PROPERTY; diff --git a/opencl/source/mem_obj/mem_obj_helper.h b/opencl/source/mem_obj/mem_obj_helper.h index 335cd5fde9..b126294698 100644 --- a/opencl/source/mem_obj/mem_obj_helper.h +++ b/opencl/source/mem_obj/mem_obj_helper.h @@ -11,7 +11,6 @@ #include "shared/source/memory_manager/unified_memory_manager.h" #include "opencl/extensions/public/cl_ext_private.h" -#include "opencl/source/helpers/memory_properties_helpers.h" #include "opencl/source/mem_obj/mem_obj.h" #include "CL/cl.h" diff --git a/opencl/source/mem_obj/mem_obj_helper_common.inl b/opencl/source/mem_obj/mem_obj_helper_common.inl index 7545f0af04..791e29a13d 100644 --- a/opencl/source/mem_obj/mem_obj_helper_common.inl +++ b/opencl/source/mem_obj/mem_obj_helper_common.inl @@ -5,6 +5,8 @@ * */ +#include "shared/source/helpers/memory_properties_helpers.h" + #include "opencl/source/mem_obj/mem_obj_helper.h" namespace NEO { diff --git a/opencl/source/mem_obj/pipe.cpp b/opencl/source/mem_obj/pipe.cpp index 473897505e..94fdf6fe56 100644 --- a/opencl/source/mem_obj/pipe.cpp +++ b/opencl/source/mem_obj/pipe.cpp @@ -12,8 +12,8 @@ #include "opencl/source/cl_device/cl_device.h" #include "opencl/source/context/context.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/helpers/get_info_status_mapper.h" -#include "opencl/source/helpers/memory_properties_helpers.h" #include "opencl/source/mem_obj/mem_obj_helper.h" namespace NEO { @@ -27,7 +27,7 @@ Pipe::Pipe(Context *context, MultiGraphicsAllocation multiGraphicsAllocation) : MemObj(context, CL_MEM_OBJECT_PIPE, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, static_cast(packetSize * (maxPackets + 1) + intelPipeHeaderReservedSpace), @@ -55,7 +55,7 @@ Pipe *Pipe::create(Context *context, DEBUG_BREAK_IF(!memoryManager); MemoryProperties memoryProperties = - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()); + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()); while (true) { auto size = static_cast(packetSize * (maxPackets + 1) + intelPipeHeaderReservedSpace); auto rootDeviceIndex = context->getDevice(0)->getRootDeviceIndex(); diff --git a/opencl/source/sharings/d3d/d3d_surface.cpp b/opencl/source/sharings/d3d/d3d_surface.cpp index ee821eeea6..f2f0c8ef41 100644 --- a/opencl/source/sharings/d3d/d3d_surface.cpp +++ b/opencl/source/sharings/d3d/d3d_surface.cpp @@ -13,8 +13,8 @@ #include "opencl/source/cl_device/cl_device.h" #include "opencl/source/context/context.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/helpers/gmm_types_converter.h" -#include "opencl/source/helpers/memory_properties_helpers.h" #include "opencl/source/mem_obj/image.h" #include "opencl/source/mem_obj/mem_obj_helper.h" @@ -100,7 +100,7 @@ Image *D3DSurface::create(Context *context, cl_dx9_surface_info_khr *surfaceInfo imgInfo.imgDesc.imageHeight /= 2; } MemoryProperties memoryProperties = - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()); + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()); AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(rootDeviceIndex, imgInfo, true, // allocateMemory memoryProperties, context->getDevice(0)->getHardwareInfo(), diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_copy_image_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_copy_image_aub_tests.cpp index f5c6f610bb..8104ab9f31 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_copy_image_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_copy_image_aub_tests.cpp @@ -87,7 +87,7 @@ HWTEST_P(AUBCopyImage, WhenCopyingThenExpectationsMet) { auto retVal = CL_INVALID_VALUE; srcImage.reset(Image::create( context.get(), - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -98,7 +98,7 @@ HWTEST_P(AUBCopyImage, WhenCopyingThenExpectationsMet) { dstImage.reset(Image::create( context.get(), - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_fill_image_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_fill_image_aub_tests.cpp index d3c3125f2a..fe927c7c3d 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_fill_image_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_fill_image_aub_tests.cpp @@ -185,7 +185,7 @@ HWTEST_P(AubFillImage, WhenFillingThenExpectationsMet) { auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); image.reset(Image::create( context.get(), - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp index 3012b562e1..a8468b05ef 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp @@ -987,7 +987,7 @@ HWTEST2_F(AUBBindlessKernel, DISABLED_givenBindlessCopyImageKernelWhenEnqueuedTh auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, device->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = std::unique_ptr(Image::create( contextCl, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &contextCl->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &contextCl->getDevice(0)->getDevice()), flags, 0, surfaceFormat, diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_map_image_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_map_image_aub_tests.cpp index ea37f0bb36..826267c588 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_map_image_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_map_image_aub_tests.cpp @@ -127,7 +127,7 @@ HWTEST_P(AUBMapImage, WhenMappingAndUnmappingThenExpectationsAreMet) { auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features); srcImage.reset(Image::create( context.get(), - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, 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 047fc45d21..176b007334 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 @@ -124,7 +124,7 @@ HWTEST_F(AUBReadBuffer, GivenReserveCanonicalGpuAddressWhenReadingBufferThenExpe MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); std::unique_ptr srcBuffer(Buffer::createBufferHw( &context, - MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()), CL_MEM_USE_HOST_PTR, 0, sizeof(srcMemory), diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_image_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_image_aub_tests.cpp index 6b49f43170..d9cd8170f6 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_image_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_image_aub_tests.cpp @@ -145,7 +145,7 @@ HWTEST_P(AUBReadImage, GivenUnalignedMemoryWhenReadingImageThenExpectationsAreMe auto retVal = CL_INVALID_VALUE; srcImage.reset(Image::create( context.get(), - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_write_image_aub_fixture.h b/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_write_image_aub_fixture.h index 5fd640e860..fc84f0acda 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_write_image_aub_fixture.h +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_write_image_aub_fixture.h @@ -83,7 +83,7 @@ struct AUBImageUnaligned auto image = std::unique_ptr(Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -178,7 +178,7 @@ struct AUBImageUnaligned auto image = std::unique_ptr(Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_verify_memory_image_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_verify_memory_image_aub_tests.cpp index 50835e7149..3a766a9488 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_verify_memory_image_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_verify_memory_image_aub_tests.cpp @@ -74,7 +74,7 @@ HWTEST_P(VerifyMemoryImageHw, givenDifferentImagesWhenValidatingMemoryThenSucces auto retVal = CL_INVALID_VALUE; std::unique_ptr image(Image::create( context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_write_image_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_write_image_aub_tests.cpp index 6c92cb44e3..f0ca35fd5e 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_write_image_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_write_image_aub_tests.cpp @@ -139,7 +139,7 @@ HWTEST_P(AUBWriteImage, GivenUnalignedMemoryWhenWritingImageThenExpectationsAreM auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); dstImage.reset(Image::create( context.get(), - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, diff --git a/opencl/test/unit_test/aub_tests/gen11/execution_model/enqueue_parent_kernel_tests_gen11.cpp b/opencl/test/unit_test/aub_tests/gen11/execution_model/enqueue_parent_kernel_tests_gen11.cpp index 9f3e49a56f..53fbfde7b6 100644 --- a/opencl/test/unit_test/aub_tests/gen11/execution_model/enqueue_parent_kernel_tests_gen11.cpp +++ b/opencl/test/unit_test/aub_tests/gen11/execution_model/enqueue_parent_kernel_tests_gen11.cpp @@ -56,7 +56,7 @@ GEN11TEST_F(GEN11AUBParentKernelFixture, WhenEnqueuingParentKernelThenExpectatio desc.image_slice_pitch = 0; // clang-format on - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &pClDevice->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &pClDevice->getDevice()); auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); Image *image = Image::create( pContext, diff --git a/opencl/test/unit_test/aub_tests/gen8/execution_model/enqueue_parent_kernel_tests_gen8.cpp b/opencl/test/unit_test/aub_tests/gen8/execution_model/enqueue_parent_kernel_tests_gen8.cpp index 72ed781ae0..763f8f7b0f 100644 --- a/opencl/test/unit_test/aub_tests/gen8/execution_model/enqueue_parent_kernel_tests_gen8.cpp +++ b/opencl/test/unit_test/aub_tests/gen8/execution_model/enqueue_parent_kernel_tests_gen8.cpp @@ -56,7 +56,7 @@ GEN8TEST_F(GEN8AUBParentKernelFixture, WhenEnqueuingParentKernelThenExpectations desc.image_row_pitch = 0; desc.image_slice_pitch = 0; - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &pClDevice->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &pClDevice->getDevice()); auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr image(Image::create( pContext, diff --git a/opencl/test/unit_test/aub_tests/gen9/execution_model/enqueue_parent_kernel_tests_gen9.cpp b/opencl/test/unit_test/aub_tests/gen9/execution_model/enqueue_parent_kernel_tests_gen9.cpp index 0ecaac5b08..afc022c5b9 100644 --- a/opencl/test/unit_test/aub_tests/gen9/execution_model/enqueue_parent_kernel_tests_gen9.cpp +++ b/opencl/test/unit_test/aub_tests/gen9/execution_model/enqueue_parent_kernel_tests_gen9.cpp @@ -54,7 +54,7 @@ GEN9TEST_F(AUBParentKernelFixture, WhenEnqueuingParentKernelThenExpectationsMet) desc.image_slice_pitch = 0; // clang-format on - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context->getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context->getDevice(0)->getDevice()); auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); Image *image = Image::create( pContext, diff --git a/opencl/test/unit_test/aub_tests/gen9/skl/command_queue/run_kernel_aub_tests_skl.cpp b/opencl/test/unit_test/aub_tests/gen9/skl/command_queue/run_kernel_aub_tests_skl.cpp index 0824756dc6..ad69ef3711 100644 --- a/opencl/test/unit_test/aub_tests/gen9/skl/command_queue/run_kernel_aub_tests_skl.cpp +++ b/opencl/test/unit_test/aub_tests/gen9/skl/command_queue/run_kernel_aub_tests_skl.cpp @@ -323,7 +323,7 @@ SKLTEST_F(AUBRunKernelIntegrateTest, GivenDeviceSideVmeThenExpectationsMet) { auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto srcImage = Image::create( context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -334,7 +334,7 @@ SKLTEST_F(AUBRunKernelIntegrateTest, GivenDeviceSideVmeThenExpectationsMet) { auto refImage = Image::create( context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, diff --git a/opencl/test/unit_test/aub_tests/mem_obj/create_image_aub_tests.cpp b/opencl/test/unit_test/aub_tests/mem_obj/create_image_aub_tests.cpp index 47d25fb1ae..5fe346d4b7 100644 --- a/opencl/test/unit_test/aub_tests/mem_obj/create_image_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/mem_obj/create_image_aub_tests.cpp @@ -102,7 +102,7 @@ HWTEST_F(AUBCreateImageArray, Given1DImageArrayThenExpectationsMet) { image.reset(Image::create( context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -180,7 +180,7 @@ HWTEST_F(AUBCreateImageArray, Given2DImageArrayThenExpectationsMet) { image.reset(Image::create( context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -305,7 +305,7 @@ HWTEST_P(CopyHostPtrTest, GivenImageWithDoubledRowPitchWhenCreatedWithCopyHostPt data += passedRowPitch; } - image.reset(Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + image.reset(Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, pHostPtr, retVal)); ASSERT_EQ(CL_SUCCESS, retVal); EXPECT_EQ(image->getImageDesc().image_row_pitch, imgInfo.rowPitch); @@ -375,7 +375,7 @@ HWTEST_P(UseHostPtrTest, GivenImageWithRowPitchWhenCreatedWithUseHostPtrFlagThen } image.reset(Image::create( context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -472,7 +472,7 @@ HWTEST_F(AUBCreateImage, GivenImage3DCreatedWithDoubledSlicePitchWhenQueriedForD } cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR; auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - image.reset(Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + image.reset(Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, host_ptr, retVal)); depthToCopy = imageDesc.image_depth; diff --git a/opencl/test/unit_test/command_queue/enqueue_map_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_map_image_tests.cpp index c2272aae3f..5e04de2ecb 100644 --- a/opencl/test/unit_test/command_queue/enqueue_map_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_map_image_tests.cpp @@ -12,7 +12,7 @@ #include "shared/test/common/test_macros/test_checks_shared.h" #include "opencl/source/event/user_event.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/test/unit_test/command_queue/command_enqueue_fixture.h" #include "opencl/test/unit_test/command_queue/command_queue_fixture.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" @@ -930,7 +930,7 @@ TEST_F(EnqueueMapImageTest, givenImage1DArrayWhenEnqueueMapImageIsCalledThenRetu public: MockImage(Context *context, cl_mem_flags flags, GraphicsAllocation *allocation, const ClSurfaceFormatInfo &surfaceFormat, const cl_image_format &imageFormat, const cl_image_desc &imageDesc) - : Image(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, + : Image(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, 0, nullptr, nullptr, imageFormat, imageDesc, true, diff --git a/opencl/test/unit_test/command_queue/enqueue_thread_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_thread_tests.cpp index 93667c7e6d..2bd347a8d3 100644 --- a/opencl/test/unit_test/command_queue/enqueue_thread_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_thread_tests.cpp @@ -11,7 +11,7 @@ #include "shared/test/common/test_macros/test_checks_shared.h" #include "opencl/source/command_queue/command_queue_hw.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/kernel/kernel.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/source/mem_obj/image.h" @@ -232,7 +232,7 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingCopyBufferToImageThenKernelHasOwner auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage( - Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); ASSERT_NE(nullptr, dstImage.get()); @@ -259,11 +259,11 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingCopyImageThenKernelHasOwnership) { auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr srcImage( - Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); ASSERT_NE(nullptr, srcImage.get()); std::unique_ptr dstImage( - Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); ASSERT_NE(nullptr, srcImage.get()); @@ -292,7 +292,7 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingCopyImageToBufferThenKernelHasOwner auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr srcImage( - Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); ASSERT_NE(nullptr, srcImage.get()); @@ -334,7 +334,7 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingFillImageThenKernelHasOwnership) { auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr image( - Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); ASSERT_NE(nullptr, image.get()); @@ -383,7 +383,7 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingReadImageThenKernelHasOwnership) { auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr image(Image::create( - context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); ASSERT_NE(nullptr, image.get()); @@ -436,7 +436,7 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingWriteImageThenKernelHasOwnership) { auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr image( - Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); ASSERT_NE(nullptr, image.get()); diff --git a/opencl/test/unit_test/command_queue/multiple_map_image_tests.cpp b/opencl/test/unit_test/command_queue/multiple_map_image_tests.cpp index 9d04b8a395..4dc25fc4a4 100644 --- a/opencl/test/unit_test/command_queue/multiple_map_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/multiple_map_image_tests.cpp @@ -118,7 +118,7 @@ struct MultipleMapImageTest : public ClDeviceFixture, public ::testing::Test { cl_int retVal = CL_SUCCESS; auto img = Image::create( - context, MemoryPropertiesHelper::createMemoryProperties(Traits::flags, 0, 0, &context->getDevice(0)->getDevice()), + context, ClMemoryPropertiesHelper::createMemoryProperties(Traits::flags, 0, 0, &context->getDevice(0)->getDevice()), Traits::flags, 0, surfaceFormat, &Traits::imageDesc, Traits::hostPtr, retVal); auto mockImage = static_cast *>(img); diff --git a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp index a81d5d4b3e..78bb9c0b6d 100644 --- a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp @@ -585,7 +585,7 @@ HWTEST_F(AubCommandStreamReceiverNoHostPtrTests, givenAubCommandStreamReceiverWh auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]); AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(aubCsr->getRootDeviceIndex(), imgInfo, true, memoryProperties, *hwInfo, osContext.getDeviceBitfield(), true); auto imageAllocation = memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr); diff --git a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_tests_xehp_and_later.cpp b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_tests_xehp_and_later.cpp index 6ba327dd3e..5482dfe1b6 100644 --- a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_tests_xehp_and_later.cpp @@ -18,7 +18,7 @@ #include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/helpers/hw_helper_tests.h" diff --git a/opencl/test/unit_test/context/driver_diagnostics_tests.cpp b/opencl/test/unit_test/context/driver_diagnostics_tests.cpp index 81d662d370..ce0f3f751b 100644 --- a/opencl/test/unit_test/context/driver_diagnostics_tests.cpp +++ b/opencl/test/unit_test/context/driver_diagnostics_tests.cpp @@ -9,7 +9,7 @@ #include "shared/test/common/helpers/debug_manager_state_restore.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/mem_obj_helper.h" #include "opencl/test/unit_test/mocks/mock_gmm.h" @@ -664,7 +664,7 @@ TEST_F(PerformanceHintTest, given64bitCompressedBufferWhenItsCreatedThenProperPe auto context = std::unique_ptr(Context::create(validProperties, ClDeviceVector(&deviceId, 1), callbackFunction, static_cast(userData), retVal)); context->isSharedContext = false; auto buffer = std::unique_ptr( - Buffer::create(context.get(), MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context->getDevice(0)->getDevice()), + Buffer::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context->getDevice(0)->getDevice()), 0, 0, size, static_cast(NULL), retVal)); snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[BUFFER_IS_COMPRESSED], buffer.get()); auto compressionSupported = HwHelper::get(hwInfo.platform.eRenderCoreFamily).isBufferSizeSuitableForRenderCompression(size, hwInfo) && @@ -684,7 +684,7 @@ TEST_F(PerformanceHintTest, givenUncompressedBufferWhenItsCreatedThenProperPerfo auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); cl_device_id deviceId = device.get(); MemoryProperties memoryProperties = - MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(0)->getDevice()); + ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(0)->getDevice()); size_t size = 0u; @@ -756,7 +756,7 @@ TEST_F(PerformanceHintTest, givenCompressedImageWhenItsCreatedThenProperPerforma auto image = std::unique_ptr(Image::create( context.get(), - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -815,7 +815,7 @@ TEST_F(PerformanceHintTest, givenImageWithNoGmmWhenItsCreatedThenNoPerformanceHi auto image = std::unique_ptr(Image::create( context.get(), - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -876,7 +876,7 @@ TEST_F(PerformanceHintTest, givenUncompressedImageWhenItsCreatedThenProperPerfor auto image = std::unique_ptr(Image::create( context.get(), - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, diff --git a/opencl/test/unit_test/fixtures/image_fixture.h b/opencl/test/unit_test/fixtures/image_fixture.h index 086a39bb84..77bde328f6 100644 --- a/opencl/test/unit_test/fixtures/image_fixture.h +++ b/opencl/test/unit_test/fixtures/image_fixture.h @@ -10,7 +10,7 @@ #include "shared/source/helpers/hw_info.h" #include "shared/test/common/helpers/default_hw_info.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/image.h" #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" @@ -87,7 +87,7 @@ struct ImageHelper { auto surfaceFormat = Image::getSurfaceFormatFromTable(Traits::flags, imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( context, - NEO::MemoryPropertiesHelper::createMemoryProperties(Traits::flags, 0, 0, &context->getDevice(0)->getDevice()), + NEO::ClMemoryPropertiesHelper::createMemoryProperties(Traits::flags, 0, 0, &context->getDevice(0)->getDevice()), Traits::flags, 0, surfaceFormat, diff --git a/opencl/test/unit_test/gen11/image_tests_gen11.cpp b/opencl/test/unit_test/gen11/image_tests_gen11.cpp index ad70279cd3..16d55584fc 100644 --- a/opencl/test/unit_test/gen11/image_tests_gen11.cpp +++ b/opencl/test/unit_test/gen11/image_tests_gen11.cpp @@ -40,7 +40,7 @@ struct AppendSurfaceStateParamsTest : public ::testing::Test { flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); EXPECT_NE(nullptr, surfaceFormat); image.reset(Image::create( - &context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); } diff --git a/opencl/test/unit_test/helpers/base_object_tests.cpp b/opencl/test/unit_test/helpers/base_object_tests.cpp index 301f002472..2d9d91a499 100644 --- a/opencl/test/unit_test/helpers/base_object_tests.cpp +++ b/opencl/test/unit_test/helpers/base_object_tests.cpp @@ -291,7 +291,7 @@ class MockBuffer : public MockBufferStorage, public Buffer { public: MockBuffer() : MockBufferStorage(), - Buffer(nullptr, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()), + Buffer(nullptr, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()), CL_MEM_USE_HOST_PTR, 0, sizeof(data), &data, &data, GraphicsAllocationHelper::toMultiGraphicsAllocation(&mockGfxAllocation), true, false, false) { } 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 8ba9147b4f..ca6b364a64 100644 --- a/opencl/test/unit_test/helpers/memory_properties_helpers_tests.cpp +++ b/opencl/test/unit_test/helpers/memory_properties_helpers_tests.cpp @@ -9,7 +9,7 @@ #include "shared/test/common/mocks/mock_graphics_allocation.h" #include "shared/test/common/mocks/ult_device_factory.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/mem_obj_helper.h" #include "opencl/test/unit_test/mocks/mock_cl_device.h" #include "opencl/test/unit_test/mocks/mock_context.h" @@ -24,61 +24,61 @@ TEST(MemoryProperties, givenValidPropertiesWhenCreateMemoryPropertiesThenTrueIsR auto pDevice = deviceFactory.rootDevices[0]; MemoryProperties properties; - properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, pDevice); EXPECT_TRUE(properties.flags.readWrite); - properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_WRITE_ONLY, 0, 0, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_WRITE_ONLY, 0, 0, pDevice); EXPECT_TRUE(properties.flags.writeOnly); - properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_ONLY, 0, 0, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_ONLY, 0, 0, pDevice); EXPECT_TRUE(properties.flags.readOnly); - properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, pDevice); EXPECT_TRUE(properties.flags.useHostPtr); - properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_ALLOC_HOST_PTR, 0, 0, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_ALLOC_HOST_PTR, 0, 0, pDevice); EXPECT_TRUE(properties.flags.allocHostPtr); - properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, pDevice); EXPECT_TRUE(properties.flags.copyHostPtr); - properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_HOST_WRITE_ONLY, 0, 0, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_HOST_WRITE_ONLY, 0, 0, pDevice); EXPECT_TRUE(properties.flags.hostWriteOnly); - properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_HOST_READ_ONLY, 0, 0, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_HOST_READ_ONLY, 0, 0, pDevice); EXPECT_TRUE(properties.flags.hostReadOnly); - properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_HOST_NO_ACCESS, 0, 0, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_HOST_NO_ACCESS, 0, 0, pDevice); EXPECT_TRUE(properties.flags.hostNoAccess); - properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_KERNEL_READ_AND_WRITE, 0, 0, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_KERNEL_READ_AND_WRITE, 0, 0, pDevice); EXPECT_TRUE(properties.flags.kernelReadAndWrite); - properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL, 0, 0, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL, 0, 0, pDevice); EXPECT_TRUE(properties.flags.accessFlagsUnrestricted); - properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_NO_ACCESS_INTEL, 0, 0, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_NO_ACCESS_INTEL, 0, 0, pDevice); EXPECT_TRUE(properties.flags.noAccess); - properties = MemoryPropertiesHelper::createMemoryProperties(0, CL_MEM_LOCALLY_UNCACHED_RESOURCE, 0, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(0, CL_MEM_LOCALLY_UNCACHED_RESOURCE, 0, pDevice); EXPECT_TRUE(properties.flags.locallyUncachedResource); - properties = MemoryPropertiesHelper::createMemoryProperties(0, CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE, 0, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(0, CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE, 0, pDevice); EXPECT_TRUE(properties.flags.locallyUncachedInSurfaceState); - properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_FORCE_HOST_MEMORY_INTEL, 0, 0, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_FORCE_HOST_MEMORY_INTEL, 0, 0, pDevice); EXPECT_TRUE(properties.flags.forceHostMemory); - properties = MemoryPropertiesHelper::createMemoryProperties(0, 0, CL_MEM_ALLOC_WRITE_COMBINED_INTEL, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, CL_MEM_ALLOC_WRITE_COMBINED_INTEL, pDevice); EXPECT_TRUE(properties.allocFlags.allocWriteCombined); - properties = MemoryPropertiesHelper::createMemoryProperties(0, 0, CL_MEM_ALLOC_INITIAL_PLACEMENT_DEVICE_INTEL, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, CL_MEM_ALLOC_INITIAL_PLACEMENT_DEVICE_INTEL, pDevice); EXPECT_TRUE(properties.allocFlags.usmInitialPlacementGpu); - properties = MemoryPropertiesHelper::createMemoryProperties(0, 0, CL_MEM_ALLOC_INITIAL_PLACEMENT_HOST_INTEL, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, CL_MEM_ALLOC_INITIAL_PLACEMENT_HOST_INTEL, pDevice); EXPECT_TRUE(properties.allocFlags.usmInitialPlacementCpu); - properties = MemoryPropertiesHelper::createMemoryProperties(0, CL_MEM_48BIT_RESOURCE_INTEL, 0, pDevice); + properties = ClMemoryPropertiesHelper::createMemoryProperties(0, CL_MEM_48BIT_RESOURCE_INTEL, 0, pDevice); EXPECT_TRUE(properties.flags.resource48Bit); } @@ -91,22 +91,22 @@ TEST(MemoryProperties, givenClMemForceLinearStorageFlagWhenCreateMemoryPropertie flags |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL; flagsIntel = 0; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); EXPECT_TRUE(memoryProperties.flags.forceLinearStorage); flags = 0; flagsIntel |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); EXPECT_TRUE(memoryProperties.flags.forceLinearStorage); flags |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL; flagsIntel |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); EXPECT_TRUE(memoryProperties.flags.forceLinearStorage); flags = 0; flagsIntel = 0; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); EXPECT_FALSE(memoryProperties.flags.forceLinearStorage); } @@ -119,22 +119,22 @@ TEST(MemoryProperties, givenClAllowUnrestrictedSizeFlagWhenCreateMemoryPropertie flags |= CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL; flagsIntel = 0; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); EXPECT_TRUE(memoryProperties.flags.allowUnrestrictedSize); flags = 0; flagsIntel |= CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); EXPECT_TRUE(memoryProperties.flags.allowUnrestrictedSize); flags |= CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL; flagsIntel |= CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); EXPECT_TRUE(memoryProperties.flags.allowUnrestrictedSize); flags = 0; flagsIntel = 0; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); EXPECT_FALSE(memoryProperties.flags.allowUnrestrictedSize); } @@ -147,19 +147,19 @@ struct MemoryPropertiesHelperTests : ::testing::Test { }; TEST_F(MemoryPropertiesHelperTests, givenNullPropertiesWhenParsingMemoryPropertiesThenTrueIsReturned) { - EXPECT_TRUE(MemoryPropertiesHelper::parseMemoryProperties(nullptr, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::UNKNOWN, context)); + EXPECT_TRUE(ClMemoryPropertiesHelper::parseMemoryProperties(nullptr, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::UNKNOWN, context)); } TEST_F(MemoryPropertiesHelperTests, givenEmptyPropertiesWhenParsingMemoryPropertiesThenTrueIsReturned) { cl_mem_properties_intel properties[] = {0}; - EXPECT_TRUE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::UNKNOWN, context)); - EXPECT_TRUE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::BUFFER, context)); - EXPECT_TRUE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::IMAGE, context)); + EXPECT_TRUE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::UNKNOWN, context)); + EXPECT_TRUE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::BUFFER, context)); + EXPECT_TRUE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::IMAGE, context)); } TEST_F(MemoryPropertiesHelperTests, givenValidPropertiesWhenParsingMemoryPropertiesThenTrueIsReturned) { @@ -173,8 +173,8 @@ TEST_F(MemoryPropertiesHelperTests, givenValidPropertiesWhenParsingMemoryPropert CL_MEM_ALLOC_WRITE_COMBINED_INTEL, CL_MEM_ALLOC_DEFAULT_INTEL, 0}; - EXPECT_TRUE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::UNKNOWN, context)); + EXPECT_TRUE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::UNKNOWN, context)); } TEST_F(MemoryPropertiesHelperTests, givenValidPropertiesWhenParsingMemoryPropertiesForBufferThenTrueIsReturned) { @@ -185,8 +185,8 @@ TEST_F(MemoryPropertiesHelperTests, givenValidPropertiesWhenParsingMemoryPropert MemObjHelper::validFlagsForBufferIntel, 0}; - EXPECT_TRUE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::BUFFER, context)); + EXPECT_TRUE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::BUFFER, context)); } TEST_F(MemoryPropertiesHelperTests, givenValidPropertiesWhenParsingMemoryPropertiesForImageThenTrueIsReturned) { @@ -197,8 +197,8 @@ TEST_F(MemoryPropertiesHelperTests, givenValidPropertiesWhenParsingMemoryPropert MemObjHelper::validFlagsForImageIntel, 0}; - EXPECT_TRUE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::IMAGE, context)); + EXPECT_TRUE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::IMAGE, context)); } TEST_F(MemoryPropertiesHelperTests, givenInvalidPropertiesWhenParsingMemoryPropertiesThenFalseIsReturned) { @@ -206,12 +206,12 @@ TEST_F(MemoryPropertiesHelperTests, givenInvalidPropertiesWhenParsingMemoryPrope (1 << 30), CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR | CL_MEM_USE_HOST_PTR, 0}; - EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::UNKNOWN, context)); - EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::BUFFER, context)); - EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::IMAGE, context)); + EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::UNKNOWN, context)); + EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::BUFFER, context)); + EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::IMAGE, context)); } TEST_F(MemoryPropertiesHelperTests, givenInvalidPropertiesWhenParsingMemoryPropertiesForImageThenFalseIsReturned) { @@ -222,8 +222,8 @@ TEST_F(MemoryPropertiesHelperTests, givenInvalidPropertiesWhenParsingMemoryPrope MemObjHelper::validFlagsForBufferIntel, 0}; - EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::IMAGE, context)); + EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::IMAGE, context)); } TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsWhenParsingMemoryPropertiesForImageThenFalseIsReturned) { @@ -234,8 +234,8 @@ TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsWhenParsingMemoryProperties MemObjHelper::validFlagsForImageIntel, 0}; - EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::IMAGE, context)); + EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::IMAGE, context)); } TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsIntelWhenParsingMemoryPropertiesForImageThenFalseIsReturned) { @@ -246,8 +246,8 @@ TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsIntelWhenParsingMemoryPrope (1 << 30), 0}; - EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::IMAGE, context)); + EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::IMAGE, context)); } TEST_F(MemoryPropertiesHelperTests, givenInvalidPropertiesWhenParsingMemoryPropertiesForBufferThenFalseIsReturned) { @@ -258,8 +258,8 @@ TEST_F(MemoryPropertiesHelperTests, givenInvalidPropertiesWhenParsingMemoryPrope MemObjHelper::validFlagsForImageIntel, 0}; - EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::BUFFER, context)); + EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::BUFFER, context)); } TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsWhenParsingMemoryPropertiesForBufferThenFalseIsReturned) { @@ -270,8 +270,8 @@ TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsWhenParsingMemoryProperties MemObjHelper::validFlagsForBufferIntel, 0}; - EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::BUFFER, context)); + EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::BUFFER, context)); } TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsIntelWhenParsingMemoryPropertiesForBufferThenFalseIsReturned) { @@ -282,8 +282,8 @@ TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsIntelWhenParsingMemoryPrope (1 << 30), 0}; - EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::BUFFER, context)); + EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::BUFFER, context)); } TEST_F(MemoryPropertiesHelperTests, givenDifferentParametersWhenCallingFillCachePolicyInPropertiesThenFlushL3FlagsAreCorrectlySet) { @@ -330,20 +330,20 @@ TEST_F(MemoryPropertiesHelperTests, givenMemFlagsWithFlagsAndPropertiesWhenParsi cl_mem_properties_intel properties[] = { CL_MEM_FLAGS, testInput.flagsProperties, 0}; - EXPECT_TRUE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, - MemoryPropertiesHelper::ObjType::UNKNOWN, context)); + EXPECT_TRUE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, + MemoryPropertiesHelper::ObjType::UNKNOWN, context)); EXPECT_EQ(testInput.expectedResult, flags); } } TEST_F(MemoryPropertiesHelperTests, WhenAdjustingDeviceBitfieldThenCorrectBitfieldIsReturned) { UltClDeviceFactory deviceFactory{2, 4}; - auto memoryPropertiesRootDevice0 = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.rootDevices[0]->getDevice()); - auto memoryPropertiesRootDevice0Tile0 = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.subDevices[0]->getDevice()); - auto memoryPropertiesRootDevice0Tile1 = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.subDevices[1]->getDevice()); - auto memoryPropertiesRootDevice1 = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.rootDevices[1]->getDevice()); - auto memoryPropertiesRootDevice1Tile0 = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.subDevices[4]->getDevice()); - auto memoryPropertiesRootDevice1Tile1 = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.subDevices[5]->getDevice()); + auto memoryPropertiesRootDevice0 = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.rootDevices[0]->getDevice()); + auto memoryPropertiesRootDevice0Tile0 = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.subDevices[0]->getDevice()); + auto memoryPropertiesRootDevice0Tile1 = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.subDevices[1]->getDevice()); + auto memoryPropertiesRootDevice1 = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.rootDevices[1]->getDevice()); + auto memoryPropertiesRootDevice1Tile0 = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.subDevices[4]->getDevice()); + auto memoryPropertiesRootDevice1Tile1 = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.subDevices[5]->getDevice()); DeviceBitfield devicesInContextBitfield0001{0b1}; DeviceBitfield devicesInContextBitfield0101{0b101}; diff --git a/opencl/test/unit_test/kernel/kernel_image_arg_tests.cpp b/opencl/test/unit_test/kernel/kernel_image_arg_tests.cpp index af84c1043c..409f815656 100644 --- a/opencl/test/unit_test/kernel/kernel_image_arg_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_image_arg_tests.cpp @@ -9,7 +9,7 @@ #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/kernel/kernel.h" #include "opencl/test/unit_test/fixtures/kernel_arg_fixture.h" #include "opencl/test/unit_test/mocks/mock_allocation_properties.h" @@ -99,7 +99,7 @@ TEST_F(KernelImageArgTest, givenImageWithNumSamplesWhenSetArgIsCalledThenPatchNu imgDesc.image_width = 5; imgDesc.image_height = 5; - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice); auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto sampleImg = Image::create(context.get(), memoryProperties, 0, 0, surfaceFormat, &imgDesc, nullptr, retVal); EXPECT_EQ(CL_SUCCESS, retVal); @@ -125,7 +125,7 @@ TEST_F(KernelImageArgTest, givenImageWithWriteOnlyAccessAndReadOnlyArgWhenCheckC auto surfaceFormat = Image::getSurfaceFormatFromTable( 0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr img( - Image::create(context.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal)); pKernelInfo->setAccessQualifier(0, KernelArgMetadata::AccessReadOnly); cl_mem memObj = img.get(); @@ -175,7 +175,7 @@ TEST_F(KernelImageArgTest, givenImageWithReadOnlyAccessAndWriteOnlyArgWhenCheckC auto surfaceFormat = Image::getSurfaceFormatFromTable( 0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr img( - Image::create(context.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal)); pKernelInfo->setAccessQualifier(0, NEO::KernelArgMetadata::AccessWriteOnly); cl_mem memObj = img.get(); @@ -198,7 +198,7 @@ TEST_F(KernelImageArgTest, givenImageWithReadOnlyAccessAndReadOnlyArgWhenCheckCo auto surfaceFormat = Image::getSurfaceFormatFromTable( 0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr img( - Image::create(context.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal)); pKernelInfo->setAccessQualifier(0, NEO::KernelArgMetadata::AccessReadOnly); cl_mem memObj = img.get(); @@ -217,7 +217,7 @@ TEST_F(KernelImageArgTest, givenImageWithWriteOnlyAccessAndWriteOnlyArgWhenCheck auto surfaceFormat = Image::getSurfaceFormatFromTable( 0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr img( - Image::create(context.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal)); pKernelInfo->setAccessQualifier(0, NEO::KernelArgMetadata::AccessWriteOnly); cl_mem memObj = img.get(); @@ -234,7 +234,7 @@ HWTEST_F(KernelImageArgTest, givenImgWithMcsAllocWhenMakeResidentThenMakeMcsAllo imgDesc.image_width = 5; imgDesc.image_height = 5; - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice); auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto img = Image::create(context.get(), memoryProperties, 0, 0, surfaceFormat, &imgDesc, nullptr, retVal); EXPECT_EQ(CL_SUCCESS, retVal); @@ -266,7 +266,7 @@ TEST_F(KernelImageArgTest, givenKernelWithSettedArgWhenUnSetCalledThenArgIsUnset auto surfaceFormat = Image::getSurfaceFormatFromTable( 0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr img( - Image::create(context.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal)); cl_mem memObj = img.get(); @@ -306,7 +306,7 @@ TEST_F(KernelImageArgTest, givenKernelWithSharedImageWhenSetArgCalledThenUsingSh auto surfaceFormat = Image::getSurfaceFormatFromTable( 0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr img( - Image::create(context.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal)); cl_mem memObj = img.get(); diff --git a/opencl/test/unit_test/kernel/kernel_tests.cpp b/opencl/test/unit_test/kernel/kernel_tests.cpp index 95e468c1ba..f2fed72401 100644 --- a/opencl/test/unit_test/kernel/kernel_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_tests.cpp @@ -24,7 +24,7 @@ #include "opencl/source/built_ins/builtins_dispatch_builder.h" #include "opencl/source/helpers/cl_hw_helper.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/kernel/kernel.h" #include "opencl/source/mem_obj/image.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" @@ -2125,7 +2125,7 @@ HWTEST_F(KernelResidencyTest, WhenMakingArgsResidentThenImageFromImageCheckIsCor cl_int retVal; MockContext context; std::unique_ptr imageNV12( - Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); EXPECT_EQ(imageNV12->getMediaPlaneType(), 0u); @@ -2141,7 +2141,7 @@ HWTEST_F(KernelResidencyTest, WhenMakingArgsResidentThenImageFromImageCheckIsCor imageDesc.mem_object = imageNV12.get(); std::unique_ptr imageY( - Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); EXPECT_EQ(imageY->getMediaPlaneType(), 0u); diff --git a/opencl/test/unit_test/mem_obj/buffer_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_tests.cpp index 55bbf8c008..252c1d7882 100644 --- a/opencl/test/unit_test/mem_obj/buffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_tests.cpp @@ -83,11 +83,11 @@ TEST(Buffer, givenReadOnlySetOfInputFlagsWhenPassedToisReadOnlyMemoryPermittedBy UltDeviceFactory deviceFactory{1, 0}; auto pDevice = deviceFactory.rootDevices[0]; cl_mem_flags flags = CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_ONLY; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice); EXPECT_TRUE(MockBuffer::isReadOnlyMemoryPermittedByFlags(memoryProperties)); flags = CL_MEM_HOST_READ_ONLY | CL_MEM_READ_ONLY; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice); EXPECT_TRUE(MockBuffer::isReadOnlyMemoryPermittedByFlags(memoryProperties)); } @@ -194,7 +194,7 @@ TEST_P(BufferReadOnlyTest, givenNonReadOnlySetOfInputFlagsWhenPassedToisReadOnly UltDeviceFactory deviceFactory{1, 0}; auto pDevice = deviceFactory.rootDevices[0]; cl_mem_flags flags = GetParam() | CL_MEM_USE_HOST_PTR; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice); EXPECT_FALSE(MockBuffer::isReadOnlyMemoryPermittedByFlags(memoryProperties)); } static cl_mem_flags nonReadOnlyFlags[] = { @@ -423,7 +423,7 @@ TEST(Buffer, givenAllocHostPtrFlagPassedToBufferCreateWhenNoSharedContextOrRende TEST(Buffer, givenRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferCompressedTypeIsReturnedIn64Bit) { MockContext context; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice()); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice()); context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = false; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, true, false, true); @@ -432,7 +432,7 @@ TEST(Buffer, givenRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenB TEST(Buffer, givenRenderCompressedBuffersDisabledLocalMemoryEnabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturnedIn64Bit) { MockContext context; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice()); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice()); context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = false; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, false, true, true); @@ -441,7 +441,7 @@ TEST(Buffer, givenRenderCompressedBuffersDisabledLocalMemoryEnabledWhenAllocatio TEST(Buffer, givenSharedContextWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) { MockContext context; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice()); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice()); context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = true; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, false, false, true); @@ -450,7 +450,7 @@ TEST(Buffer, givenSharedContextWhenAllocationTypeIsQueriedThenBufferHostMemoryTy TEST(Buffer, givenSharedContextAndRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) { MockContext context; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice()); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice()); context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = true; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, true, false, true); @@ -460,7 +460,7 @@ TEST(Buffer, givenSharedContextAndRenderCompressedBuffersEnabledWhenAllocationTy TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) { cl_mem_flags flags = CL_MEM_USE_HOST_PTR; MockContext context; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()); context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = false; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, false, false, true); @@ -470,7 +470,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledWhenAllocationTypeIsQuerie TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) { cl_mem_flags flags = CL_MEM_USE_HOST_PTR; MockContext context; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()); context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = false; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, false, true, true); @@ -480,7 +480,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledWhenAllocationTypeIsQueried TEST(Buffer, givenAllocHostPtrFlagWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) { cl_mem_flags flags = CL_MEM_ALLOC_HOST_PTR; MockContext context; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()); context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = false; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, false, false, true); @@ -490,7 +490,7 @@ TEST(Buffer, givenAllocHostPtrFlagWhenAllocationTypeIsQueriedThenBufferTypeIsRet TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledAndRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferMemoryTypeIsReturned) { cl_mem_flags flags = CL_MEM_USE_HOST_PTR; MockContext context; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()); context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = false; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, true, false, true); @@ -500,7 +500,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledAndRenderCompressedBuffers TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledAndRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferMemoryTypeIsReturned) { cl_mem_flags flags = CL_MEM_USE_HOST_PTR; MockContext context; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()); context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = false; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, true, true, true); @@ -510,7 +510,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledAndRenderCompressedBuffersE TEST(Buffer, givenUseHostPointerFlagAndForceSharedPhysicalStorageWhenLocalMemoryIsEnabledThenBufferHostMemoryTypeIsReturned) { cl_mem_flags flags = CL_MEM_USE_HOST_PTR | CL_MEM_FORCE_HOST_MEMORY_INTEL; MockContext context; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()); context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = false; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, true, true, true); @@ -520,7 +520,7 @@ TEST(Buffer, givenUseHostPointerFlagAndForceSharedPhysicalStorageWhenLocalMemory TEST(Buffer, givenAllocHostPtrFlagAndRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferCompressedTypeIsReturned) { cl_mem_flags flags = CL_MEM_ALLOC_HOST_PTR; MockContext context; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()); context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = false; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, true, false, true); @@ -529,7 +529,7 @@ TEST(Buffer, givenAllocHostPtrFlagAndRenderCompressedBuffersEnabledWhenAllocatio TEST(Buffer, givenZeroFlagsNoSharedContextAndRenderCompressedBuffersDisabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) { MockContext context; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice()); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice()); context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = false; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, false, false, true); diff --git a/opencl/test/unit_test/mem_obj/buffer_tests_xehp_and_later.cpp b/opencl/test/unit_test/mem_obj/buffer_tests_xehp_and_later.cpp index 5dcc5f59a3..dc76846747 100644 --- a/opencl/test/unit_test/mem_obj/buffer_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_tests_xehp_and_later.cpp @@ -17,7 +17,7 @@ #include "shared/test/common/mocks/mock_device.h" #include "opencl/source/cl_device/cl_device.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_context.h" @@ -448,7 +448,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterBufferTests, givenBufferAllocationWitho cl_float srcMemory[] = {1.0f, 2.0f, 3.0f, 4.0f}; std::unique_ptr buffer(Buffer::createBufferHw( &context, - MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice()), 0, 0, sizeof(srcMemory), diff --git a/opencl/test/unit_test/mem_obj/create_image_format_tests.cpp b/opencl/test/unit_test/mem_obj/create_image_format_tests.cpp index 6a090a7bcc..22b0b527e1 100644 --- a/opencl/test/unit_test/mem_obj/create_image_format_tests.cpp +++ b/opencl/test/unit_test/mem_obj/create_image_format_tests.cpp @@ -5,7 +5,7 @@ * */ -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/helpers/surface_formats.h" #include "opencl/source/mem_obj/image.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" @@ -64,7 +64,7 @@ typedef CreateImageFormatTest ReadWriteFormatTest; TEST_P(ReadWriteFormatTest, GivenValidFormatWhenCreatingImageThenImageIsCreated) { auto image = Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -89,7 +89,7 @@ typedef CreateImageFormatTest ReadOnlyFormatTest; TEST_P(ReadOnlyFormatTest, GivenValidReadOnlyFormatWhenCreatingImageThenImageIsCreated) { auto image = Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -112,7 +112,7 @@ typedef CreateImageFormatTest WriteOnlyFormatTest; TEST_P(WriteOnlyFormatTest, GivenValidWriteOnlyFormatWhenCreatingImageThenImageIsCreated) { auto image = Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, 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 68e8a53f73..e97ad99e45 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 @@ -11,7 +11,7 @@ #include "shared/test/common/mocks/mock_device.h" #include "shared/test/common/mocks/mock_memory_manager.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/image.h" #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/mocks/mock_cl_device.h" @@ -75,7 +75,7 @@ TEST_F(ImageInLocalMemoryTest, givenImageWithoutHostPtrWhenLocalMemoryIsEnabledT .WillRepeatedly(::testing::Invoke(gmockMemoryManager, &GMockMemoryManagerFailFirstAllocation::baseAllocateGraphicsMemoryInDevicePool)); std::unique_ptr image(Image::create( - context.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, memory, retVal)); ASSERT_NE(nullptr, image); diff --git a/opencl/test/unit_test/mem_obj/image1d_tests.cpp b/opencl/test/unit_test/mem_obj/image1d_tests.cpp index 052e74025c..b37dc4f41e 100644 --- a/opencl/test/unit_test/mem_obj/image1d_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image1d_tests.cpp @@ -5,7 +5,7 @@ * */ -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/source/mem_obj/image.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" @@ -75,7 +75,7 @@ HWTEST_P(CreateImage1DType, GivenValidTypeWhenCreatingImageThenImageParamsAreCor auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice), flags, 0, surfaceFormat, 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 99f769eb5e..8e5dd83c90 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 @@ -9,7 +9,7 @@ #include "shared/source/helpers/hw_helper.h" #include "opencl/source/cl_device/cl_device_info_map.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/source/mem_obj/image.h" #include "opencl/source/platform/extensions.h" @@ -61,7 +61,7 @@ class Image2dFromBufferTest : public ::testing::Test { cl_mem_flags flags = CL_MEM_READ_ONLY; auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - return Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + return Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, NULL, retVal); } cl_image_format imageFormat; @@ -94,7 +94,7 @@ TEST_F(Image2dFromBufferTest, givenBufferWhenCreateImage2dArrayFromBufferThenIma cl_mem_flags flags = CL_MEM_READ_ONLY; auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_INVALID_IMAGE_DESCRIPTOR, retVal); } @@ -111,7 +111,7 @@ TEST_F(Image2dFromBufferTest, givenInvalidRowPitchWhenCreateImage2dFromBufferThe cl_mem_flags flags = CL_MEM_READ_ONLY; auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), surfaceFormat, &imageDesc, ptr); EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal); } @@ -142,7 +142,7 @@ TEST_F(Image2dFromBufferTest, GivenInvalidHostPtrAlignmentWhenCreatingImageThenI cl_mem_flags flags = CL_MEM_READ_ONLY; auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal); @@ -157,7 +157,7 @@ TEST_F(Image2dFromBufferTest, givenInvalidFlagsWhenValidateIsCalledThenReturnErr for (auto flag : flags) { auto surfaceFormat = Image::getSurfaceFormatFromTable( flag, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flag, 0, 0, &context.getDevice(0)->getDevice()), + retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flag, 0, 0, &context.getDevice(0)->getDevice()), surfaceFormat, &imageDesc, reinterpret_cast(0x12345)); EXPECT_EQ(CL_INVALID_VALUE, retVal); } @@ -172,7 +172,7 @@ TEST_F(Image2dFromBufferTest, givenOneChannel8BitColorsNoRowPitchSpecifiedAndToo auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal); } @@ -186,7 +186,7 @@ TEST_F(Image2dFromBufferTest, givenOneChannel16BitColorsNoRowPitchSpecifiedAndTo auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal); } @@ -200,7 +200,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel8BitColorsNoRowPitchSpecifiedAndTo const auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal); } @@ -214,7 +214,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel16BitColorsNoRowPitchSpecifiedAndT auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal); } @@ -229,7 +229,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel8BitColorsAndNotTooLargeRowPitchSp auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_SUCCESS, retVal); } @@ -245,7 +245,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel8BitColorsAndTooLargeRowPitchSpeci auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal); } @@ -261,7 +261,7 @@ TEST_F(Image2dFromBufferTest, givenUnalignedImageWidthAndNoSpaceInBufferForAlign auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal); } diff --git a/opencl/test/unit_test/mem_obj/image2d_tests.cpp b/opencl/test/unit_test/mem_obj/image2d_tests.cpp index 19f018fa95..138489c682 100644 --- a/opencl/test/unit_test/mem_obj/image2d_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image2d_tests.cpp @@ -7,7 +7,7 @@ #include "shared/test/common/helpers/unit_test_helper.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/image.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/mocks/mock_context.h" @@ -57,7 +57,7 @@ class CreateImage2DTest : public ClDeviceFixture, Image *createImageWithFlags(cl_mem_flags flags) { auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - return Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + return Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal); } cl_image_format imageFormat; diff --git a/opencl/test/unit_test/mem_obj/image3d_tests.cpp b/opencl/test/unit_test/mem_obj/image3d_tests.cpp index 0d3273a9fb..ae5d0add1e 100644 --- a/opencl/test/unit_test/mem_obj/image3d_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image3d_tests.cpp @@ -8,7 +8,7 @@ #include "shared/source/helpers/aligned_memory.h" #include "shared/test/common/helpers/unit_test_helper.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/image.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/mocks/mock_context.h" @@ -62,7 +62,7 @@ HWTEST_F(CreateImage3DTest, WhenCreatingImageThenPropertiesAreSetCorrectly) { cl_mem_flags flags = CL_MEM_READ_WRITE; auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - auto image = Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + auto image = Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal); ASSERT_EQ(CL_SUCCESS, retVal); @@ -93,7 +93,7 @@ HWTEST_F(CreateImage3DTest, GivenTiledOrForcedLinearWhenCreatingImageThenPropert auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto imgInfo = MockGmm::initImgInfo(imageDesc, 0, surfaceFormat); MockGmm::queryImgParams(context->getDevice(0)->getGmmClientContext(), imgInfo); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context->getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context->getDevice(0)->getDevice()); auto image = Image::create( context, diff --git a/opencl/test/unit_test/mem_obj/image_array_size_tests.cpp b/opencl/test/unit_test/mem_obj/image_array_size_tests.cpp index 36994c68fa..8fbdd5c423 100644 --- a/opencl/test/unit_test/mem_obj/image_array_size_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_array_size_tests.cpp @@ -8,7 +8,7 @@ #include "shared/source/helpers/aligned_memory.h" #include "shared/test/common/helpers/unit_test_helper.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/image.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/mocks/mock_context.h" @@ -75,7 +75,7 @@ HWTEST_P(CreateImageArraySize, GivenArrayTypeWhenCreatingImageThenImageCreatedWi auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -116,7 +116,7 @@ HWTEST_P(CreateImageNonArraySize, GivenNonArrayTypeWhenCreatingImageThenImageCre auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, diff --git a/opencl/test/unit_test/mem_obj/image_from_subbuffer_tests.cpp b/opencl/test/unit_test/mem_obj/image_from_subbuffer_tests.cpp index 73fb352eae..447e1a462f 100644 --- a/opencl/test/unit_test/mem_obj/image_from_subbuffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_from_subbuffer_tests.cpp @@ -7,7 +7,7 @@ #include "shared/source/helpers/aligned_memory.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/source/mem_obj/image.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" @@ -63,7 +63,7 @@ class ImageFromSubBufferTest : public ClDeviceFixture, public ::testing::Test { cl_mem_flags flags = CL_MEM_READ_ONLY; auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - return Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + return Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, NULL, retVal); } cl_image_format imageFormat; diff --git a/opencl/test/unit_test/mem_obj/image_redescribe_tests.cpp b/opencl/test/unit_test/mem_obj/image_redescribe_tests.cpp index fcbfb6b5e6..25dbaf449b 100644 --- a/opencl/test/unit_test/mem_obj/image_redescribe_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_redescribe_tests.cpp @@ -8,7 +8,7 @@ #include "shared/source/helpers/aligned_memory.h" #include "shared/source/memory_manager/os_agnostic_memory_manager.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/helpers/surface_formats.h" #include "opencl/source/mem_obj/image.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" @@ -54,7 +54,7 @@ class ImageRedescribeTest : public testing::TestWithParamgetHardwareInfo().capabilityTable.supportsOcl21Features); image.reset(Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -196,7 +196,7 @@ TEST_P(ImageRedescribeTest, givenImageWithMaxSizesWhenItIsRedescribedThenNewImag auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto bigImage = std::unique_ptr(Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, diff --git a/opencl/test/unit_test/mem_obj/image_tests.cpp b/opencl/test/unit_test/mem_obj/image_tests.cpp index 475335bb99..35638a50b9 100644 --- a/opencl/test/unit_test/mem_obj/image_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_tests.cpp @@ -52,7 +52,7 @@ class CreateImageTest : public ClDeviceFixture, Image *createImageWithFlags(cl_mem_flags flags, Context *context) { auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - return Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + return Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal); } @@ -129,7 +129,7 @@ TEST(TestSliceAndRowPitch, Given1dImageWithZeroRowPitchAndZeroSlicePitchWhenGett flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -180,7 +180,7 @@ TEST(TestSliceAndRowPitch, Given1dImageWithNonZeroRowPitchAndZeroSlicePitchWhenG flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -231,7 +231,7 @@ TEST(TestSliceAndRowPitch, Given2dImageWithNonZeroRowPitchAndZeroSlicePitchWhenG flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -282,7 +282,7 @@ TEST(TestSliceAndRowPitch, Given1dArrayWithNonZeroRowPitchAndZeroSlicePitchWhenG flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -333,7 +333,7 @@ TEST(TestSliceAndRowPitch, Given2dArrayWithNonZeroRowPitchAndZeroSlicePitchWhenG flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -384,7 +384,7 @@ TEST(TestSliceAndRowPitch, Given2dArrayWithZeroRowPitchAndNonZeroSlicePitchWhenG flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -435,7 +435,7 @@ TEST(TestSliceAndRowPitch, Given2dArrayWithNonZeroRowPitchAndNonZeroSlicePitchWh flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -486,7 +486,7 @@ TEST(TestSliceAndRowPitch, Given2dArrayWithNonZeroRowPitchAndNonZeroSlicePitchGr flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -537,7 +537,7 @@ TEST(TestCreateImage, GivenSharedContextWhenImageIsCreatedThenRowAndSliceAreCorr auto image = Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -599,7 +599,7 @@ TEST(TestCreateImageUseHostPtr, GivenDifferenHostPtrAlignmentsWhenCheckingMemory for (int i = 0; i < 4; i++) { auto image = Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -639,7 +639,7 @@ TEST(TestCreateImageUseHostPtr, givenZeroCopyImageValuesWhenUsingHostPtrThenZero auto image = std::unique_ptr(Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -751,7 +751,7 @@ struct CreateImageHostPtr flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); return Image::create( context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -1171,7 +1171,7 @@ HWTEST_F(ImageCompressionTests, givenTiledImageWhenCreatingAllocationThenPreferR auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = std::unique_ptr(Image::create( - mockContext.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); ASSERT_NE(nullptr, image); EXPECT_EQ(UnitTestHelper::tiledImagesSupported, image->isTiledAllocation()); @@ -1186,7 +1186,7 @@ TEST_F(ImageCompressionTests, givenNonTiledImageWhenCreatingAllocationThenDontPr auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = std::unique_ptr(Image::create( - mockContext.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); ASSERT_NE(nullptr, image); EXPECT_FALSE(image->isTiledAllocation()); @@ -1419,7 +1419,7 @@ TEST(ImageTest, givenClMemForceLinearStorageSetWhenCreateImageThenDisallowTiling auto image = std::unique_ptr(Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, @@ -1467,7 +1467,7 @@ TEST(ImageTest, givenClMemCopyHostPointerPassedToImageCreateWhenAllocationIsNotI flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr image( - Image::create(&ctx, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + Image::create(&ctx, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, memory, retVal)); EXPECT_NE(nullptr, image); diff --git a/opencl/test/unit_test/mem_obj/image_tests_xehp_and_later.cpp b/opencl/test/unit_test/mem_obj/image_tests_xehp_and_later.cpp index 9d1edbca9c..21de5ed826 100644 --- a/opencl/test/unit_test/mem_obj/image_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/mem_obj/image_tests_xehp_and_later.cpp @@ -52,7 +52,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterImageTests, givenContextTypeDefaultWhen auto surfaceFormat = Image::getSurfaceFormatFromTable( CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = std::unique_ptr(Image::create( - &context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal)); auto imageHw = static_cast *>(image.get()); @@ -91,7 +91,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterImageTests, givenContextTypeDefaultWhen auto surfaceFormat = Image::getSurfaceFormatFromTable( CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = std::unique_ptr(Image::create( - &context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal)); auto imageHw = static_cast *>(image.get()); @@ -125,7 +125,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterImageTests, givenDebugFlagForMultiTileS auto surfaceFormat = Image::getSurfaceFormatFromTable( CL_MEM_READ_ONLY, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = std::unique_ptr(Image::create( - &context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal)); auto imageHw = static_cast *>(image.get()); @@ -171,7 +171,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterImageTests, givenContextTypeUnrestricti auto surfaceFormat = Image::getSurfaceFormatFromTable( CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = std::unique_ptr(Image::create( - &context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal)); auto imageHw = static_cast *>(image.get()); @@ -204,7 +204,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterImageTests, givenContextTypeDefaultWhen auto surfaceFormat = Image::getSurfaceFormatFromTable( CL_MEM_READ_ONLY, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = std::unique_ptr(Image::create( - &context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal)); auto imageHw = static_cast *>(image.get()); @@ -239,7 +239,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterImageTests, givenContextTypeSpecialized auto surfaceFormat = Image::getSurfaceFormatFromTable( CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = std::unique_ptr(Image::create( - &context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal)); auto imageHw = static_cast *>(image.get()); @@ -292,7 +292,7 @@ HWCMDTEST_P(IGFX_XE_HP_CORE, MultiGpuGlobalAtomicsImageTest, givenAppendSurfaceS auto surfaceFormat = Image::getSurfaceFormatFromTable( memFlags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = std::unique_ptr(Image::create( - &context, MemoryPropertiesHelper::createMemoryProperties(memFlags, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(memFlags, 0, 0, &context.getDevice(0)->getDevice()), memFlags, 0, surfaceFormat, &imageDesc, NULL, retVal)); auto imageHw = static_cast *>(image.get()); @@ -392,7 +392,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterImageTests, givenCompressionWhenAppendi auto surfaceFormat = Image::getSurfaceFormatFromTable( CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = std::unique_ptr(Image::create( - &context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal)); auto imageHw = static_cast *>(image.get()); auto surfaceState = FamilyType::cmdInitRenderSurfaceState; @@ -432,7 +432,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterImageTests, givenImageFromBufferWhenSet buffer->getGraphicsAllocation(0)->setAllocationType(GraphicsAllocation::AllocationType::BUFFER_COMPRESSED); auto surfaceFormat = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - auto image = std::unique_ptr(Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), + auto image = std::unique_ptr(Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal)); auto imageHw = static_cast *>(image.get()); diff --git a/opencl/test/unit_test/mem_obj/image_tiled_tests.cpp b/opencl/test/unit_test/mem_obj/image_tiled_tests.cpp index 938195e8f4..c99975421d 100644 --- a/opencl/test/unit_test/mem_obj/image_tiled_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_tiled_tests.cpp @@ -73,7 +73,7 @@ HWTEST_P(CreateTiledImageTest, GivenImageTypeWhenCheckingIsTiledThenTrueReturned auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice), flags, 0, surfaceFormat, 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 759d59eee0..d5247f8dd7 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 @@ -12,7 +12,7 @@ #include "shared/test/common/mocks/mock_memory_manager.h" #include "opencl/source/api/api.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/mem_obj.h" #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/libult/ult_command_stream_receiver.h" @@ -46,7 +46,7 @@ class MemObjDestructionTest : public ::testing::TestWithParam { allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{device->getRootDeviceIndex(), size}); memObj = new MemObj(context.get(), CL_MEM_OBJECT_BUFFER, - MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &device->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &device->getDevice()), CL_MEM_READ_WRITE, 0, size, nullptr, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(allocation), true, false, false); csr = device->getDefaultEngine().commandStreamReceiver; @@ -227,7 +227,7 @@ HWTEST_P(MemObjAsyncDestructionTest, givenUsedMemObjWithAsyncDestructionsEnabled MemObjSizeArray region = {{1, 1, 1}}; cl_map_flags mapFlags = CL_MAP_READ; memObj = new MemObj(context.get(), CL_MEM_OBJECT_BUFFER, - MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(0)->getDevice()), CL_MEM_READ_WRITE, 0, size, storage, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(allocation), true, false, false); memObj->addMappedPtr(storage, 1, mapFlags, region, origin, 0); diff --git a/opencl/test/unit_test/mem_obj/mem_obj_helper_tests.cpp b/opencl/test/unit_test/mem_obj/mem_obj_helper_tests.cpp index 6d594942fd..4a9ed70f6f 100644 --- a/opencl/test/unit_test/mem_obj/mem_obj_helper_tests.cpp +++ b/opencl/test/unit_test/mem_obj/mem_obj_helper_tests.cpp @@ -8,7 +8,7 @@ #include "shared/test/common/mocks/ult_device_factory.h" #include "shared/test/unit_test/utilities/base_object_utils.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/mem_obj_helper.h" #include "opencl/test/unit_test/fixtures/image_fixture.h" #include "opencl/test/unit_test/mocks/mock_context.h" @@ -39,22 +39,22 @@ TEST(MemObjHelper, givenClMemForceLinearStorageFlagWhenCheckForLinearStorageForc flags |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL; flagsIntel = 0; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); EXPECT_TRUE(memoryProperties.flags.forceLinearStorage); flags = 0; flagsIntel |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); EXPECT_TRUE(memoryProperties.flags.forceLinearStorage); flags |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL; flagsIntel |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); EXPECT_TRUE(memoryProperties.flags.forceLinearStorage); flags = 0; flagsIntel = 0; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); EXPECT_FALSE(memoryProperties.flags.forceLinearStorage); } @@ -63,61 +63,61 @@ TEST(MemObjHelper, givenValidPropertiesWhenValidatingMemoryPropertiesThenTrueIsR cl_mem_flags_intel flagsIntel = 0; UltClDeviceFactory deviceFactory{1, 0}; auto pDevice = &deviceFactory.rootDevices[0]->getDevice(); - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); MockContext context{deviceFactory.rootDevices[0]}; EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel, context)); EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr, context)); flags = CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL | CL_MEM_NO_ACCESS_INTEL; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); flags = CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL | CL_MEM_NO_ACCESS_INTEL; flagsIntel = 0; EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr, context)); flags = CL_MEM_NO_ACCESS_INTEL; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); flags = CL_MEM_NO_ACCESS_INTEL; flagsIntel = 0; EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr, context)); flags = CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR | CL_MEM_HOST_NO_ACCESS; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); flags = CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR | CL_MEM_HOST_NO_ACCESS; flagsIntel = 0; EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel, context)); EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr, context)); flags = CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR | CL_MEM_HOST_WRITE_ONLY; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); flags = CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR | CL_MEM_HOST_WRITE_ONLY; flagsIntel = 0; EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel, context)); EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr, context)); flags = CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_NO_ACCESS; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); flags = CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_NO_ACCESS; flagsIntel = 0; EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel, context)); EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr, context)); flagsIntel = CL_MEM_LOCALLY_UNCACHED_RESOURCE; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); flags = 0; flagsIntel = CL_MEM_LOCALLY_UNCACHED_RESOURCE; EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel, context)); EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr, context)); flagsIntel = CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); flags = 0; flagsIntel = CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE; EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel, context)); EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr, context)); flags = 0; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); flags = 0; flagsIntel = 0; EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel, context)); @@ -133,7 +133,7 @@ TEST(MemObjHelper, givenParentMemObjAndHostPtrFlagsWhenValidatingMemoryPropertie cl_mem_flags_intel flagsIntel = 0; UltClDeviceFactory deviceFactory{1, 0}; auto pDevice = &deviceFactory.rootDevices[0]->getDevice(); - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); MockContext context{deviceFactory.rootDevices[0]}; auto image = clUniquePtr(Image1dHelper<>::create(&context)); @@ -143,13 +143,13 @@ TEST(MemObjHelper, givenParentMemObjAndHostPtrFlagsWhenValidatingMemoryPropertie for (auto hostPtrFlag : hostPtrFlags) { flags = hostPtrFlag; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); flags = hostPtrFlag; EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, 0, image.get(), context)); EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, 0, imageWithAccessFlagsUnrestricted.get(), context)); flags |= CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice); flags |= CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL; EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, 0, image.get(), context)); EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, 0, imageWithAccessFlagsUnrestricted.get(), context)); @@ -159,6 +159,6 @@ TEST(MemObjHelper, givenParentMemObjAndHostPtrFlagsWhenValidatingMemoryPropertie TEST(MemObjHelper, givenContextWithMultipleRootDevicesWhenIsSuitableForRenderCompressionIsCalledThenFalseIsReturned) { MockDefaultContext context; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.pRootDevice0->getDevice()); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.pRootDevice0->getDevice()); EXPECT_FALSE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true)); } \ No newline at end of file diff --git a/opencl/test/unit_test/mem_obj/mem_obj_tests.cpp b/opencl/test/unit_test/mem_obj/mem_obj_tests.cpp index a49e143006..e9a98e3156 100644 --- a/opencl/test/unit_test/mem_obj/mem_obj_tests.cpp +++ b/opencl/test/unit_test/mem_obj/mem_obj_tests.cpp @@ -15,7 +15,7 @@ #include "shared/test/common/mocks/mock_graphics_allocation.h" #include "shared/test/common/mocks/mock_memory_manager.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/helpers/properties_helper.h" #include "opencl/source/mem_obj/mem_obj.h" #include "opencl/source/platform/platform.h" @@ -67,7 +67,7 @@ TEST(MemObj, GivenMemObjWhenInititalizedFromHostPtrThenInitializeFields) { char buffer[size]; MockContext context; MockGraphicsAllocation *mockAllocation = new MockGraphicsAllocation(buffer, sizeof(buffer)); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0, sizeof(buffer), buffer, buffer, GraphicsAllocationHelper::toMultiGraphicsAllocation(mockAllocation), true, false, false); @@ -83,7 +83,7 @@ TEST(MemObj, givenMemObjectWhenAskedForTransferToHostPtrThenDoNothing) { uint8_t expectedHostPtr[size] = {}; MockContext context; MockGraphicsAllocation *mockAllocation = new MockGraphicsAllocation(hostPtr, sizeof(hostPtr)); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0, size, hostPtr, hostPtr, GraphicsAllocationHelper::toMultiGraphicsAllocation(mockAllocation), true, false, false); @@ -103,7 +103,7 @@ TEST(MemObj, givenMemObjectWhenAskedForTransferFromHostPtrThenDoNothing) { uint8_t expectedBufferPtr[size] = {}; MockContext context; MockGraphicsAllocation *mockAllocation = new MockGraphicsAllocation(hostPtr, sizeof(hostPtr)); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_PIPE, memoryProperties, CL_MEM_USE_HOST_PTR, 0, size, hostPtr, hostPtr, GraphicsAllocationHelper::toMultiGraphicsAllocation(mockAllocation), true, false, false); @@ -120,7 +120,7 @@ TEST(MemObj, givenMemObjectWhenAskedForTransferFromHostPtrThenDoNothing) { TEST(MemObj, givenHostPtrAndUseHostPtrFlagWhenAskingForBaseMapPtrThenReturnHostPtr) { uint8_t hostPtr = 0; MockContext context; - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0, 1, nullptr, &hostPtr, 0, true, false, false); @@ -130,7 +130,7 @@ TEST(MemObj, givenHostPtrAndUseHostPtrFlagWhenAskingForBaseMapPtrThenReturnHostP TEST(MemObj, givenHostPtrWithoutUseHostPtrFlagWhenAskingForBaseMapPtrThenReturnAllocatedPtr) { uint8_t hostPtr = 0; MockContext context; - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0, 1, nullptr, &hostPtr, 0, true, false, false); @@ -142,7 +142,7 @@ TEST(MemObj, givenMemObjWhenReleaseAllocatedPtrIsCalledTwiceThenItDoesntCrash) { void *allocatedPtr = alignedMalloc(MemoryConstants::cacheLineSize, MemoryConstants::cacheLineSize); MockContext context; - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0, 1, nullptr, nullptr, 0, true, false, false); @@ -162,7 +162,7 @@ TEST(MemObj, givenNotReadyGraphicsAllocationWhenMemObjDestroysAllocationAsyncThe auto defaultEngine = context.getDevice(0)->getDefaultEngine(); allocation->updateTaskCount(2, defaultEngine.osContext->getContextId()); *(defaultEngine.commandStreamReceiver->getTagAddress()) = 1; - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0, MemoryConstants::pageSize, nullptr, nullptr, 0, true, false, false); auto &allocationList = defaultEngine.commandStreamReceiver->getTemporaryAllocations(); @@ -181,7 +181,7 @@ TEST(MemObj, givenReadyGraphicsAllocationWhenMemObjDestroysAllocationAsyncThenAl auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{device->getRootDeviceIndex(), MemoryConstants::pageSize}); allocation->updateTaskCount(1, device->getDefaultEngine().osContext->getContextId()); *device->getDefaultEngine().commandStreamReceiver->getTagAddress() = 1; - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0, MemoryConstants::pageSize, nullptr, nullptr, 0, true, false, false); @@ -199,7 +199,7 @@ TEST(MemObj, givenNotUsedGraphicsAllocationWhenMemObjDestroysAllocationAsyncThen context.memoryManager = &memoryManager; auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{context.getDevice(0)->getRootDeviceIndex(), MemoryConstants::pageSize}); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0, MemoryConstants::pageSize, nullptr, nullptr, 0, true, false, false); @@ -217,7 +217,7 @@ TEST(MemObj, givenMemoryManagerWithoutDeviceWhenMemObjDestroysAllocationAsyncThe context.memoryManager = &memoryManager; auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{context.getDevice(0)->getRootDeviceIndex(), MemoryConstants::pageSize}); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0, MemoryConstants::pageSize, nullptr, nullptr, 0, true, false, false); @@ -233,7 +233,7 @@ TEST(MemObj, givenMemObjAndPointerToObjStorageWithProperCommandWhenCheckIfMemTra MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment()); context.memoryManager = &memoryManager; - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0, MemoryConstants::pageSize, nullptr, nullptr, 0, true, false, false); void *ptr = memObj.getCpuAddressForMemoryTransfer(); @@ -261,7 +261,7 @@ TEST(MemObj, givenMemObjAndPointerToObjStorageBadCommandWhenCheckIfMemTransferRe MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment()); context.memoryManager = &memoryManager; - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0, MemoryConstants::pageSize, nullptr, nullptr, 0, true, false, false); void *ptr = memObj.getCpuAddressForMemoryTransfer(); @@ -274,7 +274,7 @@ TEST(MemObj, givenMemObjAndPointerToDiffrentStorageAndProperCommandWhenCheckIfMe MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment()); context.memoryManager = &memoryManager; - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0, MemoryConstants::pageSize, nullptr, nullptr, 0, true, false, false); void *ptr = (void *)0x1234; @@ -286,7 +286,7 @@ TEST(MemObj, givenSharingHandlerWhenAskedForCpuMappingThenReturnFalse) { MockContext context; MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment()); auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{context.getDevice(0)->getRootDeviceIndex(), MemoryConstants::pageSize}); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0, MemoryConstants::pageSize, nullptr, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(allocation), true, false, false); memObj.setSharingHandler(new SharingHandler()); @@ -299,7 +299,7 @@ TEST(MemObj, givenTiledObjectWhenAskedForCpuMappingThenReturnFalse) { bool isTiledAllocation() const override { return true; } }; MockContext context; - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MyMemObj memObj(nullptr, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0, MemoryConstants::pageSize, nullptr, nullptr, 0, true, false, false); @@ -314,7 +314,7 @@ TEST(MemObj, givenRenderCompressedGmmWhenAskingForMappingOnCpuThenDisallow) { auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{context.getDevice(0)->getRootDeviceIndex(), MemoryConstants::pageSize}); allocation->setDefaultGmm(new Gmm(context.getDevice(0)->getGmmClientContext(), nullptr, 1, 0, false)); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_READ_WRITE, 0, 1, allocation->getUnderlyingBuffer(), nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(allocation), false, false, false); @@ -331,7 +331,7 @@ TEST(MemObj, givenDefaultWhenAskedForCpuMappingThenReturnTrue) { context.memoryManager = &memoryManager; auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{context.getDevice(0)->getRootDeviceIndex(), MemoryConstants::pageSize}); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0, 64, allocation->getUnderlyingBuffer(), nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(allocation), true, false, false); @@ -348,7 +348,7 @@ TEST(MemObj, givenNonCpuAccessibleMemoryWhenAskingForMappingOnCpuThenDisallow) { auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{context.getDevice(0)->getRootDeviceIndex(), MemoryConstants::pageSize}); allocation->setDefaultGmm(new Gmm(context.getDevice(0)->getGmmClientContext(), nullptr, 1, 0, false)); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_READ_WRITE, 0, 1, allocation->getUnderlyingBuffer(), nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(allocation), false, false, false); @@ -398,7 +398,7 @@ TEST(MemObj, givenSharedMemObjectWithNullGfxAllocationWhenSettingGfxAllocationTh MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment()); context.memoryManager = &memoryManager; MockGraphicsAllocation *gfxAllocation = new MockGraphicsAllocation(nullptr, 0); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0, 1, nullptr, nullptr, 0, true, false, false); memObj.setSharingHandler(new MySharingHandler(&memObj)); @@ -415,7 +415,7 @@ TEST(MemObj, givenSharedMemObjectAndGfxAllocationWhenGraphicsAllocationIsRemoved MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment()); context.memoryManager = &memoryManager; MockGraphicsAllocation *graphicsAllocation = new MockGraphicsAllocation(nullptr, 0); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0, 1, nullptr, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(graphicsAllocation), true, false, false); memObj.setSharingHandler(new MySharingHandler(&memObj)); @@ -432,7 +432,7 @@ TEST(MemObj, givenSharedMemObjectAndZeroReuseCountWhenChangingGfxAllocationThenO context.memoryManager = &memoryManager; MockGraphicsAllocation *oldGfxAllocation = new MockGraphicsAllocation(nullptr, 0); MockGraphicsAllocation *newGfxAllocation = new MockGraphicsAllocation(nullptr, 0); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0, 1, nullptr, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(oldGfxAllocation), true, false, false); memObj.setSharingHandler(new MySharingHandler(&memObj)); @@ -451,7 +451,7 @@ TEST(MemObj, givenSharedMemObjectAndNonZeroReuseCountWhenChangingGfxAllocationTh context.memoryManager = &memoryManager; MockGraphicsAllocation *oldGfxAllocation = new MockGraphicsAllocation(nullptr, 0); MockGraphicsAllocation *newGfxAllocation = new MockGraphicsAllocation(nullptr, 0); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0, 1, nullptr, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(oldGfxAllocation), true, false, false); memObj.setSharingHandler(new MySharingHandler(&memObj)); @@ -470,7 +470,7 @@ TEST(MemObj, givenNotSharedMemObjectWhenChangingGfxAllocationThenOldAllocationIs context.memoryManager = &memoryManager; MockGraphicsAllocation *oldGfxAllocation = new MockGraphicsAllocation(nullptr, 0); MockGraphicsAllocation *newGfxAllocation = new MockGraphicsAllocation(nullptr, 0); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0, 1, nullptr, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(oldGfxAllocation), true, false, false); @@ -488,7 +488,7 @@ TEST(MemObj, givenGraphicsAllocationWhenCallingIsAllocDumpableThenItReturnsTheCo TEST(MemObj, givenMemObjNotUsingHostPtrWhenGettingBasePtrTwiceThenReturnSameMapPtr) { MockContext context; - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_READ_WRITE, 0, 1, nullptr, nullptr, 0, true, false, false); @@ -505,7 +505,7 @@ using MemObjMultiRootDeviceTests = MultiRootDeviceFixture; TEST_F(MemObjMultiRootDeviceTests, WhenMemObjMapIsCreatedThenAllocationHasCorrectRootDeviceIndex) { auto allocation = mockMemoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{device1->getRootDeviceIndex(), MemoryConstants::pageSize}); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(0)->getDevice()); std::unique_ptr memObj( new MemObj(context.get(), CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_READ_WRITE, 0, 1, nullptr, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(allocation), true, false, false)); @@ -528,7 +528,7 @@ TEST_F(MemObjMultiRootDeviceTests, WhenMemObjIsCreatedWithMultiGraphicsAllocatio multiGraphicsAllocation.addAllocation(allocation0); multiGraphicsAllocation.addAllocation(allocation1); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(0)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(0)->getDevice()); std::unique_ptr memObj( new MemObj(context.get(), CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_READ_WRITE, 0, 1, nullptr, nullptr, multiGraphicsAllocation, true, false, false)); @@ -549,7 +549,7 @@ TEST_F(MemObjMultiRootDeviceTests, WhenMemObjMapAreCreatedThenAllAllocationAreDe multiGraphicsAllocation.addAllocation(allocation0); multiGraphicsAllocation.addAllocation(allocation1); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(1)->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(1)->getDevice()); std::unique_ptr memObj( new MemObj(context.get(), CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_READ_WRITE, 0, 1, nullptr, nullptr, multiGraphicsAllocation, true, false, false)); diff --git a/opencl/test/unit_test/mem_obj/nv12_image_tests.cpp b/opencl/test/unit_test/mem_obj/nv12_image_tests.cpp index 7dce0bb4e4..ab379b0e62 100644 --- a/opencl/test/unit_test/mem_obj/nv12_image_tests.cpp +++ b/opencl/test/unit_test/mem_obj/nv12_image_tests.cpp @@ -11,7 +11,7 @@ #include "shared/test/common/helpers/kernel_binary_helper.h" #include "opencl/source/cl_device/cl_device_get_cap.inl" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/helpers/surface_formats.h" #include "opencl/source/mem_obj/image.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" @@ -75,14 +75,14 @@ class Nv12ImageTest : public testing::Test { void validateImageWithFlags(cl_mem_flags flags) { auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), surfaceFormat, &imageDesc, nullptr); } Image *createImageWithFlags(cl_mem_flags flags) { auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - return Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + return Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal); } @@ -179,7 +179,7 @@ TEST_F(Nv12ImageTest, given2DImageWhenPassedToValidateImageTraitsThenValidateRet imageDesc.image_depth = 0; retVal = Image::validateImageTraits( - &context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), &imageFormat, &imageDesc, nullptr); EXPECT_EQ(CL_SUCCESS, retVal); } @@ -193,7 +193,7 @@ TEST_F(Nv12ImageTest, given1DImageWhenPassedAsParentImageThenValidateImageTraits imageDesc.image_depth = 0; retVal = Image::validateImageTraits( - &context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), &imageFormat, &imageDesc, nullptr); EXPECT_EQ(CL_SUCCESS, retVal); } @@ -205,7 +205,7 @@ TEST_F(Nv12ImageTest, givenBufferWhenPassedAsNV12ParentImageThenValidateImageTra imageDesc.image_depth = 0; // Plane of NV12 image retVal = Image::validateImageTraits( - &context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), &imageFormat, &imageDesc, nullptr); EXPECT_EQ(CL_INVALID_IMAGE_DESCRIPTOR, retVal); } @@ -349,7 +349,7 @@ HWTEST_F(Nv12ImageTest, WhenCreatingParentImageThenPlanesAreWritten) { cl_mem_flags flags = CL_MEM_READ_ONLY | CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL | CL_MEM_USE_HOST_PTR; auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr imageNV12{Image::create(contextWithMockCmdQ, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, hostPtr, retVal)}; EXPECT_EQ(imageNV12->isTiledAllocation() ? 2u : 0u, cmdQ->EnqueueWriteImageCounter); @@ -494,7 +494,7 @@ TEST_F(Nv12ImageTest, GivenInvalidImageHeightWhenValidatingPlanarYuvThenInvalidI pClDevice->getCap(reinterpret_cast(maxHeight), srcSize, retSize); imageDesc.image_height = *maxHeight + 12; - retVal = Image::validatePlanarYUV(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &pClDevice->getDevice()), + retVal = Image::validatePlanarYUV(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &pClDevice->getDevice()), &imageDesc, nullptr); EXPECT_EQ(CL_INVALID_IMAGE_SIZE, retVal); @@ -512,20 +512,20 @@ TEST_F(Nv12ImageTest, GivenInvalidImageWidthWhenValidatingPlanarYuvThenInvalidIm pClDevice->getCap(reinterpret_cast(maxWidth), srcSize, retSize); imageDesc.image_width = *maxWidth + 12; - retVal = Image::validatePlanarYUV(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &pClDevice->getDevice()), + retVal = Image::validatePlanarYUV(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &pClDevice->getDevice()), &imageDesc, nullptr); EXPECT_EQ(CL_INVALID_IMAGE_SIZE, retVal); } TEST_F(Nv12ImageTest, GivenValidImageHeightWhenValidatingPlanarYuvThenSuccessIsReturned) { - retVal = Image::validatePlanarYUV(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + retVal = Image::validatePlanarYUV(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), &imageDesc, nullptr); EXPECT_EQ(CL_SUCCESS, retVal); } TEST_F(Nv12ImageTest, GivenValidImageWidthWhenValidatingPlanarYuvThenSuccessIsReturned) { - retVal = Image::validatePlanarYUV(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + retVal = Image::validatePlanarYUV(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), &imageDesc, nullptr); EXPECT_EQ(CL_SUCCESS, retVal); } diff --git a/opencl/test/unit_test/mem_obj/packed_yuv_image_tests.cpp b/opencl/test/unit_test/mem_obj/packed_yuv_image_tests.cpp index 7908457776..b85ecb8033 100644 --- a/opencl/test/unit_test/mem_obj/packed_yuv_image_tests.cpp +++ b/opencl/test/unit_test/mem_obj/packed_yuv_image_tests.cpp @@ -7,7 +7,7 @@ #include "shared/source/helpers/aligned_memory.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/helpers/surface_formats.h" #include "opencl/source/helpers/validators.h" #include "opencl/source/mem_obj/image.h" @@ -57,7 +57,7 @@ class PackedYuvImageTest : public testing::Test, auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); retVal = Image::validate( - &context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), surfaceFormat, &imageDesc, nullptr); } @@ -77,7 +77,7 @@ TEST_P(PackedYuvImageTest, GivenValidPackedYuvImageFormatAndDescriptorWhenCreati flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( &context, - MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, 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 c2f02915cf..9da8e122d0 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 @@ -14,7 +14,7 @@ #include "shared/test/common/mocks/mock_memory_manager.h" #include "shared/test/common/mocks/ult_device_factory.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/mem_obj_helper.h" #include "opencl/test/unit_test/mocks/mock_cl_device.h" #include "opencl/test/unit_test/mocks/mock_context.h" @@ -58,7 +58,7 @@ TEST(AllocationFlagsTest, givenAllocateMemoryFlagWhenGetAllocationFlagsIsCalledT HardwareInfo hwInfo(*defaultHwInfo); UltDeviceFactory deviceFactory{1, 0}; auto pDevice = deviceFactory.rootDevices[0]; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice); auto allocationProperties = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, true, 0, GraphicsAllocation::AllocationType::BUFFER, false, hwInfo, {}, true); EXPECT_TRUE(allocationProperties.flags.allocateMemory); @@ -70,13 +70,13 @@ TEST(UncacheableFlagsTest, givenUncachedResourceFlagWhenGetAllocationFlagsIsCall cl_mem_flags_intel flagsIntel = CL_MEM_LOCALLY_UNCACHED_RESOURCE; UltDeviceFactory deviceFactory{1, 0}; auto pDevice = deviceFactory.rootDevices[0]; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, flagsIntel, 0, pDevice); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, flagsIntel, 0, pDevice); auto allocationFlags = MemoryPropertiesHelper::getAllocationProperties( 0, memoryProperties, false, 0, GraphicsAllocation::AllocationType::BUFFER, false, pDevice->getHardwareInfo(), {}, true); EXPECT_TRUE(allocationFlags.flags.uncacheable); flagsIntel = 0; - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, flagsIntel, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, flagsIntel, 0, pDevice); auto allocationFlags2 = MemoryPropertiesHelper::getAllocationProperties( 0, memoryProperties, false, 0, GraphicsAllocation::AllocationType::BUFFER, false, pDevice->getHardwareInfo(), {}, true); EXPECT_FALSE(allocationFlags2.flags.uncacheable); @@ -86,7 +86,7 @@ TEST(AllocationFlagsTest, givenReadOnlyResourceFlagWhenGetAllocationFlagsIsCalle cl_mem_flags flags = CL_MEM_READ_ONLY; UltDeviceFactory deviceFactory{1, 2}; auto pDevice = deviceFactory.rootDevices[0]; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice); auto allocationFlags = MemoryPropertiesHelper::getAllocationProperties( @@ -94,7 +94,7 @@ TEST(AllocationFlagsTest, givenReadOnlyResourceFlagWhenGetAllocationFlagsIsCalle EXPECT_FALSE(allocationFlags.flags.flushL3RequiredForRead); EXPECT_FALSE(allocationFlags.flags.flushL3RequiredForWrite); - memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice); + memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice); auto allocationFlags2 = MemoryPropertiesHelper::getAllocationProperties( 0, memoryProperties, true, 0, GraphicsAllocation::AllocationType::BUFFER, false, pDevice->getHardwareInfo(), {}, false); EXPECT_TRUE(allocationFlags2.flags.flushL3RequiredForRead); @@ -417,7 +417,7 @@ TEST(MemoryAllocationTest, givenMultiTileVisiblityWhenAskedForFlagsThenL3NeedsTo UltClDeviceFactory deviceFactory{1, 2}; auto pClDevice = deviceFactory.rootDevices[0]; auto context = std::make_unique(pClDevice); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &pClDevice->getDevice()); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &pClDevice->getDevice()); auto allocationFlags = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, true, 0, GraphicsAllocation::AllocationType::BUFFER, false, hwInfo, {}, context->isSingleDeviceContext()); EXPECT_TRUE(allocationFlags.flags.flushL3RequiredForRead); EXPECT_TRUE(allocationFlags.flags.flushL3RequiredForWrite); @@ -428,7 +428,7 @@ TEST(MemoryAllocationTest, givenMultiTileVisiblityAndUncachedWhenAskedForFlagsTh auto pClDevice = deviceFactory.rootDevices[0]; auto context = std::make_unique(pClDevice); cl_mem_flags_intel flagsIntel = CL_MEM_LOCALLY_UNCACHED_RESOURCE; - MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, flagsIntel, 0, &pClDevice->getDevice()); + MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, flagsIntel, 0, &pClDevice->getDevice()); HardwareInfo hwInfo(*defaultHwInfo); auto allocationFlags = MemoryPropertiesHelper::getAllocationProperties( 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 b4d9121ceb..fcbbdf2b90 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 @@ -16,6 +16,7 @@ #include "shared/test/common/mocks/mock_memory_manager.h" #include "shared/test/common/mocks/ult_device_factory.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/mem_obj_helper.h" #include "opencl/test/unit_test/mocks/mock_allocation_properties.h" #include "opencl/test/unit_test/mocks/mock_gmm.h" @@ -1031,7 +1032,7 @@ TEST(MemoryManagerTest, givenEnabledLocalMemoryWhenAllocatingSharedResourceCopyT imgDesc.image_type = CL_MEM_OBJECT_IMAGE2D; auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]); + 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; diff --git a/opencl/test/unit_test/mocks/mock_buffer.h b/opencl/test/unit_test/mocks/mock_buffer.h index 72bca26863..0c2e889e9b 100644 --- a/opencl/test/unit_test/mocks/mock_buffer.h +++ b/opencl/test/unit_test/mocks/mock_buffer.h @@ -10,7 +10,7 @@ #include "shared/test/common/mocks/mock_device.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/test/unit_test/mocks/mock_context.h" @@ -40,14 +40,14 @@ class MockBuffer : public MockBufferStorage, public Buffer { using MockBufferStorage::device; MockBuffer(GraphicsAllocation &alloc) : MockBufferStorage(), Buffer( - nullptr, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()), + nullptr, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()), CL_MEM_USE_HOST_PTR, 0, alloc.getUnderlyingBufferSize(), alloc.getUnderlyingBuffer(), alloc.getUnderlyingBuffer(), GraphicsAllocationHelper::toMultiGraphicsAllocation(&alloc), true, false, false), externalAlloc(&alloc) { } MockBuffer() : MockBufferStorage(), Buffer( - nullptr, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()), + nullptr, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()), CL_MEM_USE_HOST_PTR, 0, sizeof(data), &data, &data, GraphicsAllocationHelper::toMultiGraphicsAllocation(&mockGfxAllocation), true, false, false) { } @@ -69,13 +69,13 @@ class AlignedBuffer : public MockBufferStorage, public Buffer { using MockBufferStorage::device; AlignedBuffer() : MockBufferStorage(false), Buffer( - nullptr, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()), + nullptr, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()), CL_MEM_USE_HOST_PTR, 0, sizeof(data) / 2, alignUp(&data, 64), alignUp(&data, 64), GraphicsAllocationHelper::toMultiGraphicsAllocation(&mockGfxAllocation), true, false, false) { } AlignedBuffer(GraphicsAllocation *gfxAllocation) : MockBufferStorage(), Buffer( - nullptr, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()), + nullptr, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()), CL_MEM_USE_HOST_PTR, 0, sizeof(data) / 2, alignUp(&data, 64), alignUp(&data, 64), GraphicsAllocationHelper::toMultiGraphicsAllocation(gfxAllocation), true, false, false) { } @@ -89,13 +89,13 @@ class UnalignedBuffer : public MockBufferStorage, public Buffer { using MockBufferStorage::device; UnalignedBuffer() : MockBufferStorage(true), Buffer( - nullptr, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()), + nullptr, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()), CL_MEM_USE_HOST_PTR, 0, sizeof(data) / 2, alignUp(&data, 4), alignUp(&data, 4), GraphicsAllocationHelper::toMultiGraphicsAllocation(&mockGfxAllocation), false, false, false) { } UnalignedBuffer(GraphicsAllocation *gfxAllocation) : MockBufferStorage(true), Buffer( - nullptr, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()), + nullptr, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()), CL_MEM_USE_HOST_PTR, 0, sizeof(data) / 2, alignUp(&data, 4), alignUp(&data, 4), GraphicsAllocationHelper::toMultiGraphicsAllocation(gfxAllocation), false, false, false) { } 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 743e8efcc1..98aff9079d 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 @@ -26,7 +26,6 @@ #include "shared/test/common/helpers/engine_descriptor_helper.h" #include "shared/test/common/mocks/mock_host_ptr_manager.h" -#include "opencl/source/helpers/memory_properties_helpers.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/helpers/execution_environment_helper.h" 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 2d4ce59d75..04d1b1400d 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 @@ -24,7 +24,7 @@ #include "shared/test/common/helpers/dispatch_flags_helper.h" #include "shared/test/common/mocks/mock_host_ptr_manager.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/helpers/execution_environment_helper.h" @@ -733,7 +733,7 @@ class DrmMockBuffer : public MockBufferStorage, public Buffer { DrmMockBuffer(char *data, size_t size, DrmAllocation *alloc) : Buffer( - nullptr, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()), + nullptr, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()), CL_MEM_USE_HOST_PTR, 0, size, data, data, GraphicsAllocationHelper::toMultiGraphicsAllocation(alloc), true, false, false), data(data), @@ -1286,4 +1286,4 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenAllocInMemoryOperationsInt mm->freeGraphicsMemory(allocation); mm->freeGraphicsMemory(commandBuffer); -} \ No newline at end of file +} 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 fb76b9db05..151722b23e 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 @@ -34,7 +34,7 @@ #include "shared/test/common/test_macros/matchers.h" #include "opencl/source/event/event.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/source/mem_obj/image.h" #include "opencl/test/unit_test/mocks/linux/mock_drm_allocation.h" @@ -1590,7 +1590,7 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCountZe cl_mem_flags flags = CL_MEM_WRITE_ONLY; auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create( - &context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); ASSERT_NE(nullptr, dstImage); @@ -1638,7 +1638,7 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCountNo cl_mem_flags flags = CL_MEM_WRITE_ONLY; auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create( - &context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); ASSERT_NE(nullptr, dstImage); @@ -1679,7 +1679,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreatedAn cl_mem_flags flags = CL_MEM_WRITE_ONLY; auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create( - &context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); if (MemoryManagement::nonfailingAllocation == failureIndex) { EXPECT_NE(nullptr, dstImage.get()); @@ -1751,7 +1751,7 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreated cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR; auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create( - &context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, data, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); ASSERT_NE(nullptr, dstImage); @@ -1797,7 +1797,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenMemoryAllocatedForImageThe cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR; auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create( - &context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, data, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); ASSERT_NE(nullptr, dstImage); @@ -1832,7 +1832,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountZer cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR; auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create( - &context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, data, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); ASSERT_NE(nullptr, dstImage); @@ -1880,7 +1880,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountNon cl_mem_flags flags = CL_MEM_WRITE_ONLY; auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create( - &context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, data, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); ASSERT_NE(nullptr, dstImage); @@ -1927,7 +1927,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhen1DarrayImageIsBeingCreated cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR; auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create( - &context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + &context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, data, retVal)); auto imageGraphicsAllocation = dstImage->getGraphicsAllocation(rootDeviceIndex); ASSERT_NE(nullptr, imageGraphicsAllocation); 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 0c68416d80..2ad22065af 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 @@ -28,7 +28,7 @@ #include "shared/test/common/mocks/ult_device_factory.h" #include "shared/test/unit_test/utilities/base_object_utils.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/source/mem_obj/image.h" #include "opencl/source/mem_obj/mem_obj_helper.h" @@ -840,7 +840,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenTiledImageWithMipCount auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage( - Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); ASSERT_NE(nullptr, dstImage); @@ -871,7 +871,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenTiledImageWithMipCountNo auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage( - Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); ASSERT_NE(nullptr, dstImage); @@ -909,7 +909,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenTiledImageIsBeingCreat auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage( - Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, data, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); ASSERT_NE(nullptr, dstImage); @@ -939,7 +939,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenNonTiledImgWithMipCountN auto surfaceFormat = Image::getSurfaceFormatFromTable( flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage( - Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), + Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); ASSERT_NE(nullptr, dstImage); @@ -1499,7 +1499,7 @@ TEST_F(WddmMemoryManagerWithAsyncDeleterTest, givenMemoryManagerWithAsyncDeleter EXPECT_EQ(0, deleter->drainCalled); EXPECT_EQ(0u, wddm->createAllocationResult.called); deleter->expectDrainBlockingValue(true); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]); AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(0, imgInfo, true, memoryProperties, *hwInfo, mockDeviceBitfield, true); memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr); @@ -1520,7 +1520,7 @@ TEST_F(WddmMemoryManagerWithAsyncDeleterTest, givenMemoryManagerWithAsyncDeleter EXPECT_EQ(0u, wddm->createAllocationResult.called); EXPECT_EQ(0u, wddm->mapGpuVirtualAddressResult.called); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]); AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(0, imgInfo, true, memoryProperties, *hwInfo, mockDeviceBitfield, true); auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr); @@ -1540,7 +1540,7 @@ TEST_F(WddmMemoryManagerWithAsyncDeleterTest, givenMemoryManagerWithoutAsyncDele wddm->createAllocationStatus = STATUS_GRAPHICS_NO_VIDEO_MEMORY; EXPECT_EQ(0u, wddm->createAllocationResult.called); - auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]); AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(0, imgInfo, true, memoryProperties, *hwInfo, mockDeviceBitfield, true); memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr); diff --git a/opencl/test/unit_test/sharings/sharing_tests.cpp b/opencl/test/unit_test/sharings/sharing_tests.cpp index f2b8c13f58..26e4bf2705 100644 --- a/opencl/test/unit_test/sharings/sharing_tests.cpp +++ b/opencl/test/unit_test/sharings/sharing_tests.cpp @@ -8,7 +8,7 @@ #include "shared/test/common/mocks/mock_graphics_allocation.h" #include "opencl/source/cl_device/cl_device.h" -#include "opencl/source/helpers/memory_properties_helpers.h" +#include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/mem_obj/mem_obj.h" #include "opencl/source/sharings/sharing.h" #include "opencl/test/unit_test/mocks/mock_context.h" @@ -42,7 +42,7 @@ TEST(sharingHandler, givenMemObjWhenAcquireIncrementCounterThenReleaseShouldDecr MockGraphicsAllocation *mockAllocation = new MockGraphicsAllocation(buffer, sizeof(buffer)); std::unique_ptr memObj( new MemObj(&context, CL_MEM_OBJECT_BUFFER, - MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()), CL_MEM_USE_HOST_PTR, 0, sizeof(buffer), buffer, buffer, GraphicsAllocationHelper::toMultiGraphicsAllocation(mockAllocation), true, false, false)); struct MockSharingHandler : SharingHandler { @@ -66,7 +66,7 @@ TEST(sharingHandler, givenMemObjWhenAcquireTwoTimesThenReleaseShouldBeCalledTwoT MockGraphicsAllocation *mockAllocation = new MockGraphicsAllocation(buffer, sizeof(buffer)); std::unique_ptr memObj( new MemObj(&context, CL_MEM_OBJECT_BUFFER, - MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()), CL_MEM_USE_HOST_PTR, 0, sizeof(buffer), buffer, buffer, GraphicsAllocationHelper::toMultiGraphicsAllocation(mockAllocation), true, false, false)); struct MockSharingHandler : SharingHandler { @@ -109,7 +109,7 @@ TEST(sharingHandler, givenSharingHandlerWhenAcquiringThenReturnErrorCode) { MockContext context; MockGraphicsAllocation *graphicsAllocation = new MockGraphicsAllocation(nullptr, 0); MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, - MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()), + ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()), CL_MEM_USE_HOST_PTR, 0, 1, nullptr, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(graphicsAllocation), true, false, false); auto result = sharingHandler.acquire(&memObj, graphicsAllocation->getRootDeviceIndex()); diff --git a/shared/source/helpers/CMakeLists.txt b/shared/source/helpers/CMakeLists.txt index 28140435b7..30fbe5d994 100644 --- a/shared/source/helpers/CMakeLists.txt +++ b/shared/source/helpers/CMakeLists.txt @@ -82,6 +82,9 @@ set(NEO_CORE_HELPERS ${CMAKE_CURRENT_SOURCE_DIR}/local_id_gen_sse4.cpp ${CMAKE_CURRENT_SOURCE_DIR}/local_work_size.cpp ${CMAKE_CURRENT_SOURCE_DIR}/local_work_size.h + ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}memory_properties_helpers.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/memory_properties_helpers.h + ${CMAKE_CURRENT_SOURCE_DIR}/memory_properties_helpers_base.inl ${CMAKE_CURRENT_SOURCE_DIR}/neo_driver_version.h ${CMAKE_CURRENT_SOURCE_DIR}/non_copyable_or_moveable.h ${CMAKE_CURRENT_SOURCE_DIR}/options.h diff --git a/shared/source/helpers/memory_properties_helpers.cpp b/shared/source/helpers/memory_properties_helpers.cpp new file mode 100644 index 0000000000..d2ac1f6893 --- /dev/null +++ b/shared/source/helpers/memory_properties_helpers.cpp @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2020-2021 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/helpers/memory_properties_helpers_base.inl" + +namespace NEO { + +void MemoryPropertiesHelper::fillPoliciesInProperties(AllocationProperties &allocationProperties, const MemoryProperties &memoryProperties, const HardwareInfo &hwInfo, bool deviceOnlyVisibilty) { + fillCachePolicyInProperties(allocationProperties, + memoryProperties.flags.locallyUncachedResource, + memoryProperties.flags.readOnly, + deviceOnlyVisibilty, + 0); +} + +uint32_t MemoryPropertiesHelper::getCacheRegion(const MemoryProperties &memoryProperties) { + return 0; +} + +} // namespace NEO diff --git a/opencl/source/helpers/memory_properties_helpers.h b/shared/source/helpers/memory_properties_helpers.h similarity index 66% rename from opencl/source/helpers/memory_properties_helpers.h rename to shared/source/helpers/memory_properties_helpers.h index 54e19f628f..933fbaad08 100644 --- a/opencl/source/helpers/memory_properties_helpers.h +++ b/shared/source/helpers/memory_properties_helpers.h @@ -9,14 +9,10 @@ #include "shared/source/helpers/bit_helpers.h" #include "shared/source/memory_manager/allocation_properties.h" -#include "opencl/extensions/public/cl_ext_private.h" - #include "memory_properties_flags.h" namespace NEO { -class Context; - class MemoryPropertiesHelper { public: enum class ObjType { @@ -25,15 +21,6 @@ class MemoryPropertiesHelper { IMAGE, }; - static void addExtraMemoryProperties(MemoryProperties &properties, cl_mem_flags flags, cl_mem_flags_intel flagsIntel); - - static MemoryProperties createMemoryProperties(cl_mem_flags flags, cl_mem_flags_intel flagsIntel, - cl_mem_alloc_flags_intel allocflags, const Device *pDevice); - - static bool parseMemoryProperties(const cl_mem_properties_intel *properties, MemoryProperties &memoryProperties, - cl_mem_flags &flags, cl_mem_flags_intel &flagsIntel, cl_mem_alloc_flags_intel &allocflags, - ObjType objectType, Context &context); - static AllocationProperties getAllocationProperties( uint32_t rootDeviceIndex, MemoryProperties memoryProperties, bool allocateMemory, size_t size, GraphicsAllocation::AllocationType type, bool multiStorageResource, const HardwareInfo &hwInfo, diff --git a/shared/source/helpers/memory_properties_helpers_base.inl b/shared/source/helpers/memory_properties_helpers_base.inl new file mode 100644 index 0000000000..8bd46d9ab0 --- /dev/null +++ b/shared/source/helpers/memory_properties_helpers_base.inl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2020-2021 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/helpers/bit_helpers.h" +#include "shared/source/helpers/memory_properties_helpers.h" + +namespace NEO { + +AllocationProperties MemoryPropertiesHelper::getAllocationProperties( + uint32_t rootDeviceIndex, MemoryProperties memoryProperties, bool allocateMemory, size_t size, + GraphicsAllocation::AllocationType type, bool multiStorageResource, const HardwareInfo &hwInfo, + DeviceBitfield subDevicesBitfieldParam, bool deviceOnlyVisibilty) { + + auto deviceBitfield = adjustDeviceBitfield(rootDeviceIndex, memoryProperties, subDevicesBitfieldParam); + AllocationProperties allocationProperties(rootDeviceIndex, allocateMemory, size, type, multiStorageResource, deviceBitfield); + fillPoliciesInProperties(allocationProperties, memoryProperties, hwInfo, deviceOnlyVisibilty); + return allocationProperties; +} + +void MemoryPropertiesHelper::fillCachePolicyInProperties(AllocationProperties &allocationProperties, bool uncached, bool readOnly, + bool deviceOnlyVisibilty, uint32_t cacheRegion) { + allocationProperties.flags.uncacheable = uncached; + auto cacheFlushRequired = !uncached && !readOnly && !deviceOnlyVisibilty; + allocationProperties.flags.flushL3RequiredForRead = cacheFlushRequired; + allocationProperties.flags.flushL3RequiredForWrite = cacheFlushRequired; + allocationProperties.cacheRegion = cacheRegion; +} + +DeviceBitfield MemoryPropertiesHelper::adjustDeviceBitfield(uint32_t rootDeviceIndex, const MemoryProperties &memoryProperties, + DeviceBitfield deviceBitfieldIn) { + if (rootDeviceIndex == memoryProperties.pDevice->getRootDeviceIndex()) { + return deviceBitfieldIn & memoryProperties.pDevice->getDeviceBitfield(); + } + return deviceBitfieldIn; +} + +} // namespace NEO diff --git a/shared/source/memory_manager/unified_memory_manager.cpp b/shared/source/memory_manager/unified_memory_manager.cpp index 4739031da9..e9cd026121 100644 --- a/shared/source/memory_manager/unified_memory_manager.cpp +++ b/shared/source/memory_manager/unified_memory_manager.cpp @@ -9,6 +9,7 @@ #include "shared/source/command_stream/command_stream_receiver.h" #include "shared/source/helpers/aligned_memory.h" +#include "shared/source/helpers/memory_properties_helpers.h" #include "shared/source/memory_manager/memory_manager.h" #include "shared/source/os_interface/hw_info_config.h"