diff options
author | Justine Tunney <jtunney@gmail.com> | 2024-01-16 03:16:33 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-16 13:16:33 +0200 |
commit | a0b3ac8c48b66206b9c5921ce57bd5c0ea6557c3 (patch) | |
tree | dc073f0aca7eee8afcd51ee660555fda5f3b6675 /ggml-metal.h | |
parent | d75c232e1da56f19ac4d2530dadbe0ab3a11fde5 (diff) |
ggml : introduce GGML_CALL function annotation (#4850)
This change makes it possible to build ggml-cuda.cu and ggml-metal.m as
independent dynamic shared objects, that may be conditionally linked at
runtime in a multiplatform binary. It introduces a GGML_CALL annotation
that documents which functions have a cyclic call relationship, between
the application code and GPU modules.
This change does nothing, unless the build defines -DGGML_MULTIPLATFORM
which causes back-references and function pointers to conform to MS ABI
which is supported by NVCC, ROCm, XCode, GCC and Clang across platforms
Diffstat (limited to 'ggml-metal.h')
-rw-r--r-- | ggml-metal.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ggml-metal.h b/ggml-metal.h index cd5e2995..8b0bfc5f 100644 --- a/ggml-metal.h +++ b/ggml-metal.h @@ -47,11 +47,11 @@ GGML_API ggml_backend_t ggml_backend_metal_init(void); GGML_API bool ggml_backend_is_metal(ggml_backend_t backend); -GGML_API ggml_backend_buffer_t ggml_backend_metal_buffer_from_ptr(void * data, size_t size, size_t max_size); +GGML_API GGML_CALL ggml_backend_buffer_t ggml_backend_metal_buffer_from_ptr(void * data, size_t size, size_t max_size); GGML_API void ggml_backend_metal_set_n_cb(ggml_backend_t backend, int n_cb); -GGML_API ggml_backend_buffer_type_t ggml_backend_metal_buffer_type(void); +GGML_API GGML_CALL ggml_backend_buffer_type_t ggml_backend_metal_buffer_type(void); // helper to check if the device supports a specific family // ideally, the user code should be doing these checks |