Skip to content
Snippets Groups Projects
Commit 05d019c6 authored by Radek Hušek's avatar Radek Hušek Committed by Radek Hušek
Browse files

Add OPTIMIZE_COMBINE & turn on OPTIMIZED_MAPPINGS

parent 307b905d
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#ifndef OPTIMIZED_MAPPINGS #ifndef OPTIMIZED_MAPPINGS
#define OPTIMIZED_MAPPINGS 0 #define OPTIMIZED_MAPPINGS 1
#endif #endif
#if OPTIMIZED_MAPPINGS #if OPTIMIZED_MAPPINGS
#pragma message "OPTIMIZED_MAPPINGS ON" #pragma message "OPTIMIZED_MAPPINGS ON"
...@@ -21,6 +21,18 @@ ...@@ -21,6 +21,18 @@
#pragma message "OPTIMIZED_MAPPINGS off" #pragma message "OPTIMIZED_MAPPINGS off"
#endif #endif
#ifndef OPTIMIZE_COMBINE
#define OPTIMIZE_COMBINE 0
#endif
#if OPTIMIZE_COMBINE
#pragma message "OPTIMIZE_COMBINE ON"
#else
#pragma message "OPTIMIZE_COMBINE off"
#endif
#ifndef MAX_EDGES #ifndef MAX_EDGES
#define MAX_EDGES 48 #define MAX_EDGES 48
#endif #endif
......
...@@ -26,6 +26,7 @@ struct Mapping { ...@@ -26,6 +26,7 @@ struct Mapping {
}; };
#if OPTIMIZED_MAPPINGS
template < size_t i, size_t shift > template < size_t i, size_t shift >
struct Consts { struct Consts {
static const uint64_t clone = (Consts<i-1, shift>::clone << shift) | 1; static const uint64_t clone = (Consts<i-1, shift>::clone << shift) | 1;
...@@ -84,7 +85,6 @@ struct FastArray { ...@@ -84,7 +85,6 @@ struct FastArray {
} }
}; };
#if OPTIMIZED_MAPPINGS
template <> struct Mapping< Ring::Z4<int> > : public FastArray<true> { template <> struct Mapping< Ring::Z4<int> > : public FastArray<true> {
Mapping(const Mapping& x) : FastArray(x) {} Mapping(const Mapping& x) : FastArray(x) {}
Mapping(size_t s = 0) : FastArray(s) {} Mapping(size_t s = 0) : FastArray(s) {}
......
...@@ -90,7 +90,9 @@ struct Tester : public AbstractTester { ...@@ -90,7 +90,9 @@ struct Tester : public AbstractTester {
Mapping& cannonize(Mapping& map) { Mapping& cannonize(Mapping& map) {
for (const auto &i : nonClassEdges) { for (const auto &i : nonClassEdges) {
#if OPTIMIZE_COMBINE
if (map[i.first] != Ring::zero) if (map[i.first] != Ring::zero)
#endif
map.combine(map[i.first], i.second); map.combine(map[i.first], i.second);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment