mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 16:45:25 +08:00
Refactor encode dispatch kernel class interface
Related-To: NEO-6589 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0a4554ab23
commit
9785ab7828
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -164,10 +164,23 @@ XE_HP_CORE_TEST_F(EncodeKernelGlobalAtomicsTestWithImplicitScalingTests, givenCl
|
||||
|
||||
bool requiresUncachedMocs = false;
|
||||
bool useGlobalAtomics = true;
|
||||
uint32_t partitionCount = 0;
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
|
||||
pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, useGlobalAtomics,
|
||||
partitionCount, false, false);
|
||||
EncodeDispatchKernelArgs dispatchArgs{
|
||||
0,
|
||||
pDevice,
|
||||
dispatchInterface.get(),
|
||||
dims,
|
||||
NEO::PreemptionMode::Disabled,
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
requiresUncachedMocs,
|
||||
useGlobalAtomics,
|
||||
false,
|
||||
false};
|
||||
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dispatchArgs);
|
||||
|
||||
EXPECT_TRUE(cmdContainer->lastSentUseGlobalAtomics);
|
||||
|
||||
@@ -192,10 +205,23 @@ XE_HP_CORE_TEST_F(EncodeKernelGlobalAtomicsTestWithImplicitScalingTests, givenCl
|
||||
bool requiresUncachedMocs = false;
|
||||
bool useGlobalAtomics = true;
|
||||
cmdContainer->lastSentUseGlobalAtomics = true;
|
||||
uint32_t partitionCount = 0;
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
|
||||
pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, useGlobalAtomics,
|
||||
partitionCount, false, false);
|
||||
EncodeDispatchKernelArgs dispatchArgs{
|
||||
0,
|
||||
pDevice,
|
||||
dispatchInterface.get(),
|
||||
dims,
|
||||
NEO::PreemptionMode::Disabled,
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
requiresUncachedMocs,
|
||||
useGlobalAtomics,
|
||||
false,
|
||||
false};
|
||||
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dispatchArgs);
|
||||
|
||||
EXPECT_TRUE(cmdContainer->lastSentUseGlobalAtomics);
|
||||
|
||||
@@ -217,10 +243,23 @@ XE_HP_CORE_TEST_F(EncodeKernelGlobalAtomicsTestWithImplicitScalingTests, givenCl
|
||||
bool requiresUncachedMocs = false;
|
||||
bool useGlobalAtomics = false;
|
||||
cmdContainer->lastSentUseGlobalAtomics = true;
|
||||
uint32_t partitionCount = 0;
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
|
||||
pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, useGlobalAtomics,
|
||||
partitionCount, false, false);
|
||||
EncodeDispatchKernelArgs dispatchArgs{
|
||||
0,
|
||||
pDevice,
|
||||
dispatchInterface.get(),
|
||||
dims,
|
||||
NEO::PreemptionMode::Disabled,
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
requiresUncachedMocs,
|
||||
useGlobalAtomics,
|
||||
false,
|
||||
false};
|
||||
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dispatchArgs);
|
||||
|
||||
EXPECT_FALSE(cmdContainer->lastSentUseGlobalAtomics);
|
||||
|
||||
@@ -245,10 +284,23 @@ XE_HP_CORE_TEST_F(EncodeKernelGlobalAtomicsTestWithImplicitScalingTests, givenCl
|
||||
bool requiresUncachedMocs = true;
|
||||
bool useGlobalAtomics = false;
|
||||
cmdContainer->lastSentUseGlobalAtomics = true;
|
||||
uint32_t partitionCount = 0;
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
|
||||
pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, useGlobalAtomics,
|
||||
partitionCount, false, false);
|
||||
EncodeDispatchKernelArgs dispatchArgs{
|
||||
0,
|
||||
pDevice,
|
||||
dispatchInterface.get(),
|
||||
dims,
|
||||
NEO::PreemptionMode::Disabled,
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
requiresUncachedMocs,
|
||||
useGlobalAtomics,
|
||||
false,
|
||||
false};
|
||||
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dispatchArgs);
|
||||
|
||||
EXPECT_FALSE(cmdContainer->lastSentUseGlobalAtomics);
|
||||
|
||||
@@ -272,10 +324,23 @@ XE_HP_CORE_TEST_F(EncodeKernelGlobalAtomicsTestWithImplicitScalingTests, givenCl
|
||||
|
||||
bool requiresUncachedMocs = false;
|
||||
bool useGlobalAtomics = false;
|
||||
uint32_t partitionCount = 0;
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
|
||||
pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, useGlobalAtomics,
|
||||
partitionCount, false, false);
|
||||
EncodeDispatchKernelArgs dispatchArgs{
|
||||
0,
|
||||
pDevice,
|
||||
dispatchInterface.get(),
|
||||
dims,
|
||||
NEO::PreemptionMode::Disabled,
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
requiresUncachedMocs,
|
||||
useGlobalAtomics,
|
||||
false,
|
||||
false};
|
||||
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dispatchArgs);
|
||||
|
||||
GenCmdList commands;
|
||||
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
|
||||
@@ -307,10 +372,23 @@ XE_HP_CORE_TEST_F(EncodeKernelGlobalAtomicsTestWithNoImplicitScalingTests, given
|
||||
|
||||
bool requiresUncachedMocs = false;
|
||||
bool useGlobalAtomics = true;
|
||||
uint32_t partitionCount = 0;
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
|
||||
pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, useGlobalAtomics,
|
||||
partitionCount, false, false);
|
||||
EncodeDispatchKernelArgs dispatchArgs{
|
||||
0,
|
||||
pDevice,
|
||||
dispatchInterface.get(),
|
||||
dims,
|
||||
NEO::PreemptionMode::Disabled,
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
requiresUncachedMocs,
|
||||
useGlobalAtomics,
|
||||
false,
|
||||
false};
|
||||
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dispatchArgs);
|
||||
|
||||
EXPECT_FALSE(cmdContainer->lastSentUseGlobalAtomics);
|
||||
GenCmdList commands;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -310,10 +310,23 @@ XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenNoFenceAsPostSyncOperationInCo
|
||||
dispatchInterface->getCrossThreadDataSizeResult = 0u;
|
||||
|
||||
bool requiresUncachedMocs = false;
|
||||
uint32_t partitionCount = 0;
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
|
||||
pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, false, partitionCount,
|
||||
false, false);
|
||||
EncodeDispatchKernelArgs dispatchArgs{
|
||||
0,
|
||||
pDevice,
|
||||
dispatchInterface.get(),
|
||||
dims,
|
||||
NEO::PreemptionMode::Disabled,
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
requiresUncachedMocs,
|
||||
false,
|
||||
false,
|
||||
false};
|
||||
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dispatchArgs);
|
||||
|
||||
GenCmdList commands;
|
||||
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
|
||||
@@ -337,10 +350,23 @@ XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenFenceAsPostSyncOperationInComp
|
||||
dispatchInterface->getCrossThreadDataSizeResult = 0u;
|
||||
|
||||
bool requiresUncachedMocs = false;
|
||||
uint32_t partitionCount = 0;
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
|
||||
pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, false, partitionCount,
|
||||
false, false);
|
||||
EncodeDispatchKernelArgs dispatchArgs{
|
||||
0,
|
||||
pDevice,
|
||||
dispatchInterface.get(),
|
||||
dims,
|
||||
NEO::PreemptionMode::Disabled,
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
requiresUncachedMocs,
|
||||
false,
|
||||
false,
|
||||
false};
|
||||
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dispatchArgs);
|
||||
|
||||
GenCmdList commands;
|
||||
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
|
||||
@@ -364,10 +390,23 @@ XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenDefaultSettingForFenceAsPostSy
|
||||
dispatchInterface->getCrossThreadDataSizeResult = 0u;
|
||||
|
||||
bool requiresUncachedMocs = false;
|
||||
uint32_t partitionCount = 0;
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
|
||||
pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, false, partitionCount,
|
||||
false, false);
|
||||
EncodeDispatchKernelArgs dispatchArgs{
|
||||
0,
|
||||
pDevice,
|
||||
dispatchInterface.get(),
|
||||
dims,
|
||||
NEO::PreemptionMode::Disabled,
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
requiresUncachedMocs,
|
||||
false,
|
||||
false,
|
||||
false};
|
||||
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dispatchArgs);
|
||||
|
||||
GenCmdList commands;
|
||||
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
|
||||
@@ -388,10 +427,23 @@ XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenCleanHeapsAndSlmNotChangedAndU
|
||||
dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSize;
|
||||
|
||||
bool requiresUncachedMocs = true;
|
||||
uint32_t partitionCount = 0;
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
|
||||
pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, false, partitionCount,
|
||||
false, false);
|
||||
EncodeDispatchKernelArgs dispatchArgs{
|
||||
0,
|
||||
pDevice,
|
||||
dispatchInterface.get(),
|
||||
dims,
|
||||
NEO::PreemptionMode::Disabled,
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
requiresUncachedMocs,
|
||||
false,
|
||||
false,
|
||||
false};
|
||||
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dispatchArgs);
|
||||
|
||||
GenCmdList commands;
|
||||
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
|
||||
@@ -437,7 +489,6 @@ XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, whenSizeForEncodeSystemMemoryFenceQ
|
||||
|
||||
XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenRevisionBAndAboveWhenSpecialModeRequiredThenDontReprogramPipelineSelect) {
|
||||
bool requiresUncachedMocs = false;
|
||||
uint32_t partitionCount = 0;
|
||||
auto hwInfo = pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
uint32_t dims[] = {1, 1, 1};
|
||||
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
|
||||
@@ -457,8 +508,24 @@ XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenRevisionBAndAboveWhenSpecialMo
|
||||
for (auto &testInput : testInputs) {
|
||||
hwInfo->platform.usRevId = testInput.revId;
|
||||
cmdContainer->lastPipelineSelectModeRequired = false;
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
|
||||
pDevice, NEO::PreemptionMode::Initial, requiresUncachedMocs, false, partitionCount, false, false);
|
||||
|
||||
EncodeDispatchKernelArgs dispatchArgs{
|
||||
0,
|
||||
pDevice,
|
||||
dispatchInterface.get(),
|
||||
dims,
|
||||
NEO::PreemptionMode::Initial,
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
requiresUncachedMocs,
|
||||
false,
|
||||
false,
|
||||
false};
|
||||
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dispatchArgs);
|
||||
EXPECT_EQ(testInput.expectedValue, cmdContainer->lastPipelineSelectModeRequired);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user