@@ -196,11 +196,49 @@ TEST_F(DeviceHostPointerTest, givenHostPointerNotAcceptedByKernelThenNewAllocati
196196 delete[] buffer;
197197}
198198
199+ TEST_F (DeviceTest, givenKernelExtendedPropertiesStructureWhenKernelPropertiesCalledThenSuccessIsReturnedAndPropertiesAreSet) {
200+ ze_device_module_properties_t kernelProperties = {};
201+
202+ ze_float_atomic_ext_properties_t kernelExtendedProperties = {};
203+ kernelExtendedProperties.stype = ZE_STRUCTURE_TYPE_FLOAT_ATOMIC_EXT_PROPERTIES;
204+ uint32_t maxValue = static_cast <ze_device_fp_flags_t >(std::numeric_limits<uint32_t >::max ());
205+ kernelExtendedProperties.fp16Flags = maxValue;
206+ kernelExtendedProperties.fp32Flags = maxValue;
207+ kernelExtendedProperties.fp64Flags = maxValue;
208+
209+ kernelProperties.pNext = &kernelExtendedProperties;
210+ ze_result_t res = device->getKernelProperties (&kernelProperties);
211+ EXPECT_EQ (res, ZE_RESULT_SUCCESS);
212+ EXPECT_NE (maxValue, kernelExtendedProperties.fp16Flags );
213+ EXPECT_NE (maxValue, kernelExtendedProperties.fp32Flags );
214+ EXPECT_NE (maxValue, kernelExtendedProperties.fp64Flags );
215+ }
216+
217+ TEST_F (DeviceTest, givenKernelExtendedPropertiesStructureWhenKernelPropertiesCalledWithIncorrectsStypeThenSuccessIsReturnedButPropertiesAreNotSet) {
218+ ze_device_module_properties_t kernelProperties = {};
219+
220+ ze_float_atomic_ext_properties_t kernelExtendedProperties = {};
221+ kernelExtendedProperties.stype = ZE_STRUCTURE_TYPE_FORCE_UINT32;
222+ uint32_t maxValue = static_cast <ze_device_fp_flags_t >(std::numeric_limits<uint32_t >::max ());
223+ kernelExtendedProperties.fp16Flags = maxValue;
224+ kernelExtendedProperties.fp32Flags = maxValue;
225+ kernelExtendedProperties.fp64Flags = maxValue;
226+
227+ kernelProperties.pNext = &kernelExtendedProperties;
228+ ze_result_t res = device->getKernelProperties (&kernelProperties);
229+ EXPECT_EQ (res, ZE_RESULT_SUCCESS);
230+ EXPECT_EQ (maxValue, kernelExtendedProperties.fp16Flags );
231+ EXPECT_EQ (maxValue, kernelExtendedProperties.fp32Flags );
232+ EXPECT_EQ (maxValue, kernelExtendedProperties.fp64Flags );
233+ }
234+
199235TEST_F (DeviceTest, givenKernelPropertiesStructureWhenKernelPropertiesCalledThenAllPropertiesAreAssigned) {
200236 const auto &hardwareInfo = this ->neoDevice ->getHardwareInfo ();
201237
202- ze_device_module_properties_t kernelProperties, kernelPropertiesBefore;
238+ ze_device_module_properties_t kernelProperties = {};
239+ ze_device_module_properties_t kernelPropertiesBefore = {};
203240 memset (&kernelProperties, std::numeric_limits<int >::max (), sizeof (ze_device_module_properties_t ));
241+ kernelProperties.pNext = nullptr ;
204242 kernelPropertiesBefore = kernelProperties;
205243 device->getKernelProperties (&kernelProperties);
206244
@@ -592,8 +630,9 @@ struct DeviceHasNoDoubleFp64Test : public ::testing::Test {
592630};
593631
594632TEST_F (DeviceHasNoDoubleFp64Test, givenDeviceThatDoesntHaveFp64WhenDbgFlagEnablesFp64ThenReportFp64Flags) {
595- ze_device_module_properties_t kernelProperties;
633+ ze_device_module_properties_t kernelProperties = {} ;
596634 memset (&kernelProperties, std::numeric_limits<int >::max (), sizeof (ze_device_module_properties_t ));
635+ kernelProperties.pNext = nullptr ;
597636
598637 device->getKernelProperties (&kernelProperties);
599638 EXPECT_FALSE (kernelProperties.flags & ZE_DEVICE_MODULE_FLAG_FP64);
@@ -631,8 +670,9 @@ struct DeviceHasNo64BitAtomicTest : public ::testing::Test {
631670};
632671
633672TEST_F (DeviceHasNo64BitAtomicTest, givenDeviceWithNoSupportForInteger64BitAtomicsThenFlagsAreSetCorrectly) {
634- ze_device_module_properties_t kernelProperties;
673+ ze_device_module_properties_t kernelProperties = {} ;
635674 memset (&kernelProperties, std::numeric_limits<int >::max (), sizeof (ze_device_module_properties_t ));
675+ kernelProperties.pNext = nullptr ;
636676
637677 device->getKernelProperties (&kernelProperties);
638678 EXPECT_TRUE (kernelProperties.flags & ZE_DEVICE_MODULE_FLAG_FP16);
@@ -658,8 +698,9 @@ struct DeviceHas64BitAtomicTest : public ::testing::Test {
658698};
659699
660700TEST_F (DeviceHas64BitAtomicTest, givenDeviceWithSupportForInteger64BitAtomicsThenFlagsAreSetCorrectly) {
661- ze_device_module_properties_t kernelProperties;
701+ ze_device_module_properties_t kernelProperties = {} ;
662702 memset (&kernelProperties, std::numeric_limits<int >::max (), sizeof (ze_device_module_properties_t ));
703+ kernelProperties.pNext = nullptr ;
663704
664705 device->getKernelProperties (&kernelProperties);
665706 EXPECT_TRUE (kernelProperties.flags & ZE_DEVICE_MODULE_FLAG_FP16);
0 commit comments