summaryrefslogtreecommitdiffstats
path: root/benchmarks/include
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/include')
-rw-r--r--benchmarks/include/benchmark_types.h4
-rw-r--r--benchmarks/include/standard_benchmarks.h7
2 files changed, 10 insertions, 1 deletions
diff --git a/benchmarks/include/benchmark_types.h b/benchmarks/include/benchmark_types.h
index 85e9565..fcdeac6 100644
--- a/benchmarks/include/benchmark_types.h
+++ b/benchmarks/include/benchmark_types.h
@@ -2,7 +2,6 @@
#include <cstdlib>
#include "psu-ds/BTree.h"
-#include "mtree.h"
#include "framework/interface/Record.h"
/* TLX BTree definitions*/
@@ -46,5 +45,8 @@ struct euclidean_distance {
}
};
+#ifdef _GNU_SOURCE
+#include "mtree.h"
typedef mt::mtree<Word2VecRec, euclidean_distance> MTree;
+#endif
diff --git a/benchmarks/include/standard_benchmarks.h b/benchmarks/include/standard_benchmarks.h
index a42cdd6..5fc549d 100644
--- a/benchmarks/include/standard_benchmarks.h
+++ b/benchmarks/include/standard_benchmarks.h
@@ -102,8 +102,10 @@ static bool insert_tput_bench(DE &de_index, std::fstream &file, size_t insert_cn
if (applied_deletes < delete_cnt && delete_idx < delete_vec.size() && gsl_rng_uniform(rng) < delete_prop) {
if constexpr (std::is_same_v<BenchBTree, DE>) {
de_index.erase_one(delete_vec[delete_idx++].key);
+ #ifdef _GNU_SOURCE
} else if constexpr (std::is_same_v<MTree, DE>) {
de_index.remove(delete_vec[delete_idx++]);
+ #endif
} else {
de_index.erase(delete_vec[delete_idx++]);
}
@@ -111,11 +113,16 @@ static bool insert_tput_bench(DE &de_index, std::fstream &file, size_t insert_cn
}
// insert the record;
+ #ifdef _GNU_SOURCE
if constexpr (std::is_same_v<MTree, DE>) {
de_index.add(insert_vec[i]);
} else {
de_index.insert(insert_vec[i]);
}
+ #else
+ de_index.insert(insert_vec[i]);
+ #endif
+
applied_inserts++;
}
auto insert_stop = std::chrono::high_resolution_clock::now();