@@ -362,6 +362,7 @@ TEST_F(DeviceTest, givenDeviceCachePropertiesThenAllPropertiesAreAssigned) {
362362
363363TEST_F (DeviceTest, givenDevicePropertiesStructureWhenDevicePropertiesCalledThenAllPropertiesAreAssigned) {
364364 ze_device_properties_t deviceProperties, devicePropertiesBefore;
365+ deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
365366
366367 deviceProperties.type = ZE_DEVICE_TYPE_FPGA;
367368 memset (&deviceProperties.vendorId , std::numeric_limits<int >::max (), sizeof (deviceProperties.vendorId ));
@@ -406,7 +407,7 @@ TEST_F(DeviceTest, givenDevicePropertiesStructureWhenDevicePropertiesCalledThenA
406407}
407408
408409TEST_F (DeviceTest, WhenGettingDevicePropertiesThenSubslicesPerSliceIsBasedOnSubslicesSupported) {
409- ze_device_properties_t deviceProperties;
410+ ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES} ;
410411 deviceProperties.type = ZE_DEVICE_TYPE_GPU;
411412
412413 device->getNEODevice ()->getRootDeviceEnvironment ().getMutableHardwareInfo ()->gtSystemInfo .MaxSubSlicesSupported = 48 ;
@@ -421,7 +422,7 @@ TEST_F(DeviceTest, WhenGettingDevicePropertiesThenSubslicesPerSliceIsBasedOnSubs
421422TEST_F (DeviceTest, GivenDebugApiUsedSetWhenGettingDevicePropertiesThenSubslicesPerSliceIsBasedOnMaxSubslicesSupported) {
422423 DebugManagerStateRestore restorer;
423424 DebugManager.flags .DebugApiUsed .set (1 );
424- ze_device_properties_t deviceProperties;
425+ ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES} ;
425426 deviceProperties.type = ZE_DEVICE_TYPE_GPU;
426427
427428 device->getNEODevice ()->getRootDeviceEnvironment ().getMutableHardwareInfo ()->gtSystemInfo .MaxSubSlicesSupported = 48 ;
@@ -434,7 +435,7 @@ TEST_F(DeviceTest, GivenDebugApiUsedSetWhenGettingDevicePropertiesThenSubslicesP
434435}
435436
436437TEST_F (DeviceTest, givenCallToDevicePropertiesThenMaximumMemoryToBeAllocatedIsCorrectlyReturned) {
437- ze_device_properties_t deviceProperties;
438+ ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES} ;
438439 deviceProperties.maxMemAllocSize = 0 ;
439440 device->getProperties (&deviceProperties);
440441 EXPECT_EQ (deviceProperties.maxMemAllocSize , this ->neoDevice ->getDeviceInfo ().maxMemAllocSize );
@@ -474,7 +475,7 @@ TEST_F(DeviceHwInfoTest, givenDeviceWithNoPageFaultSupportThenFlagIsNotSet) {
474475 executionEnvironment->rootDeviceEnvironments [0 ]->setHwInfo (&hardwareInfo);
475476 setDriverAndDevice ();
476477
477- ze_device_properties_t deviceProps;
478+ ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES} ;
478479 device->getProperties (&deviceProps);
479480 EXPECT_FALSE (deviceProps.flags & ZE_DEVICE_PROPERTY_FLAG_ONDEMANDPAGING);
480481}
@@ -485,13 +486,13 @@ TEST_F(DeviceHwInfoTest, givenDeviceWithPageFaultSupportThenFlagIsSet) {
485486 executionEnvironment->rootDeviceEnvironments [0 ]->setHwInfo (&hardwareInfo);
486487 setDriverAndDevice ();
487488
488- ze_device_properties_t deviceProps;
489+ ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES} ;
489490 device->getProperties (&deviceProps);
490491 EXPECT_TRUE (deviceProps.flags & ZE_DEVICE_PROPERTY_FLAG_ONDEMANDPAGING);
491492}
492493
493494TEST_F (DeviceTest, whenGetDevicePropertiesCalledThenCorrectDevicePropertyEccFlagSet) {
494- ze_device_properties_t deviceProps;
495+ ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES} ;
495496
496497 device->getProperties (&deviceProps);
497498 auto expected = (this ->neoDevice ->getDeviceInfo ().errorCorrectionSupport ) ? ZE_DEVICE_PROPERTY_FLAG_ECC : static_cast <ze_device_property_flag_t >(0u );
@@ -510,7 +511,7 @@ TEST_F(DeviceTest, givenCommandQueuePropertiesCallThenCallSucceeds) {
510511}
511512
512513TEST_F (DeviceTest, givenCallToDevicePropertiesThenTimestampValidBitsAreCorrectlyAssigned) {
513- ze_device_properties_t deviceProps;
514+ ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES} ;
514515
515516 device->getProperties (&deviceProps);
516517 EXPECT_EQ (36u , deviceProps.timestampValidBits );
@@ -619,7 +620,7 @@ TEST_F(GlobalTimestampTest, whenGetProfilingTimerClockandProfilingTimerResolutio
619620 EXPECT_EQ (timerClock, static_cast <uint64_t >(1000000000.0 / timerResolution));
620621}
621622
622- TEST_F (GlobalTimestampTest, whenQueryingForTimerResolutionThenDefaultTimerResolutionInNanoSecondsIsReturned ) {
623+ TEST_F (GlobalTimestampTest, whenQueryingForTimerResolutionWithLegacyDevicePropertiesStructThenDefaultTimerResolutionInNanoSecondsIsReturned ) {
623624 neoDevice->setOSTime (new FalseCpuGpuTime ());
624625 NEO::DeviceVector devices;
625626 devices.push_back (std::unique_ptr<NEO::Device>(neoDevice));
@@ -629,12 +630,28 @@ TEST_F(GlobalTimestampTest, whenQueryingForTimerResolutionThenDefaultTimerResolu
629630 double timerResolution = neoDevice->getProfilingTimerResolution ();
630631 EXPECT_NE (timerResolution, 0.0 );
631632
632- ze_device_properties_t deviceProps = {};
633+ ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES };
633634 ze_result_t res = driverHandle.get ()->devices [0 ]->getProperties (&deviceProps);
634635 EXPECT_EQ (ZE_RESULT_SUCCESS, res);
635636 EXPECT_EQ (deviceProps.timerResolution , static_cast <uint64_t >(timerResolution));
636637}
637638
639+ TEST_F (GlobalTimestampTest, whenQueryingForTimerResolutionWithDeviceProperties_1_2_StructThenDefaultTimerResolutionInCyclesPerSecondsIsReturned) {
640+ neoDevice->setOSTime (new FalseCpuGpuTime ());
641+ NEO::DeviceVector devices;
642+ devices.push_back (std::unique_ptr<NEO::Device>(neoDevice));
643+ std::unique_ptr<L0::DriverHandleImp> driverHandle = std::make_unique<L0::DriverHandleImp>();
644+ driverHandle->initialize (std::move (devices));
645+
646+ uint64_t timerClock = neoDevice->getProfilingTimerClock ();
647+ EXPECT_NE (timerClock, 0u );
648+
649+ ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2};
650+ ze_result_t res = driverHandle.get ()->devices [0 ]->getProperties (&deviceProps);
651+ EXPECT_EQ (ZE_RESULT_SUCCESS, res);
652+ EXPECT_EQ (deviceProps.timerResolution , timerClock);
653+ }
654+
638655TEST_F (GlobalTimestampTest, whenQueryingForTimerResolutionWithUseCyclesPerSecondTimerSetThenTimerResolutionInCyclesPerSecondsIsReturned) {
639656 DebugManagerStateRestore restorer;
640657 DebugManager.flags .UseCyclesPerSecondTimer .set (1u );
@@ -648,7 +665,7 @@ TEST_F(GlobalTimestampTest, whenQueryingForTimerResolutionWithUseCyclesPerSecond
648665 uint64_t timerClock = neoDevice->getProfilingTimerClock ();
649666 EXPECT_NE (timerClock, 0u );
650667
651- ze_device_properties_t deviceProps = {};
668+ ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES };
652669 ze_result_t res = driverHandle.get ()->devices [0 ]->getProperties (&deviceProps);
653670 EXPECT_EQ (ZE_RESULT_SUCCESS, res);
654671 EXPECT_EQ (deviceProps.timerResolution , timerClock);
@@ -1018,7 +1035,7 @@ TEST_F(MultipleDevicesTest, whenRetriecingSubDevicePropertiesThenCorrectFlagIsSe
10181035 EXPECT_EQ (ZE_RESULT_SUCCESS, result);
10191036 EXPECT_EQ (numSubDevices, count);
10201037
1021- ze_device_properties_t deviceProps;
1038+ ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES} ;
10221039
10231040 L0::Device *subdevice0 = static_cast <L0::Device *>(subDevices[0 ]);
10241041 subdevice0->getProperties (&deviceProps);
@@ -1243,7 +1260,7 @@ TEST(DevicePropertyFlagIsIntegratedTest, givenIntegratedDeviceThenCorrectDeviceP
12431260 driverHandle->initialize (std::move (devices));
12441261 auto device = driverHandle->devices [0 ];
12451262
1246- ze_device_properties_t deviceProps;
1263+ ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES} ;
12471264
12481265 device->getProperties (&deviceProps);
12491266 EXPECT_EQ (ZE_DEVICE_PROPERTY_FLAG_INTEGRATED, deviceProps.flags & ZE_DEVICE_PROPERTY_FLAG_INTEGRATED);
@@ -1261,7 +1278,7 @@ TEST(DevicePropertyFlagDiscreteDeviceTest, givenDiscreteDeviceThenCorrectDeviceP
12611278 driverHandle->initialize (std::move (devices));
12621279 auto device = driverHandle->devices [0 ];
12631280
1264- ze_device_properties_t deviceProps;
1281+ ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES} ;
12651282
12661283 device->getProperties (&deviceProps);
12671284 EXPECT_EQ (0u , deviceProps.flags & ZE_DEVICE_PROPERTY_FLAG_INTEGRATED);
0 commit comments