@@ -472,6 +472,16 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkGetImage3dMaxDepth)
472472 EXPECT_TRUE (image_3d_max_depth >= min_val);
473473}
474474
475+ TEST_P (TestDPCTLSyclDeviceInterface, ChkGetImageMaxBufferSize)
476+ {
477+ size_t image_max_buffer_size = 0 ;
478+ EXPECT_NO_FATAL_FAILURE (image_max_buffer_size =
479+ DPCTLDevice_GetImageMaxBufferSize (DRef));
480+ if (DPCTLDevice_HasAspect (DRef, DPCTL_SyclAspectToDPCTLAspectType (
481+ DPCTL_StrToAspectType (" image" ))))
482+ EXPECT_TRUE (image_max_buffer_size > 0 );
483+ }
484+
475485TEST_P (TestDPCTLSyclDeviceInterface, ChkGetParentDevice)
476486{
477487 DPCTLSyclDeviceRef pDRef = nullptr ;
@@ -635,13 +645,52 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkGetPartitionTypeProperty)
635645 ptp == DPCTL_PARTITION_BY_AFFINITY_DOMAIN );
636646}
637647
648+ TEST_P (TestDPCTLSyclDeviceInterface, ChkGetHalfFPConfig)
649+ {
650+ int *arr = nullptr ;
651+ size_t len = 0 ;
652+ EXPECT_NO_FATAL_FAILURE (arr = DPCTLDevice_GetHalfFPConfig (DRef, &len));
653+ // half_fp_config is empty for devices without aspect::fp16
654+ if (DPCTLDevice_HasAspect (DRef, DPCTL_SyclAspectToDPCTLAspectType (
655+ DPCTL_StrToAspectType (" fp16" ))))
656+ {
657+ EXPECT_TRUE (len > 0 );
658+ EXPECT_TRUE (arr != nullptr );
659+ }
660+ for (size_t i = 0 ; i < len; ++i) {
661+ EXPECT_TRUE (arr[i] >= DPCTL_FP_DENORM && arr[i] <= DPCTL_FP_SOFT_FLOAT );
662+ }
663+ EXPECT_NO_FATAL_FAILURE (DPCTLInt_Array_Delete (arr));
664+ }
665+
638666TEST_P (TestDPCTLSyclDeviceInterface, ChkGetSingleFPConfig)
639667{
640668 int *arr = nullptr ;
641669 size_t len = 0 ;
642670 EXPECT_NO_FATAL_FAILURE (arr = DPCTLDevice_GetSingleFPConfig (DRef, &len));
643671 EXPECT_TRUE (len > 0 );
644672 EXPECT_TRUE (arr != nullptr );
673+ for (size_t i = 0 ; i < len; ++i) {
674+ EXPECT_TRUE (arr[i] >= DPCTL_FP_DENORM && arr[i] <= DPCTL_FP_SOFT_FLOAT );
675+ }
676+ EXPECT_NO_FATAL_FAILURE (DPCTLInt_Array_Delete (arr));
677+ }
678+
679+ TEST_P (TestDPCTLSyclDeviceInterface, ChkGetDoubleFPConfig)
680+ {
681+ int *arr = nullptr ;
682+ size_t len = 0 ;
683+ EXPECT_NO_FATAL_FAILURE (arr = DPCTLDevice_GetDoubleFPConfig (DRef, &len));
684+ // double_fp_config is empty for devices without aspect::fp64
685+ if (DPCTLDevice_HasAspect (DRef, DPCTL_SyclAspectToDPCTLAspectType (
686+ DPCTL_StrToAspectType (" fp64" ))))
687+ {
688+ EXPECT_TRUE (len > 0 );
689+ EXPECT_TRUE (arr != nullptr );
690+ }
691+ for (size_t i = 0 ; i < len; ++i) {
692+ EXPECT_TRUE (arr[i] >= DPCTL_FP_DENORM && arr[i] <= DPCTL_FP_SOFT_FLOAT );
693+ }
645694 EXPECT_NO_FATAL_FAILURE (DPCTLInt_Array_Delete (arr));
646695}
647696
@@ -653,6 +702,25 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkGetAtomicMemoryOrderCapabilities)
653702 arr = DPCTLDevice_GetAtomicMemoryOrderCapabilities (DRef, &len));
654703 EXPECT_TRUE (len > 0 );
655704 EXPECT_TRUE (arr != nullptr );
705+ for (size_t i = 0 ; i < len; ++i) {
706+ EXPECT_TRUE (arr[i] >= DPCTL_MEMORY_ORDER_RELAXED &&
707+ arr[i] <= DPCTL_MEMORY_ORDER_SEQ_CST );
708+ }
709+ EXPECT_NO_FATAL_FAILURE (DPCTLInt_Array_Delete (arr));
710+ }
711+
712+ TEST_P (TestDPCTLSyclDeviceInterface, ChkGetAtomicFenceOrderCapabilities)
713+ {
714+ int *arr = nullptr ;
715+ size_t len = 0 ;
716+ EXPECT_NO_FATAL_FAILURE (
717+ arr = DPCTLDevice_GetAtomicFenceOrderCapabilities (DRef, &len));
718+ EXPECT_TRUE (len > 0 );
719+ EXPECT_TRUE (arr != nullptr );
720+ for (size_t i = 0 ; i < len; ++i) {
721+ EXPECT_TRUE (arr[i] >= DPCTL_MEMORY_ORDER_RELAXED &&
722+ arr[i] <= DPCTL_MEMORY_ORDER_SEQ_CST );
723+ }
656724 EXPECT_NO_FATAL_FAILURE (DPCTLInt_Array_Delete (arr));
657725}
658726
@@ -664,6 +732,25 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkGetAtomicMemoryScopeCapabilities)
664732 arr = DPCTLDevice_GetAtomicMemoryScopeCapabilities (DRef, &len));
665733 EXPECT_TRUE (len > 0 );
666734 EXPECT_TRUE (arr != nullptr );
735+ for (size_t i = 0 ; i < len; ++i) {
736+ EXPECT_TRUE (arr[i] >= DPCTL_MEMORY_SCOPE_WORK_ITEM &&
737+ arr[i] <= DPCTL_MEMORY_SCOPE_SYSTEM );
738+ }
739+ EXPECT_NO_FATAL_FAILURE (DPCTLInt_Array_Delete (arr));
740+ }
741+
742+ TEST_P (TestDPCTLSyclDeviceInterface, ChkGetAtomicFenceScopeCapabilities)
743+ {
744+ int *arr = nullptr ;
745+ size_t len = 0 ;
746+ EXPECT_NO_FATAL_FAILURE (
747+ arr = DPCTLDevice_GetAtomicFenceScopeCapabilities (DRef, &len));
748+ EXPECT_TRUE (len > 0 );
749+ EXPECT_TRUE (arr != nullptr );
750+ for (size_t i = 0 ; i < len; ++i) {
751+ EXPECT_TRUE (arr[i] >= DPCTL_MEMORY_SCOPE_WORK_ITEM &&
752+ arr[i] <= DPCTL_MEMORY_SCOPE_SYSTEM );
753+ }
667754 EXPECT_NO_FATAL_FAILURE (DPCTLInt_Array_Delete (arr));
668755}
669756
@@ -674,9 +761,42 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkGetPartitionProperties)
674761 EXPECT_NO_FATAL_FAILURE (arr =
675762 DPCTLDevice_GetPartitionProperties (DRef, &len));
676763 // may be empty if device doesn't support partitioning
764+ for (size_t i = 0 ; i < len; ++i) {
765+ EXPECT_TRUE (arr[i] >= DPCTL_PARTITION_NO_PARTITION &&
766+ arr[i] <= DPCTL_PARTITION_BY_AFFINITY_DOMAIN );
767+ }
677768 EXPECT_NO_FATAL_FAILURE (DPCTLInt_Array_Delete (arr));
678769}
679770
771+ TEST_P (TestDPCTLSyclDeviceInterface, ChkGetPartitionAffinityDomains)
772+ {
773+ int *arr = nullptr ;
774+ size_t len = 0 ;
775+ EXPECT_NO_FATAL_FAILURE (
776+ arr = DPCTLDevice_GetPartitionAffinityDomains (DRef, &len));
777+ // may be empty if device doesn't support partitioning by affinity
778+ for (size_t i = 0 ; i < len; ++i) {
779+ EXPECT_TRUE (
780+ arr[i] >= DPCTLPartitionAffinityDomainType::not_applicable &&
781+ arr[i] <= DPCTLPartitionAffinityDomainType::next_partitionable);
782+ }
783+ EXPECT_NO_FATAL_FAILURE (DPCTLInt_Array_Delete (arr));
784+ }
785+
786+ TEST_P (TestDPCTLSyclDeviceInterface, ChkGetPartitionTypeAffinityDomain)
787+ {
788+ DPCTLPartitionAffinityDomainType ptad;
789+ EXPECT_NO_FATAL_FAILURE (
790+ ptad = DPCTLDevice_GetPartitionTypeAffinityDomain (DRef));
791+ EXPECT_TRUE (ptad == DPCTLPartitionAffinityDomainType::not_applicable ||
792+ ptad == DPCTLPartitionAffinityDomainType::numa ||
793+ ptad == DPCTLPartitionAffinityDomainType::L4_cache ||
794+ ptad == DPCTLPartitionAffinityDomainType::L3_cache ||
795+ ptad == DPCTLPartitionAffinityDomainType::L2_cache ||
796+ ptad == DPCTLPartitionAffinityDomainType::L1_cache ||
797+ ptad == DPCTLPartitionAffinityDomainType::next_partitionable);
798+ }
799+
680800INSTANTIATE_TEST_SUITE_P (DPCTLDeviceFns,
681801 TestDPCTLSyclDeviceInterface,
682802 ::testing::Values (" opencl" ,
@@ -1051,3 +1171,187 @@ TEST_F(TestDPCTLSyclDeviceNullArgs, ChkGetCompositeDevice)
10511171 EXPECT_NO_FATAL_FAILURE (CDRef = DPCTLDevice_GetCompositeDevice (Null_DRef));
10521172 EXPECT_TRUE (CDRef == nullptr );
10531173}
1174+
1175+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetImageMaxBufferSize)
1176+ {
1177+ size_t res = 1 ;
1178+ EXPECT_NO_FATAL_FAILURE (res = DPCTLDevice_GetImageMaxBufferSize (Null_DRef));
1179+ ASSERT_TRUE (res == 0 );
1180+ }
1181+
1182+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetHalfFPConfig)
1183+ {
1184+ int *arr = nullptr ;
1185+ size_t len = 1 ;
1186+ EXPECT_NO_FATAL_FAILURE (arr = DPCTLDevice_GetHalfFPConfig (Null_DRef, &len));
1187+ ASSERT_TRUE (arr == nullptr );
1188+ ASSERT_TRUE (len == 0 );
1189+ }
1190+
1191+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetDoubleFPConfig)
1192+ {
1193+ int *arr = nullptr ;
1194+ size_t len = 1 ;
1195+ EXPECT_NO_FATAL_FAILURE (arr =
1196+ DPCTLDevice_GetDoubleFPConfig (Null_DRef, &len));
1197+ ASSERT_TRUE (arr == nullptr );
1198+ ASSERT_TRUE (len == 0 );
1199+ }
1200+
1201+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetAtomicFenceOrderCapabilities)
1202+ {
1203+ int *arr = nullptr ;
1204+ size_t len = 1 ;
1205+ EXPECT_NO_FATAL_FAILURE (
1206+ arr = DPCTLDevice_GetAtomicFenceOrderCapabilities (Null_DRef, &len));
1207+ ASSERT_TRUE (arr == nullptr );
1208+ ASSERT_TRUE (len == 0 );
1209+ }
1210+
1211+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetAtomicFenceScopeCapabilities)
1212+ {
1213+ int *arr = nullptr ;
1214+ size_t len = 1 ;
1215+ EXPECT_NO_FATAL_FAILURE (
1216+ arr = DPCTLDevice_GetAtomicFenceScopeCapabilities (Null_DRef, &len));
1217+ ASSERT_TRUE (arr == nullptr );
1218+ ASSERT_TRUE (len == 0 );
1219+ }
1220+
1221+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetPartitionAffinityDomains)
1222+ {
1223+ int *arr = nullptr ;
1224+ size_t len = 1 ;
1225+ EXPECT_NO_FATAL_FAILURE (
1226+ arr = DPCTLDevice_GetPartitionAffinityDomains (Null_DRef, &len));
1227+ ASSERT_TRUE (arr == nullptr );
1228+ ASSERT_TRUE (len == 0 );
1229+ }
1230+
1231+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetPartitionTypeAffinityDomain)
1232+ {
1233+ DPCTLPartitionAffinityDomainType res =
1234+ DPCTLPartitionAffinityDomainType::numa;
1235+ EXPECT_NO_FATAL_FAILURE (
1236+ res = DPCTLDevice_GetPartitionTypeAffinityDomain (Null_DRef));
1237+ ASSERT_TRUE (res == DPCTLPartitionAffinityDomainType::not_applicable);
1238+ }
1239+
1240+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetVendorId)
1241+ {
1242+ uint32_t res = 1 ;
1243+ EXPECT_NO_FATAL_FAILURE (res = DPCTLDevice_GetVendorId (Null_DRef));
1244+ ASSERT_TRUE (res == 0 );
1245+ }
1246+
1247+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetAddressBits)
1248+ {
1249+ uint32_t res = 1 ;
1250+ EXPECT_NO_FATAL_FAILURE (res = DPCTLDevice_GetAddressBits (Null_DRef));
1251+ ASSERT_TRUE (res == 0 );
1252+ }
1253+
1254+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetMaxSamplers)
1255+ {
1256+ uint32_t res = 1 ;
1257+ EXPECT_NO_FATAL_FAILURE (res = DPCTLDevice_GetMaxSamplers (Null_DRef));
1258+ ASSERT_TRUE (res == 0 );
1259+ }
1260+
1261+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetMaxParameterSize)
1262+ {
1263+ size_t res = 1 ;
1264+ EXPECT_NO_FATAL_FAILURE (res = DPCTLDevice_GetMaxParameterSize (Null_DRef));
1265+ ASSERT_TRUE (res == 0 );
1266+ }
1267+
1268+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetMemBaseAddrAlign)
1269+ {
1270+ uint32_t res = 1 ;
1271+ EXPECT_NO_FATAL_FAILURE (res = DPCTLDevice_GetMemBaseAddrAlign (Null_DRef));
1272+ ASSERT_TRUE (res == 0 );
1273+ }
1274+
1275+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetErrorCorrectionSupport)
1276+ {
1277+ bool res = true ;
1278+ EXPECT_NO_FATAL_FAILURE (
1279+ res = DPCTLDevice_GetErrorCorrectionSupport (Null_DRef));
1280+ ASSERT_FALSE (res);
1281+ }
1282+
1283+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkIsAvailable)
1284+ {
1285+ bool res = true ;
1286+ EXPECT_NO_FATAL_FAILURE (res = DPCTLDevice_IsAvailable (Null_DRef));
1287+ ASSERT_FALSE (res);
1288+ }
1289+
1290+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetVersion)
1291+ {
1292+ const char *version = nullptr ;
1293+ EXPECT_NO_FATAL_FAILURE (version = DPCTLDevice_GetVersion (Null_DRef));
1294+ ASSERT_TRUE (version == nullptr );
1295+ }
1296+
1297+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetBackendVersion)
1298+ {
1299+ const char *version = nullptr ;
1300+ EXPECT_NO_FATAL_FAILURE (version = DPCTLDevice_GetBackendVersion (Null_DRef));
1301+ ASSERT_TRUE (version == nullptr );
1302+ }
1303+
1304+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetLocalMemType)
1305+ {
1306+ DPCTLLocalMemType res = DPCTL_LOCAL_MEM_TYPE_LOCAL ;
1307+ EXPECT_NO_FATAL_FAILURE (res = DPCTLDevice_GetLocalMemType (Null_DRef));
1308+ ASSERT_TRUE (res == DPCTL_LOCAL_MEM_TYPE_NONE );
1309+ }
1310+
1311+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetPartitionTypeProperty)
1312+ {
1313+ DPCTLPartitionPropertyType res = DPCTL_PARTITION_EQUALLY ;
1314+ EXPECT_NO_FATAL_FAILURE (
1315+ res = DPCTLDevice_GetPartitionTypeProperty (Null_DRef));
1316+ ASSERT_TRUE (res == DPCTL_PARTITION_NO_PARTITION );
1317+ }
1318+
1319+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetSingleFPConfig)
1320+ {
1321+ int *arr = nullptr ;
1322+ size_t len = 1 ;
1323+ EXPECT_NO_FATAL_FAILURE (arr =
1324+ DPCTLDevice_GetSingleFPConfig (Null_DRef, &len));
1325+ ASSERT_TRUE (arr == nullptr );
1326+ ASSERT_TRUE (len == 0 );
1327+ }
1328+
1329+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetAtomicMemoryOrderCapabilities)
1330+ {
1331+ int *arr = nullptr ;
1332+ size_t len = 1 ;
1333+ EXPECT_NO_FATAL_FAILURE (
1334+ arr = DPCTLDevice_GetAtomicMemoryOrderCapabilities (Null_DRef, &len));
1335+ ASSERT_TRUE (arr == nullptr );
1336+ ASSERT_TRUE (len == 0 );
1337+ }
1338+
1339+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetAtomicMemoryScopeCapabilities)
1340+ {
1341+ int *arr = nullptr ;
1342+ size_t len = 1 ;
1343+ EXPECT_NO_FATAL_FAILURE (
1344+ arr = DPCTLDevice_GetAtomicMemoryScopeCapabilities (Null_DRef, &len));
1345+ ASSERT_TRUE (arr == nullptr );
1346+ ASSERT_TRUE (len == 0 );
1347+ }
1348+
1349+ TEST_F (TestDPCTLSyclDeviceNullArgs, ChkGetPartitionProperties)
1350+ {
1351+ int *arr = nullptr ;
1352+ size_t len = 1 ;
1353+ EXPECT_NO_FATAL_FAILURE (
1354+ arr = DPCTLDevice_GetPartitionProperties (Null_DRef, &len));
1355+ ASSERT_TRUE (arr == nullptr );
1356+ ASSERT_TRUE (len == 0 );
1357+ }
0 commit comments