ggml-vulkan.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include "ggml.h"
  3. #include "ggml-backend.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #define GGML_VK_NAME "Vulkan"
  8. GGML_API void ggml_vk_init(void);
  9. GGML_API void ggml_vk_preallocate_buffers_graph(struct ggml_tensor * node);
  10. GGML_API void ggml_vk_preallocate_buffers(void);
  11. GGML_API void ggml_vk_build_graph(struct ggml_tensor * node, bool last_node);
  12. GGML_API bool ggml_vk_compute_forward(struct ggml_compute_params * params, struct ggml_tensor * tensor);
  13. #ifdef GGML_VULKAN_CHECK_RESULTS
  14. void ggml_vk_check_results_1(struct ggml_compute_params * params, struct ggml_tensor * tensor);
  15. #endif
  16. GGML_API void ggml_vk_graph_cleanup(void);
  17. // backend API
  18. GGML_API GGML_CALL ggml_backend_t ggml_backend_vk_init(void);
  19. GGML_API GGML_CALL bool ggml_backend_is_vk(ggml_backend_t backend);
  20. GGML_API GGML_CALL ggml_backend_buffer_type_t ggml_backend_vk_buffer_type(void);
  21. // pinned host buffer for use with the CPU backend for faster copies between CPU and GPU
  22. GGML_API GGML_CALL ggml_backend_buffer_type_t ggml_backend_vk_host_buffer_type(void);
  23. #ifdef __cplusplus
  24. }
  25. #endif