aboutsummaryrefslogtreecommitdiff
path: root/ggml-cuda.cu
diff options
context:
space:
mode:
authorHoward Su <howard0su@gmail.com>2023-07-04 02:43:55 +0800
committerGitHub <noreply@github.com>2023-07-03 20:43:55 +0200
commitcc45a7feb8412e84ff292207621412fffc0d3d51 (patch)
treef3e64b4c05af6f50904c3329f713adda91d32535 /ggml-cuda.cu
parent55dbb915cc2a95048f56e667b09dfad38d840421 (diff)
Fix crash of test-tokenizer-0 under Debug build (#2064)
* Fix crash of test-tokenizer-0 under Debug build * Change per comment
Diffstat (limited to 'ggml-cuda.cu')
-rw-r--r--ggml-cuda.cu2
1 files changed, 1 insertions, 1 deletions
diff --git a/ggml-cuda.cu b/ggml-cuda.cu
index 50df20e..0b12a9e 100644
--- a/ggml-cuda.cu
+++ b/ggml-cuda.cu
@@ -2835,7 +2835,7 @@ void ggml_cuda_transform_tensor(void * data, struct ggml_tensor * tensor) {
}
void ggml_cuda_free_data(struct ggml_tensor * tensor) {
- if (tensor->backend != GGML_BACKEND_GPU && tensor->backend != GGML_BACKEND_GPU_SPLIT) {
+ if (!tensor || (tensor->backend != GGML_BACKEND_GPU && tensor->backend != GGML_BACKEND_GPU_SPLIT) ) {
return;
}