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
Klepl Jiří
asgn
Commits
7a8c87aa
Commit
7a8c87aa
authored
Apr 09, 2020
by
s_kleplj
Browse files
type safety improvements
parent
a81eb0e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
sol/levensol.hpp
View file @
7a8c87aa
...
...
@@ -22,7 +22,7 @@ namespace levensol {
template
<
typename
policy
>
struct
policy_data
{
using
data_type
=
std
::
size
_t
;
using
data_type
=
std
::
uint32
_t
;
static
constexpr
bool
needs_alignment
=
false
;
};
...
...
@@ -144,7 +144,7 @@ if constexpr (std::is_same<policy, policy_sse>::value) {
cycles
=
std
::
min
(
a_size
-
x
,
b_size
-
y
)
/
multiplier
;
for
(;
cycles
!=
0
;
x
+=
multiplier
,
y
+=
multiplier
,
d
+=
multiplier
,
--
cycles
)
{
data_type
data_type
a
=
_mm_lddqu_si128
((
data_pointer
)(
a_v
+
x
)),
b
=
_mm_lddqu_si128
((
data_pointer
)(
b_v
+
y
));
...
...
@@ -172,7 +172,7 @@ if constexpr (std::is_same<policy, policy_avx>::value) {
cycles
=
std
::
min
(
a_size
-
x
,
b_size
-
y
)
/
multiplier
;
for
(;
cycles
!=
0
;
x
+=
multiplier
,
y
+=
multiplier
,
d
+=
multiplier
,
--
cycles
)
{
const
data_type
const
data_type
a
=
_mm256_lddqu_si256
((
data_pointer
)(
a_v
+
x
)),
b
=
_mm256_lddqu_si256
((
data_pointer
)(
b_v
+
y
));
...
...
@@ -239,14 +239,14 @@ if constexpr (std::is_same<policy, policy_avx512>::value) {
odd_v
[
d
]
+
1
});
}
}
odd
=
!
odd
;
}
return
((
b_size
&
1
)
==
0
?
odd_v
[(
b_size
-
1
)
/
2
]
:
even_v
[(
b_size
-
1
)
/
2
])
-
1
;
}
std
::
uint32_t
compute
(
const
std
::
uint32_t
*
a
,
const
std
::
uint32_t
*
b
)
std
::
uint32_t
compute
(
const
std
::
uint32_t
*
a
,
const
std
::
uint32_t
*
b
)
{
if
(
a
==
b
)
{
return
std
::
max
(
a_size_
,
b_size_
)
-
std
::
min
(
a_size_
,
b_size_
);
...
...
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