Skip to content

Commit 12e98f6

Browse files
jeffbolznvmglambda
authored andcommitted
vulkan: sort shaders for more deterministic binary (ggml-org#11315)
Fixes ggml-org#11306.
1 parent 8b3e172 commit 12e98f6

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>
@@ -502,6 +502,7 @@ void write_output_files() {
502502
fprintf(hdr, "#include <cstdint>\n\n");
503503
fprintf(src, "#include \"%s\"\n\n", basename(target_hpp).c_str());
504504

505+
std::sort(shader_fnames.begin(), shader_fnames.end());
505506
for (const auto& pair : shader_fnames) {
506507
const std::string& name = pair.first;
507508
#ifdef _WIN32

0 commit comments

Comments
 (0)