summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Scholz <Green-Sky@users.noreply.github.com>2024-01-05 16:00:00 +0100
committerGeorgi Gerganov <ggerganov@gmail.com>2024-01-11 09:39:05 +0200
commitf34432ca1e0b288129390c1db8296a82aaf1e632 (patch)
tree5577efd2df387a61419323aeea85225517c4f9c2
parent7a9f75c38b5e62fe27b8a5a3ed823b4a3714024b (diff)
fix : cuda order of synchronization when setting a buffer (ggml/679)
* fix : cuda order of synchronization when setting a buffer * also sync before memcpy --------- Co-authored-by: slaren <slarengh@gmail.com>
-rw-r--r--ggml-cuda.cu2
1 files changed, 1 insertions, 1 deletions
diff --git a/ggml-cuda.cu b/ggml-cuda.cu
index e26260a3..900f7ba4 100644
--- a/ggml-cuda.cu
+++ b/ggml-cuda.cu
@@ -10184,8 +10184,8 @@ static void ggml_backend_cuda_buffer_set_tensor(ggml_backend_buffer_t buffer, gg
ggml_cuda_set_device(ctx->device);
CUDA_CHECK(cudaDeviceSynchronize());
-
CUDA_CHECK(cudaMemcpy((char *)tensor->data + offset, data, size, cudaMemcpyHostToDevice));
+ CUDA_CHECK(cudaDeviceSynchronize());
}
static void ggml_backend_cuda_buffer_get_tensor(ggml_backend_buffer_t buffer, const ggml_tensor * tensor, void * data, size_t offset, size_t size) {