set(TEST_TARGET test-mul-mat0)
add_executable(${TEST_TARGET} ${TEST_TARGET}.c)
target_link_libraries(${TEST_TARGET} PRIVATE ggml ${GGML_EXTRA_LIBS})
+if (MSVC)
+ target_link_options(${TEST_TARGET} PRIVATE "/STACK: 8388608") # 8MB
+endif()
target_compile_options(${TEST_TARGET} PRIVATE ${GGML_EXTRA_FLAGS})
add_test(NAME ${TEST_TARGET} COMMAND $<TARGET_FILE:${TEST_TARGET}>)
set_property(TEST ${TEST_TARGET} PROPERTY ENVIRONMENT "LLVM_PROFILE_FILE=${TEST_TARGET}.profraw")
set(TEST_TARGET test-pool)
add_executable(${TEST_TARGET} ${TEST_TARGET}.c)
target_link_libraries(${TEST_TARGET} PRIVATE ggml)
+if (MSVC)
+ target_link_options(${TEST_TARGET} PRIVATE "/STACK: 8388608") # 8MB
+endif()
add_test(NAME ${TEST_TARGET} COMMAND $<TARGET_FILE:${TEST_TARGET}>)
set_property(TEST ${TEST_TARGET} PROPERTY ENVIRONMENT "LLVM_PROFILE_FILE=${TEST_TARGET}.profraw")
set(TEST_TARGET test-customop)
add_executable(${TEST_TARGET} ${TEST_TARGET}.c)
target_link_libraries(${TEST_TARGET} PRIVATE ggml)
+if (MSVC)
+ target_link_options(${TEST_TARGET} PRIVATE "/STACK: 8388608") # 8MB
+endif()
add_test(NAME ${TEST_TARGET} COMMAND $<TARGET_FILE:${TEST_TARGET}>)
set_property(TEST ${TEST_TARGET} PROPERTY ENVIRONMENT "LLVM_PROFILE_FILE=${TEST_TARGET}.profraw")
#if defined(_WIN32)
#include <windows.h>
+typedef volatile LONG atomic_int;
static LONG atomic_fetch_add(atomic_int * ptr, LONG inc) {
return InterlockedExchangeAdd(ptr, inc);
}
assert(ggml_is_contiguous(a));
// parallelize by elements
- const int ne = ggml_nelements(dst);
+ const int ne = (int)ggml_nelements(dst);
const int dr = (ne + nth - 1) / nth;
const int ie0 = dr * ith;
const int ie1 = MIN(ie0 + dr, ne);
float * dst_data = ggml_get_data_f32(dst);
// parallelize by rows
- const int nr = ggml_nrows(dst);
+ const int nr = (int)ggml_nrows(dst);
// number of rows per thread
const int dr = (nr + nth - 1) / nth;
// row range for this thread
const int ir1 = MIN(ir0 + dr, nr);
// number of columns
- const int nc = dst->ne[0];
+ const int nc = (int)dst->ne[0];
// this assumes that the tensors are contiguous
assert(ggml_is_contiguous(dst));
assert(ith == 0);
// number of elements
- const int ne = ggml_nelements(dst);
+ const int ne = (int)ggml_nelements(dst);
// this assumes that the tensors are contiguous
assert(ggml_is_contiguous(dst));