message: Lambda const propagation problem.
diff: @@ -363,6 +363,12 @@ static void OccaPADiffusionApply3D(const int D1D,
  const int MAX_Q1D = 10;
  const int MAX_D1D = 10;
  +template<int N>
  +class Dummy
  +{
  + int array[N];
  +};
  +
  // PA Diffusion Apply 2D kernel
  template<int T_D1D = 0, int T_Q1D = 0> static
  void PADiffusionApply2D(const int NE,
  @@ -389,6 +395,23 @@ void PADiffusionApply2D(const int NE,
  const DeviceTensor<3> op(_op,3,NQ,NE);
  const DeviceTensor<3> x(_x,D1D,D1D,NE);
  DeviceTensor<3> y(_y,D1D,D1D,NE);
  +
  + const int CONST = 2; // from here, CONST seems to be captured as run-time variable :-(
  + //constexpr int CONST = 2; // also this!
  +
  + MFEM_FORALL(e, NE,
  + {
  + //const int CONST = 2; // here, it is treated as compile-time constant and the loop is unrolled
  +
  + for (int i = 0; i < CONST; i++)
  + {
  + _y[D1D*e + i] = 12345;
  + }
  +
  + Dummy<CONST> dummy; // BUT: this apparently works as compile-time constant in both cases
  + });
  +
  +/*
  MFEM_FORALL(e, NE,
  {
  double grad[MAX_Q1D][MAX_Q1D][2];
  @@ -476,7 +499,7 @@ void PADiffusionApply2D(const int NE,
  }
  }
  }
  - });
  + });*/
  }
  // PA Diffusion Apply 3D kernel
  @@ -701,9 +724,9 @@ static void PADiffusionApply(const int dim,
  switch ((D1D << 4) | Q1D)
  {
  case 0x22: PADiffusionApply2D<2,2>(NE, B, G, Bt, Gt, op, x, y); break;
  - case 0x33: PADiffusionApply2D<3,3>(NE, B, G, Bt, Gt, op, x, y); break;
  + /*case 0x33: PADiffusionApply2D<3,3>(NE, B, G, Bt, Gt, op, x, y); break;
  case 0x44: PADiffusionApply2D<4,4>(NE, B, G, Bt, Gt, op, x, y); break;
  - case 0x55: PADiffusionApply2D<5,5>(NE, B, G, Bt, Gt, op, x, y); break;
  + case 0x55: PADiffusionApply2D<5,5>(NE, B, G, Bt, Gt, op, x, y); break;*/
  default: PADiffusionApply2D(NE, B, G, Bt, Gt, op, x, y, D1D, Q1D);
  }
  return;
  