Commit a32ddf0c authored by Martin Reinecke's avatar Martin Reinecke
Browse files

more OpenMP

parent b6860082
......@@ -308,6 +308,7 @@ template<typename T> pyarr_c<T> complex2hartley
auto res = makearray<T>({nu,nv});
auto grid2 = res.mutable_data();
#pragma omp parallel for
for (size_t u=0; u<nu; ++u)
{
size_t xu = (u==0) ? 0 : nu-u;
......@@ -332,6 +333,7 @@ template<typename T> pyarr_c<complex<T>> hartley2complex
auto res=makearray<complex<T>>({nu, nv});
auto grid2 = res.mutable_data();
#pragma omp parallel for
for (size_t u=0; u<nu; ++u)
{
size_t xu = (u==0) ? 0 : nu-u;
......@@ -356,6 +358,7 @@ template<typename T> void hartley2_2D(const pyarr_c<T> &in, pyarr_c<T> &out)
{out.strides(0), out.strides(1)}, {0,1},
in.data(), out.mutable_data(), T(1), 0);
auto ptmp = out.mutable_data();
#pragma omp parallel for
for(size_t i=1; i<(nu+1)/2; ++i)
for(size_t j=1; j<(nv+1)/2; ++j)
{
......@@ -384,6 +387,7 @@ vector<double> correction_factors (size_t n, size_t nval, size_t w)
for (auto &v:psi)
v = exp(beta*(sqrt(1-v*v)-1.));
vector<double> res(nval);
#pragma omp parallel for schedule(static)
for (size_t k=0; k<nval; ++k)
{
double tmp=0;
......@@ -490,6 +494,7 @@ template<typename T> class Baselines
auto res=makearray<T2>({nvis});
auto vis = res.mutable_data();
#pragma omp parallel for
for (size_t i=0; i<nvis; ++i)
vis[i] = ms[offset(idx[i])];
return res;
......@@ -509,6 +514,7 @@ template<typename T> class Baselines
auto ms = res.mutable_data();
for (size_t i=0; i<nrows*nchan; ++i)
ms[i] = T2(0);
#pragma omp parallel for
for (size_t i=0; i<nvis; ++i)
ms[offset(idx[i])] = vis[i];
return res;
......@@ -528,6 +534,7 @@ template<typename T> class Baselines
auto vis = vis_.data();
auto ms = ms_.mutable_data();
#pragma omp parallel for
for (size_t i=0; i<nvis; ++i)
ms[offset(idx[i])] += vis[i];
return ms_;
......
Supports Markdown
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