Skip to content

Commit 1bedad3

Browse files
committed
ggml: ggml-remotingfrontend: stubs of a new backend
1 parent ee79e12 commit 1bedad3

File tree

4 files changed

+543
-0
lines changed

4 files changed

+543
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#pragma once
2+
3+
#include "ggml.h"
4+
#include "ggml-backend.h"
5+
6+
#ifdef __cplusplus
7+
extern "C" {
8+
#endif
9+
10+
#define GGML_REMOTING_NAME "RemotingFrontend"
11+
12+
GGML_BACKEND_API ggml_backend_reg_t ggml_backend_remoting_reg();
13+
14+
#ifdef __cplusplus
15+
}
16+
#endif

ggml/src/ggml-backend-reg.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
#include "ggml-vulkan.h"
4646
#endif
4747

48+
#ifdef GGML_USE_REMOTINGFRONTEND
49+
#include "ggml-remoting-frontend.h"
50+
#endif
51+
4852
#ifdef GGML_USE_OPENCL
4953
#include "ggml-opencl.h"
5054
#endif
@@ -172,6 +176,9 @@ struct ggml_backend_registry {
172176
#ifdef GGML_USE_VULKAN
173177
register_backend(ggml_backend_vk_reg());
174178
#endif
179+
#ifdef GGML_USE_REMOTINGFRONTEND
180+
register_backend(ggml_backend_remoting_reg());
181+
#endif
175182
#ifdef GGML_USE_OPENCL
176183
register_backend(ggml_backend_opencl_reg());
177184
#endif
@@ -575,6 +582,7 @@ void ggml_backend_load_all_from_path(const char * dir_path) {
575582
ggml_backend_load_best("rpc", silent, dir_path);
576583
ggml_backend_load_best("sycl", silent, dir_path);
577584
ggml_backend_load_best("vulkan", silent, dir_path);
585+
ggml_backend_load_best("remoting_frontend", silent, dir_path);
578586
ggml_backend_load_best("opencl", silent, dir_path);
579587
ggml_backend_load_best("musa", silent, dir_path);
580588
ggml_backend_load_best("cpu", silent, dir_path);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
cmake_minimum_required(VERSION 3.19)
2+
cmake_policy(SET CMP0114 NEW)
3+
4+
# function(detect_host_compiler)
5+
# find_program(HOST_C_COMPILER NAMES gcc clang NO_CMAKE_FIND_ROOT_PATH)
6+
# find_program(HOST_CXX_COMPILER NAMES g++ clang++ NO_CMAKE_FIND_ROOT_PATH)
7+
8+
# set(HOST_C_COMPILER "${HOST_C_COMPILER}" PARENT_SCOPE)
9+
# set(HOST_CXX_COMPILER "${HOST_CXX_COMPILER}" PARENT_SCOPE)
10+
# endfunction()
11+
12+
message(STATUS "Enable API Remoting frontend found")
13+
14+
ggml_add_backend_library(ggml-remotingfrontend
15+
ggml-remoting-frontend.cpp
16+
../../include/ggml-remoting-frontend.h
17+
)
18+
19+
#target_link_libraries(ggml-remotingfrontend PRIVATE remotingfrontend)
20+
target_include_directories(ggml-remotingfrontend PRIVATE ${CMAKE_CURRENT_BINARY_DIR})

0 commit comments

Comments
 (0)