ggml : move ggml_nbytes_split to ggml-cuda.cu
This commit is contained in:
parent
ae8b4840bc
commit
0040524060
3 changed files with 6 additions and 8 deletions
|
@ -8898,6 +8898,12 @@ static void ggml_cuda_nop(const ggml_tensor * src0, const ggml_tensor * src1, gg
|
||||||
(void) dst;
|
(void) dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static size_t ggml_nbytes_split(const struct ggml_tensor * tensor, int nrows_split) {
|
||||||
|
static_assert(GGML_MAX_DIMS == 4, "GGML_MAX_DIMS is not 4 - update this function");
|
||||||
|
|
||||||
|
return nrows_split*ggml_row_size(tensor->type, tensor->ne[0]);
|
||||||
|
}
|
||||||
|
|
||||||
void ggml_cuda_transform_tensor(void * data, struct ggml_tensor * tensor) {
|
void ggml_cuda_transform_tensor(void * data, struct ggml_tensor * tensor) {
|
||||||
const int64_t nrows = ggml_nrows(tensor);
|
const int64_t nrows = ggml_nrows(tensor);
|
||||||
|
|
||||||
|
|
7
ggml.c
7
ggml.c
|
@ -1997,13 +1997,6 @@ size_t ggml_nbytes_pad(const struct ggml_tensor * tensor) {
|
||||||
return GGML_PAD(ggml_nbytes(tensor), GGML_MEM_ALIGN);
|
return GGML_PAD(ggml_nbytes(tensor), GGML_MEM_ALIGN);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: move to ggml-cuda?
|
|
||||||
size_t ggml_nbytes_split(const struct ggml_tensor * tensor, int nrows_split) {
|
|
||||||
static_assert(GGML_MAX_DIMS == 4, "GGML_MAX_DIMS is not 4 - update this function");
|
|
||||||
|
|
||||||
return nrows_split*ggml_row_size(tensor->type, tensor->ne[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
int ggml_blck_size(enum ggml_type type) {
|
int ggml_blck_size(enum ggml_type type) {
|
||||||
return type_traits[type].blck_size;
|
return type_traits[type].blck_size;
|
||||||
}
|
}
|
||||||
|
|
1
ggml.h
1
ggml.h
|
@ -638,7 +638,6 @@ extern "C" {
|
||||||
GGML_API int64_t ggml_nrows (const struct ggml_tensor * tensor);
|
GGML_API int64_t ggml_nrows (const struct ggml_tensor * tensor);
|
||||||
GGML_API size_t ggml_nbytes (const struct ggml_tensor * tensor);
|
GGML_API size_t ggml_nbytes (const struct ggml_tensor * tensor);
|
||||||
GGML_API size_t ggml_nbytes_pad (const struct ggml_tensor * tensor); // same as ggml_nbytes() but padded to GGML_MEM_ALIGN
|
GGML_API size_t ggml_nbytes_pad (const struct ggml_tensor * tensor); // same as ggml_nbytes() but padded to GGML_MEM_ALIGN
|
||||||
GGML_API size_t ggml_nbytes_split(const struct ggml_tensor * tensor, int nrows_split);
|
|
||||||
|
|
||||||
GGML_API int ggml_blck_size(enum ggml_type type);
|
GGML_API int ggml_blck_size(enum ggml_type type);
|
||||||
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue