diff --git a/opencl/extensions/public/cl_ext_private.h b/opencl/extensions/public/cl_ext_private.h index 69f619fc9b..a65ee3712d 100644 --- a/opencl/extensions/public/cl_ext_private.h +++ b/opencl/extensions/public/cl_ext_private.h @@ -72,7 +72,7 @@ using cl_unified_shared_memory_capabilities_intel = cl_bitfield; #define CL_MEM_COMPARE_NOT_EQUAL 1u #define CL_MEM_FORCE_LINEAR_STORAGE_INTEL (1 << 19) -#define CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL (1 << 20) +#define CL_MEM_FORCE_HOST_MEMORY_INTEL (1 << 20) #define CL_MEM_ALLOCATION_HANDLE_INTEL 0x10050 #define CL_MEM_USES_COMPRESSION_INTEL 0x10051 diff --git a/opencl/source/gtpin/gtpin_helpers.cpp b/opencl/source/gtpin/gtpin_helpers.cpp index 0d9c722ede..d4ff35bef4 100644 --- a/opencl/source/gtpin/gtpin_helpers.cpp +++ b/opencl/source/gtpin/gtpin_helpers.cpp @@ -31,7 +31,7 @@ GTPIN_DI_STATUS GTPIN_DRIVER_CALLCONV gtpinCreateBuffer(context_handle_t context if (hostPtr == nullptr) { return GTPIN_DI_ERROR_ALLOCATION_FAILED; } - cl_mem buffer = Buffer::create(pContext, CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE | CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL, size, hostPtr, diag); + cl_mem buffer = Buffer::create(pContext, CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE | CL_MEM_FORCE_HOST_MEMORY_INTEL, size, hostPtr, diag); *pResource = (resource_handle_t)buffer; return GTPIN_DI_SUCCESS; } diff --git a/opencl/source/helpers/memory_properties_helpers_base.inl b/opencl/source/helpers/memory_properties_helpers_base.inl index e9ede4e705..4e3701a9fa 100644 --- a/opencl/source/helpers/memory_properties_helpers_base.inl +++ b/opencl/source/helpers/memory_properties_helpers_base.inl @@ -70,8 +70,8 @@ MemoryProperties MemoryPropertiesHelper::createMemoryProperties(cl_mem_flags fla memoryProperties.flags.locallyUncachedInSurfaceState = true; } - if (isValueSet(flags, CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL)) { - memoryProperties.flags.forceSharedPhysicalMemory = true; + if (isValueSet(flags, CL_MEM_FORCE_HOST_MEMORY_INTEL)) { + memoryProperties.flags.forceHostMemory = true; } if (isValueSet(allocflags, CL_MEM_ALLOC_WRITE_COMBINED_INTEL)) { diff --git a/opencl/source/mem_obj/buffer.cpp b/opencl/source/mem_obj/buffer.cpp index 6a49f03362..b49c2f22c6 100644 --- a/opencl/source/mem_obj/buffer.cpp +++ b/opencl/source/mem_obj/buffer.cpp @@ -442,7 +442,7 @@ void Buffer::checkMemory(MemoryProperties memoryProperties, GraphicsAllocation::AllocationType Buffer::getGraphicsAllocationType(const MemoryProperties &properties, Context &context, bool renderCompressedBuffers, bool isLocalMemoryEnabled, bool preferCompression) { - if (context.isSharedContext || properties.flags.forceSharedPhysicalMemory) { + if (context.isSharedContext || properties.flags.forceHostMemory) { return GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY; } diff --git a/opencl/source/mem_obj/mem_obj_helper_common.inl b/opencl/source/mem_obj/mem_obj_helper_common.inl index 1900ee2423..0e6a5bf5e2 100644 --- a/opencl/source/mem_obj/mem_obj_helper_common.inl +++ b/opencl/source/mem_obj/mem_obj_helper_common.inl @@ -100,7 +100,7 @@ const uint64_t MemObjHelper::commonFlags = extraFlags | CL_MEM_READ_WRITE | CL_M const uint64_t MemObjHelper::commonFlagsIntel = extraFlagsIntel | CL_MEM_LOCALLY_UNCACHED_RESOURCE | CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE | CL_MEM_48BIT_RESOURCE_INTEL; -const uint64_t MemObjHelper::validFlagsForBuffer = commonFlags | CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL | CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL; +const uint64_t MemObjHelper::validFlagsForBuffer = commonFlags | CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL | CL_MEM_FORCE_HOST_MEMORY_INTEL; const uint64_t MemObjHelper::validFlagsForBufferIntel = commonFlagsIntel | CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL; diff --git a/opencl/test/unit_test/api/cl_create_buffer_tests.cpp b/opencl/test/unit_test/api/cl_create_buffer_tests.cpp index a89a12d86a..136fa38687 100644 --- a/opencl/test/unit_test/api/cl_create_buffer_tests.cpp +++ b/opencl/test/unit_test/api/cl_create_buffer_tests.cpp @@ -65,7 +65,7 @@ static cl_mem_flags validFlags[] = { CL_MEM_HOST_READ_ONLY, CL_MEM_HOST_WRITE_ONLY, CL_MEM_HOST_NO_ACCESS, - CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL}; + CL_MEM_FORCE_HOST_MEMORY_INTEL}; INSTANTIATE_TEST_CASE_P( CreateBufferCheckFlags, diff --git a/opencl/test/unit_test/context/driver_diagnostics_tests.cpp b/opencl/test/unit_test/context/driver_diagnostics_tests.cpp index c45a23d105..fe7a5ffc24 100644 --- a/opencl/test/unit_test/context/driver_diagnostics_tests.cpp +++ b/opencl/test/unit_test/context/driver_diagnostics_tests.cpp @@ -88,7 +88,7 @@ TEST_P(PerformanceHintBufferTest, GivenHostPtrAndSizeAlignmentsWhenBufferIsCreat auto flags = CL_MEM_USE_HOST_PTR; if (alignedAddress && alignedSize) { - flags |= CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL; + flags |= CL_MEM_FORCE_HOST_MEMORY_INTEL; } buffer = Buffer::create( @@ -509,7 +509,7 @@ TEST_F(PerformanceHintTest, givenUncompressedBufferWhenItsCreatedThenProperPerfo HwHelper::get(hwInfo.platform.eRenderCoreFamily).obtainRenderBufferCompressionPreference(hwInfo, size)) && !is32bit && !context->isSharedContext && (!memoryProperties.flags.useHostPtr || context->getMemoryManager()->isLocalMemorySupported(device->getRootDeviceIndex())) && - !memoryProperties.flags.forceSharedPhysicalMemory; + !memoryProperties.flags.forceHostMemory; buffer = std::unique_ptr(Buffer::create(context.get(), memoryProperties, CL_MEM_READ_WRITE, 0, size, static_cast(NULL), retVal)); } 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 11a9e9c869..65b246d9fa 100644 --- a/opencl/test/unit_test/helpers/memory_properties_helpers_tests.cpp +++ b/opencl/test/unit_test/helpers/memory_properties_helpers_tests.cpp @@ -65,8 +65,8 @@ TEST(MemoryProperties, givenValidPropertiesWhenCreateMemoryPropertiesThenTrueIsR properties = MemoryPropertiesHelper::createMemoryProperties(0, CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE, 0, pDevice); EXPECT_TRUE(properties.flags.locallyUncachedInSurfaceState); - properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL, 0, 0, pDevice); - EXPECT_TRUE(properties.flags.forceSharedPhysicalMemory); + properties = MemoryPropertiesHelper::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); EXPECT_TRUE(properties.allocFlags.allocWriteCombined); diff --git a/opencl/test/unit_test/mem_obj/buffer_pin_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_pin_tests.cpp index 0fcba518b7..180894ea51 100644 --- a/opencl/test/unit_test/mem_obj/buffer_pin_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_pin_tests.cpp @@ -87,7 +87,7 @@ TEST(BufferTests, GivenHostPtrWhenBufferIsCreatedThenPinIsSet) { auto buffer = Buffer::create( &context, - CL_MEM_USE_HOST_PTR | CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL, + CL_MEM_USE_HOST_PTR | CL_MEM_FORCE_HOST_MEMORY_INTEL, size, bff, retVal); diff --git a/opencl/test/unit_test/mem_obj/buffer_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_tests.cpp index 479dea2fc0..1dbb673518 100644 --- a/opencl/test/unit_test/mem_obj/buffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_tests.cpp @@ -402,7 +402,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledAndRenderCompressedBuffersE } TEST(Buffer, givenUseHostPointerFlagAndForceSharedPhysicalStorageWhenLocalMemoryIsEnabledThenBufferHostMemoryTypeIsReturned) { - cl_mem_flags flags = CL_MEM_USE_HOST_PTR | CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL; + 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()); context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; @@ -482,7 +482,7 @@ TEST_F(RenderCompressedBuffersTests, givenBufferCompressedAllocationAndZeroCopyH void *cacheAlignedHostPtr = alignedMalloc(MemoryConstants::cacheLineSize, MemoryConstants::cacheLineSize); - buffer.reset(Buffer::create(context.get(), CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL | CL_MEM_USE_HOST_PTR, MemoryConstants::cacheLineSize, cacheAlignedHostPtr, retVal)); + buffer.reset(Buffer::create(context.get(), CL_MEM_FORCE_HOST_MEMORY_INTEL | CL_MEM_USE_HOST_PTR, MemoryConstants::cacheLineSize, cacheAlignedHostPtr, retVal)); auto allocation = buffer->getGraphicsAllocation(device->getRootDeviceIndex()); EXPECT_EQ(cacheAlignedHostPtr, allocation->getUnderlyingBuffer()); EXPECT_TRUE(buffer->isMemObjZeroCopy()); @@ -501,7 +501,7 @@ TEST_F(RenderCompressedBuffersTests, givenBufferCompressedAllocationAndZeroCopyH } hwInfo->capabilityTable.ftrRenderCompressedBuffers = true; - buffer.reset(Buffer::create(context.get(), CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL | CL_MEM_USE_HOST_PTR, MemoryConstants::cacheLineSize, cacheAlignedHostPtr, retVal)); + buffer.reset(Buffer::create(context.get(), CL_MEM_FORCE_HOST_MEMORY_INTEL | CL_MEM_USE_HOST_PTR, MemoryConstants::cacheLineSize, cacheAlignedHostPtr, retVal)); allocation = buffer->getGraphicsAllocation(device->getRootDeviceIndex()); EXPECT_EQ(cacheAlignedHostPtr, allocation->getUnderlyingBuffer()); EXPECT_TRUE(buffer->isMemObjZeroCopy()); @@ -513,7 +513,7 @@ TEST_F(RenderCompressedBuffersTests, givenBufferCompressedAllocationAndZeroCopyH } TEST_F(RenderCompressedBuffersTests, givenAllocationCreatedWithForceSharedPhysicalMemoryWhenItIsCreatedItIsZeroCopy) { - buffer.reset(Buffer::create(context.get(), CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL, 1u, nullptr, retVal)); + buffer.reset(Buffer::create(context.get(), CL_MEM_FORCE_HOST_MEMORY_INTEL, 1u, nullptr, retVal)); EXPECT_EQ(buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); EXPECT_TRUE(buffer->isMemObjZeroCopy()); EXPECT_EQ(1u, buffer->getSize()); @@ -521,7 +521,7 @@ TEST_F(RenderCompressedBuffersTests, givenAllocationCreatedWithForceSharedPhysic TEST_F(RenderCompressedBuffersTests, givenRenderCompressedBuffersAndAllocationCreatedWithForceSharedPhysicalMemoryWhenItIsCreatedItIsZeroCopy) { hwInfo->capabilityTable.ftrRenderCompressedBuffers = true; - buffer.reset(Buffer::create(context.get(), CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL, 1u, nullptr, retVal)); + buffer.reset(Buffer::create(context.get(), CL_MEM_FORCE_HOST_MEMORY_INTEL, 1u, nullptr, retVal)); EXPECT_EQ(buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); EXPECT_TRUE(buffer->isMemObjZeroCopy()); EXPECT_EQ(1u, buffer->getSize()); diff --git a/opencl/test/unit_test/mem_obj/sub_buffer_tests.cpp b/opencl/test/unit_test/mem_obj/sub_buffer_tests.cpp index 887055c38b..34c459540d 100644 --- a/opencl/test/unit_test/mem_obj/sub_buffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/sub_buffer_tests.cpp @@ -120,7 +120,7 @@ TEST_F(SubBufferTest, GivenBufferWithAlignedHostPtrAndSameMemoryStorageWhenSubBu cl_int retVal = 0; void *alignedPointer = alignedMalloc(MemoryConstants::pageSize, MemoryConstants::preferredAlignment); - Buffer *buffer = Buffer::create(&context, CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR | CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL, + Buffer *buffer = Buffer::create(&context, CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR | CL_MEM_FORCE_HOST_MEMORY_INTEL, MemoryConstants::pageSize, alignedPointer, retVal); ASSERT_NE(nullptr, buffer); 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 d89c2c0f0a..64a776eec1 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 @@ -1167,7 +1167,7 @@ TEST_F(WddmMemoryManagerTest, givenPtrAndSizePassedToCreateInternalAllocationWhe } TEST_F(BufferWithWddmMemory, WhenCreatingBufferThenBufferIsCreatedCorrectly) { - flags = CL_MEM_USE_HOST_PTR | CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL; + flags = CL_MEM_USE_HOST_PTR | CL_MEM_FORCE_HOST_MEMORY_INTEL; auto ptr = alignedMalloc(MemoryConstants::preferredAlignment, MemoryConstants::preferredAlignment); diff --git a/shared/source/memory_properties/memory_properties_flags_common.inl b/shared/source/memory_properties/memory_properties_flags_common.inl index 4f913cce78..28df95c3f8 100644 --- a/shared/source/memory_properties/memory_properties_flags_common.inl +++ b/shared/source/memory_properties/memory_properties_flags_common.inl @@ -25,7 +25,7 @@ struct MemoryFlags { uint32_t locallyUncachedResource : 1; uint32_t locallyUncachedInSurfaceState : 1; uint32_t allowUnrestrictedSize : 1; - uint32_t forceSharedPhysicalMemory : 1; + uint32_t forceHostMemory : 1; uint32_t shareable : 1; uint32_t resource48Bit : 1; uint32_t usmInitialPlacementCpu : 1;