Skip to content

Commit 0e06f5b

Browse files
committed
taco: simplifiy suitesparse benchmark and add dimension counters
1 parent 14c6e85 commit 0e06f5b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

taco/ufuncs.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ static void bench_suitesparse_ufunc(benchmark::State& state, Func op) {
243243
auto ssTensor = readIntoType<int64_t>("ssTensor", tensorPath, CSR);
244244
auto other = shiftLastMode<int64_t, int64_t>("other", ssTensor);
245245

246+
state.counters["dimx"] = ssTensor.getDimension(0);
247+
state.counters["dimy"] = ssTensor.getDimension(1);
248+
246249
for (auto _ : state) {
247250
state.PauseTiming();
248251
Tensor<int64_t> result("result", ssTensor.getDimensions(), ssTensor.getFormat());
@@ -259,9 +262,8 @@ static void bench_suitesparse_ufunc(benchmark::State& state, Func op) {
259262
static void applySuiteSparse(benchmark::internal::Benchmark* b) {
260263
std::vector<int64_t> args(ssTensors.tensors.size());
261264
for (int i = 0; i < ssTensors.tensors.size(); i++) {
262-
args[i] = i;
265+
b->Arg(i);
263266
}
264-
b->ArgsProduct({args});
265267
}
266268

267269
TACO_BENCH_ARGS(bench_suitesparse_ufunc, xor, xorOp)->Apply(applySuiteSparse);

0 commit comments

Comments
 (0)