Add whenAubCsrIsCreatedThenCreateHardwareContext hpc aub test

Related-To: NEO-6631


Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2022-03-10 15:05:37 +00:00
committed by Compute-Runtime-Automation
parent eef82189e5
commit 3ca86e7394

View File

@ -5,16 +5,30 @@
*
*/
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/ult_hw_config.h"
#include "shared/test/common/helpers/variable_backup.h"
#include "opencl/test/unit_test/aub_tests/command_stream/aub_mem_dump_tests.h"
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
using XeHpcCoreAubMemDumpTests = Test<NEO::ClDeviceFixture>;
XE_HPC_CORETEST_F(XeHpcCoreAubMemDumpTests, GivenCcsThenExpectationsAreMet) {
if (NEO::defaultHwInfo->platform.eProductFamily != IGFX_PVC) {
GTEST_SKIP();
}
setupAUB<FamilyType>(pDevice, aub_stream::ENGINE_CCS);
}
XE_HPC_CORETEST_F(XeHpcCoreAubMemDumpTests, whenAubCsrIsCreatedThenCreateHardwareContext) {
DebugManagerStateRestore restore;
VariableBackup<UltHwConfig> backup(&ultHwConfig);
ultHwConfig.useHwCsr = true;
DebugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_AUB);
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
auto &baseCsr = device->getGpgpuCommandStreamReceiver();
auto &aubCsr = static_cast<AUBCommandStreamReceiverHw<FamilyType> &>(baseCsr);
EXPECT_NE(nullptr, aubCsr.hardwareContextController.get());
EXPECT_NE(0u, aubCsr.hardwareContextController->hardwareContexts.size());
}