Skip to content

Commit

Permalink
Fix share memory allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahdhn committed Jan 7, 2025
1 parent 3c19fb4 commit a82a46e
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 72 deletions.
2 changes: 1 addition & 1 deletion apps/Remesh/collapse.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ __global__ static void __launch_bounds__(blockThreads)

// a bitmask that indicates which edge we want to flip
// we also use it to mark updated edges (for edge_status)
Bitmask edge_mask(cavity.patch_info().edges_capacity[0], shrd_alloc);
Bitmask edge_mask(cavity.patch_info().edges_capacity, shrd_alloc);
edge_mask.reset(block);

uint32_t shmem_before = shrd_alloc.get_allocated_size_bytes();
Expand Down
2 changes: 1 addition & 1 deletion apps/Remesh/flip.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ __global__ static void __launch_bounds__(blockThreads)

// a bitmask that indicates which edge we want to flip
// we also used it to mark the new edges
Bitmask edge_mask(cavity.patch_info().edges_capacity[0], shrd_alloc);
Bitmask edge_mask(cavity.patch_info().edges_capacity, shrd_alloc);
edge_mask.reset(block);

uint32_t shmem_before = shrd_alloc.get_allocated_size_bytes();
Expand Down
5 changes: 2 additions & 3 deletions apps/Remesh/remesh_rxmesh.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,9 @@ inline void remesh_rxmesh(rxmesh::RXMeshDynamic& rx)
timers.elapsed_millis("SplitTotal"));
RXMESH_INFO("Collapse Total Time {} (ms)",
timers.elapsed_millis("CollapseTotal"));
RXMESH_INFO("Flip Total Time {} (ms)",
timers.elapsed_millis("FlipTotal"));
RXMESH_INFO("Flip Total Time {} (ms)", timers.elapsed_millis("FlipTotal"));
RXMESH_INFO("Smooth Total Time {} (ms)",
timers.elapsed_millis("SmoothTotal"));
timers.elapsed_millis("SmoothTotal"));

report.add_member("split_time_ms", timers.elapsed_millis("SplitTotal"));
report.add_member("collapse_time_ms",
Expand Down
2 changes: 1 addition & 1 deletion apps/Remesh/smoothing.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ __global__ static void __launch_bounds__(blockThreads)
return;
}

if (v_boundary(v_id)) {
if (v_boundary(v_id) || iter.size() == 0) {
new_coords(v_id, 0) = coords(v_id, 0);
new_coords(v_id, 1) = coords(v_id, 1);
new_coords(v_id, 2) = coords(v_id, 2);
Expand Down
2 changes: 1 addition & 1 deletion apps/SECHistogram/sec_kernels.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ __global__ static void sec(rxmesh::Context context,
// we first use this mask to set the edge we want to collapse (and then
// filter them). Then after cavity.prologue, we reuse this bitmask to mark
// the newly added edges
Bitmask edge_mask(cavity.patch_info().edges_capacity[0], shrd_alloc);
Bitmask edge_mask(cavity.patch_info().edges_capacity, shrd_alloc);
edge_mask.reset(block);

// we use this bitmask to mark the other end of to-be-collapse edge during
Expand Down
2 changes: 1 addition & 1 deletion apps/SECPriority/secp_kernels.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ __global__ static void secp(rxmesh::Context context,
// we first use this mask to set the edge we want to collapse (and then
// filter them). Then after cavity.prologue, we reuse this bitmask to mark
// the newly added edges
Bitmask edge_mask(cavity.patch_info().edges_capacity[0], shrd_alloc);
Bitmask edge_mask(cavity.patch_info().edges_capacity, shrd_alloc);
edge_mask.reset(block);

// we use this bitmask to mark the other end of to-be-collapse edge during
Expand Down
1 change: 1 addition & 0 deletions include/rxmesh/cavity_manager2.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,7 @@ struct CavityManager2

// store the boundary edges of all cavities in compact format (similar to
// CSR for sparse matrices using m_s_cavity_size_prefix but no value ptr)
// overlap with m_s_boudary_edges_cavity_id
uint16_t* m_s_cavity_boundary_edges;

// patch stash stored in shared memory
Expand Down
Loading

0 comments on commit a82a46e

Please sign in to comment.