Commit cb72d602 authored by Peter Bell's avatar Peter Bell

Use alias templates for vtype

parent 8a1d38e4
...@@ -2812,6 +2812,8 @@ template<> struct VTYPE<long double> ...@@ -2812,6 +2812,8 @@ template<> struct VTYPE<long double>
{ {
using type = long double __attribute__ ((vector_size (VLEN<long double>::val*sizeof(long double)))); using type = long double __attribute__ ((vector_size (VLEN<long double>::val*sizeof(long double))));
}; };
template <typename T> using vtype_t = typename VTYPE<T>::type;
#endif #endif
template<typename T> arr<char> alloc_tmp(const shape_t &shape, template<typename T> arr<char> alloc_tmp(const shape_t &shape,
...@@ -2866,9 +2868,8 @@ template<typename T> POCKETFFT_NOINLINE void general_c( ...@@ -2866,9 +2868,8 @@ template<typename T> POCKETFFT_NOINLINE void general_c(
if (vlen>1) if (vlen>1)
while (it.remaining()>=vlen) while (it.remaining()>=vlen)
{ {
using vtype = typename VTYPE<T>::type;
it.advance(vlen); it.advance(vlen);
auto tdatav = reinterpret_cast<cmplx<vtype> *>(storage.data()); auto tdatav = reinterpret_cast<cmplx<vtype_t<T>> *>(storage.data());
for (size_t i=0; i<len; ++i) for (size_t i=0; i<len; ++i)
for (size_t j=0; j<vlen; ++j) for (size_t j=0; j<vlen; ++j)
{ {
...@@ -2924,9 +2925,8 @@ template<typename T> POCKETFFT_NOINLINE void general_hartley( ...@@ -2924,9 +2925,8 @@ template<typename T> POCKETFFT_NOINLINE void general_hartley(
if (vlen>1) if (vlen>1)
while (it.remaining()>=vlen) while (it.remaining()>=vlen)
{ {
using vtype = typename VTYPE<T>::type;
it.advance(vlen); it.advance(vlen);
auto tdatav = reinterpret_cast<vtype *>(storage.data()); auto tdatav = reinterpret_cast<vtype_t<T> *>(storage.data());
for (size_t i=0; i<len; ++i) for (size_t i=0; i<len; ++i)
for (size_t j=0; j<vlen; ++j) for (size_t j=0; j<vlen; ++j)
tdatav[i][j] = tin[it.iofs(j,i)]; tdatav[i][j] = tin[it.iofs(j,i)];
...@@ -2992,9 +2992,8 @@ template<typename Trafo, typename T> POCKETFFT_NOINLINE void general_dcst( ...@@ -2992,9 +2992,8 @@ template<typename Trafo, typename T> POCKETFFT_NOINLINE void general_dcst(
if (vlen>1) if (vlen>1)
while (it.remaining()>=vlen) while (it.remaining()>=vlen)
{ {
using vtype = typename VTYPE<T>::type;
it.advance(vlen); it.advance(vlen);
auto tdatav = reinterpret_cast<vtype *>(storage.data()); auto tdatav = reinterpret_cast<vtype_t<T> *>(storage.data());
for (size_t i=0; i<len; ++i) for (size_t i=0; i<len; ++i)
for (size_t j=0; j<vlen; ++j) for (size_t j=0; j<vlen; ++j)
tdatav[i][j] = tin[it.iofs(j,i)]; tdatav[i][j] = tin[it.iofs(j,i)];
...@@ -3040,9 +3039,8 @@ template<typename T> POCKETFFT_NOINLINE void general_r2c( ...@@ -3040,9 +3039,8 @@ template<typename T> POCKETFFT_NOINLINE void general_r2c(
if (vlen>1) if (vlen>1)
while (it.remaining()>=vlen) while (it.remaining()>=vlen)
{ {
using vtype = typename VTYPE<T>::type;
it.advance(vlen); it.advance(vlen);
auto tdatav = reinterpret_cast<vtype *>(storage.data()); auto tdatav = reinterpret_cast<vtype_t<T> *>(storage.data());
for (size_t i=0; i<len; ++i) for (size_t i=0; i<len; ++i)
for (size_t j=0; j<vlen; ++j) for (size_t j=0; j<vlen; ++j)
tdatav[i][j] = in[it.iofs(j,i)]; tdatav[i][j] = in[it.iofs(j,i)];
...@@ -3100,9 +3098,8 @@ template<typename T> POCKETFFT_NOINLINE void general_c2r( ...@@ -3100,9 +3098,8 @@ template<typename T> POCKETFFT_NOINLINE void general_c2r(
if (vlen>1) if (vlen>1)
while (it.remaining()>=vlen) while (it.remaining()>=vlen)
{ {
using vtype = typename VTYPE<T>::type;
it.advance(vlen); it.advance(vlen);
auto tdatav = reinterpret_cast<vtype *>(storage.data()); auto tdatav = reinterpret_cast<vtype_t<T> *>(storage.data());
for (size_t j=0; j<vlen; ++j) for (size_t j=0; j<vlen; ++j)
tdatav[0][j]=in[it.iofs(j,0)].r; tdatav[0][j]=in[it.iofs(j,0)].r;
{ {
...@@ -3172,9 +3169,8 @@ template<typename T> POCKETFFT_NOINLINE void general_r( ...@@ -3172,9 +3169,8 @@ template<typename T> POCKETFFT_NOINLINE void general_r(
if (vlen>1) if (vlen>1)
while (it.remaining()>=vlen) while (it.remaining()>=vlen)
{ {
using vtype = typename VTYPE<T>::type;
it.advance(vlen); it.advance(vlen);
auto tdatav = reinterpret_cast<vtype *>(storage.data()); auto tdatav = reinterpret_cast<vtype_t<T> *>(storage.data());
for (size_t i=0; i<len; ++i) for (size_t i=0; i<len; ++i)
for (size_t j=0; j<vlen; ++j) for (size_t j=0; j<vlen; ++j)
tdatav[i][j] = tin[it.iofs(j,i)]; tdatav[i][j] = tin[it.iofs(j,i)];
......
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