ggml-alloc.h 905 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include "ggml.h"
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. GGML_API struct ggml_allocr * ggml_allocr_new(void * data, size_t size, size_t alignment);
  7. GGML_API struct ggml_allocr * ggml_allocr_new_measure(size_t alignment);
  8. // tell the allocator to parse nodes following the order described in the list
  9. // you should call this if your graph are optimized to execute out-of-order
  10. GGML_API void ggml_allocr_set_parse_seq(struct ggml_allocr * alloc, const int * list, int n);
  11. GGML_API void ggml_allocr_free(struct ggml_allocr * alloc);
  12. GGML_API bool ggml_allocr_is_measure(struct ggml_allocr * alloc);
  13. GGML_API void ggml_allocr_reset(struct ggml_allocr * alloc);
  14. GGML_API void ggml_allocr_alloc(struct ggml_allocr * alloc, struct ggml_tensor * tensor);
  15. GGML_API size_t ggml_allocr_alloc_graph(struct ggml_allocr * alloc, struct ggml_cgraph * graph);
  16. #ifdef __cplusplus
  17. }
  18. #endif