summaryrefslogtreecommitdiff
path: root/ggml.h
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2023-10-08 20:19:14 +0300
committerGitHub <noreply@github.com>2023-10-08 20:19:14 +0300
commitdb3abcc114d5d1790ba814aa1a80ac673d4ccc3e (patch)
tree954cce12ac9d40fccf5dd3d9298efedd1d67e7d0 /ggml.h
parenteee42c670e6fa6df9cf17e7ffc319f74cbd81354 (diff)
sync : ggml (ggml-backend) (#3548)
* sync : ggml (ggml-backend) ggml-ci * zig : add ggml-backend to the build
Diffstat (limited to 'ggml.h')
-rw-r--r--ggml.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/ggml.h b/ggml.h
index a9d4e33d..3eddc44b 100644
--- a/ggml.h
+++ b/ggml.h
@@ -326,7 +326,7 @@ extern "C" {
GGML_TYPE_COUNT,
};
- enum ggml_backend {
+ enum ggml_backend_type {
GGML_BACKEND_CPU = 0,
GGML_BACKEND_GPU = 10,
GGML_BACKEND_GPU_SPLIT = 20,
@@ -479,8 +479,10 @@ extern "C" {
// n-dimensional tensor
struct ggml_tensor {
- enum ggml_type type;
- enum ggml_backend backend;
+ enum ggml_type type;
+ enum ggml_backend_type backend;
+
+ struct ggml_backend_buffer * buffer;
int n_dims;
int64_t ne[GGML_MAX_DIMS]; // number of elements
@@ -514,7 +516,7 @@ extern "C" {
void * extra; // extra things e.g. for ggml-cuda.cu
- char padding[4];
+ char padding[12];
};
static const size_t GGML_TENSOR_SIZE = sizeof(struct ggml_tensor);
@@ -1358,7 +1360,7 @@ extern "C" {
// alibi position embedding
// in-place, returns view(a)
- struct ggml_tensor * ggml_alibi(
+ GGML_API struct ggml_tensor * ggml_alibi(
struct ggml_context * ctx,
struct ggml_tensor * a,
int n_past,
@@ -1367,7 +1369,7 @@ extern "C" {
// clamp
// in-place, returns view(a)
- struct ggml_tensor * ggml_clamp(
+ GGML_API struct ggml_tensor * ggml_clamp(
struct ggml_context * ctx,
struct ggml_tensor * a,
float min,
@@ -2102,7 +2104,7 @@ extern "C" {
enum ggml_type vec_dot_type;
} ggml_type_traits_t;
- ggml_type_traits_t ggml_internal_get_type_traits(enum ggml_type type);
+ GGML_API ggml_type_traits_t ggml_internal_get_type_traits(enum ggml_type type);
#ifdef __cplusplus
}