Skip to content

Commit

Permalink
Fix SIMD ifdefs in ngpFieldOps (#1322)
Browse files Browse the repository at this point in the history
  • Loading branch information
marchdf authored Oct 24, 2024
1 parent a75e794 commit 9242f8b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions include/ngp_utils/NgpFieldOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ struct NodeFieldOp
const auto& msh = obj_.ngpMesh_;
const auto& fld = obj_.ngpField_;
const auto* einfo = edata_.info();
#ifdef STK_SIMD_NONE
#ifdef USE_STK_SIMD_NONE
fld.get(msh, einfo[0].entityNodes[ni], ic) = stk::simd::get_data(val, 0);
#else
for (int is = 0; is < edata_.numSimdElems; ++is) {
Expand All @@ -167,7 +167,7 @@ struct NodeFieldOp
const auto& msh = obj_.ngpMesh_;
const auto& fld = obj_.ngpField_;
const auto* einfo = edata_.info();
#ifdef STK_SIMD_NONE
#ifdef USE_STK_SIMD_NONE
Kokkos::atomic_add(
&fld.get(msh, einfo[0].entityNodes[ni], ic),
stk::simd::get_data(val, 0));
Expand All @@ -186,7 +186,7 @@ struct NodeFieldOp
const auto& msh = obj_.ngpMesh_;
const auto& fld = obj_.ngpField_;
const auto* einfo = edata_.info();
#ifdef STK_SIMD_NONE
#ifdef USE_STK_SIMD_NONE
fld.get(msh, einfo[0].entityNodes[ni], ic) = val;
#else
for (int is = 0; is < edata_.numSimdElems; ++is) {
Expand All @@ -201,7 +201,7 @@ struct NodeFieldOp
const auto& msh = obj_.ngpMesh_;
const auto& fld = obj_.ngpField_;
const auto* einfo = edata_.info();
#ifdef STK_SIMD_NONE
#ifdef USE_STK_SIMD_NONE
Kokkos::atomic_add(&fld.get(msh, einfo[0].entityNodes[ni], ic), val);
#else
for (int is = 0; is < edata_.numSimdElems; ++is) {
Expand Down Expand Up @@ -274,7 +274,7 @@ struct ElemFieldOp
{
const auto& fld = obj_.ngpField_;
const auto* einfo = edata_.info();
#ifdef STK_SIMD_NONE
#ifdef USE_STK_SIMD_NONE
fld.get(einfo[0].meshIdx, ic) = stk::simd::get_data(val, 0);
#else
for (int is = 0; is < edata_.numSimdElems; ++is) {
Expand All @@ -290,7 +290,7 @@ struct ElemFieldOp
const auto* einfo = edata_.info();

// No atomic_add here as only one element active per thread
#ifdef STK_SIMD_NONE
#ifdef USE_STK_SIMD_NONE
fld.get(einfo[0].meshIdx, ic) += stk::simd::get_data(val, 0);
#else
for (int is = 0; is < edata_.numSimdElems; ++is) {
Expand All @@ -304,7 +304,7 @@ struct ElemFieldOp
{
const auto& fld = obj_.ngpField_;
const auto* einfo = edata_.info();
#ifdef STK_SIMD_NONE
#ifdef USE_STK_SIMD_NONE
fld.get(einfo[0].meshIdx, ic) = val;
#else
for (int is = 0; is < edata_.numSimdElems; ++is) {
Expand All @@ -318,7 +318,7 @@ struct ElemFieldOp
{
const auto& fld = obj_.ngpField_;
const auto* einfo = edata_.info();
#ifdef STK_SIMD_NONE
#ifdef USE_STK_SIMD_NONE
fld.get(einfo[0].meshIdx, ic) += val;
#else
for (int is = 0; is < edata_.numSimdElems; ++is) {
Expand Down

0 comments on commit 9242f8b

Please sign in to comment.