From 0c84c2ba83bee7389f1c13110c0a8bf5397d85ab Mon Sep 17 00:00:00 2001 From: Ahmed Mahmoud Date: Mon, 26 Feb 2024 16:00:47 -0500 Subject: [PATCH] fix compilation --- apps/lbmMultiRes/fusedFinest.h | 2 +- .../Neon/domain/details/bGridDisg/bPartition.h | 3 +++ .../Neon/domain/details/bGridDisg/bPartition_imp.h | 12 ++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/apps/lbmMultiRes/fusedFinest.h b/apps/lbmMultiRes/fusedFinest.h index 4a8d75bb..3caf09f9 100644 --- a/apps/lbmMultiRes/fusedFinest.h +++ b/apps/lbmMultiRes/fusedFinest.h @@ -18,7 +18,7 @@ inline NEON_CUDA_HOST_DEVICE void stream(const typename Neon::domain::mGrid::Idx const auto nghCell = out.helpGetNghIdx(cell, dir); if (!out.hasChildren(nghCell)) { if (out.isActive(nghCell)) { - auto nghType = type(nghCell); + auto nghType = type(nghCell,0); if (nghType == CellType::bulk) { out(nghCell, q) = cellVal; } else { diff --git a/libNeonDomain/include/Neon/domain/details/bGridDisg/bPartition.h b/libNeonDomain/include/Neon/domain/details/bGridDisg/bPartition.h index 23e8b4bb..95de4e25 100644 --- a/libNeonDomain/include/Neon/domain/details/bGridDisg/bPartition.h +++ b/libNeonDomain/include/Neon/domain/details/bGridDisg/bPartition.h @@ -131,6 +131,9 @@ namespace Neon::domain::details::disaggregated::bGrid { isActive(const Idx &cell, const typename SBlock::BitMask *mask = nullptr) const -> bool; + NEON_CUDA_HOST_DEVICE inline auto + isActive(const Idx& cell, + const NghIdx nghDir) const -> bool; NEON_CUDA_HOST_DEVICE inline auto getDomainSize() diff --git a/libNeonDomain/include/Neon/domain/details/bGridDisg/bPartition_imp.h b/libNeonDomain/include/Neon/domain/details/bGridDisg/bPartition_imp.h index b0a6a9d5..f3ded3cd 100644 --- a/libNeonDomain/include/Neon/domain/details/bGridDisg/bPartition_imp.h +++ b/libNeonDomain/include/Neon/domain/details/bGridDisg/bPartition_imp.h @@ -454,4 +454,16 @@ bPartition::isActive(const Idx& cell, } } +template +NEON_CUDA_HOST_DEVICE inline auto +bPartition::isActive(const Idx& cell, + const NghIdx nghDir) const -> bool +{ + Idx nghCell = this->helpGetNghIdx(cell, nghDir); + if (nghCell.mDataBlockIdx == std::numeric_limits::max()) { + return false; + } + return isActive(nghCell); +} + } // namespace Neon::domain::details::disaggregated::bGrid \ No newline at end of file