Fix profiling in device enqueue scenarios.

- Remove high part define as well.

Change-Id: Ie57b8e682507e4b620ad96de2b969dd0163315e0
This commit is contained in:
Mrozek, Michal
2018-02-23 09:09:57 +01:00
committed by sys_ocldev
parent dd44a87d5f
commit a891b23830
5 changed files with 3 additions and 16 deletions

View File

@@ -455,7 +455,7 @@ size_t DeviceQueueHw<GfxFamily>::getExecutionModelCleanupSectionSize() {
template <typename GfxFamily>
size_t DeviceQueueHw<GfxFamily>::getProfilingEndCmdsSize() {
size_t size = 0;
size += sizeof(PIPE_CONTROL) + 2 * sizeof(MI_STORE_REGISTER_MEM);
size += sizeof(PIPE_CONTROL) + sizeof(MI_STORE_REGISTER_MEM);
size += sizeof(MI_LOAD_REGISTER_IMM);
return size;
}

View File

@@ -34,12 +34,5 @@ void DeviceQueueHw<GfxFamily>::addProfilingEndCmds(uint64_t timestampAddress) {
*pMICmdLow = MI_STORE_REGISTER_MEM::sInit();
pMICmdLow->setRegisterAddress(GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW);
pMICmdLow->setMemoryAddress(timestampAddress);
//hi part
timestampAddress += sizeof(uint32_t);
auto pMICmdHigh = (MI_STORE_REGISTER_MEM *)slbCS.getSpace(sizeof(MI_STORE_REGISTER_MEM));
*pMICmdHigh = MI_STORE_REGISTER_MEM::sInit();
pMICmdHigh->setRegisterAddress(GP_THREAD_TIME_REG_ADDRESS_OFFSET_HIGH);
pMICmdHigh->setMemoryAddress(timestampAddress);
}
} // namespace OCLRT

View File

@@ -22,4 +22,3 @@
#pragma once
static const unsigned int GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW = 0x23A8;
static const unsigned int GP_THREAD_TIME_REG_ADDRESS_OFFSET_HIGH = 0x23AC;

View File

@@ -761,7 +761,7 @@ HWTEST_F(TheSimplestDeviceQueueFixture, getProfilingEndCmdsSize) {
MockContext context;
std::unique_ptr<MockDeviceQueueHw<FamilyType>> mockDeviceQueueHw(new MockDeviceQueueHw<FamilyType>(&context, device.get(), deviceQueueProperties::minimumProperties[0]));
size_t expectedSize = sizeof(PIPE_CONTROL) + 2 * sizeof(MI_STORE_REGISTER_MEM) + sizeof(MI_LOAD_REGISTER_IMM);
size_t expectedSize = sizeof(PIPE_CONTROL) + sizeof(MI_STORE_REGISTER_MEM) + sizeof(MI_LOAD_REGISTER_IMM);
EXPECT_EQ(expectedSize, MockDeviceQueueHw<FamilyType>::getProfilingEndCmdsSize());
}

View File

@@ -101,12 +101,7 @@ GEN9TEST_F(Gen9DeviceQueueSlb, addProfilingEndcmds) {
EXPECT_EQ(timestampAddress, pMICmdLow->getMemoryAddress());
storeRegMemItor++;
ASSERT_NE(hwParser.cmdList.end(), storeRegMemItor);
MI_STORE_REGISTER_MEM *pMICmdHigh = (MI_STORE_REGISTER_MEM *)*storeRegMemItor;
EXPECT_EQ(GP_THREAD_TIME_REG_ADDRESS_OFFSET_HIGH, pMICmdHigh->getRegisterAddress());
EXPECT_EQ(timestampAddress + (uint64_t)sizeof(uint32_t), pMICmdHigh->getMemoryAddress());
EXPECT_EQ(hwParser.cmdList.end(), storeRegMemItor);
delete mockDeviceQueueHw;
}