Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


#include <iostream>
#include <fstream>
#include <sstream>
Expand All @@ -22,6 +20,7 @@
#include <sys/types.h>

#ifdef _WIN32
#define NOMINMAX
#include <windows.h>
#include <direct.h> // For _mkdir on Windows
#else
Expand Down Expand Up @@ -306,7 +305,7 @@ using compile_count_guard = std::unique_ptr<uint32_t, decltype(&decrement_compil
compile_count_guard acquire_compile_slot() {
// wait until fewer than N compiles are in progress.
// 16 is an arbitrary limit, the goal is to avoid "failed to create pipe" errors.
uint32_t N = 16;
uint32_t N = std::max(1u, std::min(16u, std::thread::hardware_concurrency()));
std::unique_lock<std::mutex> guard(compile_count_mutex);
compile_count_cond.wait(guard, [N] { return compile_count < N; });
compile_count++;
Expand Down
Loading