From 91654ff042a1c42546811be3cdb71af5f2b0a1fd Mon Sep 17 00:00:00 2001 From: Jared Van Bortel Date: Thu, 25 Jan 2024 17:03:06 -0500 Subject: [PATCH] kompute : fix a -Wstrict-aliasing warning --- ggml-kompute.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ggml-kompute.cpp b/ggml-kompute.cpp index 8fd956e9d..31c6f0d90 100644 --- a/ggml-kompute.cpp +++ b/ggml-kompute.cpp @@ -1527,7 +1527,8 @@ void ggml_vk_graph_compute(struct ggml_kompute_context * ctx, struct ggml_cgraph } break; case GGML_OP_SOFT_MAX: { - const float scale = ((float *) dst->op_params)[0]; + float scale; + memcpy(&scale, dst->op_params, sizeof(float)); ggml_vk_soft_max(seq, id_src0, id_src1, id_dst, off_src0, off_src1, off_dst, ne00, ne01, ne02, ne03, scale); } break; case GGML_OP_DIAG_MASK_INF: