Skip to content

Commit f9197d4

Browse files
Improve memoryPrefetch method
Signed-off-by: Bartosz Dunajski <[email protected]>
1 parent d730ce1 commit f9197d4

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

level_zero/core/source/cmdlist/cmdlist_hw.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryPrefetch(const voi
11651165
if (allocData) {
11661166
return ZE_RESULT_SUCCESS;
11671167
}
1168-
return ZE_RESULT_ERROR_UNKNOWN;
1168+
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
11691169
}
11701170

11711171
template <GFXCORE_FAMILY gfxCoreFamily>

level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ TEST_F(CommandListCreate, givenNonExistingPtrThenAppendMemoryPrefetchReturnsErro
123123
ASSERT_NE(nullptr, commandList);
124124

125125
auto res = commandList->appendMemoryPrefetch(nullptr, 0);
126-
EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, res);
126+
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, res);
127127
}
128128

129129
TEST_F(CommandListCreate, givenValidPtrThenAppendMemAdviseReturnsSuccess) {

shared/source/command_container/command_encoder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,8 @@ struct EncodeMiFlushDW {
347347

348348
template <typename GfxFamily>
349349
struct EncodeMemoryPrefetch {
350-
static void programMemoryPrefetch(LinearStream &commandStream, const GraphicsAllocation &graphicsAllocation, uint32_t size, const HardwareInfo &hwInfo);
351-
static size_t getSizeForMemoryPrefetch();
350+
static void programMemoryPrefetch(LinearStream &commandStream, const GraphicsAllocation &graphicsAllocation, uint32_t size, size_t offset, const HardwareInfo &hwInfo);
351+
static size_t getSizeForMemoryPrefetch(uint32_t size);
352352
};
353353

354354
template <typename GfxFamily>

shared/source/command_container/command_encoder.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,10 +641,10 @@ size_t EncodeMiFlushDW<GfxFamily>::getMiFlushDwCmdSizeForDataWrite() {
641641
}
642642

643643
template <typename GfxFamily>
644-
void EncodeMemoryPrefetch<GfxFamily>::programMemoryPrefetch(LinearStream &commandStream, const GraphicsAllocation &graphicsAllocation, uint32_t size, const HardwareInfo &hwInfo) {}
644+
void EncodeMemoryPrefetch<GfxFamily>::programMemoryPrefetch(LinearStream &commandStream, const GraphicsAllocation &graphicsAllocation, uint32_t size, size_t offset, const HardwareInfo &hwInfo) {}
645645

646646
template <typename GfxFamily>
647-
size_t EncodeMemoryPrefetch<GfxFamily>::getSizeForMemoryPrefetch() { return 0; }
647+
size_t EncodeMemoryPrefetch<GfxFamily>::getSizeForMemoryPrefetch(uint32_t size) { return 0; }
648648

649649
template <typename Family>
650650
void EncodeMiArbCheck<Family>::program(LinearStream &commandStream) {

shared/test/unit_test/command_container/command_encoder_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ HWTEST_F(CommandEncoderTests, whenEncodeMemoryPrefetchCalledThenDoNothing) {
4949

5050
GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 123, 456, 789, MemoryPool::LocalMemory);
5151

52-
EncodeMemoryPrefetch<FamilyType>::programMemoryPrefetch(linearStream, allocation, 2, *defaultHwInfo);
52+
EncodeMemoryPrefetch<FamilyType>::programMemoryPrefetch(linearStream, allocation, 2, 0, *defaultHwInfo);
5353

5454
EXPECT_EQ(0u, linearStream.getUsed());
55-
EXPECT_EQ(0u, EncodeMemoryPrefetch<FamilyType>::getSizeForMemoryPrefetch());
55+
EXPECT_EQ(0u, EncodeMemoryPrefetch<FamilyType>::getSizeForMemoryPrefetch(2));
5656
}
5757

5858
HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncoderTests, WhenAnyParameterIsProvidedThenRuntimeGenerationLocalIdsIsRequired) {

0 commit comments

Comments
 (0)