llama_cpp 0.12.2 → 0.12.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,46 @@
1
+ #pragma once
2
+
3
+ #include "ggml.h"
4
+ #include "ggml-backend.h"
5
+
6
+ #include <stdbool.h>
7
+ #include <stddef.h>
8
+ #include <stdint.h>
9
+
10
+ #ifdef __cplusplus
11
+ extern "C" {
12
+ #endif
13
+
14
+ struct ggml_vk_device {
15
+ int index;
16
+ int type; // same as VkPhysicalDeviceType
17
+ size_t heapSize;
18
+ const char * name;
19
+ const char * vendor;
20
+ int subgroupSize;
21
+ uint64_t bufferAlignment;
22
+ uint64_t maxAlloc;
23
+ };
24
+
25
+ struct ggml_vk_device * ggml_vk_available_devices(size_t memoryRequired, size_t * count);
26
+ bool ggml_vk_get_device(struct ggml_vk_device * device, size_t memoryRequired, const char * name);
27
+ bool ggml_vk_has_vulkan(void);
28
+ bool ggml_vk_has_device(void);
29
+ struct ggml_vk_device ggml_vk_current_device(void);
30
+
31
+ //
32
+ // backend API
33
+ //
34
+
35
+ // forward declaration
36
+ typedef struct ggml_backend * ggml_backend_t;
37
+
38
+ GGML_API ggml_backend_t ggml_backend_kompute_init(int device);
39
+
40
+ GGML_API bool ggml_backend_is_kompute(ggml_backend_t backend);
41
+
42
+ GGML_API ggml_backend_buffer_type_t ggml_backend_kompute_buffer_type(int device);
43
+
44
+ #ifdef __cplusplus
45
+ }
46
+ #endif
@@ -57,6 +57,9 @@ GGML_API GGML_CALL ggml_backend_buffer_type_t ggml_backend_metal_buffer_type(voi
57
57
  // ref: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
58
58
  GGML_API bool ggml_backend_metal_supports_family(ggml_backend_t backend, int family);
59
59
 
60
+ // capture all command buffers committed the next time `ggml_backend_graph_compute` is called
61
+ GGML_API void ggml_backend_metal_capture_next_compute(ggml_backend_t backend);
62
+
60
63
  #ifdef __cplusplus
61
64
  }
62
65
  #endif