Commit 7a8c87aa authored by s_kleplj's avatar s_kleplj
Browse files

type safety improvements

parent a81eb0e4
......@@ -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_);
......
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