Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit ea0b59c

Browse files
Drop useless output vector from benchmark Check function
1 parent 6b319f5 commit ea0b59c

File tree

5 files changed

+11
-20
lines changed

5 files changed

+11
-20
lines changed

tc/benchmarks/MLP_model.cc

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,7 @@ def _1LUT(float(E1, D) LUT1, int32(B, L1) I1) -> (O1) {
214214
inputs,
215215
check_fun);
216216
} else {
217-
std::vector<at::Tensor> outputs;
218-
Check(tc, "_1LUT", options, inputs, outputs, check_fun);
217+
Check(tc, "_1LUT", options, inputs, check_fun);
219218
if (use_flags) {
220219
autotune(
221220
FLAGS_save_tuner_proto_prefix + std::string("/1LUT_cache") + suffix,
@@ -328,8 +327,7 @@ def _2LUT(float(E1, D) LUT1, int32(B, L1) I1, float(E2, D) LUT2, int32(B, L2) I2
328327
inputs,
329328
check_fun);
330329
} else {
331-
std::vector<at::Tensor> outputs;
332-
Check(tc, "_2LUT", options, inputs, outputs, check_fun);
330+
Check(tc, "_2LUT", options, inputs, check_fun);
333331
if (use_flags) {
334332
autotune(
335333
FLAGS_save_tuner_proto_prefix + std::string("/2LUT_cache") + suffix,
@@ -382,8 +380,7 @@ def _C3(float(B,WX) I, float(WY, WX) W) -> (C3) {
382380
inputs,
383381
check_fun);
384382
} else {
385-
std::vector<at::Tensor> outputs;
386-
Check(tc, "_C3", options, inputs, outputs, check_fun);
383+
Check(tc, "_C3", options, inputs, check_fun);
387384
if (use_flags) {
388385
autotune(
389386
FLAGS_save_tuner_proto_prefix + std::string("/_C3_cache") + suffix,
@@ -438,8 +435,7 @@ def mlp1(float(B,M) I, float(M, N) W1, float(N) B1) -> (O1) {
438435
inputs,
439436
check_fun);
440437
} else {
441-
std::vector<at::Tensor> outputs;
442-
Check(tc, "mlp1", options, inputs, outputs, check_fun);
438+
Check(tc, "mlp1", options, inputs, check_fun);
443439
if (use_flags) {
444440
autotune(
445441
FLAGS_save_tuner_proto_prefix + std::string("/mlp1_cache") + suffix,
@@ -509,9 +505,7 @@ def mlp3(float(B,N) I, float(O,N) W2, float(O) B2, float(P,O) W3, float(P) B3, f
509505
inputs,
510506
check_fun);
511507
} else {
512-
std::vector<at::Tensor> outputs;
513-
514-
Check(tc, "mlp3", options, inputs, outputs, check_fun);
508+
Check(tc, "mlp3", options, inputs, check_fun);
515509
if (use_flags) {
516510
autotune(
517511
FLAGS_save_tuner_proto_prefix + std::string("/mlp3_cache") + suffix,

tc/benchmarks/batchmatmul.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ def batch_matmul(float(B, N, M) X, float(B, M, K) Y) -> (Z) {
9494
inputs,
9595
check_fun);
9696
} else {
97-
std::vector<at::Tensor> outputs;
98-
Check(tc, "batch_matmul", options, inputs, outputs, check_fun);
97+
Check(tc, "batch_matmul", options, inputs, check_fun);
9998
if (use_flags) {
10099
autotune(
101100
FLAGS_save_tuner_proto_prefix + std::string("/batchmatmul_cache") +

tc/benchmarks/benchmark_fixture.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ struct Benchmark : public ::testing::Test {
102102
const std::string& name,
103103
const tc::CudaMappingOptions& mappingOptions,
104104
const std::vector<at::Tensor>& inputs,
105-
std::vector<at::Tensor>& outputs,
106105
CheckFunction check_fun = [](const std::vector<at::Tensor>& inputs,
107-
std::vector<at::Tensor>& outputs) {
106+
const std::vector<at::Tensor>& outputs) {
108107
return true;
109108
}) {
110109
auto pExecutor =
111110
tc::aten::compile<tc::CudaBackend>(tc, name, inputs, mappingOptions);
112-
outputs = tc::aten::prepareOutputs(tc, name, inputs);
111+
std::vector<at::Tensor> outputs =
112+
tc::aten::prepareOutputs(tc, name, inputs);
113113
tc::aten::run(*pExecutor, inputs, outputs);
114114
EXPECT_TRUE(check_fun(inputs, outputs));
115115
for (size_t i = 1; i < tc::FLAGS_benchmark_warmup; ++i) {

tc/benchmarks/group_convolution.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ def group_convolution(float(N,G,C,H,W) I, float(G,F,C,KH,KW) W1, float(G,F) B)
146146
inputs,
147147
check_fun);
148148
} else {
149-
std::vector<at::Tensor> outputs;
150-
Check(tc, "group_convolution", options, inputs, outputs, check_fun);
149+
Check(tc, "group_convolution", options, inputs, check_fun);
151150
if (use_flags) {
152151
autotune(
153152
FLAGS_save_tuner_proto_prefix +

tc/benchmarks/tmm.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ def tmm(float(M,K) A, float(N,K) B) -> (C) {
9090
inputs,
9191
check_fun);
9292
} else {
93-
std::vector<at::Tensor> outputs;
94-
Check(tc, "tmm", options, inputs, outputs, check_fun);
93+
Check(tc, "tmm", options, inputs, check_fun);
9594
if (use_flags) {
9695
autotune(
9796
FLAGS_save_tuner_proto_prefix + std::string("/tmm_cache") + suffix,

0 commit comments

Comments
 (0)