From f6c893a80121816dff973e9c3bcd7bee2365552d Mon Sep 17 00:00:00 2001 From: Bartosz Dunajski Date: Thu, 23 Jul 2020 09:43:52 +0200 Subject: [PATCH] Pass HardwareInfo to programMemoryPrefetch Change-Id: I5ed0ae35143ef244e08bc88ba8817ce1cb17369c Signed-off-by: Bartosz Dunajski --- .../command_container/command_encoder.h | 2 +- .../command_container/command_encoder.inl | 2 +- .../command_encoder_tests.cpp | 19 +++---------------- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/shared/source/command_container/command_encoder.h b/shared/source/command_container/command_encoder.h index 1d57fa36e5..1a396981aa 100644 --- a/shared/source/command_container/command_encoder.h +++ b/shared/source/command_container/command_encoder.h @@ -269,7 +269,7 @@ struct EncodeMiFlushDW { template struct EncodeMemoryPrefetch { - static void programMemoryPrefetch(LinearStream &commandStream, const GraphicsAllocation &graphicsAllocation, uint32_t size); + static void programMemoryPrefetch(LinearStream &commandStream, const GraphicsAllocation &graphicsAllocation, uint32_t size, const HardwareInfo &hwInfo); static size_t getSizeForMemoryPrefetch(); }; } // namespace NEO diff --git a/shared/source/command_container/command_encoder.inl b/shared/source/command_container/command_encoder.inl index 22edbe0ab4..377c2554bb 100644 --- a/shared/source/command_container/command_encoder.inl +++ b/shared/source/command_container/command_encoder.inl @@ -496,7 +496,7 @@ size_t EncodeMiFlushDW::getMiFlushDwCmdSizeForDataWrite() { } template -void EncodeMemoryPrefetch::programMemoryPrefetch(LinearStream &commandStream, const GraphicsAllocation &graphicsAllocation, uint32_t size) {} +void EncodeMemoryPrefetch::programMemoryPrefetch(LinearStream &commandStream, const GraphicsAllocation &graphicsAllocation, uint32_t size, const HardwareInfo &hwInfo) {} template size_t EncodeMemoryPrefetch::getSizeForMemoryPrefetch() { return 0; } diff --git a/shared/test/unit_test/command_container/command_encoder_tests.cpp b/shared/test/unit_test/command_container/command_encoder_tests.cpp index 1bada32fcf..f253536f7e 100644 --- a/shared/test/unit_test/command_container/command_encoder_tests.cpp +++ b/shared/test/unit_test/command_container/command_encoder_tests.cpp @@ -6,26 +6,13 @@ */ #include "shared/source/command_container/command_encoder.h" -#include "shared/test/unit_test/fixtures/device_fixture.h" +#include "shared/test/unit_test/helpers/default_hw_info.h" #include "opencl/test/unit_test/helpers/unit_test_helper.h" #include "test.h" using namespace NEO; - -class CommandEncoderTests : public DeviceFixture, - public ::testing::Test { - - public: - void SetUp() override { - ::testing::Test::SetUp(); - DeviceFixture::SetUp(); - } - void TearDown() override { - DeviceFixture::TearDown(); - ::testing::Test::TearDown(); - } -}; +using CommandEncoderTests = ::testing::Test; HWTEST_F(CommandEncoderTests, givenImmDataWriteWhenProgrammingMiFlushDwThenSetAllRequiredFields) { using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW; @@ -62,7 +49,7 @@ HWTEST_F(CommandEncoderTests, whenEncodeMemoryPrefetchCalledThenDoNothing) { GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 123, 456, 789, MemoryPool::LocalMemory); - EncodeMemoryPrefetch::programMemoryPrefetch(linearStream, allocation, 2); + EncodeMemoryPrefetch::programMemoryPrefetch(linearStream, allocation, 2, *defaultHwInfo); EXPECT_EQ(0u, linearStream.getUsed()); EXPECT_EQ(0u, EncodeMemoryPrefetch::getSizeForMemoryPrefetch());