ggml-zdnn: rewrite into mre

Signed-off-by: Aaron Teo <aaron.teo1@ibm.com>
This commit is contained in:
Aaron Teo
2025-07-28 23:26:15 +08:00
parent 03ec5d3ed3
commit 0905168388
3 changed files with 1193 additions and 417 deletions

View File

@@ -56,18 +56,40 @@ typedef unsigned long long ulong64x2_t __attribute__((vector_size(16)));
GGML_ASSERT(status == ZDNN_OK); \
} while (0);
struct ggml_backend_zdnn_device_context {
int zdnn_device;
int zdnn_device_ref_count;
bool has_parmblk_1;
size_t max_size;
char name[128];
};
struct ggml_backend_zdnn_context {
int device;
ggml_cgraph * gf;
};
struct ggml_backend_zdnn_buffer {
void * data;
size_t size;
ggml_backend_zdnn_buffer * extra; // for bias etc.
zdnn_tensor_desc pre_tfm_desc;
zdnn_tensor_desc tfm_desc;
zdnn_ztensor ztensor;
char name[GGML_MAX_NAME];
};
ggml_backend_zdnn_buffer() : extra(nullptr) {}
struct ggml_backend_zdnn_buffer_context {
void * all_data;
size_t all_size;
bool owned;
int n_buffers;
std::vector<ggml_backend_zdnn_buffer> buffers;
};
#endif // GGML_ZDNN_IMPL