From d75c1516245ee145f1b2defb3dc8702f7cb28a11 Mon Sep 17 00:00:00 2001 From: Saood Karim Date: Mon, 21 Apr 2025 01:56:05 -0500 Subject: [PATCH] Attempt fix 13 --- ggml/src/iqk/iqk_config.h | 14 +++++++++++--- ggml/src/iqk/iqk_flash_attn.cpp | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ggml/src/iqk/iqk_config.h b/ggml/src/iqk/iqk_config.h index 2c264c2d..3d8238d7 100644 --- a/ggml/src/iqk/iqk_config.h +++ b/ggml/src/iqk/iqk_config.h @@ -14,10 +14,18 @@ #define IQK_IMPLEMENT #endif -#if defined(_WIN32) && !defined(__MINGW32__) -#define IQK_API __declspec(dllexport) +#ifdef GGML_SHARED +# if defined(_WIN32) && !defined(__MINGW32__) +# ifdef GGML_BUILD +# define IQK_API __declspec(dllexport) +# else +# define IQK_API __declspec(dllimport) +# endif +# else +# define IQK_API __attribute__ ((visibility ("default"))) +# endif #else -#define IQK_API __attribute__ ((visibility ("default"))) +# define IQK_API #endif #ifdef _MSC_VER diff --git a/ggml/src/iqk/iqk_flash_attn.cpp b/ggml/src/iqk/iqk_flash_attn.cpp index 02fe57fd..639b79af 100644 --- a/ggml/src/iqk/iqk_flash_attn.cpp +++ b/ggml/src/iqk/iqk_flash_attn.cpp @@ -29,7 +29,7 @@ inline uint32_t simple_gcd(uint32_t a, uint32_t b) { // TODO: get the ggml_type enum here without polution // -extern "C" IQK_API bool iqk_flash_attn_noalibi(int type_q, int type_mask, float max_bias, +extern "C" IQK_API bool iqk_flash_attn_noalibi(int type_q, int type_mask, float max_bias, int neq3, int neq2, long nbq3, long nbq2, int nek3, int nek2, long nbk3, long nbk2, int nev3, int nev2, long nbv3, long nbv2, @@ -253,7 +253,7 @@ extern "C" IQK_API bool iqk_flash_attn_noalibi(int type_q, int type_mask, float #else -extern "C" IQK_API bool iqk_flash_attn_noalibi([[maybe_unused]] int type_q, [[maybe_unused]] int type_mask, [[maybe_unused]] float max_bias, +bool iqk_flash_attn_noalibi([[maybe_unused]] int type_q, [[maybe_unused]] int type_mask, [[maybe_unused]] float max_bias, [[maybe_unused]] int neq3, [[maybe_unused]] int neq2, [[maybe_unused]] long nbq3, [[maybe_unused]] long nbq2, [[maybe_unused]] int nek3, [[maybe_unused]] int nek2, [[maybe_unused]] long nbk3, [[maybe_unused]] long nbk2, [[maybe_unused]] int nev3, [[maybe_unused]] int nev2, [[maybe_unused]] long nbv3, [[maybe_unused]] long nbv2,