mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Limit preemption programming in level zero command queues
When multiple command queues use the same context and retain the same state No preemption programming for copy command queues Program preemption preamble only for mid thread preemption Related-To: NEO-7187 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
17f22990e6
commit
0c301e5e99
@@ -7,6 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/aux_translation.h"
|
||||
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
@@ -82,6 +83,10 @@ struct UnitTestHelper {
|
||||
static bool timestampRegisterHighAddress();
|
||||
|
||||
static void validateSbaMocs(uint32_t expectedMocs, CommandStreamReceiver &csr);
|
||||
|
||||
static GenCmdList::iterator findMidThreadPreemptionAllocationCommand(GenCmdList::iterator begin, GenCmdList::iterator end);
|
||||
|
||||
static std::vector<GenCmdList::iterator> findAllMidThreadPreemptionAllocationCommand(GenCmdList::iterator begin, GenCmdList::iterator end);
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -77,4 +77,14 @@ inline bool UnitTestHelper<GfxFamily>::getWorkloadPartitionForStoreRegisterMemCm
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
GenCmdList::iterator UnitTestHelper<GfxFamily>::findMidThreadPreemptionAllocationCommand(GenCmdList::iterator begin, GenCmdList::iterator end) {
|
||||
return find<typename GfxFamily::GPGPU_CSR_BASE_ADDRESS *>(begin, end);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
std::vector<GenCmdList::iterator> UnitTestHelper<GfxFamily>::findAllMidThreadPreemptionAllocationCommand(GenCmdList::iterator begin, GenCmdList::iterator end) {
|
||||
return findAll<typename GfxFamily::GPGPU_CSR_BASE_ADDRESS *>(begin, end);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -105,4 +105,15 @@ inline bool UnitTestHelper<GfxFamily>::getWorkloadPartitionForStoreRegisterMemCm
|
||||
return storeRegisterMem.getWorkloadPartitionIdOffsetEnable();
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
GenCmdList::iterator UnitTestHelper<GfxFamily>::findMidThreadPreemptionAllocationCommand(GenCmdList::iterator begin, GenCmdList::iterator end) {
|
||||
return end;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
std::vector<GenCmdList::iterator> UnitTestHelper<GfxFamily>::findAllMidThreadPreemptionAllocationCommand(GenCmdList::iterator begin, GenCmdList::iterator end) {
|
||||
std::vector<GenCmdList::iterator> emptyList;
|
||||
return emptyList;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -2103,3 +2103,11 @@ TEST_F(CommandStreamReceiverTest, givenPreambleFlagIsSetWhenGettingFlagStateThen
|
||||
commandStreamReceiver->setPreambleSetFlag(true);
|
||||
EXPECT_TRUE(commandStreamReceiver->getPreambleSetFlag());
|
||||
}
|
||||
|
||||
TEST_F(CommandStreamReceiverTest, givenPreemptionSentIsInitialWhenSettingPreemptionToNewModeThenExpectCorrectPreemption) {
|
||||
PreemptionMode mode = PreemptionMode::Initial;
|
||||
EXPECT_EQ(mode, commandStreamReceiver->getPreemptionMode());
|
||||
mode = PreemptionMode::ThreadGroup;
|
||||
commandStreamReceiver->setPreemptionMode(mode);
|
||||
EXPECT_EQ(mode, commandStreamReceiver->getPreemptionMode());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user