Spaces:
Running
Running
ggml : skip intermediate .air file when compiling .metallib (llama/12247)
Browse filesThis commit updates the compilation of default.metallib to skip the
intermediate .air (Apple Intermediate Representation) file.
The motivation for this change is to simplify the custom command a
little and avoid generating and then removing the .air file.
ggml/src/ggml-metal/CMakeLists.txt
CHANGED
|
@@ -88,9 +88,8 @@ else()
|
|
| 88 |
|
| 89 |
add_custom_command(
|
| 90 |
OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/default.metallib
|
| 91 |
-
COMMAND xcrun -sdk macosx metal
|
| 92 |
-
|
| 93 |
-
COMMAND rm -f ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.air
|
| 94 |
COMMAND rm -f ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-common.h
|
| 95 |
COMMAND rm -f ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.metal
|
| 96 |
DEPENDS ggml-metal.metal ${METALLIB_COMMON}
|
|
|
|
| 88 |
|
| 89 |
add_custom_command(
|
| 90 |
OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/default.metallib
|
| 91 |
+
COMMAND xcrun -sdk macosx metal ${XC_FLAGS} -c ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.metal -o - |
|
| 92 |
+
xcrun -sdk macosx metallib - -o ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/default.metallib
|
|
|
|
| 93 |
COMMAND rm -f ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-common.h
|
| 94 |
COMMAND rm -f ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.metal
|
| 95 |
DEPENDS ggml-metal.metal ${METALLIB_COMMON}
|