// n-dimensional tensor
struct ggml_tensor {
enum ggml_type type;
- enum ggml_backend_type backend;
+
+ GGML_DEPRECATED(enum ggml_backend_type backend, "use the buffer type to find the storage location of the tensor");
struct ggml_backend_buffer * buffer;
tensor->buffer = buffer;
tensor->data = (char *)tensor->view_src->data + tensor->view_offs;
- tensor->backend = tensor->view_src->backend;
ggml_backend_buffer_init_tensor(buffer, tensor);
}
struct ggml_tensor * const result = (struct ggml_tensor *)((char *)ctx->mem_buffer + obj_new->offs);
+#ifdef __clang__
+ // temporary until ggml_tensor::backend is removed
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
*result = (struct ggml_tensor) {
/*.type =*/ type,
/*.backend =*/ GGML_BACKEND_TYPE_CPU,
/*.padding =*/ { 0 },
};
+#ifdef __clang__
+ #pragma clang diagnostic pop
+#endif
+
// TODO: this should not be needed as long as we don't rely on aligned SIMD loads
//ggml_assert_aligned(result->data);