|
13 | 13 |
|
14 | 14 | #include "ggml-alloc.h" |
15 | 15 | #include "ggml-backend.h" |
| 16 | +#include "ggml-cpu.h" |
16 | 17 | #include "ggml.h" |
17 | 18 |
|
18 | 19 | #include "stable-diffusion.h" |
@@ -733,25 +734,25 @@ void convert_tensor(void* src, |
733 | 734 | if (src_type == GGML_TYPE_F16) { |
734 | 735 | ggml_fp16_to_fp32_row((ggml_fp16_t*)src, (float*)dst, n); |
735 | 736 | } else { |
736 | | - auto qtype = ggml_internal_get_type_traits(src_type); |
737 | | - if (qtype.to_float == NULL) { |
| 737 | + auto qtype = ggml_get_type_traits(src_type); |
| 738 | + if (qtype->to_float == NULL) { |
738 | 739 | throw std::runtime_error(format("type %s unsupported for integer quantization: no dequantization available", |
739 | 740 | ggml_type_name(src_type))); |
740 | 741 | } |
741 | | - qtype.to_float(src, (float*)dst, n); |
| 742 | + qtype->to_float(src, (float*)dst, n); |
742 | 743 | } |
743 | 744 | } else { |
744 | 745 | // src_type == GGML_TYPE_F16 => dst_type is quantized |
745 | 746 | // src_type is quantized => dst_type == GGML_TYPE_F16 or dst_type is quantized |
746 | | - auto qtype = ggml_internal_get_type_traits(src_type); |
747 | | - if (qtype.to_float == NULL) { |
| 747 | + auto qtype = ggml_get_type_traits(src_type); |
| 748 | + if (qtype->to_float == NULL) { |
748 | 749 | throw std::runtime_error(format("type %s unsupported for integer quantization: no dequantization available", |
749 | 750 | ggml_type_name(src_type))); |
750 | 751 | } |
751 | 752 | std::vector<char> buf; |
752 | 753 | buf.resize(sizeof(float) * n); |
753 | 754 | char* src_data_f32 = buf.data(); |
754 | | - qtype.to_float(src, (float*)src_data_f32, n); |
| 755 | + qtype->to_float(src, (float*)src_data_f32, n); |
755 | 756 | if (dst_type == GGML_TYPE_F16) { |
756 | 757 | ggml_fp32_to_fp16_row((float*)src_data_f32, (ggml_fp16_t*)dst, n); |
757 | 758 | } else { |
|
0 commit comments