mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 08:53:55 +08:00
refactor: don't use global ProductHelper getter 11/n
Related-To: NEO-6853 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
fb8c844e00
commit
27393c76ea
@@ -51,10 +51,12 @@ HWTEST_F(CommandEncoderTests, givenImmDataWriteWhenProgrammingMiFlushDwThenSetAl
|
||||
|
||||
uint64_t gpuAddress = 0x1230000;
|
||||
uint64_t immData = 456;
|
||||
|
||||
MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<ProductHelper>();
|
||||
MiFlushArgs args;
|
||||
args.commandWithPostSync = true;
|
||||
EncodeMiFlushDW<FamilyType>::programMiFlushDw(linearStream, gpuAddress, immData, args, *defaultHwInfo);
|
||||
|
||||
EncodeMiFlushDW<FamilyType>::programMiFlushDw(linearStream, gpuAddress, immData, args, productHelper);
|
||||
auto miFlushDwCmd = reinterpret_cast<MI_FLUSH_DW *>(buffer);
|
||||
|
||||
unsigned int sizeMultiplier = 1;
|
||||
@@ -83,25 +85,29 @@ HWTEST2_F(CommandEncoderTests, given57bitVaForDestinationAddressWhenProgrammingM
|
||||
|
||||
const uint64_t setGpuAddress = 0xffffffffffffffff;
|
||||
const uint64_t verifyGpuAddress = 0xfffffffffffffff8;
|
||||
|
||||
MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<ProductHelper>();
|
||||
MiFlushArgs args;
|
||||
args.commandWithPostSync = true;
|
||||
EncodeMiFlushDW<FamilyType>::programMiFlushDw(linearStream, setGpuAddress, 0, args, *defaultHwInfo);
|
||||
EncodeMiFlushDW<FamilyType>::programMiFlushDw(linearStream, setGpuAddress, 0, args, productHelper);
|
||||
auto miFlushDwCmd = reinterpret_cast<MI_FLUSH_DW *>(buffer);
|
||||
|
||||
EXPECT_EQ(verifyGpuAddress, miFlushDwCmd->getDestinationAddress());
|
||||
}
|
||||
|
||||
HWTEST_F(CommandEncoderTests, whenEncodeMemoryPrefetchCalledThenDoNothing) {
|
||||
|
||||
MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
|
||||
uint8_t buffer[MemoryConstants::pageSize] = {};
|
||||
LinearStream linearStream(buffer, sizeof(buffer));
|
||||
|
||||
GraphicsAllocation allocation(0, AllocationType::UNKNOWN, nullptr, 123, 456, 789, MemoryPool::LocalMemory, MemoryManager::maxOsContextCount);
|
||||
|
||||
EncodeMemoryPrefetch<FamilyType>::programMemoryPrefetch(linearStream, allocation, 2, 0, *defaultHwInfo);
|
||||
EncodeMemoryPrefetch<FamilyType>::programMemoryPrefetch(linearStream, allocation, 2, 0, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
|
||||
EXPECT_EQ(0u, linearStream.getUsed());
|
||||
EXPECT_EQ(0u, EncodeMemoryPrefetch<FamilyType>::getSizeForMemoryPrefetch(2, *defaultHwInfo));
|
||||
EXPECT_EQ(0u, EncodeMemoryPrefetch<FamilyType>::getSizeForMemoryPrefetch(2, *mockExecutionEnvironment.rootDeviceEnvironments[0]));
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncoderTests, WhenAnyParameterIsProvidedThenRuntimeGenerationLocalIdsIsRequired) {
|
||||
@@ -122,11 +128,12 @@ HWTEST_F(CommandEncoderTests, givenNotify) {
|
||||
|
||||
uint64_t gpuAddress = 0x1230000;
|
||||
uint64_t immData = 456;
|
||||
|
||||
MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<ProductHelper>();
|
||||
MiFlushArgs args;
|
||||
args.commandWithPostSync = true;
|
||||
args.notifyEnable = true;
|
||||
EncodeMiFlushDW<FamilyType>::programMiFlushDw(linearStream, gpuAddress, immData, args, *defaultHwInfo);
|
||||
EncodeMiFlushDW<FamilyType>::programMiFlushDw(linearStream, gpuAddress, immData, args, productHelper);
|
||||
auto miFlushDwCmd = reinterpret_cast<MI_FLUSH_DW *>(buffer);
|
||||
|
||||
unsigned int sizeMultiplier = 1;
|
||||
|
||||
Reference in New Issue
Block a user