Skip to content

Commit

Permalink
initialize ne_counter vectors to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
joeljonsson committed Nov 9, 2023
1 parent 2b1fc69 commit 1b3f29f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/numerics/APRDownsampleGPU.cu
Original file line number Diff line number Diff line change
Expand Up @@ -899,8 +899,7 @@ __global__ void _fill_ne_rows_tree_cuda(const uint64_t* __restrict__ level_xz_ve
template<int blockSize_z, int blockSize_x>
void compute_ne_rows_tree_cuda(GPUAccessHelper& tree_access, VectorData<int>& ne_count, ScopedCudaMemHandler<int*, JUST_ALLOC>& ne_rows_gpu) {

ne_count.resize(tree_access.level_max() + 3);
ne_count[0] = 0;
ne_count.resize(tree_access.level_max() + 3, 0);

int z_blocks_max = (tree_access.z_num(tree_access.level_max()) + blockSize_z - 1) / blockSize_z;
int num_levels = tree_access.level_max() - tree_access.level_min() + 1;
Expand Down Expand Up @@ -979,8 +978,7 @@ void compute_ne_rows_tree_cuda(GPUAccessHelper& tree_access, VectorData<int>& ne


void compute_ne_rows_tree(GPUAccessHelper& tree_access, VectorData<int>& ne_counter, VectorData<int>& ne_rows) {
ne_counter.resize(tree_access.level_max() + 3);
ne_counter[0] = 0;
ne_counter.resize(tree_access.level_max() + 3, 0);

int z = 0;
int x = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/numerics/miscCuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ __global__ void fill_ne_rows_cuda(const uint64_t* level_xz_vec,
template<int blockSize_z, int blockSize_x>
void compute_ne_rows_cuda(GPUAccessHelper& access, VectorData<int>& ne_count, ScopedCudaMemHandler<int*, JUST_ALLOC>& ne_rows_gpu, int blockSize) {

ne_count.resize(access.level_max()+2);
ne_count.resize(access.level_max()+2, 0);

int stride = blockSize_z * blockSize;

Expand Down Expand Up @@ -360,7 +360,7 @@ inline void add_nonempty(GPUAccessHelper& access, uint64_t& counter, VectorData<


void compute_ne_rows(GPUAccessHelper& access, VectorData<int>& ne_counter, VectorData<int>& ne_rows, int block_size) {
ne_counter.resize(access.level_max()+2);
ne_counter.resize(access.level_max()+2, 0);

int z = 0;
int x = 0;
Expand Down

0 comments on commit 1b3f29f

Please sign in to comment.