mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
TBX with AUB dump to call open on aub manager
Call open on aub manager to open file stream. Change-Id: Id48ac4b3bdb212db4adc5912bacd28ccb895c9cf Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
@ -156,6 +156,12 @@ CommandStreamReceiver *TbxCommandStreamReceiverHw<GfxFamily>::create(const std::
|
|||||||
executionEnvironment.initAubCenter(localMemoryEnabled, fullName, CommandStreamReceiverType::CSR_TBX_WITH_AUB);
|
executionEnvironment.initAubCenter(localMemoryEnabled, fullName, CommandStreamReceiverType::CSR_TBX_WITH_AUB);
|
||||||
|
|
||||||
csr = new CommandStreamReceiverWithAUBDump<TbxCommandStreamReceiverHw<GfxFamily>>(baseName, executionEnvironment);
|
csr = new CommandStreamReceiverWithAUBDump<TbxCommandStreamReceiverHw<GfxFamily>>(baseName, executionEnvironment);
|
||||||
|
if (csr->aubManager) {
|
||||||
|
if (!csr->aubManager->isOpen()) {
|
||||||
|
csr->aubManager->open(fullName);
|
||||||
|
UNRECOVERABLE_IF(!csr->aubManager->isOpen());
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
csr = new TbxCommandStreamReceiverHw<GfxFamily>(executionEnvironment);
|
csr = new TbxCommandStreamReceiverHw<GfxFamily>(executionEnvironment);
|
||||||
}
|
}
|
||||||
|
@ -482,3 +482,26 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenCreatedWithAubDumpThenFileNameIsE
|
|||||||
std::unique_ptr<TbxCommandStreamReceiverHw<FamilyType>> tbxCsr(reinterpret_cast<TbxCommandStreamReceiverHw<FamilyType> *>(TbxCommandStreamReceiver::create("aubfile", true, executionEnvironment)));
|
std::unique_ptr<TbxCommandStreamReceiverHw<FamilyType>> tbxCsr(reinterpret_cast<TbxCommandStreamReceiverHw<FamilyType> *>(TbxCommandStreamReceiver::create("aubfile", true, executionEnvironment)));
|
||||||
EXPECT_STREQ(fullName.c_str(), executionEnvironment.aubFileNameReceived.c_str());
|
EXPECT_STREQ(fullName.c_str(), executionEnvironment.aubFileNameReceived.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenCreatedWithAubDumpThenOpenIsCalledOnAubManagerToOpenFileStream) {
|
||||||
|
MockExecutionEnvironment executionEnvironment;
|
||||||
|
executionEnvironment.setHwInfo(*platformDevices);
|
||||||
|
|
||||||
|
std::unique_ptr<TbxCommandStreamReceiverHw<FamilyType>> tbxCsrWithAubDump(reinterpret_cast<TbxCommandStreamReceiverHw<FamilyType> *>(
|
||||||
|
TbxCommandStreamReceiver::create("aubfile", true, executionEnvironment)));
|
||||||
|
EXPECT_TRUE(tbxCsrWithAubDump->aubManager->isOpen());
|
||||||
|
}
|
||||||
|
|
||||||
|
HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenCreatedWithAubDumpSeveralTimesThenOpenIsCalledOnAubManagerOnceOnly) {
|
||||||
|
MockExecutionEnvironment executionEnvironment(*platformDevices, true);
|
||||||
|
executionEnvironment.setHwInfo(*platformDevices);
|
||||||
|
|
||||||
|
auto tbxCsrWithAubDump1 = std::unique_ptr<TbxCommandStreamReceiverHw<FamilyType>>(reinterpret_cast<TbxCommandStreamReceiverHw<FamilyType> *>(
|
||||||
|
TbxCommandStreamReceiverHw<FamilyType>::create("aubfile", true, executionEnvironment)));
|
||||||
|
|
||||||
|
auto tbxCsrWithAubDump2 = std::unique_ptr<TbxCommandStreamReceiverHw<FamilyType>>(reinterpret_cast<TbxCommandStreamReceiverHw<FamilyType> *>(
|
||||||
|
TbxCommandStreamReceiverHw<FamilyType>::create("aubfile", true, executionEnvironment)));
|
||||||
|
|
||||||
|
auto mockManager = reinterpret_cast<MockAubManager *>(executionEnvironment.aubCenter->getAubManager());
|
||||||
|
EXPECT_EQ(1u, mockManager->openCalledCnt);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user