File tree 1 file changed +2
-1
lines changed
1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -181,9 +181,10 @@ if (LLAMA_METAL)
181
181
#
182
182
# note: this is the only way I found to disable fast-math in Metal. it's ugly, but at least it works
183
183
# disabling fast math is needed in order to pass tests/test-backend-ops
184
+ # note: adding -fno-inline fixes the tests when using MTL_SHADER_VALIDATION=1
184
185
add_custom_command (
185
186
OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /ggml.metallib
186
- COMMAND xcrun -sdk macosx metal -fno-fast-math -c ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /ggml-metal.metal -o ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /ggml-metal.air
187
+ 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
187
188
COMMAND xcrun -sdk macosx metallib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /ggml-metal.air -o ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /ggml.metallib
188
189
DEPENDS ggml-metal.metal
189
190
COMMENT "Compiling Metal kernels"
You can’t perform that action at this time.
0 commit comments