Skip to content

Problem when use with iOS and Metal: GGML_METAL_ADD_KERNEL #1377

Closed
@paulocoutinhox

Description

@paulocoutinhox

Hi,

Im trying compile for iOS, but get this error:

/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/whisper/ggml-metal.m:218:9: error: cast of Objective-C pointer type 'id<MTLComputePipelineState>' to C pointer type 'void *' requires a bridged cast
        GGML_METAL_ADD_KERNEL(add);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/whisper/ggml-metal.m:210:107: note: expanded from macro 'GGML_METAL_ADD_KERNEL'
        metal_printf("%s: loaded %-32s %16p | th_max = %4d | th_width = %4d\n", __func__, "kernel_"#name, (void *) ctx->pipeline_##name, \
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/whisper/ggml-metal.m:18:43: note: expanded from macro 'metal_printf'
#define metal_printf(...) fprintf(stderr, __VA_ARGS__)
                                          ^~~~~~~~~~~
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/whisper/ggml-metal.m:218:9: note: use __bridge to convert directly (no change in ownership)
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/whisper/ggml-metal.m:210:107: note: expanded from macro 'GGML_METAL_ADD_KERNEL'
        metal_printf("%s: loaded %-32s %16p | th_max = %4d | th_width = %4d\n", __func__, "kernel_"#name, (void *) ctx->pipeline_##name, \
                                                                                                          ^
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/whisper/ggml-metal.m:218:9: note: use CFBridgingRetain call to make an ARC object available as a +1 'void *'
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/whisper/ggml-metal.m:210:116: note: expanded from macro 'GGML_METAL_ADD_KERNEL'
        metal_printf("%s: loaded %-32s %16p | th_max = %4d | th_width = %4d\n", __func__, "kernel_"#name, (void *) ctx->pipeline_##name, \

In this line:
https://github.com/ggerganov/whisper.cpp/blob/master/ggml-metal.m#L207-L218

How can i solve this?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions