@@ -194,6 +194,7 @@ void ffPrintGPU(FFGPUOptions* options)
194194        ffStrbufDestroy (& gpu -> name );
195195        ffStrbufDestroy (& gpu -> driver );
196196        ffStrbufDestroy (& gpu -> platformApi );
197+         ffStrbufDestroy (& gpu -> memoryType );
197198    }
198199}
199200
@@ -399,9 +400,6 @@ void ffGenerateGPUJsonResult(FFGPUOptions* options, yyjson_mut_doc* doc, yyjson_
399400        else 
400401            yyjson_mut_obj_add_null (doc , dedicatedObj , "used" );
401402
402-         yyjson_mut_obj_add_strbuf (doc , obj , "driver" , & gpu -> driver );
403-         yyjson_mut_obj_add_strbuf (doc , obj , "name" , & gpu -> name );
404- 
405403        yyjson_mut_val *  sharedObj  =  yyjson_mut_obj_add_obj (doc , memoryObj , "shared" );
406404        if  (gpu -> shared .total  !=  FF_GPU_VMEM_SIZE_UNSET )
407405            yyjson_mut_obj_add_uint (doc , sharedObj , "total" , gpu -> shared .total );
@@ -412,7 +410,13 @@ void ffGenerateGPUJsonResult(FFGPUOptions* options, yyjson_mut_doc* doc, yyjson_
412410        else 
413411            yyjson_mut_obj_add_null (doc , sharedObj , "used" );
414412
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 );
416420
417421        if (gpu -> temperature  ==  gpu -> temperature ) //FF_GPU_TEMP_UNSET 
418422            yyjson_mut_obj_add_real (doc , obj , "temperature" , gpu -> temperature );
@@ -443,6 +447,7 @@ void ffGenerateGPUJsonResult(FFGPUOptions* options, yyjson_mut_doc* doc, yyjson_
443447        ffStrbufDestroy (& gpu -> name );
444448        ffStrbufDestroy (& gpu -> driver );
445449        ffStrbufDestroy (& gpu -> platformApi );
450+         ffStrbufDestroy (& gpu -> memoryType );
446451    }
447452}
448453
0 commit comments