Pass HardwareInfo to programMemoryPrefetch

Change-Id: I5ed0ae35143ef244e08bc88ba8817ce1cb17369c
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2020-07-23 09:43:52 +02:00
committed by sys_ocldev
parent 63a801ee07
commit f6c893a801
3 changed files with 5 additions and 18 deletions

View File

@ -269,7 +269,7 @@ struct EncodeMiFlushDW {
template <typename GfxFamily>
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

View File

@ -496,7 +496,7 @@ size_t EncodeMiFlushDW<GfxFamily>::getMiFlushDwCmdSizeForDataWrite() {
}
template <typename GfxFamily>
void EncodeMemoryPrefetch<GfxFamily>::programMemoryPrefetch(LinearStream &commandStream, const GraphicsAllocation &graphicsAllocation, uint32_t size) {}
void EncodeMemoryPrefetch<GfxFamily>::programMemoryPrefetch(LinearStream &commandStream, const GraphicsAllocation &graphicsAllocation, uint32_t size, const HardwareInfo &hwInfo) {}
template <typename GfxFamily>
size_t EncodeMemoryPrefetch<GfxFamily>::getSizeForMemoryPrefetch() { return 0; }

View File

@ -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<FamilyType>::programMemoryPrefetch(linearStream, allocation, 2);
EncodeMemoryPrefetch<FamilyType>::programMemoryPrefetch(linearStream, allocation, 2, *defaultHwInfo);
EXPECT_EQ(0u, linearStream.getUsed());
EXPECT_EQ(0u, EncodeMemoryPrefetch<FamilyType>::getSizeForMemoryPrefetch());