Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Simon Perkins
ducc
Commits
441c17ed
Commit
441c17ed
authored
Jan 13, 2020
by
Martin Reinecke
Browse files
fixes
parent
11e3210f
Changes
3
Show whitespace changes
Inline
Side-by-side
Makefile.am
View file @
441c17ed
...
...
@@ -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
\
...
...
libsharp2/sharp_core_inc.cc
View file @
441c17ed
...
...
@@ -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
;
...
...
mr_util/simd.h
View file @
441c17ed
...
...
@@ -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
;
}
in
t
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
;
...
...
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