Update ggml-cuda.cu

Co-authored-by: slaren <slarengh@gmail.com>
This commit is contained in:
Johannes Gäßler 2023-12-20 14:53:09 +01:00 committed by GitHub
parent 842adecffc
commit 967a0146fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9434,7 +9434,7 @@ bool ggml_cuda_compute_forward(struct ggml_compute_params * params, struct ggml_
return false;
}
if (tensor->src[0]->backend == GGML_BACKEND_GPU_SPLIT) {
if (tensor->src[0] != nullptr && tensor->src[0]->backend == GGML_BACKEND_GPU_SPLIT) {
ggml_cuda_set_peer_access(tensor->src[1]->ne[1]);
}