Early return for zero size calls to get_tensor.
Signed-off-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
parent
6c00a06692
commit
89b1915de3
1 changed files with 6 additions and 0 deletions
|
@ -1805,6 +1805,9 @@ static void * ggml_backend_kompute_buffer_get_base(ggml_backend_buffer_t buffer)
|
||||||
static void ggml_backend_kompute_buffer_set_tensor(ggml_backend_buffer_t buffer, ggml_tensor * tensor, const void * data, size_t offset, size_t size) {
|
static void ggml_backend_kompute_buffer_set_tensor(ggml_backend_buffer_t buffer, ggml_tensor * tensor, const void * data, size_t offset, size_t size) {
|
||||||
GGML_UNUSED(buffer);
|
GGML_UNUSED(buffer);
|
||||||
|
|
||||||
|
if (!size)
|
||||||
|
return;
|
||||||
|
|
||||||
const auto res = ggml_vk_get_tensor(tensor);
|
const auto res = ggml_vk_get_tensor(tensor);
|
||||||
GGML_ASSERT(res);
|
GGML_ASSERT(res);
|
||||||
|
|
||||||
|
@ -1816,6 +1819,9 @@ static void ggml_backend_kompute_buffer_set_tensor(ggml_backend_buffer_t buffer,
|
||||||
static void ggml_backend_kompute_buffer_get_tensor(ggml_backend_buffer_t buffer, const ggml_tensor * tensor, void * data, size_t offset, size_t size) {
|
static void ggml_backend_kompute_buffer_get_tensor(ggml_backend_buffer_t buffer, const ggml_tensor * tensor, void * data, size_t offset, size_t size) {
|
||||||
GGML_UNUSED(buffer);
|
GGML_UNUSED(buffer);
|
||||||
|
|
||||||
|
if (!size)
|
||||||
|
return;
|
||||||
|
|
||||||
const auto res = ggml_vk_get_tensor(tensor);
|
const auto res = ggml_vk_get_tensor(tensor);
|
||||||
GGML_ASSERT(res);
|
GGML_ASSERT(res);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue