Commit 7841327c authored by Martin Reinecke's avatar Martin Reinecke
Browse files

fewer pointers

parent 5a11a3b4
......@@ -369,7 +369,7 @@ template<typename T> MRUTIL_NOINLINE void sharp_job<T>::execute()
for (int chunk=0; chunk<nchunks; ++chunk)
{
size_t llim=chunk*chunksize, ulim=min(llim+chunksize,ginfo.npairs());
vector<int> ispair(ulim-llim);
vector<bool> ispair(ulim-llim);
vector<size_t> mlim(ulim-llim);
vector<double> cth(ulim-llim), sth(ulim-llim);
for (size_t i=0; i<ulim-llim; ++i)
......@@ -396,7 +396,7 @@ template<typename T> MRUTIL_NOINLINE void sharp_job<T>::execute()
/* alm->alm_tmp where necessary */
ljob.alm2almtmp(mi);
inner_loop (ljob, ispair.data(), cth.data(), sth.data(), llim, ulim, generator, mi, mlim.data());
inner_loop (ljob, ispair, cth, sth, llim, ulim, generator, mi, mlim);
/* alm_tmp->alm where necessary */
ljob.almtmp2alm(mi);
......
......@@ -31,9 +31,9 @@
#undef GENERIC_ARCH
#undef ARCH
using t_inner_loop = void (*) (sharp_protojob &job, const int *ispair,
const double *cth_, const double *sth_, size_t llim, size_t ulim,
sharp_Ylmgen &gen, size_t mi, const size_t *mlim);
using t_inner_loop = void (*) (sharp_protojob &job, const vector<bool> &ispair,
const vector<double> &cth_, const vector<double> &sth_, size_t llim, size_t ulim,
sharp_Ylmgen &gen, size_t mi, const vector<size_t> &mlim);
using t_veclen = size_t (*) (void);
using t_max_nvec = size_t (*) (size_t spin);
using t_architecture = const char *(*) (void);
......@@ -62,9 +62,9 @@ static int XCONCATX2(have,arch)(void) \
return res; \
} \
\
void XCONCATX2(inner_loop,arch) (sharp_protojob &job, const int *ispair, \
const double *cth_, const double *sth_, size_t llim, size_t ulim, \
sharp_Ylmgen &gen, size_t mi, const size_t *mlim); \
void XCONCATX2(inner_loop,arch) (sharp_protojob &job, const vector<bool> &ispair, \
const vector<double> &cth_, const vector<double> &sth_, size_t llim, size_t ulim, \
sharp_Ylmgen &gen, size_t mi, const vector<size_t> &mlim); \
size_t XCONCATX2(sharp_veclen,arch) (void); \
size_t XCONCATX2(sharp_max_nvec,arch) (size_t spin); \
const char *XCONCATX2(sharp_architecture,arch) (void);
......@@ -107,9 +107,10 @@ DECL2(avx)
#pragma GCC visibility push(hidden)
void inner_loop (sharp_protojob &job, const int *ispair,const double *cth,
const double *sth, size_t llim, size_t ulim, sharp_Ylmgen &gen, size_t mi,
const size_t *mlim)
void inner_loop (sharp_protojob &job, const vector<bool> &ispair,
const vector<double> &cth, const vector<double> &sth,
size_t llim, size_t ulim, sharp_Ylmgen &gen, size_t mi,
const vector<size_t> &mlim)
{
if (!inner_loop_) assign_funcs();
inner_loop_(job, ispair, cth, sth, llim, ulim, gen, mi, mlim);
......
......@@ -939,9 +939,9 @@ MRUTIL_NOINLINE static void calc_alm2map_deriv1(sharp_protojob & MRUTIL_RESTRICT
#define VZERO(var) do { memset(&(var),0,sizeof(var)); } while(0)
MRUTIL_NOINLINE static void inner_loop_a2m(sharp_protojob &job, const int *ispair,
const double *cth_, const double *sth_, size_t llim, size_t ulim,
sharp_Ylmgen &gen, size_t mi, const size_t *mlim)
MRUTIL_NOINLINE static void inner_loop_a2m(sharp_protojob &job, const vector<bool> & ispair,
const vector<double> &cth_, const vector<double> &sth_, size_t llim, size_t ulim,
sharp_Ylmgen &gen, size_t mi, const vector<size_t> &mlim)
{
const size_t m = job.ainfo.mval(mi);
gen.prepare(m);
......@@ -1093,9 +1093,9 @@ MRUTIL_NOINLINE static void inner_loop_a2m(sharp_protojob &job, const int *ispai
}
}
MRUTIL_NOINLINE static void inner_loop_m2a(sharp_protojob &job, const int *ispair,
const double *cth_, const double *sth_, size_t llim, size_t ulim,
sharp_Ylmgen &gen, size_t mi, const size_t *mlim)
MRUTIL_NOINLINE static void inner_loop_m2a(sharp_protojob &job, const vector<bool> &ispair,
const vector<double> &cth_, const vector<double> &sth_, size_t llim, size_t ulim,
sharp_Ylmgen &gen, size_t mi, const vector<size_t> &mlim)
{
const size_t m = job.ainfo.mval(mi);
gen.prepare(m);
......@@ -1213,12 +1213,9 @@ MRUTIL_NOINLINE static void inner_loop_m2a(sharp_protojob &job, const int *ispai
}
}
void XARCH(inner_loop) (sharp_protojob &job, const int *ispair,
const double *cth_, const double *sth_, size_t llim, size_t ulim,
sharp_Ylmgen &gen, size_t mi, const size_t *mlim);
void XARCH(inner_loop) (sharp_protojob &job, const int *ispair,
const double *cth_, const double *sth_, size_t llim, size_t ulim,
sharp_Ylmgen &gen, size_t mi, const size_t *mlim)
void XARCH(inner_loop) (sharp_protojob &job, const vector<bool> &ispair,
const vector<double> &cth_, const vector<double> &sth_, size_t llim, size_t ulim,
sharp_Ylmgen &gen, size_t mi, const vector<size_t> &mlim)
{
(job.type==SHARP_MAP2ALM) ?
inner_loop_m2a(job,ispair,cth_,sth_,llim,ulim,gen,mi,mlim) :
......@@ -1228,22 +1225,15 @@ void XARCH(inner_loop) (sharp_protojob &job, const int *ispair,
#undef VZERO
size_t XARCH(sharp_veclen)(void)
{
return VLEN;
}
{ return VLEN; }
size_t XARCH(sharp_max_nvec)(size_t spin)
{
return (spin==0) ? nv0 : nvx;
}
{ return (spin==0) ? nv0 : nvx; }
#define xstr(a) str(a)
#define str(a) #a
const char *XARCH(sharp_architecture)(void);
const char *XARCH(sharp_architecture)(void)
{
return xstr(ARCH);
}
const char *XARCH(sharp_architecture)()
{ return xstr(ARCH); }
#pragma GCC visibility pop
......
......@@ -92,9 +92,9 @@ template<typename T> class sharp_job: public sharp_protojob
void execute();
};
void inner_loop (sharp_protojob &job, const int *ispair,const double *cth,
const double *sth, size_t llim, size_t ulim, sharp_Ylmgen &gen, size_t mi,
const size_t *mlim);
void inner_loop (sharp_protojob &job, const std::vector<bool> &ispair,
const std::vector<double> &cth, const std::vector<double> &sth, size_t llim,
size_t ulim, sharp_Ylmgen &gen, size_t mi, const std::vector<size_t> &mlim);
size_t sharp_max_nvec(size_t spin);
......
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