Skip to content

Commit

Permalink
Fix for debug build: Fix ill-formed KOKKOS macro function decoration. (
Browse files Browse the repository at this point in the history
  • Loading branch information
overfelt authored Oct 4, 2024
1 parent 92223d2 commit 5df557f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
7 changes: 4 additions & 3 deletions include/ScratchViews.h
Original file line number Diff line number Diff line change
Expand Up @@ -776,10 +776,11 @@ MasterElementViews<T, TEAMHANDLETYPE, SHMEM>::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_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_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:
Expand Down
26 changes: 13 additions & 13 deletions include/master_element/MasterElementFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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];
Expand All @@ -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");

Expand All @@ -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,
Expand Down Expand Up @@ -222,7 +222,7 @@ generic_gij_3d(
}

template <typename AlgTraits>
KOKKOS_FUNCTION void
KOKKOS_INLINE_FUNCTION void
generic_Mij_2d(
const int numIntPoints,
const double* deriv,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
{
Expand All @@ -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] = {
Expand Down

0 comments on commit 5df557f

Please sign in to comment.