diff options
| author | Douglas Rumbaugh <dbr4@psu.edu> | 2024-04-22 12:27:43 -0400 |
|---|---|---|
| committer | Douglas Rumbaugh <dbr4@psu.edu> | 2024-04-22 12:27:43 -0400 |
| commit | 0bb5b46ec2b64be17f6269631915e62d02e315e4 (patch) | |
| tree | a45733b510f27a7a0b59f50b983a38ceb9bfa178 /benchmarks/include/file_util.h | |
| parent | 735d397513bc0160ba9ecb17c32c4441ed125f52 (diff) | |
| download | dynamic-extension-0bb5b46ec2b64be17f6269631915e62d02e315e4.tar.gz | |
Added plain BSM and MDSP BSM benchmark
Diffstat (limited to 'benchmarks/include/file_util.h')
| -rw-r--r-- | benchmarks/include/file_util.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/benchmarks/include/file_util.h b/benchmarks/include/file_util.h index 2a3300a..ea8b42e 100644 --- a/benchmarks/include/file_util.h +++ b/benchmarks/include/file_util.h @@ -97,6 +97,22 @@ static std::vector<R> read_sosd_file(std::string &fname, size_t n) { return records; } +template<typename K, typename V> +static std::vector<std::pair<K, V>> read_sosd_file_pair(std::string &fname, size_t n) { + std::fstream file; + file.open(fname, std::ios::in | std::ios::binary); + + std::vector<std::pair<K,V>> records(n); + for (size_t i=0; i<n; i++) { + uint64_t k; + file.read((char*) &(k), sizeof(uint64_t)); + records[i].first = k; + records[i].second = i; + } + + return records; +} + /* * This function expects a plaintext file with each vector on its own line. * There should be D dimensions (or more) for each record, separated by |