]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
ggml : fix SHARED build
authorGeorgi Gerganov <redacted>
Sat, 29 Apr 2023 16:13:53 +0000 (19:13 +0300)
committerGeorgi Gerganov <redacted>
Sat, 29 Apr 2023 16:13:53 +0000 (19:13 +0300)
include/ggml/ggml.h
src/CMakeLists.txt
src/ggml.c

index 38ae9a6eeeb71b29cb40a8e318ef3319334c3b0c..c1c5495c63f44cbe8669bf4a48a4fd419cd5c760 100644 (file)
@@ -701,8 +701,8 @@ extern "C" {
             struct ggml_tensor  * c1);
 
     // Mapping operations
-    GGML_API typedef void (*ggml_unary_op_f32_t)(const int, float *, const float *);
-    GGML_API typedef void (*ggml_binary_op_f32_t)(const int, float *, const float *, const float *);
+    typedef void (*ggml_unary_op_f32_t)(const int, float *, const float *);
+    typedef void (*ggml_binary_op_f32_t)(const int, float *, const float *, const float *);
 
     GGML_API struct ggml_tensor * ggml_map_unary_f32(
             struct ggml_context        * ctx,
index c37540408bce617c5f1867644c8aedc0cc43d70e..26f14b1f5242e94058de4afdd944ac4d93e624d5 100644 (file)
@@ -212,6 +212,10 @@ if (BUILD_SHARED_LIBS)
     target_compile_definitions(${TARGET} PUBLIC
         GGML_SHARED
         )
+
+    target_compile_definitions(${TARGET} PRIVATE
+        GGML_BUILD
+        )
 endif()
 
 target_compile_definitions(${TARGET} PUBLIC
index 6b9237186572f0f4387806ea1f6ab4479efc0257..ebbaf11c620cc87fb661d400979d89b3f5d2c058 100644 (file)
@@ -9124,7 +9124,7 @@ static void ggml_compute_forward_alibi_f32(
     //const int nb3 = src0->nb[3];
 
     assert(nb0 == sizeof(float));
-    assert(ne1+n_past == ne0);
+    assert(ne1 + n_past == ne0); (void) n_past;
 
     // add alibi to src0 (KQ_scaled)
     const int n_heads_log2_floor = 1 << (int) floor(log2(n_head));
@@ -9185,7 +9185,7 @@ static void ggml_compute_forward_alibi_f16(
     //const int nb3 = src0->nb[3];
 
     assert(nb0 == sizeof(ggml_fp16_t));
-    assert(ne1+n_past == ne0);
+    assert(ne1 + n_past == ne0); (void) n_past;
 
     // add alibi to src0 (KQ_scaled)
     const int n_heads_log2_floor = 1 << (int) floor(log2(n_head));