1
0

ggml-sycl.h 1.5 KB

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