Skip to content

Commit d4f78de

Browse files
committed
fix cuda
1 parent f3b489b commit d4f78de

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ggml/src/ggml-cuda/convert.cuh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ template<typename dst_t, typename src_t>
3939
} else if constexpr(std::is_same_v<src_t, nv_bfloat16>) {
4040
return __bfloat162float(x);
4141
} else if constexpr(std::is_same_v<dst_t, int32_t>) {
42-
return __float2int_rd(x);
43-
} else if constexpr(std::is_same_v<src_t, int32_t>) {
44-
return __int2float_rd(x);
42+
return int32_t(x);
4543
} else {
4644
return float(x);
4745
}

ggml/src/ggml-cuda/ggml-cuda.cu

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3458,6 +3458,12 @@ static bool ggml_backend_cuda_device_supports_op(ggml_backend_dev_t dev, const g
34583458
if (src0_type == GGML_TYPE_F32 && src1_type == GGML_TYPE_IQ4_NL) {
34593459
return true;
34603460
}
3461+
if (src0_type == GGML_TYPE_F32 && src1_type == GGML_TYPE_I32) {
3462+
return true;
3463+
}
3464+
if (src0_type == GGML_TYPE_I32 && src1_type == GGML_TYPE_F32) {
3465+
return true;
3466+
}
34613467
if (src0_type == src1_type && ggml_is_contiguous(op->src[0]) && ggml_is_contiguous(op->src[1])) {
34623468
return true;
34633469
}

0 commit comments

Comments
 (0)