mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-10-01 02:17:42 -05:00
ggml : fix c++ odr by properly using GGML_COMMON_DECL_CPP (#29504)
* fix c++ odr by properly using GGML_COMMON_DECL_CPP * using actual field rather than macro Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> --------- Co-authored-by: XZiar <xziar@xziar.xziar> Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
This commit is contained in:
co-authored by
Georgi Gerganov
XZiar
parent
a3f84faf49
commit
da89bb3ccc
@@ -9,7 +9,7 @@
|
||||
// bit unpacking routines: tiled_unpk_nib4, tiled_unpk_2bit, tiled_unpk_or
|
||||
// LUT value expansion routines: tiled_lut8, tiled_unpk_sign32, tiled_unpk_tern8
|
||||
|
||||
#define GGML_COMMON_DECL_C
|
||||
#define GGML_COMMON_DECL_CPP
|
||||
#include "ggml-common.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -35,8 +35,8 @@ static void tiled_unpack_src0(const block_q4_K * rows, int64_t row_stride, int n
|
||||
const int s_off = r * nb_stride + slab * NB;
|
||||
const block_q4_K & x = rows[r * row_stride + slab];
|
||||
|
||||
tile->d[d_off] = ggml_fp16_to_fp32(x.d);
|
||||
tile->dmin[d_off] = ggml_fp16_to_fp32(x.dmin);
|
||||
tile->d[d_off] = ggml_fp16_to_fp32(x.data.data.d);
|
||||
tile->dmin[d_off] = ggml_fp16_to_fp32(x.data.data.dmin);
|
||||
|
||||
uint32_t utmp[4];
|
||||
memcpy(utmp, x.scales, 12);
|
||||
@@ -80,8 +80,8 @@ static void tiled_unpack_src0(const block_q5_K * rows, int64_t row_stride, int n
|
||||
const int s_off = r * nb_stride + slab * NB;
|
||||
const block_q5_K & x = rows[r * row_stride + slab];
|
||||
|
||||
tile->d[d_off] = ggml_fp16_to_fp32(x.d);
|
||||
tile->dmin[d_off] = ggml_fp16_to_fp32(x.dmin);
|
||||
tile->d[d_off] = ggml_fp16_to_fp32(x.data.data.d);
|
||||
tile->dmin[d_off] = ggml_fp16_to_fp32(x.data.data.dmin);
|
||||
|
||||
uint32_t utmp[4];
|
||||
memcpy(utmp, x.scales, 12);
|
||||
@@ -207,8 +207,8 @@ static void tiled_unpack_src0(const block_q2_K * rows, int64_t row_stride, int n
|
||||
const int q_off = r * qk_stride + slab * TILED_TILE_K;
|
||||
const int s_off = r * nb_stride + slab * NB;
|
||||
const block_q2_K & x = rows[r * row_stride + slab];
|
||||
tile->d[d_off] = ggml_fp16_to_fp32(x.d);
|
||||
tile->dmin[d_off] = ggml_fp16_to_fp32(x.dmin);
|
||||
tile->d[d_off] = ggml_fp16_to_fp32(x.data.data.d);
|
||||
tile->dmin[d_off] = ggml_fp16_to_fp32(x.data.data.dmin);
|
||||
|
||||
// 2-bit code: element e -> half=e>>7, el=e&127
|
||||
// byte = half*32 + (el & 31), shift = 2*(el >> 5)
|
||||
|
||||
Reference in New Issue
Block a user