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

incorporation of cpp gold code

parent 604dd27a
......@@ -2,5 +2,5 @@
target_include_directories(${TARGET_MACRO} PUBLIC ".")
target_include_directories(${TARGET_LEVEN} PUBLIC ".")
target_sources(${TARGET_MACRO} PUBLIC "fmwkng.hpp" "macroasgn.hpp" "macroasgn.cpp" "macromain.cpp")
target_sources(${TARGET_MACRO} PUBLIC "fmwkng.hpp" "macroasgn.hpp" "macroasgn.cpp" "macromain.cpp" "macrogold.cpp")
target_sources(${TARGET_LEVEN} PUBLIC "fmwkng.hpp" "levenasgn.hpp" "levenmain.cpp")
This diff is collapsed.
......@@ -4,6 +4,8 @@
#ifndef macroasgn_hpp_
#define macroasgn_hpp_
#include "fmwkng.hpp"
#include <cstddef>
#include <string>
#include <vector>
......@@ -27,7 +29,7 @@ namespace macroasgn {
limit += i;
}
const std::string * getline()
const std::string* getline()
{
if (index >= limit)
{
......@@ -47,4 +49,138 @@ namespace macroasgn {
};
}
namespace macrosol {
struct policy_scalar;
struct policy_sse;
#ifdef USE_AVX
struct policy_avx;
#endif
#ifdef USE_AVX512
struct policy_avx512;
#endif
};
namespace macromain {
struct platform_scalar {
using tag_category = fmwkng::platform_tag_category;
static auto name() { return "scalar"; }
static auto code_name() { return "macromain::platform_scalar"; }
using policy = macrosol::policy_scalar;
};
struct platform_sse {
using tag_category = fmwkng::platform_tag_category;
static auto name() { return "sse"; }
static auto code_name() { return "macromain::platform_sse"; }
using policy = macrosol::policy_sse;
};
#ifdef USE_AVX
struct platform_avx {
using tag_category = fmwkng::platform_tag_category;
static auto name() { return "avx"; }
static auto code_name() { return "macromain::platform_avx"; }
using policy = macrosol::policy_avx;
};
#endif
#ifdef USE_AVX512
struct platform_avx512 {
using tag_category = fmwkng::platform_tag_category;
static auto name() { return "avx512"; }
static auto code_name() { return "macromain::platform_avx512"; }
using policy = macrosol::policy_avx512;
};
#endif
struct nonmacro_weight {
using tag_category = fmwkng::range_tag_category;
static auto name() { return "nonmacro_weight"; }
static auto code_name() { return "macromain::nonmacro_weight"; }
static auto enumerator() {
return fmwkng::logarithmic(3, 48,
#ifdef NDEBUG
4
#else
16
#endif
);
}
};
struct exp_width {
using tag_category = fmwkng::range_tag_category;
static auto name() { return "exp_width"; }
static auto code_name() { return "macromain::exp_width"; }
static auto enumerator() {
return fmwkng::logarithmic(3, 12, 4);
}
};
struct lines {
using tag_category = fmwkng::range_tag_category;
static auto name() { return "lines"; }
static auto code_name() { return "macromain::lines"; }
static auto enumerator() {
return fmwkng::auto_repeat(
#ifdef NDEBUG
480000
#else
4800
#endif
);
}
};
struct line_policy {
using ranges = fmwkng::ranges< lines>;
static auto name() { return "time_per_line"; }
static auto code_name() { return "macromain::line_policy"; }
template< typename CTX>
static auto complexity(CTX&& ctx) { return fmwkng::get<exp_width>(ctx); }
static constexpr fmwkng::average_t minimum_count =
#ifdef NDEBUG
1000000000ULL
#else
100000000ULL
#endif
;
};
struct dump {
using tag_category = fmwkng::range_tag_category;
static auto name() { return "dump"; }
static auto enumerator() {
return fmwkng::flag(false);
}
};
struct output_hash {
using tag_category = fmwkng::result_tag_category;
static auto name() { return "output_hash"; }
static auto code_name() { return "macromain::output_hash"; }
using value_type = std::size_t;
};
struct root_config {
static auto code_name() { return "macromain::root_config"; }
using platforms = fmwkng::platforms<
platform_scalar
,
platform_sse
#ifdef USE_AVX
, platform_avx
#endif
#ifdef USE_AVX512
, platform_avx512
#endif
>;
using ranges = fmwkng::ranges<nonmacro_weight, exp_width, lines, dump>;
};
const fmwkng::gold_data& gold_results();
}
#endif
This diff is collapsed.
......@@ -10,117 +10,6 @@
namespace macromain {
struct platform_scalar {
using tag_category = fmwkng::platform_tag_category;
static auto name() { return "scalar"; }
static auto code_name() { return "macromain::platform_scalar"; }
using policy = macrosol::policy_scalar;
};
struct platform_sse {
using tag_category = fmwkng::platform_tag_category;
static auto name() { return "sse"; }
static auto code_name() { return "macromain::platform_sse"; }
using policy = macrosol::policy_sse;
};
#ifdef USE_AVX
struct platform_avx {
using tag_category = fmwkng::platform_tag_category;
static auto name() { return "avx"; }
static auto code_name() { return "macromain::platform_avx"; }
using policy = macrosol::policy_avx;
};
#endif
#ifdef USE_AVX512
struct platform_avx512 {
using tag_category = fmwkng::platform_tag_category;
static auto name() { return "avx512"; }
static auto code_name() { return "macromain::platform_avx512"; }
using policy = macrosol::policy_avx512;
};
#endif
struct nonmacro_weight {
using tag_category = fmwkng::range_tag_category;
static auto name() { return "nonmacro_weight"; }
static auto code_name() { return "macromain::nonmacro_weight"; }
static auto enumerator() {
return fmwkng::logarithmic(3, 48,
#ifdef NDEBUG
4
#else
16
#endif
);
}
};
struct exp_width {
using tag_category = fmwkng::range_tag_category;
static auto name() { return "exp_width"; }
static auto code_name() { return "macromain::exp_width"; }
static auto enumerator() {
return fmwkng::logarithmic(3, 12, 4);
}
};
struct lines {
using tag_category = fmwkng::range_tag_category;
static auto name() { return "lines"; }
static auto code_name() { return "macromain::lines"; }
static auto enumerator() {
return fmwkng::auto_repeat(
#ifdef NDEBUG
480000
#else
48000
#endif
);
}
};
struct line_policy {
using ranges = fmwkng::ranges< lines>;
static auto name() { return "time_per_line"; }
static auto code_name() { return "macromain::line_policy"; }
template< typename CTX>
static auto complexity(CTX&& ctx) { return fmwkng::get<exp_width>(ctx); }
static constexpr fmwkng::average_t minimum_count = 1000000000ULL;
};
struct dump {
using tag_category = fmwkng::range_tag_category;
static auto name() { return "dump"; }
static auto enumerator() {
return fmwkng::flag(false);
}
};
struct output_hash {
using tag_category = fmwkng::result_tag_category;
static auto name() { return "output_hash"; }
static auto code_name() { return "macromain::output_hash"; }
using value_type = std::size_t;
};
struct root_config {
static auto code_name() { return "macromain::root_config"; }
using platforms = fmwkng::platforms<
platform_scalar
,
platform_sse
#ifdef USE_AVX
, platform_avx
#endif
#ifdef USE_AVX512
, platform_avx512
#endif
>;
using ranges = fmwkng::ranges<nonmacro_weight, exp_width, lines, dump>;
};
struct run_thread_ftor {
template< typename CTX>
void operator()(CTX&& ctx2) const
......
Supports Markdown
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