Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pypocketfft
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Martin Reinecke
pypocketfft
Commits
1e3079c4
Commit
1e3079c4
authored
Apr 19, 2019
by
Martin Reinecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
4d223cc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
59 deletions
+13
-59
pocketfft.cc
pocketfft.cc
+13
-59
No files found.
pocketfft.cc
View file @
1e3079c4
/*
* This file is part of pocketfft.
* Licensed under a 3-clause BSD style license - see LICENSE.md
*/
/*
* Main implementation file.
*
* Copyright (C) 2004-2019 Max-Planck-Society
* \author Martin Reinecke
*/
#include <cmath>
#include <cstring>
#include <algorithm>
...
...
@@ -1984,64 +1996,6 @@ class multi_iter
int64_t
remaining
()
const
{
return
rem
;
}
};
#if 0
template<typename T> void pocketfft_general_c(int ndim, const size_t *shape,
const int64_t *stride_in, const int64_t *stride_out, int nax,
const size_t *axes, bool forward, const cmplx<T> *data_in,
cmplx<T> *data_out, T fct)
{
// allocate temporary 1D array storage, if necessary
size_t tmpsize = 0;
for (int iax=0; iax<nax; ++iax)
{
bool inplace = false;
int64_t stride = (iax==0) ? stride_in[axes[iax]] : stride_out[axes[iax]];
if (stride==1)
if ((iax>0) || (data_in==data_out))
inplace = true;
if (!inplace)
if (shape[axes[iax]] > tmpsize) tmpsize = shape[axes[iax]];
}
arr<cmplx<T>> tdata(tmpsize);
multiarr a_in(ndim, shape, stride_in), a_out(ndim, shape, stride_out);
unique_ptr<pocketfft_c<T>> plan;
for (int iax=0; iax<nax; ++iax)
{
int axis = axes[iax];
multi_iter it_in(a_in, axis), it_out(a_out, axis);
bool inplace = (data_in==data_out) && (it_in.stride()==1);
if ((!plan) || (it_in.length()!=plan->length()))
plan.reset(new pocketfft_c<T>(it_in.length()));
while (!it_in.done())
{
if (inplace)
{
cmplx<T> *d = data_out+it_in.offset();
forward ? plan->forward((T *)d, fct)
: plan->backward((T *)d, fct);
}
else
{
for (size_t i=0; i<it_in.length(); ++i)
tdata[i] = data_in[it_in.offset()+i*it_in.stride()];
forward ? plan->forward((T *)tdata.data(), fct)
: plan->backward((T *)tdata.data(), fct);
for (size_t i=0; i<it_out.length(); ++i)
data_out[it_out.offset()+i*it_out.stride()] = tdata[i];
}
it_in.advance();
if (!inplace)
it_out.advance();
}
// after the first dimension, take data from output array
a_in = a_out;
data_in = data_out;
// factor has been applied, use 1 for remaining axes
fct = T(1);
}
}
#else
#if defined(__AVX__)
#include <x86intrin.h>
...
...
@@ -2134,7 +2088,7 @@ template<typename T> void pocketfft_general_c(int ndim, const size_t *shape,
fct
=
T
(
1
);
}
}
#endif
template
<
typename
T
>
void
pocketfft_general_hartley
(
int
ndim
,
const
size_t
*
shape
,
const
int64_t
*
stride_in
,
const
int64_t
*
stride_out
,
int
nax
,
const
size_t
*
axes
,
const
T
*
data_in
,
T
*
data_out
,
T
fct
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment