Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahdhn committed Jan 6, 2025
1 parent 71df217 commit 3c19fb4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/rxmesh/cavity_manager2.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ struct CavityManager2
/**
* @brief try to add an edge in the cavity graph that connects the two nodes
* that represents the cavities c0 and c1. If we can not add the edge
* (because if the space constraints), we deactivate the cavity with more
* (because of the space constraints), we deactivate the cavity with more
* overlaps
*/
__device__ __forceinline__ void add_edge_to_cavity_graph(const uint16_t c0,
Expand Down
12 changes: 9 additions & 3 deletions include/rxmesh/cavity_manager_impl2.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -1191,10 +1191,16 @@ CavityManager2<blockThreads, cop>::add_edge_to_cavity_graph(const uint16_t c0,

// decide which cavity to deactivate
// we choose the one with more overlaps
// printf("\n deactiaving !!!!!!!!!!! ");
if (c0_id > c1_id) {
if (c0_id > c1_id && c0_id != MAX_OVERLAP_CAVITIES) {
clear(c0, c0_id);
} else {
} else if (c0_id > c1_id && c1_id != MAX_OVERLAP_CAVITIES) {
clear(c1, c1_id);
}

// if we can prioritize based on overlapping size
if (c0_id != MAX_OVERLAP_CAVITIES) {
clear(c0, c0_id);
} else if (c1_id != MAX_OVERLAP_CAVITIES) {
clear(c1, c1_id);
}
}
Expand Down
11 changes: 11 additions & 0 deletions include/rxmesh/kernels/rxmesh_queries.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ __device__ __forceinline__ void orient_edges_around_vertices(
// TODO if the vertex is not owned by this patch, then there is no
// reason to orient its edges because no serious computation is done on
// it
if (patch_info.is_deleted(LocalVertexT(v))) {
continue;
}

int start = int(s_output_offset[v]);
int end = int(s_output_offset[v + 1]);
Expand Down Expand Up @@ -601,6 +604,10 @@ __device__ __forceinline__ void v_v(cooperative_groups::thread_block& block,
const uint32_t* s_ev_duplicate32 =
reinterpret_cast<const uint32_t*>(s_ev_duplicate);
for (uint32_t v = threadIdx.x; v < num_vertices; v += blockThreads) {
if (detail::is_deleted(v, active_mask_v)) {
continue;
}

uint32_t start = s_output_offset[v];
uint32_t end = s_output_offset[v + 1];

Expand All @@ -616,6 +623,10 @@ __device__ __forceinline__ void v_v(cooperative_groups::thread_block& block,
// uint16_t v1 = s_ev_duplicate[2 * edge + 1];

assert(v0 != INVALID16 && v1 != INVALID16);

assert(!detail::is_deleted(v0, active_mask_v));
assert(!detail::is_deleted(v1, active_mask_v));

assert(v0 == v || v1 == v);
// s_output_value[e] = (v0 == v) ? v1 : v0;
s_output_value[e] = (v0 == v) * v1 + (v1 == v) * v0;
Expand Down

0 comments on commit 3c19fb4

Please sign in to comment.