Commit 441c17ed authored by Martin Reinecke's avatar Martin Reinecke
Browse files

fixes

parent 11e3210f
......@@ -12,6 +12,8 @@ libmrutil_la_SOURCES = \
libsharp2/sharp_ylmgen.h \
mr_util/math_utils.h \
mr_util/cmplx.h \
mr_util/aligned_array.h \
mr_util/simd.h \
mr_util/error_handling.cc \
mr_util/error_handling.h \
mr_util/morton_utils.cc \
......
......@@ -323,7 +323,7 @@ MRUTIL_NOINLINE static void alm2map_kernel(s0data_v & MRUTIL_RESTRICT d,
MRUTIL_NOINLINE static void calc_alm2map (sharp_job & MRUTIL_RESTRICT job,
const sharp_Ylmgen &gen, s0data_v & MRUTIL_RESTRICT d, size_t nth)
{
size_t l,il,lmax=gen.lmax;
size_t l,il=0,lmax=gen.lmax;
size_t nv2 = (nth+VLEN-1)/VLEN;
iter_to_ieee(gen, d, l, il, nv2);
job.opcnt += il * 4*nth;
......@@ -417,7 +417,7 @@ MRUTIL_NOINLINE static void map2alm_kernel(s0data_v & MRUTIL_RESTRICT d,
MRUTIL_NOINLINE static void calc_map2alm (sharp_job & MRUTIL_RESTRICT job,
const sharp_Ylmgen &gen, s0data_v & MRUTIL_RESTRICT d, size_t nth)
{
size_t l,il,lmax=gen.lmax;
size_t l,il=0,lmax=gen.lmax;
size_t nv2 = (nth+VLEN-1)/VLEN;
iter_to_ieee(gen, d, l, il, nv2);
job.opcnt += il * 4*nth;
......
......@@ -63,7 +63,7 @@ template<typename T, size_t len> struct vmask_
vmask_(const vmask_ &other) = default;
vmask_(Tm v_): v(v_) {}
operator Tm() const { return v; }
int bits() const { return hlp::maskbits(v); }
size_t bits() const { return hlp::maskbits(v); }
vmask_ operator& (const vmask_ &other) const { return hlp::mask_and(v,other.v); }
};
......@@ -175,6 +175,7 @@ template<typename T> class pseudoscalar
{
private:
T v;
public:
pseudoscalar() = default;
pseudoscalar(const pseudoscalar &other) = default;
......@@ -188,21 +189,20 @@ template<typename T> class pseudoscalar
pseudoscalar &operator-=(pseudoscalar other) { v-=other.v; return *this; }
pseudoscalar &operator*=(pseudoscalar other) { v*=other.v; return *this; }
pseudoscalar &operator/=(pseudoscalar other) { v/=other.v; return *this; }
/*
pseudoscalar abs() const { return hlp::abs(v); }
inline pseudoscalar sqrt() const
{ return sqrt(v); }
pseudoscalar abs() const { return std::abs(v); }
inline pseudoscalar sqrt() const { return std::sqrt(v); }
pseudoscalar max(const pseudoscalar &other) const
{ return hlp::max(v, other.v); }
Tm operator>(const pseudoscalar &other) const
{ return hlp::gt(v, other.v); }
Tm operator>=(const pseudoscalar &other) const
{ return hlp::ge(v, other.v); }
Tm operator<(const vtp &other) const
{ return hlp::lt(v, other.v); }
Tm operator!=(const vtp &other) const
{ return hlp::ne(v, other.v); }
*/
{ return std::max(v, other.v); }
bool operator>(const pseudoscalar &other) const
{ return v>other.v; }
bool operator>=(const pseudoscalar &other) const
{ return v>=other.v; }
bool operator<(const pseudoscalar &other) const
{ return v<other.v; }
bool operator!=(const pseudoscalar &other) const
{ return v!=other.v; }
const T &operator[] (size_t /*i*/) const { return v; }
T &operator[](size_t /*i*/) { return v; }
};
......@@ -215,10 +215,10 @@ template<typename T> class helper_<T,1>
using Tm = bool;
static Tv from_scalar(T v) { return v; }
static Tv abs(Tv v) { return abs(v); }
static Tv max(Tv v1, Tv v2) { return max(v1, v2); }
static Tv blend(Tm m, Tv v1, Tv v2) { m ? v1 : v2; }
static Tv sqrt(Tv v) { return sqrt(v); }
static Tv abs(Tv v) { return v.abs(); }
static Tv max(Tv v1, Tv v2) { return v1.max(v2); }
static Tv blend(Tm m, Tv v1, Tv v2) { return m ? v1 : v2; }
static Tv sqrt(Tv v) { return v.sqrt(); }
static Tm gt (Tv v1, Tv v2) { return v1>v2; }
static Tm ge (Tv v1, Tv v2) { return v1>=v2; }
static Tm lt (Tv v1, Tv v2) { return v1<v2; }
......@@ -376,6 +376,8 @@ template<> class helper_<float,4>
};
template<typename T> using native_simd = vtp<T,16/sizeof(T)>;
#else
template<typename T> using native_simd = vtp<T,1>;
#endif
}
using detail_simd::native_simd;
......
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