@@ -194,6 +194,7 @@ void ffPrintGPU(FFGPUOptions* options)
194
194
ffStrbufDestroy (& gpu -> name );
195
195
ffStrbufDestroy (& gpu -> driver );
196
196
ffStrbufDestroy (& gpu -> platformApi );
197
+ ffStrbufDestroy (& gpu -> memoryType );
197
198
}
198
199
}
199
200
@@ -399,9 +400,6 @@ void ffGenerateGPUJsonResult(FFGPUOptions* options, yyjson_mut_doc* doc, yyjson_
399
400
else
400
401
yyjson_mut_obj_add_null (doc , dedicatedObj , "used" );
401
402
402
- yyjson_mut_obj_add_strbuf (doc , obj , "driver" , & gpu -> driver );
403
- yyjson_mut_obj_add_strbuf (doc , obj , "name" , & gpu -> name );
404
-
405
403
yyjson_mut_val * sharedObj = yyjson_mut_obj_add_obj (doc , memoryObj , "shared" );
406
404
if (gpu -> shared .total != FF_GPU_VMEM_SIZE_UNSET )
407
405
yyjson_mut_obj_add_uint (doc , sharedObj , "total" , gpu -> shared .total );
@@ -412,7 +410,13 @@ void ffGenerateGPUJsonResult(FFGPUOptions* options, yyjson_mut_doc* doc, yyjson_
412
410
else
413
411
yyjson_mut_obj_add_null (doc , sharedObj , "used" );
414
412
415
- yyjson_mut_obj_add_strbuf (doc , obj , "memoryType" , & gpu -> memoryType );
413
+ if (gpu -> memoryType .length )
414
+ yyjson_mut_obj_add_strbuf (doc , memoryObj , "type" , & gpu -> memoryType );
415
+ else
416
+ yyjson_mut_obj_add_null (doc , memoryObj , "type" );
417
+
418
+ yyjson_mut_obj_add_strbuf (doc , obj , "driver" , & gpu -> driver );
419
+ yyjson_mut_obj_add_strbuf (doc , obj , "name" , & gpu -> name );
416
420
417
421
if (gpu -> temperature == gpu -> temperature ) //FF_GPU_TEMP_UNSET
418
422
yyjson_mut_obj_add_real (doc , obj , "temperature" , gpu -> temperature );
@@ -443,6 +447,7 @@ void ffGenerateGPUJsonResult(FFGPUOptions* options, yyjson_mut_doc* doc, yyjson_
443
447
ffStrbufDestroy (& gpu -> name );
444
448
ffStrbufDestroy (& gpu -> driver );
445
449
ffStrbufDestroy (& gpu -> platformApi );
450
+ ffStrbufDestroy (& gpu -> memoryType );
446
451
}
447
452
}
448
453
0 commit comments