@@ -92,6 +92,26 @@ void check_platform_default_context(
9292 EXPECT_NO_FATAL_FAILURE (DPCTLContext_Delete (CRef));
9393}
9494
95+ void check_platform_get_devices (__dpctl_keep const DPCTLSyclPlatformRef PRef)
96+ {
97+ DPCTLDeviceVectorRef DVRef = nullptr ;
98+ size_t nDevices = 0 ;
99+
100+ DPCTLSyclDeviceType defDTy = DPCTLSyclDeviceType::DPCTL_ALL;
101+ EXPECT_NO_FATAL_FAILURE (DVRef = DPCTLPlatform_GetDevices (PRef, defDTy));
102+ EXPECT_TRUE (DVRef != nullptr );
103+ EXPECT_NO_FATAL_FAILURE (nDevices = DPCTLDeviceVector_Size (DVRef));
104+ for (auto i = 0ul ; i < nDevices; ++i) {
105+ DPCTLSyclDeviceRef DRef = nullptr ;
106+ EXPECT_NO_FATAL_FAILURE (DRef = DPCTLDeviceVector_GetAt (DV, i));
107+ ASSERT_TRUE (DRef != nullptr );
108+ EXPECT_NO_FATAL_FAILURE (DPCTLDevice_Delete (DRef));
109+ }
110+
111+ EXPECT_NO_FATAL_FAILURE (DPCTLDeviceVector_Clear (DVRef));
112+ EXPECT_NO_FATAL_FAILURE (DPCTLDeviceVector_Delete (DVRef));
113+ }
114+
95115} // namespace
96116
97117struct TestDPCTLSyclPlatformInterface
@@ -282,6 +302,11 @@ TEST_P(TestDPCTLSyclPlatformInterface, ChkAreEqNullArg)
282302 ASSERT_TRUE (DPCTLPlatform_Hash (Null_PRef) == 0 );
283303}
284304
305+ TEST_P (TestDPCTLSyclPlatformInterface, ChkGetDevices)
306+ {
307+ check_platform_get_devices (PRef);
308+ }
309+
285310TEST_F (TestDPCTLSyclDefaultPlatform, ChkGetName) { check_platform_name (PRef); }
286311
287312TEST_F (TestDPCTLSyclDefaultPlatform, ChkGetVendor)
0 commit comments