ggml-sycl.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #include "ggml-sycl/presets.hpp"
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. // backend API
  14. GGML_API ggml_backend_t ggml_backend_sycl_init(int device);
  15. // devide buffer
  16. GGML_API ggml_backend_buffer_type_t ggml_backend_sycl_buffer_type(int device);
  17. // split tensor buffer that splits matrices by rows across multiple devices
  18. GGML_API GGML_CALL ggml_backend_buffer_type_t ggml_backend_sycl_split_buffer_type(const float * tensor_split);
  19. // pinned host buffer for use with the CPU backend for faster copies between CPU and GPU
  20. GGML_API ggml_backend_buffer_type_t ggml_backend_sycl_host_buffer_type(void);
  21. GGML_API void ggml_backend_sycl_print_sycl_devices(void);
  22. GGML_API GGML_CALL void ggml_sycl_get_gpu_list(int *id_list, int max_len);
  23. GGML_API GGML_CALL void ggml_sycl_get_device_description(int device, char *description, size_t description_size);
  24. GGML_API GGML_CALL int ggml_backend_sycl_get_device_count();
  25. GGML_API GGML_CALL void ggml_backend_sycl_get_device_memory(int device, size_t *free, size_t *total);
  26. // SYCL doesn't support registering host memory, keep here for reference
  27. // GGML_API GGML_CALL bool ggml_backend_sycl_register_host_buffer(void * buffer, size_t size);
  28. // GGML_API GGML_CALL void ggml_backend_sycl_unregister_host_buffer(void * buffer);
  29. #ifdef __cplusplus
  30. }
  31. #endif