From ca4ec6d867db7ddc9f5f01f4eec0a9c64812c858 Mon Sep 17 00:00:00 2001 From: zhangjidong <1119708529@qq.com> Date: Tue, 30 Jan 2024 22:14:50 +0800 Subject: [PATCH] Add assert in ggml_cuda_op_pool2d --- ggml-cuda.cu | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ggml-cuda.cu b/ggml-cuda.cu index ed79f6abf..00f64a59e 100644 --- a/ggml-cuda.cu +++ b/ggml-cuda.cu @@ -8723,6 +8723,9 @@ static void ggml_cuda_op_pool2d( const ggml_tensor * src0, const ggml_tensor * src1, ggml_tensor * dst, const float * src0_dd, const float * src1_dd, float * dst_dd, cudaStream_t main_stream) { + GGML_ASSERT(src0->type == GGML_TYPE_F32); + GGML_ASSERT( dst->type == GGML_TYPE_F32); + const int32_t * opts = (const int32_t *)dst->op_params; enum ggml_op_pool op = static_cast(opts[0]); const int k0 = opts[1];