Skip to content

Commit

Permalink
ggml : add ggml-common.h
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Mar 14, 2024
1 parent 1887429 commit 67f59ec
Show file tree
Hide file tree
Showing 6 changed files with 1,838 additions and 1 deletion.
2 changes: 2 additions & 0 deletions scripts/sync-llama-am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ if [ -f $SRC_GGML/llama-src.patch ]; then
# ggml-alloc.c -> src/ggml-alloc.c
# ggml-backend-impl.h -> src/ggml-backend-impl.h
# ggml-backend.c -> src/ggml-backend.c
# ggml-common.h -> src/ggml-common.h
# ggml-cuda.cu -> src/ggml-cuda.cu
# ggml-cuda.h -> src/ggml-cuda.h
# ggml-impl.h -> src/ggml-impl.h
Expand Down Expand Up @@ -125,6 +126,7 @@ if [ -f $SRC_GGML/llama-src.patch ]; then
-e 's/\/ggml-alloc\.c/\/src\/ggml-alloc.c/g' \
-e 's/\/ggml-backend-impl\.h/\/src\/ggml-backend-impl.h/g' \
-e 's/\/ggml-backend\.c/\/src\/ggml-backend.c/g' \
-e 's/\/ggml-common\.h/\/src\/ggml-common.h/g' \
-e 's/\/ggml-cuda\.cu/\/src\/ggml-cuda.cu/g' \
-e 's/\/ggml-cuda\.h/\/src\/ggml-cuda.h/g' \
-e 's/\/ggml-impl\.h/\/src\/ggml-impl.h/g' \
Expand Down
1 change: 1 addition & 0 deletions scripts/sync-llama.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cp -rpv ../llama.cpp/ggml.c src/ggml.c
cp -rpv ../llama.cpp/ggml-alloc.c src/ggml-alloc.c
cp -rpv ../llama.cpp/ggml-backend-impl.h src/ggml-backend-impl.h
cp -rpv ../llama.cpp/ggml-backend.c src/ggml-backend.c
cp -rpv ../llama.cpp/ggml-common.h src/ggml-common.h
cp -rpv ../llama.cpp/ggml-cuda.cu src/ggml-cuda.cu
cp -rpv ../llama.cpp/ggml-cuda.h src/ggml-cuda.h
cp -rpv ../llama.cpp/ggml-impl.h src/ggml-impl.h
Expand Down
2 changes: 2 additions & 0 deletions scripts/sync-whisper-am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ if [ -f $SRC_GGML/whisper-src.patch ]; then
# ggml-alloc.c -> src/ggml-alloc.c
# ggml-backend-impl.h -> src/ggml-backend-impl.h
# ggml-backend.c -> src/ggml-backend.c
# ggml-common.h -> src/ggml-common.h
# ggml-cuda.cu -> src/ggml-cuda.cu
# ggml-cuda.h -> src/ggml-cuda.h
# ggml-impl.h -> src/ggml-impl.h
Expand Down Expand Up @@ -132,6 +133,7 @@ if [ -f $SRC_GGML/whisper-src.patch ]; then
-e 's/\/ggml-alloc\.c/\/src\/ggml-alloc.c/g' \
-e 's/\/ggml-backend-impl\.h/\/src\/ggml-backend-impl.h/g' \
-e 's/\/ggml-backend\.c/\/src\/ggml-backend.c/g' \
-e 's/\/ggml-common\.h/\/src\/ggml-common.h/g' \
-e 's/\/ggml-cuda\.cu/\/src\/ggml-cuda.cu/g' \
-e 's/\/ggml-cuda\.h/\/src\/ggml-cuda.h/g' \
-e 's/\/ggml-impl\.h/\/src\/ggml-impl.h/g' \
Expand Down
1 change: 1 addition & 0 deletions scripts/sync-whisper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ cp -rpv ../whisper.cpp/ggml-impl.h src/ggml-impl.h
cp -rpv ../whisper.cpp/ggml-alloc.c src/ggml-alloc.c
cp -rpv ../whisper.cpp/ggml-backend-impl.h src/ggml-backend-impl.h
cp -rpv ../whisper.cpp/ggml-backend.c src/ggml-backend.c
cp -rpv ../whisper.cpp/ggml-common.h src/ggml-common.h
cp -rpv ../whisper.cpp/ggml-cuda.cu src/ggml-cuda.cu
cp -rpv ../whisper.cpp/ggml-cuda.h src/ggml-cuda.h
cp -rpv ../whisper.cpp/ggml-kompute.cpp src/ggml-kompute.cpp
Expand Down
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ if (GGML_METAL)
# get full path to the file
#add_compile_definitions(GGML_METAL_DIR_KERNELS="${CMAKE_CURRENT_SOURCE_DIR}/")

# copy ggml-metal.metal to bin directory
# copy ggml-common.h and ggml-metal.metal to bin directory
configure_file(ggml-common.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-common.h COPYONLY)
configure_file(ggml-metal.metal ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.metal COPYONLY)

set(GGML_EXTRA_LIBS ${GGML_EXTRA_LIBS}
Expand Down
Loading

0 comments on commit 67f59ec

Please sign in to comment.