mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
Add helper for encoding memory prefetch
Change-Id: I481ec11b66ad392ba9748bb5bbb6fd0ad3ce7f12 Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
@@ -230,4 +230,10 @@ struct EncodeMiFlushDW {
|
||||
static size_t getMiFlushDwCmdSizeForDataWrite();
|
||||
static size_t getMiFlushDwWaSize();
|
||||
};
|
||||
|
||||
template <typename GfxFamily>
|
||||
struct EncodeMemoryPrefetch {
|
||||
static void programMemoryPrefetch(LinearStream &commandStream, uint64_t gpuVa, uint32_t size);
|
||||
static size_t getSizeForMemoryPrefetch();
|
||||
};
|
||||
} // namespace NEO
|
||||
|
||||
@@ -405,4 +405,10 @@ size_t EncodeMiFlushDW<GfxFamily>::getMiFlushDwCmdSizeForDataWrite() {
|
||||
return sizeof(typename GfxFamily::MI_FLUSH_DW) + EncodeMiFlushDW<GfxFamily>::getMiFlushDwWaSize();
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void EncodeMemoryPrefetch<GfxFamily>::programMemoryPrefetch(LinearStream &commandStream, uint64_t gpuVa, uint32_t size) {}
|
||||
|
||||
template <typename GfxFamily>
|
||||
size_t EncodeMemoryPrefetch<GfxFamily>::getSizeForMemoryPrefetch() { return 0; }
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -31,4 +31,5 @@ template struct EncodeAtomic<Family>;
|
||||
template struct EncodeSempahore<Family>;
|
||||
template struct EncodeBatchBufferStartOrEnd<Family>;
|
||||
template struct EncodeMiFlushDW<Family>;
|
||||
template struct EncodeMemoryPrefetch<Family>;
|
||||
} // namespace NEO
|
||||
|
||||
@@ -63,4 +63,5 @@ template struct EncodeSempahore<Family>;
|
||||
template struct EncodeBatchBufferStartOrEnd<Family>;
|
||||
template struct EncodeMiFlushDW<Family>;
|
||||
template struct EncodeWA<Family>;
|
||||
template struct EncodeMemoryPrefetch<Family>;
|
||||
} // namespace NEO
|
||||
|
||||
@@ -31,4 +31,5 @@ template struct EncodeAtomic<Family>;
|
||||
template struct EncodeSempahore<Family>;
|
||||
template struct EncodeBatchBufferStartOrEnd<Family>;
|
||||
template struct EncodeMiFlushDW<Family>;
|
||||
template struct EncodeMemoryPrefetch<Family>;
|
||||
} // namespace NEO
|
||||
|
||||
@@ -31,4 +31,5 @@ template struct EncodeAtomic<Family>;
|
||||
template struct EncodeSempahore<Family>;
|
||||
template struct EncodeBatchBufferStartOrEnd<Family>;
|
||||
template struct EncodeMiFlushDW<Family>;
|
||||
template struct EncodeMemoryPrefetch<Family>;
|
||||
} // namespace NEO
|
||||
|
||||
@@ -55,3 +55,13 @@ HWTEST_F(CommandEncoderTests, givenImmDataWriteWhenProgrammingMiFlushDwThenSetAl
|
||||
EXPECT_EQ(gpuAddress, miFlushDwCmd->getDestinationAddress());
|
||||
EXPECT_EQ(immData, miFlushDwCmd->getImmediateData());
|
||||
}
|
||||
|
||||
HWTEST_F(CommandEncoderTests, whenEncodeMemoryPrefetchCalledThenDoNothing) {
|
||||
uint8_t buffer[MemoryConstants::pageSize] = {};
|
||||
LinearStream linearStream(buffer, sizeof(buffer));
|
||||
|
||||
EncodeMemoryPrefetch<FamilyType>::programMemoryPrefetch(linearStream, 1, 2);
|
||||
|
||||
EXPECT_EQ(0u, linearStream.getUsed());
|
||||
EXPECT_EQ(0u, EncodeMemoryPrefetch<FamilyType>::getSizeForMemoryPrefetch());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user