cmake : add -fno-inline for Metal build (#4545)
This commit is contained in:
parent
515cfec44f
commit
a184e1050c
1 changed files with 2 additions and 1 deletions
|
@ -181,9 +181,10 @@ if (LLAMA_METAL)
|
||||||
#
|
#
|
||||||
# note: this is the only way I found to disable fast-math in Metal. it's ugly, but at least it works
|
# note: this is the only way I found to disable fast-math in Metal. it's ugly, but at least it works
|
||||||
# disabling fast math is needed in order to pass tests/test-backend-ops
|
# disabling fast math is needed in order to pass tests/test-backend-ops
|
||||||
|
# note: adding -fno-inline fixes the tests when using MTL_SHADER_VALIDATION=1
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml.metallib
|
OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml.metallib
|
||||||
COMMAND xcrun -sdk macosx metal -fno-fast-math -c ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.metal -o ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.air
|
COMMAND xcrun -sdk macosx metal -fno-fast-math -fno-inline -c ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.metal -o ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.air
|
||||||
COMMAND xcrun -sdk macosx metallib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.air -o ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml.metallib
|
COMMAND xcrun -sdk macosx metallib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.air -o ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml.metallib
|
||||||
DEPENDS ggml-metal.metal
|
DEPENDS ggml-metal.metal
|
||||||
COMMENT "Compiling Metal kernels"
|
COMMENT "Compiling Metal kernels"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue