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
5361953a
Commit
5361953a
authored
May 19, 2020
by
Martin Reinecke
Browse files
Merge branch 'tweaks_for_older_compilers' into 'master'
replace reduce by accumulate See merge request mtr/cxxbase!11
parents
5fedd515
a7763eac
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/mr_util/infra/mav.h
View file @
5361953a
...
...
@@ -122,7 +122,7 @@ class fmav_info
public:
fmav_info
(
const
shape_t
&
shape_
,
const
stride_t
&
stride_
)
:
shp
(
shape_
),
str
(
stride_
),
sz
(
reduc
e
(
shp
.
begin
(),
shp
.
end
(),
size_t
(
1
),
multiplies
<>
()))
:
shp
(
shape_
),
str
(
stride_
),
sz
(
accumulat
e
(
shp
.
begin
(),
shp
.
end
(),
size_t
(
1
),
multiplies
<>
()))
{
MR_assert
(
shp
.
size
()
>
0
,
"at least 1D required"
);
MR_assert
(
shp
.
size
()
==
str
.
size
(),
"dimensions mismatch"
);
...
...
@@ -184,7 +184,7 @@ template<size_t ndim> class mav_info
public:
mav_info
(
const
shape_t
&
shape_
,
const
stride_t
&
stride_
)
:
shp
(
shape_
),
str
(
stride_
),
sz
(
reduc
e
(
shp
.
begin
(),
shp
.
end
(),
size_t
(
1
),
multiplies
<>
()))
{}
:
shp
(
shape_
),
str
(
stride_
),
sz
(
accumulat
e
(
shp
.
begin
(),
shp
.
end
(),
size_t
(
1
),
multiplies
<>
()))
{}
mav_info
(
const
shape_t
&
shape_
)
:
mav_info
(
shape_
,
shape2stride
(
shape_
))
{}
size_t
size
()
const
{
return
sz
;
}
...
...
src/mr_util/sharp/sharp_core_inc.cc
View file @
5361953a
...
...
@@ -78,8 +78,8 @@ static inline void vhsum_cmplx_special (Tv a, Tv b, Tv c, Tv d,
static
inline
void
vhsum_cmplx_special
(
Tv
a
,
Tv
b
,
Tv
c
,
Tv
d
,
complex
<
double
>
*
MRUTIL_RESTRICT
cc
)
{
cc
[
0
]
+=
complex
<
double
>
(
reduc
e
(
a
,
std
::
plus
<>
()),
reduc
e
(
b
,
std
::
plus
<>
()));
cc
[
1
]
+=
complex
<
double
>
(
reduc
e
(
c
,
std
::
plus
<>
()),
reduc
e
(
d
,
std
::
plus
<>
()));
cc
[
0
]
+=
complex
<
double
>
(
accumulat
e
(
a
,
std
::
plus
<>
()),
accumulat
e
(
b
,
std
::
plus
<>
()));
cc
[
1
]
+=
complex
<
double
>
(
accumulat
e
(
c
,
std
::
plus
<>
()),
accumulat
e
(
d
,
std
::
plus
<>
()));
}
#endif
...
...
Write
Preview
Supports
Markdown
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