Skip to content

Commit

Permalink
Fix ArgPair() compilation issue in sparse_dense_binary_op_shared_test.
Browse files Browse the repository at this point in the history
Change: 121872731
  • Loading branch information
concretevitamin authored and tensorflower-gardener committed May 9, 2016
1 parent fd25fa1 commit bf7e5fe
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions tensorflow/core/kernels/sparse_dense_binary_op_shared_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,23 +265,25 @@ static ST MakeSparseTensor(Graph* g, int B, int M, int N, int nnz_inner) {
}

// [8, 4, N{nnz}] cmul [8, 4, N]
static void BM_SparseMatCMulDenseMat(int iters, int N, int nnz_inner) {
Graph* g = new Graph(OpRegistry::Global());
Node* dense = MakeTensor(g, 8, 4, N);
ST sp = MakeSparseTensor(g, 8, 4, N, nnz_inner);

testing::ItemsProcessed(static_cast<int64>(iters * 8 * 4 * N * 2));
test::Benchmark(
"cpu", SparseMatCMulDenseMat(g, sp.indices, sp.vals, sp.shape, dense))
.Run(iters);
}
BENCHMARK(BM_SparseMatCMulDenseMat)
->ArgPair(1 << 20, 1)
->ArgPair(1 << 20, 8)
->ArgPair(1 << 20, 32)
->ArgPair(1 << 18, 1)
->ArgPair(1 << 18, 8)
->ArgPair(1 << 18, 32);
#define BM_SparseMatCMulDenseMatArgs(N, NNZ_INNER) \
static void BM_SparseMatCMulDenseMat_##N##_##NNZ_INNER(int iters) { \
Graph* g = new Graph(OpRegistry::Global()); \
Node* dense = MakeTensor(g, 8, 4, N); \
ST sp = MakeSparseTensor(g, 8, 4, N, NNZ_INNER); \
\
testing::ItemsProcessed(static_cast<int64>(iters * 8 * 4 * N * 2)); \
test::Benchmark( \
"cpu", SparseMatCMulDenseMat(g, sp.indices, sp.vals, sp.shape, dense)) \
.Run(iters); \
} \
BENCHMARK(BM_SparseMatCMulDenseMat_##N##_##NNZ_INNER)

BM_SparseMatCMulDenseMatArgs(1048576, 1);
BM_SparseMatCMulDenseMatArgs(1048576, 8);
BM_SparseMatCMulDenseMatArgs(1048576, 32);
BM_SparseMatCMulDenseMatArgs(262144, 1);
BM_SparseMatCMulDenseMatArgs(262144, 8);
BM_SparseMatCMulDenseMatArgs(262144, 32);

} // namespace

Expand Down

0 comments on commit bf7e5fe

Please sign in to comment.