|
|
|
@ -140,9 +140,6 @@ ggml_fp16_t ggml_fp32_to_fp16(float x) {
|
|
|
|
|
#include <immintrin.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// FP16 <-> FP32
|
|
|
|
|
// ref: https://github.com/Maratyszcza/FP16
|
|
|
|
|
|
|
|
|
|
#ifdef __F16C__
|
|
|
|
|
float ggml_fp16_to_fp32(ggml_fp16_t h) {
|
|
|
|
|
return _cvtsh_ss(h);
|
|
|
|
@ -156,6 +153,9 @@ ggml_fp16_t ggml_fp32_to_fp16(float f) {
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
// FP16 <-> FP32
|
|
|
|
|
// ref: https://github.com/Maratyszcza/FP16
|
|
|
|
|
|
|
|
|
|
static inline float fp32_from_bits(uint32_t w) {
|
|
|
|
|
union {
|
|
|
|
|
uint32_t as_bits;
|
|
|
|
|