1//
 2//  MIT license
 3//  Copyright (C) 2024 Intel Corporation
 4//  SPDX-License-Identifier: MIT
 5//
 6
 7#pragma once
 8
 9#include "ggml.h"
10#include "ggml-backend.h"
11
12#define GGML_SYCL_NAME "SYCL"
13#define GGML_SYCL_MAX_DEVICES 48
14
15#ifdef  __cplusplus
16extern "C" {
17#endif
18
19// backend API
20GGML_BACKEND_API ggml_backend_t ggml_backend_sycl_init(int device);
21
22GGML_BACKEND_API bool ggml_backend_is_sycl(ggml_backend_t backend);
23
24// devide buffer
25GGML_BACKEND_API ggml_backend_buffer_type_t ggml_backend_sycl_buffer_type(int device);
26
27// split tensor buffer that splits matrices by rows across multiple devices
28GGML_BACKEND_API ggml_backend_buffer_type_t ggml_backend_sycl_split_buffer_type(const float * tensor_split);
29
30// pinned host buffer for use with the CPU backend for faster copies between CPU and GPU
31GGML_BACKEND_API ggml_backend_buffer_type_t ggml_backend_sycl_host_buffer_type(void);
32
33GGML_BACKEND_API void ggml_backend_sycl_print_sycl_devices(void);
34GGML_BACKEND_API void ggml_backend_sycl_get_gpu_list(int *id_list, int max_len);
35GGML_BACKEND_API void ggml_backend_sycl_get_device_description(int device,
36                                                       char *description,
37                                                       size_t description_size);
38GGML_BACKEND_API int  ggml_backend_sycl_get_device_count();
39GGML_BACKEND_API void ggml_backend_sycl_get_device_memory(int device, size_t *free, size_t *total);
40
41// SYCL doesn't support registering host memory, keep here for reference
42// GGML_BACKEND_API bool ggml_backend_sycl_register_host_buffer(void * buffer, size_t size);
43// GGML_BACKEND_API void ggml_backend_sycl_unregister_host_buffer(void * buffer);
44
45GGML_BACKEND_API ggml_backend_reg_t ggml_backend_sycl_reg(void);
46
47#ifdef  __cplusplus
48}
49#endif