@@ -2149,11 +2149,11 @@ static void ggml_vk_create_pipeline_func(vk_device& device, vk_pipeline& pipelin
21492149
21502150 // Patch SPIR-V to enable RTE rounding for FP16, avoiding the need for
21512151 // separate shader variants compiled with -DRTE16.
2152- std::vector<uint32_t> spv ;
2152+ std::vector<uint32_t> spirv ;
21532153 if (device->float_controls_rte_fp16) {
21542154 const uint32_t* spv_words = reinterpret_cast<const uint32_t *>(spv_data);
21552155 size_t word_count = spv_size / sizeof(uint32_t);
2156- spv .assign(spv_words, spv_words + word_count);
2156+ spirv .assign(spv_words, spv_words + word_count);
21572157
21582158 // Find insertion points respecting SPIR-V layout order:
21592159 // Header(5) -> OpCapability -> OpExtension -> ... -> OpEntryPoint -> OpExecutionMode -> ...
@@ -2163,9 +2163,9 @@ static void ggml_vk_create_pipeline_func(vk_device& device, vk_pipeline& pipelin
21632163 size_t exec_insert_pos = pos;
21642164 uint32_t entry_point_id = 0;
21652165
2166- while (pos < spv .size()) {
2167- uint32_t opcode = spv [pos] & spv::OpCodeMask;
2168- uint32_t len = spv [pos] >> spv::WordCountShift;
2166+ while (pos < spirv .size()) {
2167+ uint32_t opcode = spirv [pos] & spv::OpCodeMask;
2168+ uint32_t len = spirv [pos] >> spv::WordCountShift;
21692169 if (len == 0) break;
21702170
21712171 if (opcode == spv::OpCapability) {
@@ -2174,7 +2174,7 @@ static void ggml_vk_create_pipeline_func(vk_device& device, vk_pipeline& pipelin
21742174 } else if (opcode == spv::OpExtension) {
21752175 ext_insert_pos = pos + len;
21762176 } else if (opcode == spv::OpEntryPoint) {
2177- entry_point_id = spv [pos + 2];
2177+ entry_point_id = spirv [pos + 2];
21782178 exec_insert_pos = pos + len;
21792179 } else if (opcode == spv::OpExecutionMode || opcode == spv::OpExecutionModeId) {
21802180 exec_insert_pos = pos + len;
@@ -2189,21 +2189,21 @@ static void ggml_vk_create_pipeline_func(vk_device& device, vk_pipeline& pipelin
21892189
21902190 // OpExecutionMode %entrypoint RoundingModeRTE 16
21912191 uint32_t exec_mode[] = { (4u << spv::WordCountShift) | spv::OpExecutionMode, entry_point_id, spv::ExecutionModeRoundingModeRTE, 16 };
2192- spv .insert(spv .begin() + exec_insert_pos, std::begin(exec_mode), std::end(exec_mode));
2192+ spirv .insert(spirv .begin() + exec_insert_pos, std::begin(exec_mode), std::end(exec_mode));
21932193
21942194 // OpExtension "SPV_KHR_float_controls"
21952195 const char ext_str[] = "SPV_KHR_float_controls";
21962196 size_t ext_str_words = CEIL_DIV(sizeof(ext_str), sizeof(uint32_t));
21972197 std::vector<uint32_t> extension(1 + ext_str_words, 0);
21982198 extension[0] = (uint32_t)((1 + ext_str_words) << spv::WordCountShift) | spv::OpExtension;
21992199 memcpy(&extension[1], ext_str, sizeof(ext_str));
2200- spv .insert(spv .begin() + ext_insert_pos, extension.begin(), extension.end());
2200+ spirv .insert(spirv .begin() + ext_insert_pos, extension.begin(), extension.end());
22012201
22022202 // OpCapability RoundingModeRTE
22032203 uint32_t capability[] = { (2u << spv::WordCountShift) | spv::OpCapability, spv::CapabilityRoundingModeRTE };
2204- spv .insert(spv .begin() + cap_insert_pos, std::begin(capability), std::end(capability));
2204+ spirv .insert(spirv .begin() + cap_insert_pos, std::begin(capability), std::end(capability));
22052205
2206- shader_module_create_info = vk::ShaderModuleCreateInfo({}, spv .size() * sizeof(uint32_t), spv .data());
2206+ shader_module_create_info = vk::ShaderModuleCreateInfo({}, spirv .size() * sizeof(uint32_t), spirv .data());
22072207 }
22082208
22092209 pipeline->shader_module = device->device.createShaderModule(shader_module_create_info);
0 commit comments