File tree Expand file tree Collapse file tree 2 files changed +88
-851
lines changed Expand file tree Collapse file tree 2 files changed +88
-851
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,14 @@ static inline float bf16_to_f32(ggml_bf16_t x) {
2828 return GGML_BF16_TO_FP32 (x);
2929}
3030
31+ static inline float i32_to_f32 (int32_t x) {
32+ return x;
33+ }
34+
35+ static inline int32_t f32_to_i32 (float x) {
36+ return x;
37+ }
38+
3139static inline float f32_to_f32 (float x) {
3240 return x;
3341}
@@ -54,6 +62,12 @@ struct type_conversion_table<ggml_bf16_t> {
5462 static constexpr ggml_bf16_t (*from_f32)(float ) = f32_to_bf16;
5563};
5664
65+ template <>
66+ struct type_conversion_table <int32_t > {
67+ static constexpr float (*to_f32)(int32_t ) = i32_to_f32;
68+ static constexpr int32_t (*from_f32)(float ) = f32_to_i32;
69+ };
70+
5771static std::pair<int64_t , int64_t > get_thread_range (const struct ggml_compute_params * params, const struct ggml_tensor * src0) {
5872 const int64_t ith = params->ith ;
5973 const int64_t nth = params->nth ;
You can’t perform that action at this time.
0 commit comments