Add device capability for timestamp valid bits

Change-Id: Ib4a0f4ce80f0fc3649f366ceb458e8f506a97e34
Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@intel.com>
This commit is contained in:
Aravind Gopalakrishnan
2020-09-18 10:58:07 -07:00
committed by sys_ocldev
parent 7fdfa870fe
commit 2e912aff52
15 changed files with 55 additions and 13 deletions

View File

@ -359,6 +359,8 @@ ze_result_t DeviceImp::getProperties(ze_device_properties_t *pDeviceProperties)
pDeviceProperties->coreClockRate = deviceInfo.maxClockFrequency;
pDeviceProperties->maxMemAllocSize = this->neoDevice->getDeviceInfo().maxMemAllocSize;
pDeviceProperties->maxCommandQueuePriority = 0;
pDeviceProperties->numThreadsPerEU = deviceInfo.numThreadsPerEU;
@ -373,7 +375,9 @@ ze_result_t DeviceImp::getProperties(ze_device_properties_t *pDeviceProperties)
pDeviceProperties->timerResolution = this->neoDevice->getDeviceInfo().outProfilingTimerResolution;
pDeviceProperties->maxMemAllocSize = this->neoDevice->getDeviceInfo().maxMemAllocSize;
pDeviceProperties->timestampValidBits = hardwareInfo.capabilityTable.timestampValidBits;
pDeviceProperties->kernelTimestampValidBits = hardwareInfo.capabilityTable.kernelTimestampValidBits;
if (hardwareInfo.capabilityTable.isIntegratedDevice) {
pDeviceProperties->flags |= ZE_DEVICE_PROPERTY_FLAG_INTEGRATED;

View File

@ -126,6 +126,8 @@ TEST_F(DeviceTest, givenDevicePropertiesStructureWhenDevicePropertiesCalledThenA
memset(&deviceProperties.numSubslicesPerSlice, std::numeric_limits<int>::max(), sizeof(deviceProperties.numSubslicesPerSlice));
memset(&deviceProperties.numSlices, std::numeric_limits<int>::max(), sizeof(deviceProperties.numSlices));
memset(&deviceProperties.timerResolution, std::numeric_limits<int>::max(), sizeof(deviceProperties.timerResolution));
memset(&deviceProperties.timestampValidBits, std::numeric_limits<uint32_t>::max(), sizeof(deviceProperties.timestampValidBits));
memset(&deviceProperties.kernelTimestampValidBits, std::numeric_limits<uint32_t>::max(), sizeof(deviceProperties.kernelTimestampValidBits));
memset(&deviceProperties.name, std::numeric_limits<int>::max(), sizeof(deviceProperties.name));
deviceProperties.maxMemAllocSize = 0;
@ -145,6 +147,8 @@ TEST_F(DeviceTest, givenDevicePropertiesStructureWhenDevicePropertiesCalledThenA
EXPECT_NE(deviceProperties.numSubslicesPerSlice, devicePropertiesBefore.numSubslicesPerSlice);
EXPECT_NE(deviceProperties.numSlices, devicePropertiesBefore.numSlices);
EXPECT_NE(deviceProperties.timerResolution, devicePropertiesBefore.timerResolution);
EXPECT_NE(deviceProperties.timestampValidBits, devicePropertiesBefore.timestampValidBits);
EXPECT_NE(deviceProperties.kernelTimestampValidBits, devicePropertiesBefore.kernelTimestampValidBits);
EXPECT_NE(0, memcmp(&deviceProperties.name, &devicePropertiesBefore.name, sizeof(devicePropertiesBefore.name)));
EXPECT_NE(deviceProperties.maxMemAllocSize, devicePropertiesBefore.maxMemAllocSize);
}
@ -175,6 +179,14 @@ TEST_F(DeviceTest, givenCommandQueuePropertiesCallThenCallSucceeds) {
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
}
TEST_F(DeviceTest, givenCallToDevicePropertiesThenTimestampValidBitsAreCorrectlyAssigned) {
ze_device_properties_t deviceProps;
device->getProperties(&deviceProps);
EXPECT_EQ(36u, deviceProps.timestampValidBits);
EXPECT_EQ(32u, deviceProps.kernelTimestampValidBits);
}
struct DeviceHasNoDoubleFp64Test : public ::testing::Test {
void SetUp() override {
DebugManager.flags.CreateMultipleRootDevices.set(numRootDevices);

View File

@ -76,7 +76,9 @@ const RuntimeCapabilityTable EHL::capabilityTable{
false, // supportsIndependentForwardProgress
true, // hostPtrTrackingEnabled
false, // levelZeroSupported
true // isIntegratedDevice
true, // isIntegratedDevice
36u, // timestampValidBits
32u // kernelTimestampValidBits
};
WorkaroundTable EHL::workaroundTable = {};

View File

@ -77,7 +77,9 @@ const RuntimeCapabilityTable ICLLP::capabilityTable{
true, // supportsIndependentForwardProgress
true, // hostPtrTrackingEnabled
true, // levelZeroSupported
true // isIntegratedDevice
true, // isIntegratedDevice
36u, // timestampValidBits
32u // kernelTimestampValidBits
};
WorkaroundTable ICLLP::workaroundTable = {};

View File

@ -76,7 +76,9 @@ const RuntimeCapabilityTable LKF::capabilityTable{
false, // supportsIndependentForwardProgress
true, // hostPtrTrackingEnabled
false, // levelZeroSupported
true // isIntegratedDevice
true, // isIntegratedDevice
36u, // timestampValidBits
32u // kernelTimestampValidBits
};
WorkaroundTable LKF::workaroundTable = {};

View File

@ -80,7 +80,9 @@ const RuntimeCapabilityTable DG1::capabilityTable{
false, // supportsIndependentForwardProgress
false, // hostPtrTrackingEnabled
true, // levelZeroSupported
false // isIntegratedDevice
false, // isIntegratedDevice
36u, // timestampValidBits
32u // kernelTimestampValidBits
};
WorkaroundTable DG1::workaroundTable = {};

View File

@ -74,7 +74,9 @@ const RuntimeCapabilityTable RKL::capabilityTable{
false, // supportsIndependentForwardProgress
false, // hostPtrTrackingEnabled
false, // levelZeroSupported
true // isIntegratedDevice
true, // isIntegratedDevice
36u, // timestampValidBits
32u // kernelTimestampValidBits
};
WorkaroundTable RKL::workaroundTable = {};

View File

@ -78,7 +78,9 @@ const RuntimeCapabilityTable TGLLP::capabilityTable{
false, // supportsIndependentForwardProgress
false, // hostPtrTrackingEnabled
true, // levelZeroSupported
true // isIntegratedDevice
true, // isIntegratedDevice
36u, // timestampValidBits
32u // kernelTimestampValidBits
};
WorkaroundTable TGLLP::workaroundTable = {};

View File

@ -81,7 +81,9 @@ const RuntimeCapabilityTable BDW::capabilityTable{
true, // supportsIndependentForwardProgress
true, // hostPtrTrackingEnabled
false, // levelZeroSupported
true // isIntegratedDevice
true, // isIntegratedDevice
36u, // timestampValidBits
32u // kernelTimestampValidBits
};
WorkaroundTable BDW::workaroundTable = {};

View File

@ -78,7 +78,9 @@ const RuntimeCapabilityTable BXT::capabilityTable{
false, // supportsIndependentForwardProgress
true, // hostPtrTrackingEnabled
false, // levelZeroSupported
true // isIntegratedDevice
true, // isIntegratedDevice
36u, // timestampValidBits
32u // kernelTimestampValidBits
};
WorkaroundTable BXT::workaroundTable = {};

View File

@ -73,7 +73,9 @@ const RuntimeCapabilityTable CFL::capabilityTable{
true, // supportsIndependentForwardProgress
true, // hostPtrTrackingEnabled
true, // levelZeroSupported
true // isIntegratedDevice
true, // isIntegratedDevice
36u, // timestampValidBits
32u // kernelTimestampValidBits
};
WorkaroundTable CFL::workaroundTable = {};

View File

@ -73,7 +73,9 @@ const RuntimeCapabilityTable GLK::capabilityTable{
false, // supportsIndependentForwardProgress
true, // hostPtrTrackingEnabled
false, // levelZeroSupported
true // isIntegratedDevice
true, // isIntegratedDevice
36u, // timestampValidBits
32u // kernelTimestampValidBits
};
WorkaroundTable GLK::workaroundTable = {};

View File

@ -73,7 +73,9 @@ const RuntimeCapabilityTable KBL::capabilityTable{
true, // supportsIndependentForwardProgress
true, // hostPtrTrackingEnabled
true, // levelZeroSupported
true // isIntegratedDevice
true, // isIntegratedDevice
36u, // timestampValidBits
32u // kernelTimestampValidBits
};
WorkaroundTable KBL::workaroundTable = {};

View File

@ -81,7 +81,9 @@ const RuntimeCapabilityTable SKL::capabilityTable{
true, // supportsIndependentForwardProgress
true, // hostPtrTrackingEnabled
true, // levelZeroSupported
true // isIntegratedDevice
true, // isIntegratedDevice
36u, // timestampValidBits
32u // kernelTimestampValidBits
};
WorkaroundTable SKL::workaroundTable = {};
FeatureTable SKL::featureTable = {};

View File

@ -61,6 +61,8 @@ struct RuntimeCapabilityTable {
bool hostPtrTrackingEnabled;
bool levelZeroSupported;
bool isIntegratedDevice;
uint32_t timestampValidBits;
uint32_t kernelTimestampValidBits;
};
struct HardwareCapabilities {