Skip to content

Commit

Permalink
Z4co: replace std::function with pointer to make rocm happy
Browse files Browse the repository at this point in the history
  • Loading branch information
lwJi committed Aug 27, 2024
1 parent df588a1 commit 724eb79
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions Z4co/src/initial2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,19 @@ extern "C" void Z4co_Initial2(CCTK_ARGUMENTS) {
CCTK_DELTA_SPACE(2),
};

function<vec<simd<CCTK_REAL>, dim>(
vec<simd<CCTK_REAL>, dim> (*calc_deriv)(
const GF3D2<const CCTK_REAL> &, const simdl<CCTK_REAL> &,
const vect<int, dim> &, const vect<CCTK_REAL, dim> &)>
calc_deriv;
const vect<int, dim> &, const vect<CCTK_REAL, dim> &);

switch (deriv_order) {
case 2:
calc_deriv = [](const GF3D2<const CCTK_REAL> &gf,
const simdl<CCTK_REAL> &mask, const vect<int, dim> &I,
const vect<CCTK_REAL, dim> &dx) {
return Derivs::calc_deriv<2>(gf, mask, I, dx);
};
calc_deriv = &Derivs::calc_deriv<2>;
break;
case 4:
calc_deriv = [](const GF3D2<const CCTK_REAL> &gf,
const simdl<CCTK_REAL> &mask, const vect<int, dim> &I,
const vect<CCTK_REAL, dim> &dx) {
return Derivs::calc_deriv<4>(gf, mask, I, dx);
};
calc_deriv = &Derivs::calc_deriv<4>;
break;
case 6:
calc_deriv = [](const GF3D2<const CCTK_REAL> &gf,
const simdl<CCTK_REAL> &mask, const vect<int, dim> &I,
const vect<CCTK_REAL, dim> &dx) {
return Derivs::calc_deriv<6>(gf, mask, I, dx);
};
calc_deriv = &Derivs::calc_deriv<6>;
break;
default:
assert(0);
Expand Down

0 comments on commit 724eb79

Please sign in to comment.