From: Jeff Bolz Date: Thu, 23 Jan 2025 07:07:50 +0000 (-0600) Subject: vulkan: sort shaders for more deterministic binary (llama/11315) X-Git-Tag: upstream/0.0.1689~36 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=59933b4aacd294e09bc0ed885cea33182aa5a444;p=pkg%2Fggml%2Fsources%2Fggml vulkan: sort shaders for more deterministic binary (llama/11315) Fixes #11306. --- diff --git a/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp b/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp index 8bcb6410..e9c6cb9d 100644 --- a/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp +++ b/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp @@ -17,13 +17,13 @@ #include #include #include +#include #include #include #ifdef _WIN32 #include #include // For _mkdir on Windows - #include // For std::replace on w64devkit #else #include #include @@ -502,6 +502,7 @@ void write_output_files() { fprintf(hdr, "#include \n\n"); fprintf(src, "#include \"%s\"\n\n", basename(target_hpp).c_str()); + std::sort(shader_fnames.begin(), shader_fnames.end()); for (const auto& pair : shader_fnames) { const std::string& name = pair.first; #ifdef _WIN32