Merge 3453401cfe
into 902368a06b
This commit is contained in:
commit
6e824b0dd0
3 changed files with 16 additions and 0 deletions
|
@ -73,6 +73,10 @@ if (BLAS_FOUND)
|
||||||
message(STATUS "BLAS found, Includes: ${BLAS_INCLUDE_DIRS}")
|
message(STATUS "BLAS found, Includes: ${BLAS_INCLUDE_DIRS}")
|
||||||
|
|
||||||
target_compile_options(ggml-blas PRIVATE ${BLAS_LINKER_FLAGS})
|
target_compile_options(ggml-blas PRIVATE ${BLAS_LINKER_FLAGS})
|
||||||
|
# GCC on apple complains about vector conversions
|
||||||
|
if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
target_compile_options(ggml-blas PRIVATE -flax-vector-conversions)
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (${BLAS_INCLUDE_DIRS} MATCHES "mkl" AND (${GGML_BLAS_VENDOR} MATCHES "Generic" OR ${GGML_BLAS_VENDOR} MATCHES "Intel"))
|
if (${BLAS_INCLUDE_DIRS} MATCHES "mkl" AND (${GGML_BLAS_VENDOR} MATCHES "Generic" OR ${GGML_BLAS_VENDOR} MATCHES "Intel"))
|
||||||
add_compile_definitions(GGML_BLAS_USE_MKL)
|
add_compile_definitions(GGML_BLAS_USE_MKL)
|
||||||
|
|
|
@ -319,6 +319,10 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
|
||||||
message(STATUS "Adding CPU backend variant ${GGML_CPU_NAME}: ${ARCH_FLAGS} ${ARCH_DEFINITIONS}")
|
message(STATUS "Adding CPU backend variant ${GGML_CPU_NAME}: ${ARCH_FLAGS} ${ARCH_DEFINITIONS}")
|
||||||
target_sources(${GGML_CPU_NAME} PRIVATE ${GGML_CPU_SOURCES})
|
target_sources(${GGML_CPU_NAME} PRIVATE ${GGML_CPU_SOURCES})
|
||||||
target_compile_options(${GGML_CPU_NAME} PRIVATE ${ARCH_FLAGS})
|
target_compile_options(${GGML_CPU_NAME} PRIVATE ${ARCH_FLAGS})
|
||||||
|
# GCC on apple complains about vector conversions
|
||||||
|
if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
target_compile_options(${GGML_CPU_NAME} PRIVATE -flax-vector-conversions)
|
||||||
|
endif ()
|
||||||
target_compile_definitions(${GGML_CPU_NAME} PRIVATE ${ARCH_DEFINITIONS})
|
target_compile_definitions(${GGML_CPU_NAME} PRIVATE ${ARCH_DEFINITIONS})
|
||||||
|
|
||||||
if (GGML_BACKEND_DL)
|
if (GGML_BACKEND_DL)
|
||||||
|
|
|
@ -206,6 +206,14 @@ static int sched_yield (void) {
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
// GCC fails to compile ggml on macos
|
||||||
|
#if defined(__APPLE__) && !defined(__clang__)
|
||||||
|
#undef __restrict
|
||||||
|
#define __restrict
|
||||||
|
#define _Nullable
|
||||||
|
#define _Nonnull
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <stdatomic.h>
|
#include <stdatomic.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue