Reintroduces stricter check for CPU->CUDA backend async copy via

GGML_DEVICE_TYPE_CPU.
This commit is contained in:
aendk 2026-01-12 15:35:38 +01:00
parent b039e01a1e
commit 6ed448922c
1 changed files with 1 additions and 1 deletions

View File

@ -2794,7 +2794,7 @@ static bool ggml_backend_cuda_cpy_tensor_async(ggml_backend_t backend_src, ggml_
ggml_backend_buffer_t buf_dst = dst->view_src ? dst->view_src->buffer : dst->buffer;
//enables async copies from CPU to CUDA, instead of only CUDA-to-CUDA
bool copy_from_host = ggml_backend_buffer_is_host(src->buffer);
bool copy_from_host = ggml_backend_buffer_is_host(src->buffer) && ggml_backend_dev_type(backend_src->device) == GGML_BACKEND_DEVICE_TYPE_CPU;
if (!(copy_from_host || ggml_backend_is_cuda(backend_src)) || !ggml_backend_is_cuda(backend_dst)) {
return false;