Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory access out of bounds #70

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/preprocess_kernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ __global__ void generateBaseFeatures_kernel(unsigned int *mask, float *voxels,
unsigned int current_pillarId = 0;
current_pillarId = atomicAdd(pillar_num, 1);

if( current_pillarId >= MAX_VOXELS ) return;

voxel_num[current_pillarId] = count;

uint4 idx = {0, 0, voxel_idy, voxel_idx};
Expand Down Expand Up @@ -194,10 +196,10 @@ __global__ void generateFeatures_kernel(float* voxel_features,
int pillar_idx = blockIdx.x * WARPS_PER_BLOCK + threadIdx.x/WARP_SIZE;
int point_idx = threadIdx.x % WARP_SIZE;

int pillar_idx_inBlock = threadIdx.x/32;
int pillar_idx_inBlock = threadIdx.x/WARP_SIZE;
unsigned int num_pillars = params[0];

if (pillar_idx >= num_pillars) return;
if (pillar_idx >= num_pillars || pillar_idx >= MAX_VOXELS) return;

__shared__ float4 pillarSM[WARPS_PER_BLOCK][WARP_SIZE];
__shared__ float4 pillarSumSM[WARPS_PER_BLOCK];
Expand Down