diff --git a/Jenkinsfile b/Jenkinsfile index d3c01598f2..a65e3551c9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ #!groovy dependenciesRevision='9154d35827a517f6ae2e1e4fef470fc3026b79c7-1350' strategy='EQUAL' -allowedCD=259 +allowedCD=258 allowedF=7 diff --git a/runtime/mem_obj/buffer.cpp b/runtime/mem_obj/buffer.cpp index 301f5af4b7..599c29402b 100644 --- a/runtime/mem_obj/buffer.cpp +++ b/runtime/mem_obj/buffer.cpp @@ -382,7 +382,7 @@ void Buffer::checkMemory(MemoryPropertiesFlags memoryProperties, GraphicsAllocation::AllocationType Buffer::getGraphicsAllocationType(const MemoryPropertiesFlags &properties, Context &context, bool renderCompressedBuffers, bool isLocalMemoryEnabled, bool preferCompression) { - if (is32bit || context.isSharedContext || properties.flags.forceSharedPhysicalMemory) { + if (context.isSharedContext || properties.flags.forceSharedPhysicalMemory) { return GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY; } diff --git a/unit_tests/context/driver_diagnostics_tests.cpp b/unit_tests/context/driver_diagnostics_tests.cpp index 39134b36af..8229efa7f8 100644 --- a/unit_tests/context/driver_diagnostics_tests.cpp +++ b/unit_tests/context/driver_diagnostics_tests.cpp @@ -474,7 +474,7 @@ TEST_F(PerformanceHintTest, given64bitCompressedBufferWhenItsCreatedThenProperPe snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[BUFFER_IS_COMPRESSED], buffer.get()); auto compressionSupported = HwHelper::get(hwInfo.platform.eRenderCoreFamily).obtainRenderBufferCompressionPreference(hwInfo, size) && HwHelper::renderCompressedBuffersSupported(hwInfo); - if (!is32bit && compressionSupported) { + if (compressionSupported) { EXPECT_TRUE(containsHint(expectedHint, userData)); } else { EXPECT_FALSE(containsHint(expectedHint, userData)); diff --git a/unit_tests/mem_obj/buffer_tests.cpp b/unit_tests/mem_obj/buffer_tests.cpp index fc8a3c9eed..100afff40a 100644 --- a/unit_tests/mem_obj/buffer_tests.cpp +++ b/unit_tests/mem_obj/buffer_tests.cpp @@ -331,11 +331,7 @@ TEST(Buffer, givenRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenB context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = false; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, true, false, true); - if (is32bit) { - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type); - } else { - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_COMPRESSED, type); - } + EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_COMPRESSED, type); } TEST(Buffer, givenRenderCompressedBuffersDisabledLocalMemoryEnabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturnedIn64Bit) { @@ -344,11 +340,7 @@ TEST(Buffer, givenRenderCompressedBuffersDisabledLocalMemoryEnabledWhenAllocatio context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = false; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, false, true, true); - if (is32bit) { - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type); - } else { - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type); - } + EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type); } TEST(Buffer, givenSharedContextWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) { @@ -386,11 +378,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledWhenAllocationTypeIsQueried context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = false; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, false, true, true); - if (is64bit) { - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type); - } else { - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type); - } + EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type); } TEST(Buffer, givenAllocHostPtrFlagWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) { @@ -400,11 +388,7 @@ TEST(Buffer, givenAllocHostPtrFlagWhenAllocationTypeIsQueriedThenBufferTypeIsRet context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = false; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, false, false, true); - if (is64bit) { - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type); - } else { - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type); - } + EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type); } TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledAndRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferMemoryTypeIsReturned) { @@ -424,11 +408,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledAndRenderCompressedBuffersE context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = false; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, true, true, true); - if (is64bit) { - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_COMPRESSED, type); - } else { - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type); - } + EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_COMPRESSED, type); } TEST(Buffer, givenUseHostPointerFlagAndForceSharedPhysicalStorageWhenLocalMemoryIsEnabledThenBufferHostMemoryTypeIsReturned) { @@ -448,11 +428,7 @@ TEST(Buffer, givenAllocHostPtrFlagAndRenderCompressedBuffersEnabledWhenAllocatio context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = false; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, true, false, true); - if (is64bit) { - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_COMPRESSED, type); - } else { - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type); - } + EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_COMPRESSED, type); } TEST(Buffer, givenZeroFlagsNoSharedContextAndRenderCompressedBuffersDisabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) { @@ -461,11 +437,7 @@ TEST(Buffer, givenZeroFlagsNoSharedContextAndRenderCompressedBuffersDisabledWhen context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; context.isSharedContext = false; auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, false, false, true); - if (is32bit) { - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type); - } else { - EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type); - } + EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type); } TEST(Buffer, givenClMemCopyHostPointerPassedToBufferCreateWhenAllocationIsNotInSystemMemoryPoolThenAllocationIsWrittenByEnqueueWriteBuffer) { @@ -573,17 +545,12 @@ TEST_F(RenderCompressedBuffersTests, givenBufferNotCompressedAllocationAndNoHost hwInfo->capabilityTable.ftrRenderCompressedBuffers = true; buffer.reset(Buffer::create(context.get(), 0, bufferSize, nullptr, retVal)); - if (is32bit) { + if (HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).obtainRenderBufferCompressionPreference(context->getDevice(0)->getHardwareInfo(), bufferSize)) { + EXPECT_FALSE(buffer->isMemObjZeroCopy()); + EXPECT_EQ(buffer->getGraphicsAllocation()->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_COMPRESSED); + } else { EXPECT_TRUE(buffer->isMemObjZeroCopy()); EXPECT_EQ(buffer->getGraphicsAllocation()->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); - } else { - if (HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).obtainRenderBufferCompressionPreference(context->getDevice(0)->getHardwareInfo(), bufferSize)) { - EXPECT_FALSE(buffer->isMemObjZeroCopy()); - EXPECT_EQ(buffer->getGraphicsAllocation()->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_COMPRESSED); - } else { - EXPECT_TRUE(buffer->isMemObjZeroCopy()); - EXPECT_EQ(buffer->getGraphicsAllocation()->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); - } } } @@ -592,14 +559,10 @@ TEST_F(RenderCompressedBuffersTests, givenBufferCompressedAllocationWhenSharedCo context->isSharedContext = false; buffer.reset(Buffer::create(context.get(), CL_MEM_READ_WRITE, bufferSize, nullptr, retVal)); - if (is32bit) { - EXPECT_EQ(buffer->getGraphicsAllocation()->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + if (HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).obtainRenderBufferCompressionPreference(context->getDevice(0)->getHardwareInfo(), bufferSize)) { + EXPECT_EQ(buffer->getGraphicsAllocation()->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_COMPRESSED); } else { - if (HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).obtainRenderBufferCompressionPreference(context->getDevice(0)->getHardwareInfo(), bufferSize)) { - EXPECT_EQ(buffer->getGraphicsAllocation()->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_COMPRESSED); - } else { - EXPECT_EQ(buffer->getGraphicsAllocation()->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); - } + EXPECT_EQ(buffer->getGraphicsAllocation()->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); } context->isSharedContext = true; buffer.reset(Buffer::create(context.get(), CL_MEM_USE_HOST_PTR, bufferSize, hostPtr, retVal)); @@ -613,14 +576,10 @@ TEST_F(RenderCompressedBuffersTests, givenDebugVariableSetWhenHwFlagIsNotSetThen DebugManager.flags.RenderCompressedBuffersEnabled.set(1); buffer.reset(Buffer::create(context.get(), 0, bufferSize, nullptr, retVal)); - if (is32bit) { - EXPECT_NE(buffer->getGraphicsAllocation()->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_COMPRESSED); + if (HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).obtainRenderBufferCompressionPreference(context->getDevice(0)->getHardwareInfo(), bufferSize)) { + EXPECT_EQ(buffer->getGraphicsAllocation()->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_COMPRESSED); } else { - if (HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).obtainRenderBufferCompressionPreference(context->getDevice(0)->getHardwareInfo(), bufferSize)) { - EXPECT_EQ(buffer->getGraphicsAllocation()->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_COMPRESSED); - } else { - EXPECT_EQ(buffer->getGraphicsAllocation()->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); - } + EXPECT_EQ(buffer->getGraphicsAllocation()->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); } DebugManager.flags.RenderCompressedBuffersEnabled.set(0);