diff --git a/level_zero/core/source/device/device_imp.cpp b/level_zero/core/source/device/device_imp.cpp index 6afac20170..18ae98ac96 100644 --- a/level_zero/core/source/device/device_imp.cpp +++ b/level_zero/core/source/device/device_imp.cpp @@ -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; diff --git a/level_zero/core/test/unit_tests/sources/device/test_device.cpp b/level_zero/core/test/unit_tests/sources/device/test_device.cpp index 7b330e18f1..e75668a1bd 100644 --- a/level_zero/core/test/unit_tests/sources/device/test_device.cpp +++ b/level_zero/core/test/unit_tests/sources/device/test_device.cpp @@ -126,6 +126,8 @@ TEST_F(DeviceTest, givenDevicePropertiesStructureWhenDevicePropertiesCalledThenA memset(&deviceProperties.numSubslicesPerSlice, std::numeric_limits::max(), sizeof(deviceProperties.numSubslicesPerSlice)); memset(&deviceProperties.numSlices, std::numeric_limits::max(), sizeof(deviceProperties.numSlices)); memset(&deviceProperties.timerResolution, std::numeric_limits::max(), sizeof(deviceProperties.timerResolution)); + memset(&deviceProperties.timestampValidBits, std::numeric_limits::max(), sizeof(deviceProperties.timestampValidBits)); + memset(&deviceProperties.kernelTimestampValidBits, std::numeric_limits::max(), sizeof(deviceProperties.kernelTimestampValidBits)); memset(&deviceProperties.name, std::numeric_limits::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); diff --git a/opencl/source/gen11/hw_info_ehl.inl b/opencl/source/gen11/hw_info_ehl.inl index 9c1b0192b5..4ce2ef1e18 100644 --- a/opencl/source/gen11/hw_info_ehl.inl +++ b/opencl/source/gen11/hw_info_ehl.inl @@ -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 = {}; diff --git a/opencl/source/gen11/hw_info_icllp.inl b/opencl/source/gen11/hw_info_icllp.inl index 5e356bb77a..f9d4f5c00b 100644 --- a/opencl/source/gen11/hw_info_icllp.inl +++ b/opencl/source/gen11/hw_info_icllp.inl @@ -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 = {}; diff --git a/opencl/source/gen11/hw_info_lkf.inl b/opencl/source/gen11/hw_info_lkf.inl index 5f3ddebef9..4237553c21 100644 --- a/opencl/source/gen11/hw_info_lkf.inl +++ b/opencl/source/gen11/hw_info_lkf.inl @@ -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 = {}; diff --git a/opencl/source/gen12lp/hw_info_dg1.inl b/opencl/source/gen12lp/hw_info_dg1.inl index e3ace7c1a9..83803c977b 100644 --- a/opencl/source/gen12lp/hw_info_dg1.inl +++ b/opencl/source/gen12lp/hw_info_dg1.inl @@ -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 = {}; diff --git a/opencl/source/gen12lp/hw_info_rkl.inl b/opencl/source/gen12lp/hw_info_rkl.inl index cbaef88639..0a6fb8c521 100644 --- a/opencl/source/gen12lp/hw_info_rkl.inl +++ b/opencl/source/gen12lp/hw_info_rkl.inl @@ -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 = {}; diff --git a/opencl/source/gen12lp/hw_info_tgllp.inl b/opencl/source/gen12lp/hw_info_tgllp.inl index 71087166a5..ba3391eb3d 100644 --- a/opencl/source/gen12lp/hw_info_tgllp.inl +++ b/opencl/source/gen12lp/hw_info_tgllp.inl @@ -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 = {}; diff --git a/opencl/source/gen8/hw_info_bdw.inl b/opencl/source/gen8/hw_info_bdw.inl index c846ec9e48..08e569cdef 100644 --- a/opencl/source/gen8/hw_info_bdw.inl +++ b/opencl/source/gen8/hw_info_bdw.inl @@ -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 = {}; diff --git a/opencl/source/gen9/hw_info_bxt.inl b/opencl/source/gen9/hw_info_bxt.inl index bfd903cc49..b5d7ecd10f 100644 --- a/opencl/source/gen9/hw_info_bxt.inl +++ b/opencl/source/gen9/hw_info_bxt.inl @@ -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 = {}; diff --git a/opencl/source/gen9/hw_info_cfl.inl b/opencl/source/gen9/hw_info_cfl.inl index 2043792179..6f56148984 100644 --- a/opencl/source/gen9/hw_info_cfl.inl +++ b/opencl/source/gen9/hw_info_cfl.inl @@ -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 = {}; diff --git a/opencl/source/gen9/hw_info_glk.inl b/opencl/source/gen9/hw_info_glk.inl index 54cebf6aa9..6a3176b895 100644 --- a/opencl/source/gen9/hw_info_glk.inl +++ b/opencl/source/gen9/hw_info_glk.inl @@ -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 = {}; diff --git a/opencl/source/gen9/hw_info_kbl.inl b/opencl/source/gen9/hw_info_kbl.inl index c68b23ff1d..5333e0d288 100644 --- a/opencl/source/gen9/hw_info_kbl.inl +++ b/opencl/source/gen9/hw_info_kbl.inl @@ -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 = {}; diff --git a/opencl/source/gen9/hw_info_skl.inl b/opencl/source/gen9/hw_info_skl.inl index ee2eb4d1dc..00ac65fe32 100644 --- a/opencl/source/gen9/hw_info_skl.inl +++ b/opencl/source/gen9/hw_info_skl.inl @@ -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 = {}; diff --git a/shared/source/helpers/hw_info.h b/shared/source/helpers/hw_info.h index b134fce83b..fd4e1eef6b 100644 --- a/shared/source/helpers/hw_info.h +++ b/shared/source/helpers/hw_info.h @@ -61,6 +61,8 @@ struct RuntimeCapabilityTable { bool hostPtrTrackingEnabled; bool levelZeroSupported; bool isIntegratedDevice; + uint32_t timestampValidBits; + uint32_t kernelTimestampValidBits; }; struct HardwareCapabilities {