ollama-debug.c: change 'ld' to 'PRIi64'

* macOS has different definition per info from @mxyng
This commit is contained in:
shane.xb.qian 2025-03-13 17:10:37 +08:00
parent 85ab552028
commit 30d7a59ba8

View File

@ -1,4 +1,5 @@
#include <string.h>
#include <inttypes.h>
#include "ollama-debug.h"
@ -24,7 +25,7 @@ static void print_tensor(const void *tensor, void (*cb)(const void *, int),
fprintf(stderr, "[");
for (int i = 0; i < dims[0]; i++) {
if (i >= nitems && i < dims[0] - nitems) {
fprintf(stderr, "... (%ld more), ", dims[0] - 2 * nitems);
fprintf(stderr, "... (%" PRIi64 " more), ", dims[0] - 2 * nitems);
int skip = dims[0] - 2 * nitems;
if (ndims > 1) {
stride += mul(dims + 1, ndims - 1) * skip;
@ -67,7 +68,7 @@ static void print_tensor_i32(const void *tensor, int i) {
}
static void ollama_debug_tensor(const struct ggml_tensor *tensor, bool verbose, const char *prefix, int indent) {
fprintf(stderr, "%s%s %s (%s): [%ld %ld %ld %ld]\n", prefix, tensor->name,
fprintf(stderr, "%s%s %s (%s): [%" PRIi64 " %" PRIi64 " %" PRIi64 " %" PRIi64 "]\n", prefix, tensor->name,
ggml_op_name(tensor->op), ggml_type_name(tensor->type), tensor->ne[0],
tensor->ne[1], tensor->ne[2], tensor->ne[3]);