slaren commited on
Commit
1a5606e
·
1 Parent(s): 2c417da

ggml : tag ggml_tensor::backend as deprecated (llama/7290)

Browse files
Files changed (3) hide show
  1. ggml-backend.c +0 -1
  2. ggml.c +10 -0
  3. ggml.h +2 -1
ggml-backend.c CHANGED
@@ -1895,7 +1895,6 @@ void ggml_backend_view_init(ggml_backend_buffer_t buffer, struct ggml_tensor * t
1895
 
1896
  tensor->buffer = buffer;
1897
  tensor->data = (char *)tensor->view_src->data + tensor->view_offs;
1898
- tensor->backend = tensor->view_src->backend;
1899
  ggml_backend_buffer_init_tensor(buffer, tensor);
1900
  }
1901
 
 
1895
 
1896
  tensor->buffer = buffer;
1897
  tensor->data = (char *)tensor->view_src->data + tensor->view_offs;
 
1898
  ggml_backend_buffer_init_tensor(buffer, tensor);
1899
  }
1900
 
ggml.c CHANGED
@@ -3178,6 +3178,12 @@ static struct ggml_tensor * ggml_new_tensor_impl(
3178
 
3179
  struct ggml_tensor * const result = (struct ggml_tensor *)((char *)ctx->mem_buffer + obj_new->offs);
3180
 
 
 
 
 
 
 
3181
  *result = (struct ggml_tensor) {
3182
  /*.type =*/ type,
3183
  /*.backend =*/ GGML_BACKEND_TYPE_CPU,
@@ -3200,6 +3206,10 @@ static struct ggml_tensor * ggml_new_tensor_impl(
3200
  /*.padding =*/ { 0 },
3201
  };
3202
 
 
 
 
 
3203
  // TODO: this should not be needed as long as we don't rely on aligned SIMD loads
3204
  //ggml_assert_aligned(result->data);
3205
 
 
3178
 
3179
  struct ggml_tensor * const result = (struct ggml_tensor *)((char *)ctx->mem_buffer + obj_new->offs);
3180
 
3181
+ #ifdef __clang__
3182
+ // temporary until ggml_tensor::backend is removed
3183
+ #pragma clang diagnostic push
3184
+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
3185
+ #endif
3186
+
3187
  *result = (struct ggml_tensor) {
3188
  /*.type =*/ type,
3189
  /*.backend =*/ GGML_BACKEND_TYPE_CPU,
 
3206
  /*.padding =*/ { 0 },
3207
  };
3208
 
3209
+ #ifdef __clang__
3210
+ #pragma clang diagnostic pop
3211
+ #endif
3212
+
3213
  // TODO: this should not be needed as long as we don't rely on aligned SIMD loads
3214
  //ggml_assert_aligned(result->data);
3215
 
ggml.h CHANGED
@@ -565,7 +565,8 @@ extern "C" {
565
  // n-dimensional tensor
566
  struct ggml_tensor {
567
  enum ggml_type type;
568
- enum ggml_backend_type backend;
 
569
 
570
  struct ggml_backend_buffer * buffer;
571
 
 
565
  // n-dimensional tensor
566
  struct ggml_tensor {
567
  enum ggml_type type;
568
+
569
+ GGML_DEPRECATED(enum ggml_backend_type backend, "use the buffer type to find the storage location of the tensor");
570
 
571
  struct ggml_backend_buffer * buffer;
572