Skip to content

Commit e1349f4

Browse files
committed
vulkan: sort shaders for more deterministic binary
Fixes #11306.
1 parent 9f7add1 commit e1349f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
#include <cstring>
1818
#include <cstdlib>
1919
#include <cassert>
20+
#include <algorithm>
2021
#include <sys/stat.h>
2122
#include <sys/types.h>
2223

2324
#ifdef _WIN32
2425
#include <windows.h>
2526
#include <direct.h> // For _mkdir on Windows
26-
#include <algorithm> // For std::replace on w64devkit
2727
#else
2828
#include <unistd.h>
2929
#include <sys/wait.h>
@@ -499,6 +499,7 @@ void write_output_files() {
499499
fprintf(hdr, "#include <cstdint>\n\n");
500500
fprintf(src, "#include \"%s\"\n\n", basename(target_hpp).c_str());
501501

502+
std::sort(shader_fnames.begin(), shader_fnames.end());
502503
for (const auto& pair : shader_fnames) {
503504
const std::string& name = pair.first;
504505
#ifdef _WIN32

0 commit comments

Comments
 (0)