Skip to content

Commit b553fde

Browse files
Fix lsplatform function to use DPCTLPlatformMgr_GetInfo
1 parent 889cf20 commit b553fde

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dpctl/_sycl_platform.pyx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ from ._backend cimport ( # noqa: E211
3434
DPCTLPlatform_GetPlatforms,
3535
DPCTLPlatform_GetVendor,
3636
DPCTLPlatform_GetVersion,
37+
DPCTLPlatformMgr_GetInfo,
3738
DPCTLPlatformMgr_PrintInfo,
3839
DPCTLPlatformVector_Delete,
3940
DPCTLPlatformVector_GetAt,
@@ -323,6 +324,7 @@ def lsplatform(verbosity=0):
323324
cdef DPCTLPlatformVectorRef PVRef = NULL
324325
cdef size_t v = 0
325326
cdef size_t size = 0
327+
cdef const char * info_str = NULL
326328
cdef DPCTLSyclPlatformRef PRef = NULL
327329

328330
if not isinstance(verbosity, int):
@@ -347,8 +349,11 @@ def lsplatform(verbosity=0):
347349
if v != 0:
348350
print("Platform ", i, "::")
349351
PRef = DPCTLPlatformVector_GetAt(PVRef, i)
350-
DPCTLPlatformMgr_PrintInfo(PRef, v)
352+
info_str = DPCTLPlatformMgr_GetInfo(PRef,v)
353+
py_info = <bytes> info_str
354+
DPCTLCString_Delete(info_str)
351355
DPCTLPlatform_Delete(PRef)
356+
print(py_info.decode("utf-8"),end='')
352357
DPCTLPlatformVector_Delete(PVRef)
353358

354359

0 commit comments

Comments
 (0)