Merge 0547e7449a into 2634ed207a
This commit is contained in:
commit
d134a80e18
|
|
@ -258,6 +258,7 @@ void ggml_backend_tensor_set_async(ggml_backend_t backend, struct ggml_tensor *
|
||||||
GGML_ASSERT(offset + size <= ggml_nbytes(tensor) && "tensor write out of bounds");
|
GGML_ASSERT(offset + size <= ggml_nbytes(tensor) && "tensor write out of bounds");
|
||||||
|
|
||||||
if (backend->iface.set_tensor_async == NULL) {
|
if (backend->iface.set_tensor_async == NULL) {
|
||||||
|
ggml_backend_synchronize(backend);
|
||||||
ggml_backend_tensor_set(tensor, data, offset, size);
|
ggml_backend_tensor_set(tensor, data, offset, size);
|
||||||
} else {
|
} else {
|
||||||
backend->iface.set_tensor_async(backend, tensor, data, offset, size);
|
backend->iface.set_tensor_async(backend, tensor, data, offset, size);
|
||||||
|
|
@ -271,6 +272,7 @@ void ggml_backend_tensor_get_async(ggml_backend_t backend, const struct ggml_ten
|
||||||
GGML_ASSERT(offset + size <= ggml_nbytes(tensor) && "tensor read out of bounds");
|
GGML_ASSERT(offset + size <= ggml_nbytes(tensor) && "tensor read out of bounds");
|
||||||
|
|
||||||
if (backend->iface.get_tensor_async == NULL) {
|
if (backend->iface.get_tensor_async == NULL) {
|
||||||
|
ggml_backend_synchronize(backend);
|
||||||
ggml_backend_tensor_get(tensor, data, offset, size);
|
ggml_backend_tensor_get(tensor, data, offset, size);
|
||||||
} else {
|
} else {
|
||||||
backend->iface.get_tensor_async(backend, tensor, data, offset, size);
|
backend->iface.get_tensor_async(backend, tensor, data, offset, size);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue