File tree 5 files changed +47
-2
lines changed
5 files changed +47
-2
lines changed Original file line number Diff line number Diff line change 4
4
[submodule "taco/benchmark "]
5
5
path = taco/benchmark
6
6
url = ../../google/benchmark.git
7
+ [submodule "taco/suitesparse "]
8
+ path = taco/suitesparse
9
+ url = ../../DrTimothyAldenDavis/GraphBLAS.git
Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ BENCHFLAGS := #"--benchmark-group-by=func"
5
5
IGNORE += taco
6
6
IGNORE_FLAGS := $(addprefix --ignore=, $(IGNORE ) )
7
7
8
+ GRAPHBLAS := "OFF"
9
+ OPENMP := "OFF"
10
+
8
11
export TACO_TENSOR_PATH = data/
9
12
10
13
# To group benchmark output by benchmark, use BENCHFLAGS=--benchmark-group-by=func.
21
24
endif
22
25
23
26
taco/build/taco-bench : check-and-reinit-submodules taco/benchmark/googletest
24
- mkdir -p taco/build/ && cd taco/build/ && cmake ../ && make -j4 taco-bench
27
+ mkdir -p taco/build/ && cd taco/build/ && cmake -DOPENMP= $( OPENMP ) -DGRAPHBLAS= $( GRAPHBLAS ) ../ && $( MAKE ) taco-bench
25
28
26
29
taco/benchmark/googletest : check-and-reinit-submodules
27
30
if [ ! -d " taco/benchmark/googletest" ] ; then git clone https://github.com/google/googletest taco/benchmark/googletest; fi
Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
2
2
project (taco-bench)
3
3
set (CMAKE_BUILD_TYPE "release" )
4
+ option (GRAPHBLAS "Build GraphBLAS benchmarks" OFF )
5
+
6
+ if (GRAPHBLAS)
7
+ message ("-- Will build GraphBLAS benchmarks" )
8
+ add_definitions (-DGRAPHBLAS)
9
+ endif (GRAPHBLAS)
4
10
5
11
add_subdirectory (taco)
6
12
add_subdirectory (benchmark)
13
+ if (GRAPHBLAS)
14
+ add_subdirectory (suitesparse)
15
+ endif (GRAPHBLAS)
7
16
8
- include_directories (taco taco/include benchmark/include )
17
+ include_directories (taco taco/include benchmark/include suitesparse/ Include )
9
18
10
19
file (GLOB TEST_SOURCES *.cpp *.h)
11
20
@@ -14,4 +23,7 @@ set(CMAKE_CXX_FLAGS "${C_CXX_FLAGS} -std=c++14")
14
23
add_executable (taco-bench ${TEST_SOURCES} bench.h)
15
24
target_link_libraries (taco-bench benchmark::benchmark)
16
25
target_link_libraries (taco-bench taco)
26
+ if (GRAPHBLAS)
27
+ target_link_libraries (taco-bench graphblas)
28
+ endif (GRAPHBLAS)
17
29
Original file line number Diff line number Diff line change
1
+ #if GRAPHBLAS
2
+
1
3
#include " bench.h"
2
4
#include " benchmark/benchmark.h"
3
5
6
8
#include " taco/index_notation/index_notation.h"
7
9
#include " taco/index_notation/tensor_operator.h"
8
10
11
+ extern " C" {
12
+ #include " GraphBLAS.h"
13
+ }
14
+
9
15
#include < vector>
10
16
#include < limits>
11
17
@@ -76,4 +82,24 @@ static void bench_mxv_taco(benchmark::State& state) {
76
82
taco_set_num_threads (1 );
77
83
}
78
84
85
+ static void bench_mxv_suitesparse (benchmark::State& state) {
86
+ GrB_init (GrB_BLOCKING);
87
+
88
+ Tensor<double > T = read (" /data/scratch/s3chou/formats-bench/data/webbase_1M.mtx" , CSR);
89
+
90
+ for (const auto & c : T) {
91
+ // A.insert(c.first.toVector(), c.second);
92
+ }
93
+
94
+ GrB_Vector x = nullptr ;
95
+ GrB_Index n;
96
+ GrB_Vector_new (&x, GrB_FP64, n);
97
+
98
+ for (auto _ : state) {
99
+ }
100
+ }
101
+
79
102
TACO_BENCH (bench_mxv_taco);
103
+ TACO_BENCH (bench_mxv_suitesparse);
104
+
105
+ #endif
You can’t perform that action at this time.
0 commit comments