-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.hpp
60 lines (47 loc) · 1.31 KB
/
common.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright (C) 2023 Adam Lugowski. All rights reserved.
// Use of this source code is governed by the BSD 2-clause license found in the LICENSE.txt file.
// SPDX-License-Identifier: BSD-2-Clause
#pragma once
#include <array>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <sstream>
#include <vector>
#include <benchmark/benchmark.h>
struct problem {
std::string name;
std::filesystem::path mm_path;
};
/**
* row/column index type
*/
using INDEX_TYPE = int64_t;
/**
* value type
*/
using VALUE_TYPE = double;
// Options that may want to be configured as switches later
// Using variables in service of that possible future goal.
/**
* default number of Google Benchmark iterations to run
*/
static int num_iterations = 1;
/**
* Whether to delete files written by a benchmark.
* Set to false to be able to inspect what the benchmark wrote.
*/
static bool delete_written_files_on_finish = true;
/**
* Some codes are much slower than others. That's ok, but
* can make benchmarking very large datasets annoying.
*/
#ifndef ENABLE_SLOW_BENCHMARKS
#define ENABLE_SLOW_BENCHMARKS 1
#endif
/**
* Directory where benchmarks may write temporary data to.
*/
extern std::filesystem::path temporary_write_dir;
void BenchmarkArgument(benchmark::internal::Benchmark* b);
problem& get_problem(int i);