Skip to content

Commit bf9d14c

Browse files
committed
test: remember to set n_thread for cpu backend
1 parent 8549245 commit bf9d14c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,6 @@ endif()
161161
# 3rd-party
162162
#
163163

164-
if (EMSCRIPTEN)
165-
add_compile_options(-pthread)
166-
link_libraries (-pthread)
167-
endif()
168-
169164
if (LLAMA_USE_SYSTEM_GGML)
170165
message(STATUS "Using system-provided libggml, skipping ggml build")
171166
find_package(ggml REQUIRED)

tests/test-backend-ops.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <ggml-alloc.h>
2020
#include <ggml-backend.h>
2121
#include <ggml-cpp.h>
22+
#include <ggml-cpu.h>
2223

2324
#include <algorithm>
2425
#include <array>
@@ -6704,6 +6705,9 @@ static bool test_backend(ggml_backend_t backend, test_mode mode, const char * op
67046705
return false;
67056706
}
67066707

6708+
// TODO: find a better way to set the number of threads for the CPU backend
6709+
ggml_backend_cpu_set_n_threads(backend_cpu, N_THREADS);
6710+
67076711
size_t n_ok = 0;
67086712
for (auto & test : test_cases) {
67096713
if (test->eval(backend, backend_cpu, op_names_filter, output_printer)) {

0 commit comments

Comments
 (0)