From: Jeff Bolz Date: Mon, 18 Nov 2024 14:28:42 +0000 (-0600) Subject: vulkan: remove use of null initializer (llama/10372) X-Git-Tag: upstream/1.7.4~182 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=48862c7b272a58a57434a3c6339e3ae53c8e8ef0;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp vulkan: remove use of null initializer (llama/10372) Seems like this isn't working for vulkan-over-metal when the array is sized by a spec constant. Maybe a spirv-cross limitation? --- diff --git a/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec.comp b/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec.comp index ddbac5d2..970aac6e 100644 --- a/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec.comp +++ b/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec.comp @@ -5,8 +5,6 @@ #endif #extension GL_EXT_shader_explicit_arithmetic_types_int32 : require -#extension GL_EXT_null_initializer : enable - #include "mul_mat_vec_base.comp" layout(local_size_x_id = 0, local_size_y = 1, local_size_z = 1) in; @@ -57,7 +55,11 @@ void compute_outputs(const uint32_t first_row, const uint32_t num_rows) { y_offset = QUANT_R == 1 ? 1 : QUANT_K/2; - FLOAT_TYPE temp[NUM_ROWS] = {}; + FLOAT_TYPE temp[NUM_ROWS]; + + for (uint i = 0; i < NUM_ROWS; ++i) { + temp[i] = FLOAT_TYPE(0); + } const int unroll_count = 8;