Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed29a28

Browse files
rgerganovmglambda
authored andcommitted
rpc-server : add support for the SYCL backend (ggml-org#10934)
1 parent c4d6296 commit ed29a28

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

examples/rpc/rpc-server.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
#include "ggml-vulkan.h"
1313
#endif
1414

15+
#ifdef GGML_USE_SYCL
16+
#include "ggml-sycl.h"
17+
#endif
18+
1519
#include "ggml-rpc.h"
1620
#ifdef _WIN32
1721
# include <windows.h>
@@ -91,6 +95,12 @@ static ggml_backend_t create_backend() {
9195
if (!backend) {
9296
fprintf(stderr, "%s: ggml_backend_vulkan_init() failed\n", __func__);
9397
}
98+
#elif GGML_USE_SYCL
99+
fprintf(stderr, "%s: using SYCL backend\n", __func__);
100+
backend = ggml_backend_sycl_init(0); // init device 0
101+
if (!backend) {
102+
fprintf(stderr, "%s: ggml_backend_sycl_init() failed\n", __func__);
103+
}
94104
#endif
95105

96106
// if there aren't GPU Backends fallback to CPU backend
@@ -106,6 +116,8 @@ static void get_backend_memory(size_t * free_mem, size_t * total_mem) {
106116
ggml_backend_cuda_get_device_memory(0, free_mem, total_mem);
107117
#elif GGML_USE_VULKAN
108118
ggml_backend_vk_get_device_memory(0, free_mem, total_mem);
119+
#elif GGML_USE_SYCL
120+
ggml_backend_sycl_get_device_memory(0, free_mem, total_mem);
109121
#else
110122
#ifdef _WIN32
111123
MEMORYSTATUSEX status;

0 commit comments

Comments
 (0)