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/1.7.4+95~41 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=ba523d5e224ba2fae1871787e21f48d8f1b26a17;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp vulkan: sort shaders for more deterministic binary (llama/11315) Fixes #11306. --- diff --git a/ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp b/ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp index 8bcb6410..e9c6cb9d 100644 --- a/ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp +++ b/ggml/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