]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
vulkan: sort shaders for more deterministic binary (#11315)
authorJeff Bolz <redacted>
Thu, 23 Jan 2025 07:07:50 +0000 (01:07 -0600)
committerGitHub <redacted>
Thu, 23 Jan 2025 07:07:50 +0000 (08:07 +0100)
Fixes #11306.

ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp

index 8bcb64101b150428e316257da54ca64414c85f63..e9c6cb9d45da59872138ade3c73f60e66913f301 100644 (file)
 #include <cstring>
 #include <cstdlib>
 #include <cassert>
+#include <algorithm>
 #include <sys/stat.h>
 #include <sys/types.h>
 
 #ifdef _WIN32
     #include <windows.h>
     #include <direct.h> // For _mkdir on Windows
-    #include <algorithm> // For std::replace on w64devkit
 #else
     #include <unistd.h>
     #include <sys/wait.h>
@@ -502,6 +502,7 @@ void write_output_files() {
     fprintf(hdr, "#include <cstdint>\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