Pass timestamp resolution to scheduler through event pool.

Related-To: NEO-2491

Change-Id: I7fb42441320b2b8a63b65ebe1d7f1f435809c80e
Signed-off-by: Piotr Zdunowski <piotr.zdunowski@intel.com>
This commit is contained in:
Piotr Zdunowski
2019-10-03 16:05:30 +02:00
committed by sys_ocldev
parent bb7c4d9222
commit 5e4362258a
5 changed files with 27 additions and 2 deletions

View File

@@ -141,6 +141,7 @@ void DeviceQueue::initDeviceQueue() {
auto igilEventPool = reinterpret_cast<IGIL_EventPool *>(eventPoolBuffer->getUnderlyingBuffer());
memset(eventPoolBuffer->getUnderlyingBuffer(), 0x0, eventPoolBuffer->getUnderlyingBufferSize());
igilEventPool->m_TimestampResolution = static_cast<float>(device->getProfilingTimerResolution());
igilEventPool->m_size = caps.maxOnDeviceEvents;
}

View File

@@ -35,6 +35,7 @@ void DeviceQueueHw<GfxFamily>::resetDeviceQueue() {
auto igilEventPool = reinterpret_cast<IGIL_EventPool *>(eventPoolBuffer->getUnderlyingBuffer());
memset(eventPoolBuffer->getUnderlyingBuffer(), 0x0, eventPoolBuffer->getUnderlyingBufferSize());
igilEventPool->m_TimestampResolution = static_cast<float>(device->getProfilingTimerResolution());
igilEventPool->m_size = caps.maxOnDeviceEvents;
auto igilCmdQueue = reinterpret_cast<IGIL_CommandQueue *>(queueBuffer->getUnderlyingBuffer());

View File

@@ -2665,9 +2665,9 @@ void UpdateEventsTreeStatusParallel( clk_event_t eventId, __global IGIL_EventPoo
CLCompleteTransitionTime = PROFILING_MAX_TIMER_VALUE - StartTime + CompleteTime;
}
//First value is END - START timestamp
retValues[ 0 ] = ( ulong )( ( float )CLEndTransitionTime * __intel__getProfilingTimerResolution() );
retValues[ 0 ] = ( ulong )( ( float )CLEndTransitionTime * eventsPool->m_TimestampResolution );
//Second value is COMPLETE - START timestamp
retValues[ 1 ] = ( ulong )( ( float )CLCompleteTransitionTime * __intel__getProfilingTimerResolution() );
retValues[ 1 ] = ( ulong )( ( float )CLCompleteTransitionTime * eventsPool->m_TimestampResolution );
}
}
//Signal parent because we completed

View File

@@ -138,6 +138,17 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueHwTest, addLriWithoutArbCheck) {
delete mockDeviceQueueHw;
}
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueHwTest, GivenDeviceQueueHWWhenEventPoolIsCreatedThenTimestampResolutionIsSet) {
auto timestampResolution = static_cast<float>(device->getProfilingTimerResolution());
auto deviceQueue = std::unique_ptr<DeviceQueue>(createQueueObject());
ASSERT_NE(deviceQueue, nullptr);
auto eventPoolBuffer = reinterpret_cast<IGIL_EventPool *>(deviceQueue->getEventPoolBuffer()->getUnderlyingBuffer());
EXPECT_FLOAT_EQ(timestampResolution, eventPoolBuffer->m_TimestampResolution);
}
class DeviceQueueSlb : public DeviceQueueHwTest {
public:
template <typename Cmd>

View File

@@ -116,6 +116,17 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, createDeviceQueuesWhenMultipleDevic
const_cast<DeviceInfo *>(&device->getDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues;
}
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, GivenDeviceQueueWhenEventPoolIsCreatedThenTimestampResolutionIsSet) {
auto timestampResolution = static_cast<float>(device->getProfilingTimerResolution());
auto deviceQueue = std::unique_ptr<DeviceQueue>(createQueueObject());
ASSERT_NE(deviceQueue, nullptr);
auto eventPoolBuffer = reinterpret_cast<IGIL_EventPool *>(deviceQueue->getEventPoolBuffer()->getUnderlyingBuffer());
EXPECT_FLOAT_EQ(timestampResolution, eventPoolBuffer->m_TimestampResolution);
}
typedef DeviceQueueTest DeviceQueueBuffer;
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueBuffer, setPreferredSizeWhenNoPropertyGiven) {
@@ -170,6 +181,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueBuffer, initValues) {
IGIL_EventPool expectedIgilEventPool = {0, 0, 0};
expectedIgilEventPool.m_head = 0;
expectedIgilEventPool.m_size = deviceInfo.maxOnDeviceEvents;
expectedIgilEventPool.m_TimestampResolution = static_cast<float>(device->getProfilingTimerResolution());
// initialized header
EXPECT_EQ(0, memcmp(deviceQueue->getQueueBuffer()->getUnderlyingBuffer(),