From 60b6a5519195710fa9a7dc335944e9772cc685d9 Mon Sep 17 00:00:00 2001
From: "nicolas.marie" <nicolas.marie@ensiie.eu>
Date: Thu, 21 Dec 2023 15:34:24 +0100
Subject: [PATCH] fixe cuda SEGV

---
 Projet/CODE/apm/src/apm_gpu.cu | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Projet/CODE/apm/src/apm_gpu.cu b/Projet/CODE/apm/src/apm_gpu.cu
index 44cd14f..ce4656c 100644
--- a/Projet/CODE/apm/src/apm_gpu.cu
+++ b/Projet/CODE/apm/src/apm_gpu.cu
@@ -175,7 +175,7 @@ levenshtein_cu(char *find, char *buf, int len, int n_bytes
 {
 	int tId = blockIdx.x * blockDim.x + threadIdx.x;//global thread id
 
-	if (tId > n_bytes)
+	if (tId >= n_bytes - len)
 	{
 		return; //we are past the buffer length - do not process
 	}
-- 
GitLab