Skip to content

Commit 097fed3

Browse files
authored
fix windows compile and 0 thread case
1 parent 254abe1 commit 097fed3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ void string_to_spv(const std::string& _name, const std::string& in_fname, const
305305
{
306306
// wait until fewer than N compiles are in progress.
307307
// 16 is an arbitrary limit, the goal is to avoid "failed to create pipe" errors.
308-
uint32_t N = std::min(16u, std::thread::hardware_concurrency());
308+
uint32_t N = (std::max)(1u, (std::min)(16u, std::thread::hardware_concurrency()));
309309
std::unique_lock<std::mutex> guard(compile_count_mutex);
310310
while (compile_count >= N) {
311311
compile_count_cond.wait(guard);

0 commit comments

Comments
 (0)