Skip to content

Commit 5f2a09a

Browse files
committed
ggml-cpu: extern c ggml_table_f32_f16 + chore docs
Signed-off-by: Aaron Teo <[email protected]>
1 parent 6cebee2 commit 5f2a09a

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

ggml/src/ggml-cpu/ggml-cpu.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3460,13 +3460,6 @@ int ggml_cpu_has_sme(void) {
34603460
}
34613461

34623462
void ggml_cpu_init(void) {
3463-
// needed to initialize f16 tables
3464-
{
3465-
struct ggml_init_params params = { 0, NULL, false };
3466-
struct ggml_context * ctx = ggml_init(params);
3467-
ggml_free(ctx);
3468-
}
3469-
34703463
ggml_critical_section_start();
34713464

34723465
static bool is_first_call = true;

ggml/src/ggml-cpu/simd-mappings.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,12 @@
138138
#endif
139139

140140
// precomputed f32 table for f16 (256 KB)
141-
// defined in ggml.c, initialized in ggml_init()
142-
GGML_API float ggml_table_f32_f16[1 << 16];
141+
// defined in ggml-cpu.c, initialized in ggml_cpu_init()
142+
#ifdef __cplusplus
143+
extern "C" float ggml_table_f32_f16[1 << 16];
144+
#else
145+
extern float ggml_table_f32_f16[1 << 16];
146+
#endif
143147

144148
// On ARM NEON, it's quicker to directly convert x -> x instead of calling into ggml_lookup_fp16_to_fp32,
145149
// so we define GGML_CPU_FP16_TO_FP32 and GGML_CPU_FP32_TO_FP16 elsewhere for NEON.

0 commit comments

Comments
 (0)