diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-06-10 15:49:59 +0200 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-06-14 08:27:03 +0200 |
| commit | 7fe02715aac68b958250b43f9d48d641af0a045c (patch) | |
| tree | 7bc866f87999991ef0a3ffa0dd36ce91444e5172 /qwen_kernels.h | |
| parent | e8259865f41ceb50dd28b267186d11c62a465135 (diff) | |
| download | ffwd-7fe02715aac68b958250b43f9d48d641af0a045c.tar.gz ffwd-7fe02715aac68b958250b43f9d48d641af0a045c.zip | |
build: export only the public API from the shared library
Diffstat (limited to 'qwen_kernels.h')
| -rw-r--r-- | qwen_kernels.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/qwen_kernels.h b/qwen_kernels.h index fd23c02..9b8156c 100644 --- a/qwen_kernels.h +++ b/qwen_kernels.h @@ -7,6 +7,17 @@ #ifndef QWEN_KERNELS_H #define QWEN_KERNELS_H +/* Public-API export annotation. The libraries are built with + * -fvisibility=hidden, so only declarations carrying PPLX_API are exported + * from the shared library; everything else stays internal. */ +#ifndef PPLX_API +#if defined(__GNUC__) +#define PPLX_API __attribute__((visibility("default"))) +#else +#define PPLX_API +#endif +#endif + #include <stddef.h> #include <stdint.h> @@ -131,12 +142,12 @@ void qwen_apply_rope_neox(float *x, const float *cos_vals, const float *sin_vals /* Set number of threads for parallel operations (default: 1). * Creates a persistent thread pool. Call before inference. */ -void qwen_set_threads(int n); +PPLX_API void qwen_set_threads(int n); /* Get number of available CPU cores */ -int qwen_get_num_cpus(void); +PPLX_API int qwen_get_num_cpus(void); /* Global verbose flag */ -extern int qwen_verbose; +PPLX_API extern int qwen_verbose; #endif /* QWEN_KERNELS_H */ |
