From 43aaa381512d6f0d6c01b8504883f0bf559e67df Mon Sep 17 00:00:00 2001 From: James Overfelt Date: Fri, 4 Oct 2024 13:40:33 -0600 Subject: [PATCH 1/2] Fix for debug build: Fix ill-formed KOKKOS macro function decoration. --- include/ScratchViews.h | 4 +-- .../master_element/MasterElementFunctions.h | 26 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/ScratchViews.h b/include/ScratchViews.h index 3386303ad..6f1df76ba 100644 --- a/include/ScratchViews.h +++ b/include/ScratchViews.h @@ -777,9 +777,9 @@ MasterElementViews::fill_master_element_views_new_me( case SCS_SHIFTED_GRAD_OP: STK_NGP_ThrowRequireMsg( meSCS != nullptr, - "ERROR, meSCS needs to be non-null if SCS_GRAD_OP is requested."); + "ERROR, meSCS needs to be non-null if SCS_SHIFTED_GRAD_OP is requested."); STK_NGP_ThrowRequireMsg( - coordsView != nullptr, "ERROR, coords null but SCS_GRAD_OP requested."); + coordsView != nullptr, "ERROR, coords null but SCS_SHIFTED_GRAD_OP requested."); meSCS->shifted_grad_op(*coordsView, dndx_shifted, deriv); break; case SCS_GIJ: diff --git a/include/master_element/MasterElementFunctions.h b/include/master_element/MasterElementFunctions.h index 66840e784..768baeec2 100644 --- a/include/master_element/MasterElementFunctions.h +++ b/include/master_element/MasterElementFunctions.h @@ -62,7 +62,7 @@ template < typename GradViewType, typename CoordViewType, typename OutputViewType> -KOKKOS_FUNCTION KOKKOS_FUNCTION void +KOKKOS_INLINE_FUNCTION void generic_grad_op( const GradViewType& referenceGradWeights, const CoordViewType& coords, @@ -82,11 +82,11 @@ generic_grad_op( CoordViewType::rank == 2, "Coordinate view assumed to be rank 2"); static_assert(OutputViewType::rank == 3, "Weight view assumed to be rank 3"); - STK_ThrowAssert( + STK_NGP_ThrowAssert( AlgTraits::nodesPerElement_ == referenceGradWeights.extent(1)); - STK_ThrowAssert(AlgTraits::nDim_ == referenceGradWeights.extent(2)); + STK_NGP_ThrowAssert(AlgTraits::nDim_ == referenceGradWeights.extent(2)); for (int i = 0; i < dim; ++i) - STK_ThrowAssert(weights.extent(i) == referenceGradWeights.extent(i)); + STK_NGP_ThrowAssert(weights.extent(i) == referenceGradWeights.extent(i)); for (unsigned ip = 0; ip < referenceGradWeights.extent(0); ++ip) { NALU_ALIGNED ftype jact[dim][dim]; @@ -112,7 +112,7 @@ generic_grad_op( NALU_ALIGNED ftype det = ftype(0.0); for (int i = 0; i < dim; ++i) det += jact[i][0] * adjJac[i][0]; - STK_ThrowAssertMsg( + STK_NGP_ThrowAssertMsg( stk::simd::are_any(det > tiny_positive_value()), "Problem with Jacobian determinant"); @@ -135,7 +135,7 @@ template < typename GradViewType, typename CoordViewType, typename OutputViewType> -KOKKOS_FUNCTION void +KOKKOS_INLINE_FUNCTION void generic_gij_3d( const GradViewType& referenceGradWeights, const CoordViewType& coords, @@ -222,7 +222,7 @@ generic_gij_3d( } template -KOKKOS_FUNCTION void +KOKKOS_INLINE_FUNCTION void generic_Mij_2d( const int numIntPoints, const double* deriv, @@ -319,7 +319,7 @@ template < typename GradViewType, typename CoordViewType, typename OutputViewType> -KOKKOS_FUNCTION void +KOKKOS_INLINE_FUNCTION void generic_Mij_2d( const GradViewType& referenceGradWeights, const CoordViewType& coords, @@ -502,7 +502,7 @@ template < typename GradViewType, typename CoordViewType, typename OutputViewType> -KOKKOS_FUNCTION void +KOKKOS_INLINE_FUNCTION void generic_Mij_3d( const GradViewType& referenceGradWeights, const CoordViewType& coords, @@ -583,7 +583,7 @@ template < typename GradViewType, typename CoordViewType, typename OutputViewType> -KOKKOS_FUNCTION void +KOKKOS_INLINE_FUNCTION void generic_determinant_3d( GradViewType referenceGradWeights, CoordViewType coords, OutputViewType detj) { @@ -599,11 +599,11 @@ generic_determinant_3d( static_assert(OutputViewType::rank == 1, "Weight view assumed to be 1D"); static_assert(AlgTraits::nDim_ == 3, "3D method"); - STK_ThrowAssert( + STK_NGP_ThrowAssert( AlgTraits::nodesPerElement_ == referenceGradWeights.extent(1)); - STK_ThrowAssert(AlgTraits::nDim_ == referenceGradWeights.extent(2)); + STK_NGP_ThrowAssert(AlgTraits::nDim_ == referenceGradWeights.extent(2)); - STK_ThrowAssert(detj.extent(0) == referenceGradWeights.extent(0)); + STK_NGP_ThrowAssert(detj.extent(0) == referenceGradWeights.extent(0)); for (unsigned ip = 0; ip < referenceGradWeights.extent(0); ++ip) { NALU_ALIGNED ftype jac[3][3] = { From 714a8a3d9a6fa149e90e6251b0dcdee6c5a19082 Mon Sep 17 00:00:00 2001 From: James Overfelt Date: Fri, 4 Oct 2024 13:50:22 -0600 Subject: [PATCH 2/2] Trying to fix formatting. --- include/ScratchViews.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/ScratchViews.h b/include/ScratchViews.h index 6f1df76ba..832ffd9ce 100644 --- a/include/ScratchViews.h +++ b/include/ScratchViews.h @@ -776,10 +776,11 @@ MasterElementViews::fill_master_element_views_new_me( break; case SCS_SHIFTED_GRAD_OP: STK_NGP_ThrowRequireMsg( - meSCS != nullptr, - "ERROR, meSCS needs to be non-null if SCS_SHIFTED_GRAD_OP is requested."); + meSCS != nullptr, "ERROR, meSCS needs to be non-null if " + "SCS_SHIFTED_GRAD_OP is requested."); STK_NGP_ThrowRequireMsg( - coordsView != nullptr, "ERROR, coords null but SCS_SHIFTED_GRAD_OP requested."); + coordsView != nullptr, + "ERROR, coords null but SCS_SHIFTED_GRAD_OP requested."); meSCS->shifted_grad_op(*coordsView, dndx_shifted, deriv); break; case SCS_GIJ: