Skip to content

Commit 300fc03

Browse files
committed
Forking to C++.
1 parent 4375415 commit 300fc03

File tree

81 files changed

+16297
-25263
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+16297
-25263
lines changed

.github/workflows/bench.yml.disabled

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ on:
2727
push:
2828
branches:
2929
- master
30-
paths: ['llama.cpp', 'ggml.c', 'ggml-backend.cpp', 'ggml-quants.c', '**/*.cu', 'examples/server/*.h*', 'examples/server/*.cpp']
30+
paths: ['llama.cpp', 'ggml.cpp', 'ggml-backend.cpp', 'ggml-quants.cpp', '**/*.cu', 'examples/server/*.h*', 'examples/server/*.cpp']
3131
pull_request_target:
3232
types: [opened, synchronize, reopened]
33-
paths: ['llama.cpp', 'ggml.c', 'ggml-backend.cpp', 'ggml-quants.c', '**/*.cu', 'examples/server/*.h*', 'examples/server/*.cpp']
33+
paths: ['llama.cpp', 'ggml.cpp', 'ggml-backend.cpp', 'ggml-quants.cpp', '**/*.cu', 'examples/server/*.h*', 'examples/server/*.cpp']
3434
schedule:
3535
- cron: '04 2 * * *'
3636

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.14) # for add_link_options and implicit target directories.
2-
project("llama.cpp" C CXX)
2+
project("llama.cpp" CXX)
33
include(CheckIncludeFileCXX)
44

55
#set(CMAKE_WARN_DEPRECATED YES)

CMakePresets.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
2121
"CMAKE_CXX_COMPILER": "icx",
2222
"CMAKE_C_COMPILER": "cl",
23-
"GGML_SYCL": "ON",
23+
"OIML_SYCL": "ON",
2424
"CMAKE_INSTALL_RPATH": "$ORIGIN;$ORIGIN/.."
2525
}
2626
},
2727
{ "name": "debug", "hidden": true, "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" } },
2828
{ "name": "release", "hidden": true, "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" } },
2929
{ "name": "reldbg", "hidden": true, "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo" } },
30-
{ "name": "static", "hidden": true, "cacheVariables": { "GGML_STATIC": "ON" } },
31-
{ "name": "sycl_f16", "hidden": true, "cacheVariables": { "GGML_SYCL_F16": "ON" } },
32-
{ "name": "vulkan", "hidden": true, "cacheVariables": { "GGML_VULKAN": "ON" } },
30+
{ "name": "static", "hidden": true, "cacheVariables": { "OIML_STATIC": "ON" } },
31+
{ "name": "sycl_f16", "hidden": true, "cacheVariables": { "OIML_SYCL_F16": "ON" } },
32+
{ "name": "vulkan", "hidden": true, "cacheVariables": { "OIML_VULKAN": "ON" } },
3333

3434
{
3535
"name": "x64-windows-llvm", "hidden": true,
@@ -86,6 +86,10 @@
8686
{ "name": "x64-windows-msvc-release", "inherits": [ "base", "reldbg" ] },
8787
{ "name": "x64-windows-msvc+static-release", "inherits": [ "base", "reldbg", "static" ] },
8888

89+
{ "name": "x64-windows-msvc-debug-cli", "inherits": [ "base", "debug" ],"cacheVariables": { "CLI":"TRUE" } },
90+
{ "name": "x64-windows-msvc-release-cli", "inherits": [ "base", "reldbg" ],"cacheVariables": { "CLI":"TRUE" } },
91+
{ "name": "x64-windows-msvc+static-release-cli", "inherits": [ "base", "reldbg", "static" ],"cacheVariables": { "CLI":"TRUE" } },
92+
8993
{ "name": "x64-windows-sycl-debug", "inherits": [ "sycl-base", "debug" ] },
9094
{ "name": "x64-windows-sycl-debug-f16", "inherits": [ "sycl-base", "debug", "sycl_f16" ] },
9195
{ "name": "x64-windows-sycl-release", "inherits": [ "sycl-base", "release" ] },

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ DEP_FILES = $(OBJ_GGML:.o=.d) $(OBJ_LLAMA:.o=.d) $(OBJ_COMMON:.o=.d)
11191119
all: $(BUILD_TARGETS)
11201120

11211121
# force c++ build for source file that have same name as c file
1122-
# Note: need this exception because `ggml-cpu.c` and `ggml-cpu.cpp` both produce the same obj/dep files
1122+
# Note: need this exception because `ggml-cpu.cpp` and `ggml-cpu.cpp` both produce the same obj/dep files
11231123
$(DIR_GGML)/%_cpp.o: $(DIR_GGML)/%.cpp
11241124
$(CXX) $(CXXFLAGS) -MMD -c $< -o $@
11251125

@@ -1267,15 +1267,15 @@ llama-gguf: examples/gguf/gguf.cpp \
12671267
$(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS)
12681268

12691269
examples/gguf-hash/deps/sha1/sha1.o: \
1270-
examples/gguf-hash/deps/sha1/sha1.c
1270+
examples/gguf-hash/deps/sha1/sha1.cpp
12711271
$(CC) $(CFLAGS) -Iexamples/gguf-hash/deps -c $< -o $@
12721272

12731273
examples/gguf-hash/deps/xxhash/xxhash.o: \
1274-
examples/gguf-hash/deps/xxhash/xxhash.c
1274+
examples/gguf-hash/deps/xxhash/xxhash.cpp
12751275
$(CC) $(CFLAGS) -Iexamples/gguf-hash/deps -c $< -o $@
12761276

12771277
examples/gguf-hash/deps/sha256/sha256.o: \
1278-
examples/gguf-hash/deps/sha256/sha256.c
1278+
examples/gguf-hash/deps/sha256/sha256.cpp
12791279
$(CC) $(CFLAGS) -Iexamples/gguf-hash/deps -c $< -o $@
12801280

12811281
llama-gguf-hash: examples/gguf-hash/gguf-hash.cpp examples/gguf-hash/deps/sha1/sha1.o examples/gguf-hash/deps/xxhash/xxhash.o examples/gguf-hash/deps/sha256/sha256.o\
@@ -1532,7 +1532,7 @@ tests/test-rope: tests/test-rope.cpp ggml/src/ggml.o \
15321532
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
15331533
$(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS)
15341534

1535-
tests/test-c.o: tests/test-c.c include/llama.h
1535+
tests/test-c.o: tests/test-c.cpp include/llama.h
15361536
$(CC) $(CFLAGS) -c $(filter-out %.h,$^) -o $@
15371537

15381538
tests/test-backend-ops: tests/test-backend-ops.cpp \

common/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,5 @@ if (LLAMA_LLGUIDANCE)
137137
endif ()
138138

139139
target_include_directories(${TARGET} PUBLIC .)
140-
target_compile_features (${TARGET} PUBLIC cxx_std_17)
140+
target_compile_features (${TARGET} PUBLIC cxx_std_20)
141141
target_link_libraries (${TARGET} PRIVATE ${LLAMA_COMMON_EXTRA_LIBS} PUBLIC llama Threads::Threads)

examples/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ else()
2626
add_subdirectory(gbnf-validator)
2727
endif()
2828

29-
add_subdirectory(gguf-hash)
3029
add_subdirectory(gguf-split)
3130
add_subdirectory(gguf)
3231
add_subdirectory(gritlm)

examples/batched-bench/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ set(TARGET llama-batched-bench)
22
add_executable(${TARGET} batched-bench.cpp)
33
install(TARGETS ${TARGET} RUNTIME)
44
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
5-
target_compile_features(${TARGET} PRIVATE cxx_std_17)
5+
target_compile_features(${TARGET} PRIVATE cxx_std_20)

examples/batched/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ set(TARGET llama-batched)
22
add_executable(${TARGET} batched.cpp)
33
install(TARGETS ${TARGET} RUNTIME)
44
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
5-
target_compile_features(${TARGET} PRIVATE cxx_std_17)
5+
target_compile_features(${TARGET} PRIVATE cxx_std_20)

examples/convert-llama2c-to-ggml/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ set(TARGET llama-convert-llama2c-to-ggml)
22
add_executable(${TARGET} convert-llama2c-to-ggml.cpp)
33
install(TARGETS ${TARGET} RUNTIME)
44
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
5-
target_compile_features(${TARGET} PRIVATE cxx_std_17)
5+
target_compile_features(${TARGET} PRIVATE cxx_std_20)

examples/cvector-generator/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ set(TARGET llama-cvector-generator)
22
add_executable(${TARGET} cvector-generator.cpp pca.hpp)
33
install(TARGETS ${TARGET} RUNTIME)
44
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
5-
target_compile_features(${TARGET} PRIVATE cxx_std_17)
5+
target_compile_features(${TARGET} PRIVATE cxx_std_20)

0 commit comments

Comments
 (0)