From 46e61a5bd44947cc1bfe06a7ea73716e07a33e1e Mon Sep 17 00:00:00 2001 From: PanZezhong1725 <141193946+PanZezhong1725@users.noreply.github.com> Date: Fri, 5 Jan 2024 09:19:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Slice=E5=86=85=E5=AD=98?= =?UTF-8?q?=E8=B6=8A=E7=95=8C=E9=97=AE=E9=A2=98=20(#204)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix (slice): add guard for area out of range Co-authored-by: Haojie Wang --- src/kernels/cuda/pad_slice.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kernels/cuda/pad_slice.cu b/src/kernels/cuda/pad_slice.cu index f119bd9c..cd6bc37b 100644 --- a/src/kernels/cuda/pad_slice.cu +++ b/src/kernels/cuda/pad_slice.cu @@ -35,7 +35,7 @@ __global__ void _pad_slice_kernel(T *part, T *whole, TransMetaData metaData, whole[tid] = 0; else whole[tid] = part[offset]; - else + else if (offset >= 0) part[offset] = whole[tid]; tid += stride; }