@@ -326,18 +326,16 @@ extern "C" {
326326 // get ggml_status name string
327327 GGML_API GGML_CALL const char * ggml_status_to_string (enum ggml_status status );
328328
329+ // ieee 754-2008 half-precision float16
330+ // todo: make this not an integral type
329331 typedef uint16_t ggml_fp16_t ;
332+ GGML_API float ggml_fp16_to_fp32 (ggml_fp16_t );
333+ GGML_API ggml_fp16_t ggml_fp32_to_fp16 (float );
334+ GGML_API void ggml_fp16_to_fp32_row (const ggml_fp16_t * , float * , int64_t );
335+ GGML_API void ggml_fp32_to_fp16_row (const float * , ggml_fp16_t * , int64_t );
330336
331- // convert FP16 <-> FP32
332- GGML_API float ggml_fp16_to_fp32 (ggml_fp16_t x );
333- GGML_API ggml_fp16_t ggml_fp32_to_fp16 (float x );
334-
335- GGML_API void ggml_fp16_to_fp32_row (const ggml_fp16_t * x , float * y , int64_t n );
336- GGML_API void ggml_fp32_to_fp16_row (const float * x , ggml_fp16_t * y , int64_t n );
337-
338- // bfloat16
339- struct ggml_bf16_s ;
340- typedef struct ggml_bf16_s ggml_bf16_t ;
337+ // google brain half-precision bfloat16
338+ typedef struct { uint16_t bits ; } ggml_bf16_t ;
341339 GGML_API ggml_bf16_t ggml_fp32_to_bf16 (float );
342340 GGML_API float ggml_bf16_to_fp32 (ggml_bf16_t ); // consider just doing << 16
343341 GGML_API void ggml_bf16_to_fp32_row (const ggml_bf16_t * , float * , int64_t );
0 commit comments