summaryrefslogtreecommitdiffstats
path: root/benchmarks/include
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/include')
-rw-r--r--benchmarks/include/data-proc.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/benchmarks/include/data-proc.h b/benchmarks/include/data-proc.h
index f758ed4..dbac671 100644
--- a/benchmarks/include/data-proc.h
+++ b/benchmarks/include/data-proc.h
@@ -10,6 +10,8 @@
#include "psu-ds/BTree.h"
+#pragma once
+
typedef uint64_t key_type;
typedef uint64_t value_type;
typedef uint64_t weight_type;
@@ -242,3 +244,15 @@ static bool build_delete_vec(std::vector<R> &to_delete, std::vector<R> &vec, siz
td:
return true;
}
+
+static std::vector<int64_t> read_sosd_file(std::string &fname, size_t n) {
+ std::fstream file;
+ file.open(fname, std::ios::in | std::ios::binary);
+
+ std::vector<int64_t> records(n);
+ for (size_t i=0; i<n; i++) {
+ file.read((char*) &(records[i]), sizeof(int64_t));
+ }
+
+ return records;
+}