Skip to content

Commit 9422c5e

Browse files
authored
[SYCL] Update rpc-server.cpp to include SYCL backend (ggml-org#7682)
* Update rpc-server.cpp to include SYCL backend Draft PR to address inclusion of SYCL backend for RPC server * Update rpc-server.cpp
1 parent e141ce6 commit 9422c5e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

examples/rpc/rpc-server.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
#include "ggml-metal.h"
77
#endif
88

9+
#ifdef GGML_USE_SYCL
10+
#include "ggml-sycl.h"
11+
#endif
12+
913
#include "ggml-rpc.h"
1014
#ifdef _WIN32
1115
# include <windows.h>
@@ -79,6 +83,12 @@ static ggml_backend_t create_backend() {
7983
if (!backend) {
8084
fprintf(stderr, "%s: ggml_backend_metal_init() failed\n", __func__);
8185
}
86+
#elif GGML_USE_SYCL
87+
fprintf(stderr, "%s: using SYCL backend\n", __func__);
88+
backend = ggml_backend_sycl_init(0); // init device 0
89+
if (!backend) {
90+
fprintf(stderr, "%s: ggml_backend_sycl_init() failed\n", __func__);
91+
}
8292
#endif
8393

8494
// if there aren't GPU Backends fallback to CPU backend

0 commit comments

Comments
 (0)