Skip to content

Commit 813a12c

Browse files
slarenggerganovyeahdongcn
committed
ggml : build backends as libraries (llama/10256)
* ggml : build backends as libraries --------- Signed-off-by: Xiaodong Ye <[email protected]> Co-authored-by: Georgi Gerganov <[email protected]> Co-authored-by: R0CKSTAR <[email protected]>
1 parent 6039bd4 commit 813a12c

File tree

172 files changed

+72612
-15370
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+72612
-15370
lines changed

CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ endif()
116116

117117
# ggml core
118118
set(GGML_SCHED_MAX_COPIES "4" CACHE STRING "ggml: max input copies for pipeline parallelism")
119+
option(GGML_CPU "ggml: enable CPU backend" ON)
119120

120121
# 3rd party libs / backends
121122
option(GGML_ACCELERATE "ggml: enable Accelerate framework" ON)
@@ -141,7 +142,7 @@ option(GGML_CUDA_NO_VMM "ggml: do not try to use CUDA VMM"
141142
option(GGML_CUDA_FA_ALL_QUANTS "ggml: compile all quants for FlashAttention" OFF)
142143
option(GGML_CUDA_GRAPHS "ggml: use CUDA graphs (llama.cpp only)" ${GGML_CUDA_GRAPHS_DEFAULT})
143144

144-
option(GGML_HIPBLAS "ggml: use hipBLAS" OFF)
145+
option(GGML_HIP "ggml: use HIP" OFF)
145146
option(GGML_HIP_UMA "ggml: use HIP unified memory architecture" OFF)
146147
option(GGML_VULKAN "ggml: use Vulkan" OFF)
147148
option(GGML_VULKAN_CHECK_RESULTS "ggml: run Vulkan op checks" OFF)
@@ -238,12 +239,15 @@ set_target_properties(ggml PROPERTIES PUBLIC_HEADER "${GGML_PUBLIC_HEADERS}")
238239
install(TARGETS ggml PUBLIC_HEADER)
239240

240241
if (BUILD_SHARED_LIBS)
241-
install(TARGETS ggml LIBRARY)
242+
install(TARGETS ggml LIBRARY)
243+
install(TARGETS ggml-base LIBRARY)
242244
endif()
243245

246+
# FIXME: this should be done in the backend cmake files
244247
if (GGML_METAL)
248+
# FIXME: does this need to be installed with GGML_METAL_EMBED_LIBRARY?
245249
install(
246-
FILES src/ggml-metal.metal
250+
FILES src/ggml-metal/ggml-metal.metal
247251
PERMISSIONS
248252
OWNER_READ
249253
OWNER_WRITE

include/ggml-amx.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ extern "C" {
99
#endif
1010

1111
// buffer_type API
12-
GGML_API ggml_backend_buffer_type_t ggml_backend_amx_buffer_type(void);
12+
GGML_BACKEND_API ggml_backend_buffer_type_t ggml_backend_amx_buffer_type(void);
1313

14-
GGML_API bool ggml_backend_is_amx(ggml_backend_t backend);
14+
GGML_BACKEND_API bool ggml_backend_is_amx(ggml_backend_t backend);
1515

1616
// backend API
17-
GGML_API ggml_backend_t ggml_backend_amx_init(void);
17+
GGML_BACKEND_API ggml_backend_t ggml_backend_amx_init(void);
1818

19-
GGML_API void ggml_backend_amx_set_n_threads(ggml_backend_t backend_amx, int n_threads);
19+
GGML_BACKEND_API void ggml_backend_amx_set_n_threads(ggml_backend_t backend_amx, int n_threads);
2020

21-
GGML_API ggml_backend_reg_t ggml_backend_amx_reg(void);
21+
GGML_BACKEND_API ggml_backend_reg_t ggml_backend_amx_reg(void);
2222

2323
#ifdef __cplusplus
2424
}

include/ggml-backend.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33
#include "ggml.h"
44
#include "ggml-alloc.h"
55

6+
#ifdef GGML_BACKEND_SHARED
7+
# if defined(_WIN32) && !defined(__MINGW32__)
8+
# ifdef GGML_BACKEND_BUILD
9+
# define GGML_BACKEND_API __declspec(dllexport) extern
10+
# else
11+
# define GGML_BACKEND_API __declspec(dllimport) extern
12+
# endif
13+
# else
14+
# define GGML_BACKEND_API __attribute__ ((visibility ("default"))) extern
15+
# endif
16+
#else
17+
# define GGML_BACKEND_API extern
18+
#endif
19+
620
#ifdef __cplusplus
721
extern "C" {
822
#endif

include/ggml-blas.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ extern "C" {
99
#endif
1010

1111
// backend API
12-
GGML_API ggml_backend_t ggml_backend_blas_init(void);
12+
GGML_BACKEND_API ggml_backend_t ggml_backend_blas_init(void);
1313

14-
GGML_API bool ggml_backend_is_blas(ggml_backend_t backend);
14+
GGML_BACKEND_API bool ggml_backend_is_blas(ggml_backend_t backend);
1515

1616
// number of threads used for conversion to float
1717
// for openblas and blis, this will also set the number of threads used for blas operations
18-
GGML_API void ggml_backend_blas_set_n_threads(ggml_backend_t backend_blas, int n_threads);
18+
GGML_BACKEND_API void ggml_backend_blas_set_n_threads(ggml_backend_t backend_blas, int n_threads);
1919

20-
GGML_API ggml_backend_reg_t ggml_backend_blas_reg(void);
20+
GGML_BACKEND_API ggml_backend_reg_t ggml_backend_blas_reg(void);
2121

2222

2323
#ifdef __cplusplus

include/ggml-cann.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ extern "C" {
3434
*/
3535
#define GGML_CANN_MAX_DEVICES 16
3636

37-
GGML_API ggml_backend_reg_t ggml_backend_cann_reg(void);
37+
GGML_BACKEND_API ggml_backend_reg_t ggml_backend_cann_reg(void);
3838

3939
/**
4040
* @brief Initializes the CANN backend for a specified device.
@@ -46,7 +46,7 @@ GGML_API ggml_backend_reg_t ggml_backend_cann_reg(void);
4646
* @param device The index of the device to initialize.
4747
* @return A pointer to the initialized backend instance, or nullptr on failure.
4848
*/
49-
GGML_API ggml_backend_t ggml_backend_cann_init(int32_t device);
49+
GGML_BACKEND_API ggml_backend_t ggml_backend_cann_init(int32_t device);
5050

5151
/**
5252
* @brief Checks if a given backend is a CANN backend.
@@ -57,7 +57,7 @@ GGML_API ggml_backend_t ggml_backend_cann_init(int32_t device);
5757
* @param backend The backend instance to check.
5858
* @return True if the backend is a CANN backend, false otherwise.
5959
*/
60-
GGML_API bool ggml_backend_is_cann(ggml_backend_t backend);
60+
GGML_BACKEND_API bool ggml_backend_is_cann(ggml_backend_t backend);
6161

6262
/**
6363
* @brief Retrieves the CANN buffer type for a specified device.
@@ -69,7 +69,7 @@ GGML_API bool ggml_backend_is_cann(ggml_backend_t backend);
6969
* @return A pointer to the buffer type interface for the specified device, or
7070
* nullptr if the device index is out of range.
7171
*/
72-
GGML_API ggml_backend_buffer_type_t
72+
GGML_BACKEND_API ggml_backend_buffer_type_t
7373
ggml_backend_cann_buffer_type(int32_t device);
7474

7575
/**
@@ -80,14 +80,14 @@ ggml_backend_cann_buffer_type(int32_t device);
8080
*
8181
* @return The number of CANN devices available.
8282
*/
83-
GGML_API int32_t ggml_backend_cann_get_device_count(void);
83+
GGML_BACKEND_API int32_t ggml_backend_cann_get_device_count(void);
8484

8585
/**
8686
* @brief pinned host buffer for use with the CPU backend for faster copies between CPU and NPU.
8787
*
8888
* @return A pointer to the host buffer type interface.
8989
*/
90-
GGML_API ggml_backend_buffer_type_t ggml_backend_cann_host_buffer_type(void);
90+
GGML_BACKEND_API ggml_backend_buffer_type_t ggml_backend_cann_host_buffer_type(void);
9191

9292
/**
9393
* @brief Retrieves the description of a specific CANN device.
@@ -99,7 +99,7 @@ GGML_API ggml_backend_buffer_type_t ggml_backend_cann_host_buffer_type(void);
9999
* @param description Pointer to a buffer where the description will be written.
100100
* @param description_size Size of the description buffer.
101101
*/
102-
GGML_API void ggml_backend_cann_get_device_description(
102+
GGML_BACKEND_API void ggml_backend_cann_get_device_description(
103103
int32_t device, char* description, size_t description_size);
104104

105105
/**
@@ -114,7 +114,7 @@ GGML_API void ggml_backend_cann_get_device_description(
114114
* @param total Pointer to a variable where the total memory size will be
115115
* stored.
116116
*/
117-
GGML_API void ggml_backend_cann_get_device_memory(int32_t device,
117+
GGML_BACKEND_API void ggml_backend_cann_get_device_memory(int32_t device,
118118
size_t* free,
119119
size_t* total);
120120

include/ggml-cpu.h

Lines changed: 64 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -54,54 +54,77 @@ extern "C" {
5454
GGML_NUMA_STRATEGY_COUNT
5555
};
5656

57-
GGML_API void ggml_numa_init(enum ggml_numa_strategy numa); // call once for better performance on NUMA systems
58-
GGML_API bool ggml_is_numa(void); // true if init detected that system has >1 NUMA node
57+
GGML_BACKEND_API void ggml_numa_init(enum ggml_numa_strategy numa); // call once for better performance on NUMA systems
58+
GGML_BACKEND_API bool ggml_is_numa(void); // true if init detected that system has >1 NUMA node
5959

60-
GGML_API struct ggml_tensor * ggml_new_i32(struct ggml_context * ctx, int32_t value);
61-
GGML_API struct ggml_tensor * ggml_new_f32(struct ggml_context * ctx, float value);
60+
GGML_BACKEND_API struct ggml_tensor * ggml_new_i32(struct ggml_context * ctx, int32_t value);
61+
GGML_BACKEND_API struct ggml_tensor * ggml_new_f32(struct ggml_context * ctx, float value);
6262

63-
GGML_API struct ggml_tensor * ggml_set_i32 (struct ggml_tensor * tensor, int32_t value);
64-
GGML_API struct ggml_tensor * ggml_set_f32 (struct ggml_tensor * tensor, float value);
63+
GGML_BACKEND_API struct ggml_tensor * ggml_set_i32 (struct ggml_tensor * tensor, int32_t value);
64+
GGML_BACKEND_API struct ggml_tensor * ggml_set_f32 (struct ggml_tensor * tensor, float value);
6565

66-
GGML_API int32_t ggml_get_i32_1d(const struct ggml_tensor * tensor, int i);
67-
GGML_API void ggml_set_i32_1d(const struct ggml_tensor * tensor, int i, int32_t value);
66+
GGML_BACKEND_API int32_t ggml_get_i32_1d(const struct ggml_tensor * tensor, int i);
67+
GGML_BACKEND_API void ggml_set_i32_1d(const struct ggml_tensor * tensor, int i, int32_t value);
6868

69-
GGML_API int32_t ggml_get_i32_nd(const struct ggml_tensor * tensor, int i0, int i1, int i2, int i3);
70-
GGML_API void ggml_set_i32_nd(const struct ggml_tensor * tensor, int i0, int i1, int i2, int i3, int32_t value);
69+
GGML_BACKEND_API int32_t ggml_get_i32_nd(const struct ggml_tensor * tensor, int i0, int i1, int i2, int i3);
70+
GGML_BACKEND_API void ggml_set_i32_nd(const struct ggml_tensor * tensor, int i0, int i1, int i2, int i3, int32_t value);
7171

72-
GGML_API float ggml_get_f32_1d(const struct ggml_tensor * tensor, int i);
73-
GGML_API void ggml_set_f32_1d(const struct ggml_tensor * tensor, int i, float value);
72+
GGML_BACKEND_API float ggml_get_f32_1d(const struct ggml_tensor * tensor, int i);
73+
GGML_BACKEND_API void ggml_set_f32_1d(const struct ggml_tensor * tensor, int i, float value);
7474

75-
GGML_API float ggml_get_f32_nd(const struct ggml_tensor * tensor, int i0, int i1, int i2, int i3);
76-
GGML_API void ggml_set_f32_nd(const struct ggml_tensor * tensor, int i0, int i1, int i2, int i3, float value);
75+
GGML_BACKEND_API float ggml_get_f32_nd(const struct ggml_tensor * tensor, int i0, int i1, int i2, int i3);
76+
GGML_BACKEND_API void ggml_set_f32_nd(const struct ggml_tensor * tensor, int i0, int i1, int i2, int i3, float value);
7777

78-
GGML_API struct ggml_threadpool_params ggml_threadpool_params_default(int n_threads);
79-
GGML_API void ggml_threadpool_params_init (struct ggml_threadpool_params * p, int n_threads);
80-
GGML_API bool ggml_threadpool_params_match (const struct ggml_threadpool_params * p0, const struct ggml_threadpool_params * p1);
81-
GGML_API struct ggml_threadpool * ggml_threadpool_new (struct ggml_threadpool_params * params);
82-
GGML_API void ggml_threadpool_free (struct ggml_threadpool * threadpool);
83-
GGML_API int ggml_threadpool_get_n_threads(struct ggml_threadpool * threadpool);
84-
GGML_API void ggml_threadpool_pause (struct ggml_threadpool * threadpool);
85-
GGML_API void ggml_threadpool_resume (struct ggml_threadpool * threadpool);
78+
GGML_BACKEND_API struct ggml_threadpool_params ggml_threadpool_params_default(int n_threads);
79+
GGML_BACKEND_API void ggml_threadpool_params_init (struct ggml_threadpool_params * p, int n_threads);
80+
GGML_BACKEND_API bool ggml_threadpool_params_match (const struct ggml_threadpool_params * p0, const struct ggml_threadpool_params * p1);
81+
GGML_BACKEND_API struct ggml_threadpool * ggml_threadpool_new (struct ggml_threadpool_params * params);
82+
GGML_BACKEND_API void ggml_threadpool_free (struct ggml_threadpool * threadpool);
83+
GGML_BACKEND_API int ggml_threadpool_get_n_threads(struct ggml_threadpool * threadpool);
84+
GGML_BACKEND_API void ggml_threadpool_pause (struct ggml_threadpool * threadpool);
85+
GGML_BACKEND_API void ggml_threadpool_resume (struct ggml_threadpool * threadpool);
8686

8787
// ggml_graph_plan() has to be called before ggml_graph_compute()
8888
// when plan.work_size > 0, caller must allocate memory for plan.work_data
89-
GGML_API struct ggml_cplan ggml_graph_plan(
89+
GGML_BACKEND_API struct ggml_cplan ggml_graph_plan(
9090
const struct ggml_cgraph * cgraph,
9191
int n_threads, /* = GGML_DEFAULT_N_THREADS */
9292
struct ggml_threadpool * threadpool /* = NULL */ );
93-
GGML_API enum ggml_status ggml_graph_compute(struct ggml_cgraph * cgraph, struct ggml_cplan * cplan);
93+
GGML_BACKEND_API enum ggml_status ggml_graph_compute(struct ggml_cgraph * cgraph, struct ggml_cplan * cplan);
9494

9595
// same as ggml_graph_compute() but the work data is allocated as a part of the context
9696
// note: the drawback of this API is that you must have ensured that the context has enough memory for the work data
97-
GGML_API enum ggml_status ggml_graph_compute_with_ctx(struct ggml_context * ctx, struct ggml_cgraph * cgraph, int n_threads);
97+
GGML_BACKEND_API enum ggml_status ggml_graph_compute_with_ctx(struct ggml_context * ctx, struct ggml_cgraph * cgraph, int n_threads);
9898

99-
// TODO: move to backend interface
100-
GGML_API int ggml_cpu_has_neon (void);
101-
GGML_API int ggml_cpu_has_sve (void);
102-
GGML_API int ggml_cpu_has_matmul_int8(void);
103-
// get the sve vector length in bytes
104-
GGML_API int ggml_cpu_get_sve_cnt(void);
99+
//
100+
// system info
101+
//
102+
103+
// x86
104+
GGML_BACKEND_API int ggml_cpu_has_sse3 (void);
105+
GGML_BACKEND_API int ggml_cpu_has_ssse3 (void);
106+
GGML_BACKEND_API int ggml_cpu_has_avx (void);
107+
GGML_BACKEND_API int ggml_cpu_has_avx2 (void);
108+
GGML_BACKEND_API int ggml_cpu_has_f16c (void);
109+
GGML_BACKEND_API int ggml_cpu_has_fma (void);
110+
GGML_BACKEND_API int ggml_cpu_has_avx_vnni (void);
111+
GGML_BACKEND_API int ggml_cpu_has_avx512 (void);
112+
GGML_BACKEND_API int ggml_cpu_has_avx512_vbmi(void);
113+
GGML_BACKEND_API int ggml_cpu_has_avx512_vnni(void);
114+
GGML_BACKEND_API int ggml_cpu_has_avx512_bf16(void);
115+
GGML_BACKEND_API int ggml_cpu_has_amx_int8 (void);
116+
// ARM
117+
GGML_BACKEND_API int ggml_cpu_has_neon (void);
118+
GGML_BACKEND_API int ggml_cpu_has_arm_fma (void);
119+
GGML_BACKEND_API int ggml_cpu_has_fp16_va (void);
120+
GGML_BACKEND_API int ggml_cpu_has_matmul_int8(void);
121+
GGML_BACKEND_API int ggml_cpu_has_sve (void);
122+
GGML_BACKEND_API int ggml_cpu_get_sve_cnt (void); // sve vector length in bytes
123+
// other
124+
GGML_BACKEND_API int ggml_cpu_has_riscv_v (void);
125+
GGML_BACKEND_API int ggml_cpu_has_vsx (void);
126+
GGML_BACKEND_API int ggml_cpu_has_wasm_simd (void);
127+
GGML_BACKEND_API int ggml_cpu_has_llamafile (void);
105128

106129
// Internal types and functions exposed for tests and benchmarks
107130

@@ -115,6 +138,7 @@ extern "C" {
115138
const void * GGML_RESTRICT y, int nr, int nc);
116139

117140
struct ggml_type_traits_cpu {
141+
ggml_from_float_t from_float;
118142
ggml_from_float_to_mat_t from_float_to_mat;
119143
ggml_vec_dot_t vec_dot;
120144
enum ggml_type vec_dot_type;
@@ -124,25 +148,25 @@ extern "C" {
124148
ggml_gemm_t gemm;
125149
};
126150

127-
GGML_API const struct ggml_type_traits_cpu * ggml_get_type_traits_cpu(enum ggml_type type);
151+
GGML_BACKEND_API const struct ggml_type_traits_cpu * ggml_get_type_traits_cpu(enum ggml_type type);
128152

129-
GGML_API void ggml_cpu_init(void);
153+
GGML_BACKEND_API void ggml_cpu_init(void);
130154

131155
//
132156
// CPU backend
133157
//
134158

135-
GGML_API ggml_backend_t ggml_backend_cpu_init(void);
159+
GGML_BACKEND_API ggml_backend_t ggml_backend_cpu_init(void);
136160

137-
GGML_API bool ggml_backend_is_cpu (ggml_backend_t backend);
138-
GGML_API void ggml_backend_cpu_set_n_threads (ggml_backend_t backend_cpu, int n_threads);
139-
GGML_API void ggml_backend_cpu_set_threadpool (ggml_backend_t backend_cpu, ggml_threadpool_t threadpool);
140-
GGML_API void ggml_backend_cpu_set_abort_callback(ggml_backend_t backend_cpu, ggml_abort_callback abort_callback, void * abort_callback_data);
161+
GGML_BACKEND_API bool ggml_backend_is_cpu (ggml_backend_t backend);
162+
GGML_BACKEND_API void ggml_backend_cpu_set_n_threads (ggml_backend_t backend_cpu, int n_threads);
163+
GGML_BACKEND_API void ggml_backend_cpu_set_threadpool (ggml_backend_t backend_cpu, ggml_threadpool_t threadpool);
164+
GGML_BACKEND_API void ggml_backend_cpu_set_abort_callback(ggml_backend_t backend_cpu, ggml_abort_callback abort_callback, void * abort_callback_data);
141165

142-
GGML_API ggml_backend_reg_t ggml_backend_cpu_reg(void);
166+
GGML_BACKEND_API ggml_backend_reg_t ggml_backend_cpu_reg(void);
143167

144168
#ifdef GGML_USE_CPU_HBM
145-
GGML_API ggml_backend_buffer_type_t ggml_backend_cpu_hbm_buffer_type(void);
169+
GGML_BACKEND_API ggml_backend_buffer_type_t ggml_backend_cpu_hbm_buffer_type(void);
146170
#endif
147171

148172
#ifdef __cplusplus

include/ggml-cuda.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
extern "C" {
88
#endif
99

10-
#ifdef GGML_USE_HIPBLAS
10+
#ifdef GGML_USE_HIP
1111
#define GGML_CUDA_NAME "ROCm"
1212
#define GGML_CUBLAS_NAME "hipBLAS"
1313
#elif defined(GGML_USE_MUSA)
@@ -20,27 +20,27 @@ extern "C" {
2020
#define GGML_CUDA_MAX_DEVICES 16
2121

2222
// backend API
23-
GGML_API ggml_backend_t ggml_backend_cuda_init(int device);
23+
GGML_BACKEND_API ggml_backend_t ggml_backend_cuda_init(int device);
2424

25-
GGML_API bool ggml_backend_is_cuda(ggml_backend_t backend);
25+
GGML_BACKEND_API bool ggml_backend_is_cuda(ggml_backend_t backend);
2626

2727
// device buffer
28-
GGML_API ggml_backend_buffer_type_t ggml_backend_cuda_buffer_type(int device);
28+
GGML_BACKEND_API ggml_backend_buffer_type_t ggml_backend_cuda_buffer_type(int device);
2929

3030
// split tensor buffer that splits matrices by rows across multiple devices
31-
GGML_API ggml_backend_buffer_type_t ggml_backend_cuda_split_buffer_type(int main_device, const float * tensor_split);
31+
GGML_BACKEND_API ggml_backend_buffer_type_t ggml_backend_cuda_split_buffer_type(int main_device, const float * tensor_split);
3232

3333
// pinned host buffer for use with the CPU backend for faster copies between CPU and GPU
34-
GGML_API ggml_backend_buffer_type_t ggml_backend_cuda_host_buffer_type(void);
34+
GGML_BACKEND_API ggml_backend_buffer_type_t ggml_backend_cuda_host_buffer_type(void);
3535

36-
GGML_API int ggml_backend_cuda_get_device_count(void);
37-
GGML_API void ggml_backend_cuda_get_device_description(int device, char * description, size_t description_size);
38-
GGML_API void ggml_backend_cuda_get_device_memory(int device, size_t * free, size_t * total);
36+
GGML_BACKEND_API int ggml_backend_cuda_get_device_count(void);
37+
GGML_BACKEND_API void ggml_backend_cuda_get_device_description(int device, char * description, size_t description_size);
38+
GGML_BACKEND_API void ggml_backend_cuda_get_device_memory(int device, size_t * free, size_t * total);
3939

40-
GGML_API bool ggml_backend_cuda_register_host_buffer(void * buffer, size_t size);
41-
GGML_API void ggml_backend_cuda_unregister_host_buffer(void * buffer);
40+
GGML_BACKEND_API bool ggml_backend_cuda_register_host_buffer(void * buffer, size_t size);
41+
GGML_BACKEND_API void ggml_backend_cuda_unregister_host_buffer(void * buffer);
4242

43-
GGML_API ggml_backend_reg_t ggml_backend_cuda_reg(void);
43+
GGML_BACKEND_API ggml_backend_reg_t ggml_backend_cuda_reg(void);
4444

4545
#ifdef __cplusplus
4646
}

include/ggml-kompute.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ struct ggml_vk_device ggml_vk_current_device(void);
3737
// forward declaration
3838
typedef struct ggml_backend * ggml_backend_t;
3939

40-
GGML_API ggml_backend_t ggml_backend_kompute_init(int device);
40+
GGML_BACKEND_API ggml_backend_t ggml_backend_kompute_init(int device);
4141

42-
GGML_API bool ggml_backend_is_kompute(ggml_backend_t backend);
42+
GGML_BACKEND_API bool ggml_backend_is_kompute(ggml_backend_t backend);
4343

44-
GGML_API ggml_backend_buffer_type_t ggml_backend_kompute_buffer_type(int device);
44+
GGML_BACKEND_API ggml_backend_buffer_type_t ggml_backend_kompute_buffer_type(int device);
4545

46-
GGML_API ggml_backend_reg_t ggml_backend_kompute_reg(void);
46+
GGML_BACKEND_API ggml_backend_reg_t ggml_backend_kompute_reg(void);
4747

4848
#ifdef __cplusplus
4949
}

0 commit comments

Comments
 (0)