ggml : restore ggml_type_sizef() to aboid major version bump (ggml/1441)
This commit is contained in:
parent
48e61238e1
commit
79187f2fb8
|
|
@ -733,6 +733,10 @@ extern "C" {
|
||||||
GGML_API size_t ggml_type_size(enum ggml_type type); // size in bytes for all elements in a block
|
GGML_API size_t ggml_type_size(enum ggml_type type); // size in bytes for all elements in a block
|
||||||
GGML_API size_t ggml_row_size (enum ggml_type type, int64_t ne); // size in bytes for all elements in a row
|
GGML_API size_t ggml_row_size (enum ggml_type type, int64_t ne); // size in bytes for all elements in a row
|
||||||
|
|
||||||
|
GGML_DEPRECATED(
|
||||||
|
GGML_API double ggml_type_sizef(enum ggml_type type), // ggml_type_size()/ggml_blck_size() as float
|
||||||
|
"use ggml_row_size() instead");
|
||||||
|
|
||||||
GGML_API const char * ggml_type_name(enum ggml_type type);
|
GGML_API const char * ggml_type_name(enum ggml_type type);
|
||||||
GGML_API const char * ggml_op_name (enum ggml_op op);
|
GGML_API const char * ggml_op_name (enum ggml_op op);
|
||||||
GGML_API const char * ggml_op_symbol(enum ggml_op op);
|
GGML_API const char * ggml_op_symbol(enum ggml_op op);
|
||||||
|
|
|
||||||
|
|
@ -1294,6 +1294,12 @@ size_t ggml_row_size(enum ggml_type type, int64_t ne) {
|
||||||
return ggml_type_size(type)*ne/ggml_blck_size(type);
|
return ggml_type_size(type)*ne/ggml_blck_size(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double ggml_type_sizef(enum ggml_type type) {
|
||||||
|
assert(type >= 0);
|
||||||
|
assert(type < GGML_TYPE_COUNT);
|
||||||
|
return ((double)(type_traits[type].type_size))/type_traits[type].blck_size;
|
||||||
|
}
|
||||||
|
|
||||||
const char * ggml_type_name(enum ggml_type type) {
|
const char * ggml_type_name(enum ggml_type type) {
|
||||||
assert(type >= 0);
|
assert(type >= 0);
|
||||||
assert(type < GGML_TYPE_COUNT);
|
assert(type < GGML_TYPE_COUNT);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue