CUDA: fix bad asserts for partial offload (#13337)

This commit is contained in:
Johannes Gäßler 2025-05-06 13:58:51 +02:00 committed by GitHub
parent 764b85627b
commit 2356fb1d53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 21 additions and 6 deletions

View file

@ -1299,6 +1299,10 @@ bool ggml_is_contiguous_2(const struct ggml_tensor * tensor) {
return ggml_is_contiguous_n(tensor, 2);
}
bool ggml_is_contiguously_allocated(const struct ggml_tensor * tensor) {
return ggml_nbytes(tensor) == ggml_nelements(tensor) * ggml_type_size(tensor->type)/ggml_blck_size(tensor->type);
}
bool ggml_is_permuted(const struct ggml_tensor * tensor) {
static_assert(GGML_MAX_DIMS == 4, "GGML_MAX_DIMS is not 4 - update this function");