Commit 1971f449 authored by Peter Bell's avatar Peter Bell

Remove specific general_ functions {c, r, hartley & dcst}

parent 4ef6e3bf
......@@ -2955,13 +2955,6 @@ struct ExecC2C
}
};
template<typename T> void general_c(
const cndarr<cmplx<T>> &in, ndarr<cmplx<T>> &out,
const shape_t &axes, bool forward, T fct, size_t nthreads)
{
general_nd<pocketfft_c<T>>(in, out, axes, fct, nthreads, ExecC2C{forward});
}
template <typename T, size_t vlen> void copy_hartley(const multi_iter<vlen> &it,
const vtype_t<T> *POCKETFFT_RESTRICT src, ndarr<T> &dst)
{
......@@ -3005,13 +2998,6 @@ struct ExecHartley
}
};
template<typename T> POCKETFFT_NOINLINE void general_hartley(
const cndarr<T> &in, ndarr<T> &out, const shape_t &axes, T fct,
size_t nthreads)
{
general_nd<pocketfft_r<T>>(in, out, axes, fct, nthreads, ExecHartley{});
}
struct ExecDcst
{
bool ortho;
......@@ -3028,13 +3014,6 @@ struct ExecDcst
}
};
template<typename Trafo, typename T> POCKETFFT_NOINLINE void general_dcst(
const cndarr<T> &in, ndarr<T> &out, const shape_t &axes,
T fct, bool ortho, int type, bool cosine, size_t nthreads)
{
general_nd<Trafo>(in, out, axes, fct, nthreads, ExecDcst{ortho, type, cosine});
}
template<typename T> POCKETFFT_NOINLINE void general_r2c(
const cndarr<T> &in, ndarr<cmplx<T>> &out, size_t axis, bool forward, T fct,
size_t POCKETFFT_NTHREADS)
......@@ -3172,14 +3151,6 @@ struct ExecR2R
}
};
template<typename T> POCKETFFT_NOINLINE void general_r(
const cndarr<T> &in, ndarr<T> &out, const shape_t &axes, bool r2c,
bool forward, T fct, size_t nthreads)
{
general_nd<pocketfft_r<T>>(in, out, axes, fct, nthreads,
ExecR2R{r2c, forward});
}
#undef POCKETFFT_NTHREADS
template<typename T> void c2c(const shape_t &shape, const stride_t &stride_in,
......@@ -3191,7 +3162,7 @@ template<typename T> void c2c(const shape_t &shape, const stride_t &stride_in,
util::sanity_check(shape, stride_in, stride_out, data_in==data_out, axes);
cndarr<cmplx<T>> ain(data_in, shape, stride_in);
ndarr<cmplx<T>> aout(data_out, shape, stride_out);
general_c(ain, aout, axes, forward, fct, nthreads);
general_nd<pocketfft_c<T>>(ain, aout, axes, fct, nthreads, ExecC2C{forward});
}
template<typename T> void dct(const shape_t &shape,
......@@ -3203,12 +3174,13 @@ template<typename T> void dct(const shape_t &shape,
util::sanity_check(shape, stride_in, stride_out, data_in==data_out, axes);
cndarr<T> ain(data_in, shape, stride_in);
ndarr<T> aout(data_out, shape, stride_out);
const ExecDcst exec{ortho, type, true};
if (type==1)
general_dcst<T_dct1<T>>(ain, aout, axes, fct, ortho, type, true, nthreads);
general_nd<T_dct1<T>>(ain, aout, axes, fct, nthreads, exec);
else if (type==4)
general_dcst<T_dcst4<T>>(ain, aout, axes, fct, ortho, type, true, nthreads);
general_nd<T_dcst4<T>>(ain, aout, axes, fct, nthreads, exec);
else
general_dcst<T_dcst23<T>>(ain, aout, axes, fct, ortho, type, true, nthreads);
general_nd<T_dcst23<T>>(ain, aout, axes, fct, nthreads, exec);
}
template<typename T> void dst(const shape_t &shape,
......@@ -3220,12 +3192,13 @@ template<typename T> void dst(const shape_t &shape,
util::sanity_check(shape, stride_in, stride_out, data_in==data_out, axes);
cndarr<T> ain(data_in, shape, stride_in);
ndarr<T> aout(data_out, shape, stride_out);
const ExecDcst exec{ortho, type, false};
if (type==1)
general_dcst<T_dst1<T>>(ain, aout, axes, fct, ortho, type, false, nthreads);
general_nd<T_dst1<T>>(ain, aout, axes, fct, nthreads, exec);
else if (type==4)
general_dcst<T_dcst4<T>>(ain, aout, axes, fct, ortho, type, false, nthreads);
general_nd<T_dcst4<T>>(ain, aout, axes, fct, nthreads, exec);
else
general_dcst<T_dcst23<T>>(ain, aout, axes, fct, ortho, type, false, nthreads);
general_nd<T_dcst23<T>>(ain, aout, axes, fct, nthreads, exec);
}
template<typename T> void r2c(const shape_t &shape_in,
......@@ -3309,7 +3282,8 @@ template<typename T> void r2r_fftpack(const shape_t &shape,
util::sanity_check(shape, stride_in, stride_out, data_in==data_out, axes);
cndarr<T> ain(data_in, shape, stride_in);
ndarr<T> aout(data_out, shape, stride_out);
general_r(ain, aout, axes, real2hermitian, forward, fct, nthreads);
general_nd<pocketfft_r<T>>(ain, aout, axes, fct, nthreads,
ExecR2R{real2hermitian, forward});
}
template<typename T> void r2r_separable_hartley(const shape_t &shape,
......@@ -3320,7 +3294,7 @@ template<typename T> void r2r_separable_hartley(const shape_t &shape,
util::sanity_check(shape, stride_in, stride_out, data_in==data_out, axes);
cndarr<T> ain(data_in, shape, stride_in);
ndarr<T> aout(data_out, shape, stride_out);
general_hartley(ain, aout, axes, fct, nthreads);
general_nd<pocketfft_r<T>>(ain, aout, axes, fct, nthreads, ExecHartley{});
}
} // namespace detail
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment