Enable BCS split WA in OCL

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2022-09-01 12:28:18 +00:00
committed by Compute-Runtime-Automation
parent 11374b83af
commit d672920121
12 changed files with 49 additions and 3 deletions

View File

@@ -251,6 +251,7 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
static bool isAssignEngineRoundRobinEnabled();
static bool isTimestampWaitEnabled();
static bool isBlitSplitEnabled();
MOCKABLE_VIRTUAL void releaseIndirectHeap(IndirectHeap::Type heapType);

View File

@@ -1105,7 +1105,8 @@ size_t CommandQueueHw<GfxFamily>::calculateHostPtrSizeForImage(const size_t *reg
template <typename GfxFamily>
bool CommandQueueHw<GfxFamily>::isSplitEnqueueBlitSupported() {
auto bcsSplit = HwInfoConfig::get(getDevice().getHardwareInfo().platform.eProductFamily)->isBlitSplitEnqueueWARequired(getDevice().getHardwareInfo());
auto bcsSplit = HwInfoConfig::get(getDevice().getHardwareInfo().platform.eProductFamily)->isBlitSplitEnqueueWARequired(getDevice().getHardwareInfo()) &&
CommandQueue::isBlitSplitEnabled();
if (DebugManager.flags.SplitBcsCopy.get() != -1) {
bcsSplit = DebugManager.flags.SplitBcsCopy.get();

View File

@@ -17,4 +17,8 @@ bool CommandQueue::isTimestampWaitEnabled() {
return true;
}
bool CommandQueue::isBlitSplitEnabled() {
return true;
}
} // namespace NEO

View File

@@ -306,6 +306,8 @@ HWTEST_F(IoqCommandQueueHwBlitTest, givenSplitBcsCopyWhenCheckIsSplitEnqueueBlit
DebugManagerStateRestore restorer;
DebugManager.flags.SplitBcsCopy.set(1);
auto *cmdQHw = static_cast<CommandQueueHw<FamilyType> *>(this->pCmdQ);
VariableBackup<UltHwConfig> backup{&ultHwConfig};
ultHwConfig.useBlitSplit = true;
{
EXPECT_FALSE(cmdQHw->isSplitEnqueueBlitNeeded(TransferDirection::HostToHost, 64 * MemoryConstants::megaByte, *cmdQHw->getBcsCommandStreamReceiver(aub_stream::EngineType::ENGINE_BCS)));
EXPECT_FALSE(cmdQHw->isSplitEnqueueBlitNeeded(TransferDirection::LocalToLocal, 64 * MemoryConstants::megaByte, *cmdQHw->getBcsCommandStreamReceiver(aub_stream::EngineType::ENGINE_BCS)));
@@ -331,6 +333,14 @@ HWTEST_F(IoqCommandQueueHwBlitTest, givenSplitBcsCopyWhenCheckIsSplitEnqueueBlit
EXPECT_FALSE(cmdQHw->isSplitEnqueueBlitNeeded(TransferDirection::LocalToHost, 64 * MemoryConstants::megaByte, *cmdQHw->getBcsCommandStreamReceiver(aub_stream::EngineType::ENGINE_BCS)));
EXPECT_FALSE(cmdQHw->isSplitEnqueueBlitNeeded(TransferDirection::HostToLocal, 64 * MemoryConstants::megaByte, *cmdQHw->getBcsCommandStreamReceiver(aub_stream::EngineType::ENGINE_BCS)));
}
{
DebugManager.flags.SplitBcsCopy.set(-1);
ultHwConfig.useBlitSplit = false;
EXPECT_FALSE(cmdQHw->isSplitEnqueueBlitNeeded(TransferDirection::HostToHost, 64 * MemoryConstants::megaByte, *cmdQHw->getBcsCommandStreamReceiver(aub_stream::EngineType::ENGINE_BCS)));
EXPECT_FALSE(cmdQHw->isSplitEnqueueBlitNeeded(TransferDirection::LocalToLocal, 64 * MemoryConstants::megaByte, *cmdQHw->getBcsCommandStreamReceiver(aub_stream::EngineType::ENGINE_BCS)));
EXPECT_FALSE(cmdQHw->isSplitEnqueueBlitNeeded(TransferDirection::LocalToHost, 64 * MemoryConstants::megaByte, *cmdQHw->getBcsCommandStreamReceiver(aub_stream::EngineType::ENGINE_BCS)));
EXPECT_FALSE(cmdQHw->isSplitEnqueueBlitNeeded(TransferDirection::HostToLocal, 64 * MemoryConstants::megaByte, *cmdQHw->getBcsCommandStreamReceiver(aub_stream::EngineType::ENGINE_BCS)));
}
}
char hostPtr[16 * MemoryConstants::megaByte];

View File

@@ -19,4 +19,8 @@ bool CommandQueue::isTimestampWaitEnabled() {
return ultHwConfig.useWaitForTimestamps;
}
bool CommandQueue::isBlitSplitEnabled() {
return ultHwConfig.useBlitSplit;
}
} // namespace NEO

View File

@@ -895,6 +895,10 @@ TEST(CommandQueueTest, whenCheckEngineTimestampWaitEnabledThenReturnsTrue) {
EXPECT_TRUE(CommandQueue::isTimestampWaitEnabled());
}
TEST(CommandQueueTest, whenCheckBlitSplitEnabledThenReturnsTrue) {
EXPECT_TRUE(CommandQueue::isBlitSplitEnabled());
}
TEST(PlatformsDestructor, whenGlobalPlatformsDestructorIsCalledThenGlobalPlatformsAreDestroyed) {
EXPECT_NE(nullptr, platformsImpl);
platformsDestructor();