ctx->function_add = [ctx->library newFunctionWithName:@"kernel_add"];
ctx->pipeline_add = [ctx->device newComputePipelineStateWithFunction:ctx->function_add error:nil];
- fprintf(stderr, "%s: loaded kernel_add: %p\n", __func__, ctx->pipeline_add);
+ fprintf(stderr, "%s: loaded kernel_add: %p\n", __func__, (void *) ctx->pipeline_add);
ctx->function_relu = [ctx->library newFunctionWithName:@"kernel_relu"];
ctx->pipeline_relu = [ctx->device newComputePipelineStateWithFunction:ctx->function_relu error:nil];
- fprintf(stderr, "%s: loaded kernel_relu: %p\n", __func__, ctx->pipeline_relu);
+ fprintf(stderr, "%s: loaded kernel_relu: %p\n", __func__, (void *) ctx->pipeline_relu);
ctx->function_soft_max = [ctx->library newFunctionWithName:@"kernel_soft_max" constantValues:constants error:nil];
ctx->pipeline_soft_max = [ctx->device newComputePipelineStateWithFunction:ctx->function_soft_max error:nil];
- fprintf(stderr, "%s: loaded kernel_soft_max: %p\n", __func__, ctx->pipeline_soft_max);
+ fprintf(stderr, "%s: loaded kernel_soft_max: %p\n", __func__, (void *) ctx->pipeline_soft_max);
}
#ifdef GGML_MTL_HEAP
id<MTLBuffer> id_dst = mnist_mtl_get_buffer(ctx, inp, &offs_src0);
- memcpy(id_dst.contents + offs_src0, inp->data, ggml_nbytes(inp));
+ memcpy((char *) id_dst.contents + offs_src0, inp->data, ggml_nbytes(inp));
}
for (int i = 0; i < gf->n_nodes; ++i) {
#include <string>
#include <vector>
#include <thread>
+#include <cinttypes>
#if defined(_MSC_VER)
#pragma warning(disable: 4244 4267) // possible loss of data
void print_t_f32(const char* title, struct ggml_tensor * t, int n = 10) {
printf("%s\n", title);
float * data = (float *)t->data;
- printf("dims: %jd %jd %jd %jd f32\n", t->ne[0], t->ne[1], t->ne[2], t->ne[3]);
+ printf("dims: % " PRId64 " % " PRId64 " % " PRId64 " % " PRId64 " f32\n", t->ne[0], t->ne[1], t->ne[2], t->ne[3]);
printf("First & Last %d elements:\n", n);
for (int i = 0; i < std::min((int) (t->ne[0]*t->ne[1]), n); i++) {
printf("%.5f ", data[i]);