Commit da42ae06 authored by Bednárek David RNDr. Ph.D.'s avatar Bednárek David RNDr. Ph.D.
Browse files

Merge branch 'build_test' into 'master'

Updated levenstein interface

See merge request teaching/nprg054/asgn!9
parents ccccb4c7 827393c2
......@@ -14,38 +14,36 @@
namespace levenasgn {
using data_element = std::uint32_t;
using time_complexity = std::size_t;
template< typename IT>
inline std::uint64_t chksum(IT b, IT e)
{
std::uint64_t s = 0;
struct generator_4 {
for (; b != e; ++b)
auto begin1() const
{
auto x = *b;
s = s * 3 + (std::uint64_t)x;
return v1_.cbegin();
}
return s;
}
auto end1() const
{
return v1_.cend();
}
struct generator_4 {
auto data1() const
{
return v1_.data();
}
time_complexity complexity() const
auto size1() const
{
return s1_ * s2_;
return v1_.size();
}
auto begin1() const
auto data2() const
{
return v1_.cbegin();
return v2_.data();
}
auto end1() const
auto size2() const
{
return v1_.cend();
return v2_.size();
}
auto begin2() const
......@@ -86,10 +84,6 @@ namespace levenasgn {
{
}
void reset()
{
}
data_element get()
{
return data_element(ui_(engine_));
......@@ -106,7 +100,7 @@ namespace levenasgn {
namespace levensol {
struct policy_scalar;
//struct policy_scalar;
struct policy_sse;
struct policy_avx;
struct policy_avx512;
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -23,14 +23,14 @@ namespace levenmain {
std::mt19937_64::default_seed + ctx2.thread_index()
), get<a_size>(ctx4), get<b_size>(ctx4));
levensol::levenstein<policy> data(mg.begin1(), mg.end1(), mg.begin2(), mg.end2());
levensol::levenstein<policy> data(mg.size1(), mg.size2());
for (auto&& ctx5 : auto_measurement<repeat_policy>(ctx4, 1024))
{
std::size_t h = 0;
for (auto i : for_index<repeats>(ctx5))
{
auto rv = data.compute();
auto rv = data.compute(mg.data1(), mg.data2());
h = rv;
}
if (stop_for_results(ctx5))
......
#ifndef levensol_hpp_
#define levensol_hpp_
#include <cstdint>
#include <cstddef>
namespace levensol {
template< typename policy>
class levenstein {
public:
typedef int data_element;
template< typename I1, typename I2>
levenstein(I1 i1b, I1 i1e, I2 i2b, I2 i2e)
levenstein(std::size_t a_size, std::size_t b_size)
{}
data_element compute() { return 0; }
};
struct policy_scalar {
std::uint32_t compute(const std::uint32_t* a, const std::uint32_t* b)
{
return 0;
}
};
struct policy_sse {
......
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