File tree Expand file tree Collapse file tree 5 files changed +47
-2
lines changed
Expand file tree Collapse file tree 5 files changed +47
-2
lines changed Original file line number Diff line number Diff line change 44[submodule "taco/benchmark "]
55 path = taco/benchmark
66 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"
55IGNORE += taco
66IGNORE_FLAGS := $(addprefix --ignore=, $(IGNORE ) )
77
8+ GRAPHBLAS := "OFF"
9+ OPENMP := "OFF"
10+
811export TACO_TENSOR_PATH = data/
912
1013# To group benchmark output by benchmark, use BENCHFLAGS=--benchmark-group-by=func.
2124endif
2225
2326taco/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
2528
2629taco/benchmark/googletest : check-and-reinit-submodules
2730 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 11cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
22project (taco-bench)
33set (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)
410
511add_subdirectory (taco)
612add_subdirectory (benchmark)
13+ if (GRAPHBLAS)
14+ add_subdirectory (suitesparse)
15+ endif (GRAPHBLAS)
716
8- include_directories (taco taco/include benchmark/include )
17+ include_directories (taco taco/include benchmark/include suitesparse/ Include )
918
1019file (GLOB TEST_SOURCES *.cpp *.h)
1120
@@ -14,4 +23,7 @@ set(CMAKE_CXX_FLAGS "${C_CXX_FLAGS} -std=c++14")
1423add_executable (taco-bench ${TEST_SOURCES} bench.h)
1524target_link_libraries (taco-bench benchmark::benchmark)
1625target_link_libraries (taco-bench taco)
26+ if (GRAPHBLAS)
27+ target_link_libraries (taco-bench graphblas)
28+ endif (GRAPHBLAS)
1729
Original file line number Diff line number Diff line change 1+ #if GRAPHBLAS
2+
13#include " bench.h"
24#include " benchmark/benchmark.h"
35
68#include " taco/index_notation/index_notation.h"
79#include " taco/index_notation/tensor_operator.h"
810
11+ extern " C" {
12+ #include " GraphBLAS.h"
13+ }
14+
915#include < vector>
1016#include < limits>
1117
@@ -76,4 +82,24 @@ static void bench_mxv_taco(benchmark::State& state) {
7682 taco_set_num_threads (1 );
7783}
7884
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+
79102TACO_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