|
10 | 10 |
|
11 | 11 | #include <stdlib.h> |
12 | 12 |
|
13 | | -#define FF_GPU_NUM_FORMAT_ARGS 12 |
| 13 | +#define FF_GPU_NUM_FORMAT_ARGS 13 |
14 | 14 |
|
15 | 15 | static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResult* gpu) |
16 | 16 | { |
@@ -103,6 +103,7 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu |
103 | 103 | FF_FORMAT_ARG(sUsed, "shared-used"), |
104 | 104 | FF_FORMAT_ARG(gpu->platformApi, "platform-api"), |
105 | 105 | FF_FORMAT_ARG(frequency, "frequency"), |
| 106 | + FF_FORMAT_ARG(index, "index"), |
106 | 107 | })); |
107 | 108 | } |
108 | 109 | } |
@@ -323,13 +324,10 @@ void ffGenerateGPUJsonResult(FFGPUOptions* options, yyjson_mut_doc* doc, yyjson_ |
323 | 324 | { |
324 | 325 | yyjson_mut_val* obj = yyjson_mut_arr_add_obj(doc, arr); |
325 | 326 |
|
326 | | - if (gpu->index != FF_GPU_INDEX_UNSET){ |
327 | | - yyjson_mut_obj_add_uint(doc, obj, "index", (uint64_t)gpu->index); |
328 | | - } |
| 327 | + if (gpu->index != FF_GPU_INDEX_UNSET) |
| 328 | + yyjson_mut_obj_add_uint(doc, obj, "index", gpu->index); |
329 | 329 | else |
330 | | - { |
331 | 330 | yyjson_mut_obj_add_null(doc, obj, "index"); |
332 | | - } |
333 | 331 |
|
334 | 332 | if (gpu->coreCount != FF_GPU_CORE_COUNT_UNSET) |
335 | 333 | yyjson_mut_obj_add_int(doc, obj, "coreCount", gpu->coreCount); |
@@ -411,6 +409,7 @@ void ffPrintGPUHelpFormat(void) |
411 | 409 | "GPU used shared memory - shared-used", |
412 | 410 | "The platform API used when detecting the GPU - platform-api", |
413 | 411 | "Current frequency in GHz - frequency", |
| 412 | + "GPU vendor specific index - index", |
414 | 413 | })); |
415 | 414 | } |
416 | 415 |
|
|
0 commit comments