Skip to content

Commit

Permalink
add is_concurrent RXMeshDynamic update_launchbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahdhn committed Nov 8, 2023
1 parent d69c19c commit 39d6d7e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions apps/Simplification/simplification_rxmesh.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ inline void simplification_rxmesh(rxmesh::RXMeshDynamic& rx,
true,
false,
false,
false,
[](uint32_t v, uint32_t e, uint32_t f) {
return e * sizeof(uint8_t);
});
Expand Down
16 changes: 13 additions & 3 deletions include/rxmesh/rxmesh_dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,8 @@ class RXMeshDynamic : public RXMeshStatic
* @param oriented if the query is oriented. Valid only for Op::VV queries
* @param with_vertex_valence if vertex valence is requested to be
* pre-computed and stored in shared memory
* @param is_concurrent: in case of multiple queries (i.e., op.size() > 1),
* this parameter indicates if queries needs to be access at the same time
* @param user_shmem a (lambda) function that takes the number of vertices,
* edges, and faces and returns additional user-desired shared memory in
* bytes
Expand All @@ -449,6 +451,7 @@ class RXMeshDynamic : public RXMeshStatic
const bool is_dyn = true,
const bool oriented = false,
const bool with_vertex_valence = false,
const bool is_concurrent = false,
std::function<size_t(uint32_t, uint32_t, uint32_t)> user_shmem =
[](uint32_t v, uint32_t e, uint32_t f) { return 0; }) const
{
Expand All @@ -458,6 +461,7 @@ class RXMeshDynamic : public RXMeshStatic
is_dyn,
oriented,
with_vertex_valence,
is_concurrent,
user_shmem);

RXMESH_TRACE(
Expand Down Expand Up @@ -489,6 +493,8 @@ class RXMeshDynamic : public RXMeshStatic
* @param oriented if the query is oriented. Valid only for Op::VV queries
* @param with_vertex_valence if vertex valence is requested to be
* pre-computed and stored in shared memory
* @param is_concurrent: in case of multiple queries (i.e., op.size() > 1),
* this parameter indicates if queries needs to be access at the same time
* @param user_shmem a (lambda) function that takes the number of vertices,
* edges, and faces and returns additional user-desired shared memory in
* bytes
Expand All @@ -501,6 +507,7 @@ class RXMeshDynamic : public RXMeshStatic
const bool is_dyn = true,
const bool oriented = false,
const bool with_vertex_valence = false,
const bool is_concurrent = false,
std::function<size_t(uint32_t, uint32_t, uint32_t)> user_shmem =
[](uint32_t v, uint32_t e, uint32_t f) { return 0; }) const
{
Expand All @@ -510,9 +517,12 @@ class RXMeshDynamic : public RXMeshStatic
// static query shared memory
size_t static_shmem = 0;
for (auto o : op) {
static_shmem =
std::max(static_shmem,
this->calc_shared_memory<blockThreads>(o, oriented));
size_t sh = this->calc_shared_memory<blockThreads>(o, oriented);
if (is_concurrent) {
static_shmem += sh;
} else {
static_shmem = std::max(static_shmem, sh);
}
}

if (is_dyn) {
Expand Down

0 comments on commit 39d6d7e

Please sign in to comment.