From 060e57a327f6c79a04828f773ee27e12d9dce7c6 Mon Sep 17 00:00:00 2001 From: Molly Sophia Date: Sat, 28 Dec 2024 19:24:17 +0800 Subject: [PATCH] Fix cuda warning Signed-off-by: Molly Sophia --- ggml/src/ggml-cuda/gla.cu | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ggml/src/ggml-cuda/gla.cu b/ggml/src/ggml-cuda/gla.cu index c18d628587759f..3debbf933175ac 100644 --- a/ggml/src/ggml-cuda/gla.cu +++ b/ggml/src/ggml-cuda/gla.cu @@ -73,7 +73,8 @@ void ggml_cuda_op_gated_linear_attn(ggml_backend_cuda_context & ctx, ggml_tensor const int64_t C = dst->ne[0]; const int64_t H = dst->src[0]->ne[1]; - const float scale = ((const float*)(dst->op_params))[0]; + float scale; + memcpy(&scale, (float*)dst->op_params, sizeof(float)); float * dst_d = (float *)dst->data;