diff options
Diffstat (limited to 'eval/src/tests/tensor/instruction_benchmark/instruction_benchmark.cpp')
-rw-r--r-- | eval/src/tests/tensor/instruction_benchmark/instruction_benchmark.cpp | 190 |
1 files changed, 95 insertions, 95 deletions
diff --git a/eval/src/tests/tensor/instruction_benchmark/instruction_benchmark.cpp b/eval/src/tests/tensor/instruction_benchmark/instruction_benchmark.cpp index 000794aca7d..d8dff63cddf 100644 --- a/eval/src/tests/tensor/instruction_benchmark/instruction_benchmark.cpp +++ b/eval/src/tests/tensor/instruction_benchmark/instruction_benchmark.cpp @@ -61,7 +61,7 @@ template <typename T> using CREF = std::reference_wrapper<const T>; //----------------------------------------------------------------------------- -test::GenSpec GS(double bias) { return test::GenSpec().cells_float().seq_bias(bias); } +test::GenSpec GS(double bias) { return test::GenSpec(bias).cells_float(); } //----------------------------------------------------------------------------- @@ -566,7 +566,7 @@ void benchmark_tensor_create(const vespalib::string &desc, const TensorSpec &pro ASSERT_FALSE(proto_type.is_error()); std::vector<CREF<TensorSpec>> stack_spec; for (const auto &cell: proto.cells()) { - stack_spec.emplace_back(stash.create<TensorSpec>(GS(cell.second).gen())); + stack_spec.emplace_back(stash.create<TensorSpec>(GS(cell.second))); } std::vector<EvalOp::UP> list; for (const Impl &impl: impl_list) { @@ -602,7 +602,7 @@ void benchmark_tensor_peek(const vespalib::string &desc, const TensorSpec &lhs, stack_spec.emplace_back(lhs); if (peek_spec.is_dynamic) { for (const auto &entry: peek_spec.spec) { - stack_spec.emplace_back(stash.create<TensorSpec>(GS(double(entry.second)).gen())); + stack_spec.emplace_back(stash.create<TensorSpec>(GS(double(entry.second)))); } } std::vector<EvalOp::UP> list; @@ -617,15 +617,15 @@ void benchmark_tensor_peek(const vespalib::string &desc, const TensorSpec &lhs, //----------------------------------------------------------------------------- TEST(MakeInputTest, print_some_test_input) { - auto number = GS(5.0).gen(); - auto sparse = GS(1.0).map("x", 5, 3).gen(); - auto dense = GS(10.0).idx("x", 5).gen(); - auto mixed = GS(100.0).map("x", 3, 7).idx("y", 2).idx("z", 2).gen(); + auto number = GS(5.0); + auto sparse = GS(1.0).map("x", 5, 3); + auto dense = GS(10.0).idx("x", 5); + auto mixed = GS(100.0).map("x", 3, 7).idx("y", 2).idx("z", 2); fprintf(stderr, "--------------------------------------------------------\n"); - fprintf(stderr, "simple number: %s\n", number.to_string().c_str()); - fprintf(stderr, "sparse vector: %s\n", sparse.to_string().c_str()); - fprintf(stderr, "dense vector: %s\n", dense.to_string().c_str()); - fprintf(stderr, "mixed cube: %s\n", mixed.to_string().c_str()); + fprintf(stderr, "simple number: %s\n", number.gen().to_string().c_str()); + fprintf(stderr, "sparse vector: %s\n", sparse.gen().to_string().c_str()); + fprintf(stderr, "dense vector: %s\n", dense.gen().to_string().c_str()); + fprintf(stderr, "mixed cube: %s\n", mixed.gen().to_string().c_str()); fprintf(stderr, "--------------------------------------------------------\n"); } @@ -685,197 +685,197 @@ void benchmark_encode_decode(const vespalib::string &desc, const TensorSpec &pro // relevant for the overall performance of the tensor implementation. TEST(EncodeDecodeBench, encode_decode_dense) { - auto proto = GS(1.0).idx("a", 64).idx("b", 64).gen(); + auto proto = GS(1.0).idx("a", 64).idx("b", 64); benchmark_encode_decode("dense tensor", proto); } TEST(EncodeDecodeBench, encode_decode_sparse) { - auto proto = GS(1.0).map("a", 64, 1).map("b", 64, 1).gen(); + auto proto = GS(1.0).map("a", 64, 1).map("b", 64, 1); benchmark_encode_decode("sparse tensor", proto); } TEST(EncodeDecodeBench, encode_decode_mixed) { - auto proto = GS(1.0).map("a", 64, 1).idx("b", 64).gen(); + auto proto = GS(1.0).map("a", 64, 1).idx("b", 64); benchmark_encode_decode("mixed tensor", proto); } //----------------------------------------------------------------------------- TEST(DenseConcat, small_vectors) { - auto lhs = GS(1.0).idx("x", 10).gen(); - auto rhs = GS(2.0).idx("x", 10).gen(); + auto lhs = GS(1.0).idx("x", 10); + auto rhs = GS(2.0).idx("x", 10); benchmark_concat("small dense vector append concat", lhs, rhs, "x"); } TEST(DenseConcat, cross_vectors) { - auto lhs = GS(1.0).idx("x", 10).gen(); - auto rhs = GS(2.0).idx("x", 10).gen(); + auto lhs = GS(1.0).idx("x", 10); + auto rhs = GS(2.0).idx("x", 10); benchmark_concat("small dense vector cross concat", lhs, rhs, "y"); } TEST(DenseConcat, cube_and_vector) { - auto lhs = GS(1.0).idx("a", 16).idx("b", 16).idx("c", 16).gen(); - auto rhs = GS(42.0).idx("a", 16).gen(); + auto lhs = GS(1.0).idx("a", 16).idx("b", 16).idx("c", 16); + auto rhs = GS(42.0).idx("a", 16); benchmark_concat("cube vs vector concat", lhs, rhs, "a"); } TEST(SparseConcat, small_vectors) { - auto lhs = GS(1.0).map("x", 10, 1).gen(); - auto rhs = GS(2.0).map("x", 10, 2).gen(); + auto lhs = GS(1.0).map("x", 10, 1); + auto rhs = GS(2.0).map("x", 10, 2); benchmark_concat("small sparse concat", lhs, rhs, "y"); } TEST(MixedConcat, mixed_vs_dense) { - auto lhs = GS(1.0).idx("a", 16).idx("b", 16).map("c", 16, 1).gen(); - auto rhs = GS(2.0).idx("a", 16).idx("b", 16).gen(); + auto lhs = GS(1.0).idx("a", 16).idx("b", 16).map("c", 16, 1); + auto rhs = GS(2.0).idx("a", 16).idx("b", 16); benchmark_concat("mixed dense concat a", lhs, rhs, "a"); } TEST(MixedConcat, large_mixed_a) { - auto lhs = GS(1.0).idx("a", 16).idx("b", 16).map("c", 16, 1).gen(); - auto rhs = GS(2.0).idx("a", 16).idx("b", 16).map("c", 16, 2).gen(); + auto lhs = GS(1.0).idx("a", 16).idx("b", 16).map("c", 16, 1); + auto rhs = GS(2.0).idx("a", 16).idx("b", 16).map("c", 16, 2); benchmark_concat("mixed append concat a", lhs, rhs, "a"); } TEST(MixedConcat, large_mixed_b) { - auto lhs = GS(1.0).idx("a", 16).idx("b", 16).map("c", 16, 1).gen(); - auto rhs = GS(2.0).idx("a", 16).idx("b", 16).map("c", 16, 2).gen(); + auto lhs = GS(1.0).idx("a", 16).idx("b", 16).map("c", 16, 1); + auto rhs = GS(2.0).idx("a", 16).idx("b", 16).map("c", 16, 2); benchmark_concat("mixed append concat b", lhs, rhs, "b"); } //----------------------------------------------------------------------------- TEST(NumberJoin, plain_op2) { - auto lhs = GS(2.0).gen(); - auto rhs = GS(3.0).gen(); + auto lhs = GS(2.0); + auto rhs = GS(3.0); benchmark_join("simple numbers multiply", lhs, rhs, operation::Mul::f); } //----------------------------------------------------------------------------- TEST(DenseJoin, small_vectors) { - auto lhs = GS(1.0).idx("x", 10).gen(); - auto rhs = GS(2.0).idx("x", 10).gen(); + auto lhs = GS(1.0).idx("x", 10); + auto rhs = GS(2.0).idx("x", 10); benchmark_join("small dense vector multiply", lhs, rhs, operation::Mul::f); } TEST(DenseJoin, full_overlap) { - auto lhs = GS(1.0).idx("a", 16).idx("b", 16).idx("c", 16).gen(); - auto rhs = GS(2.0).idx("a", 16).idx("b", 16).idx("c", 16).gen(); + auto lhs = GS(1.0).idx("a", 16).idx("b", 16).idx("c", 16); + auto rhs = GS(2.0).idx("a", 16).idx("b", 16).idx("c", 16); benchmark_join("dense full overlap multiply", lhs, rhs, operation::Mul::f); } TEST(DenseJoin, partial_overlap) { - auto lhs = GS(1.0).idx("a", 8).idx("c", 8).idx("d", 8).gen(); - auto rhs = GS(2.0).idx("b", 8).idx("c", 8).idx("d", 8).gen(); + auto lhs = GS(1.0).idx("a", 8).idx("c", 8).idx("d", 8); + auto rhs = GS(2.0).idx("b", 8).idx("c", 8).idx("d", 8); benchmark_join("dense partial overlap multiply", lhs, rhs, operation::Mul::f); } TEST(DenseJoin, subset_overlap) { - auto lhs = GS(1.0).idx("a", 16).idx("b", 16).idx("c", 16).gen(); - auto rhs_inner = GS(2.0).idx("b", 16).idx("c", 16).gen(); - auto rhs_outer = GS(3.0).idx("a", 16).idx("b", 16).gen(); + auto lhs = GS(1.0).idx("a", 16).idx("b", 16).idx("c", 16); + auto rhs_inner = GS(2.0).idx("b", 16).idx("c", 16); + auto rhs_outer = GS(3.0).idx("a", 16).idx("b", 16); benchmark_join("dense subset overlap inner multiply", lhs, rhs_inner, operation::Mul::f); benchmark_join("dense subset overlap outer multiply", lhs, rhs_outer, operation::Mul::f); } TEST(DenseJoin, no_overlap) { - auto lhs = GS(1.0).idx("a", 4).idx("e", 4).idx("f", 4).gen(); - auto rhs = GS(2.0).idx("b", 4).idx("c", 4).idx("d", 4).gen(); + auto lhs = GS(1.0).idx("a", 4).idx("e", 4).idx("f", 4); + auto rhs = GS(2.0).idx("b", 4).idx("c", 4).idx("d", 4); benchmark_join("dense no overlap multiply", lhs, rhs, operation::Mul::f); } TEST(DenseJoin, simple_expand) { - auto lhs = GS(1.0).idx("a", 5).idx("b", 4).idx("c", 4).gen(); - auto rhs = GS(2.0).idx("d", 4).idx("e", 4).idx("f", 5).gen(); + auto lhs = GS(1.0).idx("a", 5).idx("b", 4).idx("c", 4); + auto rhs = GS(2.0).idx("d", 4).idx("e", 4).idx("f", 5); benchmark_join("dense simple expand multiply", lhs, rhs, operation::Mul::f); } TEST(DenseJoin, multiply_by_number) { - auto lhs = GS(3.0).gen(); - auto rhs = GS(2.0).idx("a", 16).idx("b", 16).idx("c", 16).gen(); + auto lhs = GS(3.0); + auto rhs = GS(2.0).idx("a", 16).idx("b", 16).idx("c", 16); benchmark_join("dense cube multiply by number", lhs, rhs, operation::Mul::f); } //----------------------------------------------------------------------------- TEST(SparseJoin, small_vectors) { - auto lhs = GS(1.0).map("x", 10, 1).gen(); - auto rhs = GS(2.0).map("x", 10, 2).gen(); + auto lhs = GS(1.0).map("x", 10, 1); + auto rhs = GS(2.0).map("x", 10, 2); benchmark_join("small sparse vector multiply", lhs, rhs, operation::Mul::f); } TEST(SparseJoin, large_vectors) { - auto lhs = GS(1.0).map("x", 1800, 1).gen(); - auto rhs = GS(2.0).map("x", 1000, 2).gen(); + auto lhs = GS(1.0).map("x", 1800, 1); + auto rhs = GS(2.0).map("x", 1000, 2); benchmark_join("large sparse vector multiply", lhs, rhs, operation::Mul::f); } TEST(SparseJoin, full_overlap) { - auto lhs = GS(1.0).map("a", 16, 1).map("b", 16, 1).map("c", 16, 1).gen(); - auto rhs = GS(2.0).map("a", 16, 2).map("b", 16, 2).map("c", 16, 2).gen(); + auto lhs = GS(1.0).map("a", 16, 1).map("b", 16, 1).map("c", 16, 1); + auto rhs = GS(2.0).map("a", 16, 2).map("b", 16, 2).map("c", 16, 2); benchmark_join("sparse full overlap multiply", lhs, rhs, operation::Mul::f); } TEST(SparseJoin, full_overlap_big_vs_small) { - auto lhs = GS(1.0).map("a", 16, 1).map("b", 16, 1).map("c", 16, 1).gen(); - auto rhs = GS(2.0).map("a", 2, 1).map("b", 2, 1).map("c", 2, 1).gen(); + auto lhs = GS(1.0).map("a", 16, 1).map("b", 16, 1).map("c", 16, 1); + auto rhs = GS(2.0).map("a", 2, 1).map("b", 2, 1).map("c", 2, 1); benchmark_join("sparse full overlap big vs small multiply", lhs, rhs, operation::Mul::f); } TEST(SparseJoin, partial_overlap) { - auto lhs = GS(1.0).map("a", 8, 1).map("c", 8, 1).map("d", 8, 1).gen(); - auto rhs = GS(2.0).map("b", 8, 2).map("c", 8, 2).map("d", 8, 2).gen(); + auto lhs = GS(1.0).map("a", 8, 1).map("c", 8, 1).map("d", 8, 1); + auto rhs = GS(2.0).map("b", 8, 2).map("c", 8, 2).map("d", 8, 2); benchmark_join("sparse partial overlap multiply", lhs, rhs, operation::Mul::f); } TEST(SparseJoin, no_overlap) { - auto lhs = GS(1.0).map("a", 4, 1).map("e", 4, 1).map("f", 4, 1).gen(); - auto rhs = GS(2.0).map("b", 4, 1).map("c", 4, 1).map("d", 4, 1).gen(); + auto lhs = GS(1.0).map("a", 4, 1).map("e", 4, 1).map("f", 4, 1); + auto rhs = GS(2.0).map("b", 4, 1).map("c", 4, 1).map("d", 4, 1); benchmark_join("sparse no overlap multiply", lhs, rhs, operation::Mul::f); } TEST(SparseJoin, multiply_by_number) { - auto lhs = GS(3.0).gen(); - auto rhs = GS(2.0).map("a", 16, 2).map("b", 16, 2).map("c", 16, 2).gen(); + auto lhs = GS(3.0); + auto rhs = GS(2.0).map("a", 16, 2).map("b", 16, 2).map("c", 16, 2); benchmark_join("sparse multiply by number", lhs, rhs, operation::Mul::f); } //----------------------------------------------------------------------------- TEST(MixedJoin, full_overlap) { - auto lhs = GS(1.0).map("a", 16, 1).map("b", 16, 1).idx("c", 16).gen(); - auto rhs = GS(2.0).map("a", 16, 2).map("b", 16, 2).idx("c", 16).gen(); + auto lhs = GS(1.0).map("a", 16, 1).map("b", 16, 1).idx("c", 16); + auto rhs = GS(2.0).map("a", 16, 2).map("b", 16, 2).idx("c", 16); benchmark_join("mixed full overlap multiply", lhs, rhs, operation::Mul::f); } TEST(MixedJoin, partial_sparse_overlap) { - auto lhs = GS(1.0).map("a", 8, 1).map("c", 8, 1).idx("d", 8).gen(); - auto rhs = GS(2.0).map("b", 8, 2).map("c", 8, 2).idx("d", 8).gen(); + auto lhs = GS(1.0).map("a", 8, 1).map("c", 8, 1).idx("d", 8); + auto rhs = GS(2.0).map("b", 8, 2).map("c", 8, 2).idx("d", 8); benchmark_join("mixed partial sparse overlap multiply", lhs, rhs, operation::Mul::f); } TEST(MixedJoin, no_overlap) { - auto lhs = GS(1.0).map("a", 4, 1).map("e", 4, 1).idx("f", 4).gen(); - auto rhs = GS(2.0).map("b", 4, 1).map("c", 4, 1).idx("d", 4).gen(); + auto lhs = GS(1.0).map("a", 4, 1).map("e", 4, 1).idx("f", 4); + auto rhs = GS(2.0).map("b", 4, 1).map("c", 4, 1).idx("d", 4); benchmark_join("mixed no overlap multiply", lhs, rhs, operation::Mul::f); } TEST(MixedJoin, multiply_by_number) { - auto lhs = GS(3.0).gen(); - auto rhs = GS(2.0).map("a", 16, 2).map("b", 16, 2).idx("c", 16).gen(); + auto lhs = GS(3.0); + auto rhs = GS(2.0).map("a", 16, 2).map("b", 16, 2).idx("c", 16); benchmark_join("mixed multiply by number", lhs, rhs, operation::Mul::f); } //----------------------------------------------------------------------------- TEST(ReduceBench, number_reduce) { - auto lhs = GS(1.0).gen(); + auto lhs = GS(1.0); benchmark_reduce("number reduce", lhs, Aggr::SUM, {}); } TEST(ReduceBench, dense_reduce) { - auto lhs = GS(1.0).idx("a", 16).idx("b", 16).idx("c", 16).gen(); + auto lhs = GS(1.0).idx("a", 16).idx("b", 16).idx("c", 16); benchmark_reduce("dense reduce inner", lhs, Aggr::SUM, {"c"}); benchmark_reduce("dense reduce middle", lhs, Aggr::SUM, {"b"}); benchmark_reduce("dense reduce outer", lhs, Aggr::SUM, {"a"}); @@ -886,7 +886,7 @@ TEST(ReduceBench, dense_reduce) { } TEST(ReduceBench, sparse_reduce) { - auto lhs = GS(1.0).map("a", 16, 1).map("b", 16, 1).map("c", 16, 1).gen(); + auto lhs = GS(1.0).map("a", 16, 1).map("b", 16, 1).map("c", 16, 1); benchmark_reduce("sparse reduce inner", lhs, Aggr::SUM, {"c"}); benchmark_reduce("sparse reduce middle", lhs, Aggr::SUM, {"b"}); benchmark_reduce("sparse reduce outer", lhs, Aggr::SUM, {"a"}); @@ -898,7 +898,7 @@ TEST(ReduceBench, sparse_reduce) { TEST(ReduceBench, mixed_reduce) { auto lhs = GS(1.0).map("a", 4, 1).map("b", 4, 1).map("c", 4, 1) - .idx("d", 4).idx("e", 4).idx("f", 4).gen(); + .idx("d", 4).idx("e", 4).idx("f", 4); benchmark_reduce("mixed reduce middle dense", lhs, Aggr::SUM, {"e"}); benchmark_reduce("mixed reduce middle sparse", lhs, Aggr::SUM, {"b"}); benchmark_reduce("mixed reduce middle sparse/dense", lhs, Aggr::SUM, {"b", "e"}); @@ -910,87 +910,87 @@ TEST(ReduceBench, mixed_reduce) { //----------------------------------------------------------------------------- TEST(RenameBench, dense_rename) { - auto lhs = GS(1.0).idx("a", 64).idx("b", 64).gen(); + auto lhs = GS(1.0).idx("a", 64).idx("b", 64); benchmark_rename("dense transpose", lhs, {"a", "b"}, {"b", "a"}); } TEST(RenameBench, sparse_rename) { - auto lhs = GS(1.0).map("a", 64, 1).map("b", 64, 1).gen(); + auto lhs = GS(1.0).map("a", 64, 1).map("b", 64, 1); benchmark_rename("sparse transpose", lhs, {"a", "b"}, {"b", "a"}); } TEST(RenameBench, mixed_rename) { - auto lhs = GS(1.0).map("a", 8, 1).map("b", 8, 1).idx("c", 8).idx("d", 8).gen(); + auto lhs = GS(1.0).map("a", 8, 1).map("b", 8, 1).idx("c", 8).idx("d", 8); benchmark_rename("mixed multi-transpose", lhs, {"a", "b", "c", "d"}, {"b", "a", "d", "c"}); } //----------------------------------------------------------------------------- TEST(MergeBench, dense_merge) { - auto lhs = GS(1.0).idx("a", 64).idx("b", 64).gen(); - auto rhs = GS(2.0).idx("a", 64).idx("b", 64).gen(); + auto lhs = GS(1.0).idx("a", 64).idx("b", 64); + auto rhs = GS(2.0).idx("a", 64).idx("b", 64); benchmark_merge("dense merge", lhs, rhs, operation::Max::f); } TEST(MergeBench, sparse_merge_big_small) { - auto lhs = GS(1.0).map("a", 64, 1).map("b", 64, 1).gen(); - auto rhs = GS(2.0).map("a", 8, 1).map("b", 8, 1).gen(); + auto lhs = GS(1.0).map("a", 64, 1).map("b", 64, 1); + auto rhs = GS(2.0).map("a", 8, 1).map("b", 8, 1); benchmark_merge("sparse merge big vs small", lhs, rhs, operation::Max::f); } TEST(MergeBench, sparse_merge_minimal_overlap) { - auto lhs = GS(1.0).map("a", 64, 11).map("b", 32, 11).gen(); - auto rhs = GS(2.0).map("a", 32, 13).map("b", 64, 13).gen(); + auto lhs = GS(1.0).map("a", 64, 11).map("b", 32, 11); + auto rhs = GS(2.0).map("a", 32, 13).map("b", 64, 13); benchmark_merge("sparse merge minimal overlap", lhs, rhs, operation::Max::f); } TEST(MergeBench, mixed_merge) { - auto lhs = GS(1.0).map("a", 64, 1).idx("b", 64).gen(); - auto rhs = GS(2.0).map("a", 64, 2).idx("b", 64).gen(); + auto lhs = GS(1.0).map("a", 64, 1).idx("b", 64); + auto rhs = GS(2.0).map("a", 64, 2).idx("b", 64); benchmark_merge("mixed merge", lhs, rhs, operation::Max::f); } //----------------------------------------------------------------------------- TEST(MapBench, number_map) { - auto lhs = GS(1.75).gen(); + auto lhs = GS(1.75); benchmark_map("number map", lhs, operation::Floor::f); } TEST(MapBench, dense_map) { - auto lhs = GS(1.75).idx("a", 64).idx("b", 64).gen(); + auto lhs = GS(1.75).idx("a", 64).idx("b", 64); benchmark_map("dense map", lhs, operation::Floor::f); } TEST(MapBench, sparse_map_small) { - auto lhs = GS(1.75).map("a", 4, 1).map("b", 4, 1).gen(); + auto lhs = GS(1.75).map("a", 4, 1).map("b", 4, 1); benchmark_map("sparse map small", lhs, operation::Floor::f); } TEST(MapBench, sparse_map_big) { - auto lhs = GS(1.75).map("a", 64, 1).map("b", 64, 1).gen(); + auto lhs = GS(1.75).map("a", 64, 1).map("b", 64, 1); benchmark_map("sparse map big", lhs, operation::Floor::f); } TEST(MapBench, mixed_map) { - auto lhs = GS(1.75).map("a", 64, 1).idx("b", 64).gen(); + auto lhs = GS(1.75).map("a", 64, 1).idx("b", 64); benchmark_map("mixed map", lhs, operation::Floor::f); } //----------------------------------------------------------------------------- TEST(TensorCreateBench, create_dense) { - auto proto = GS(1.0).idx("a", 32).idx("b", 32).gen(); + auto proto = GS(1.0).idx("a", 32).idx("b", 32); benchmark_tensor_create("dense tensor create", proto); } TEST(TensorCreateBench, create_sparse) { - auto proto = GS(1.0).map("a", 32, 1).map("b", 32, 1).gen(); + auto proto = GS(1.0).map("a", 32, 1).map("b", 32, 1); benchmark_tensor_create("sparse tensor create", proto); } TEST(TensorCreateBench, create_mixed) { - auto proto = GS(1.0).map("a", 32, 1).idx("b", 32).gen(); + auto proto = GS(1.0).map("a", 32, 1).idx("b", 32); benchmark_tensor_create("mixed tensor create", proto); } @@ -998,7 +998,7 @@ TEST(TensorCreateBench, create_mixed) { TEST(TensorLambdaBench, simple_lambda) { auto type = ValueType::from_spec("tensor<float>(a[64],b[64])"); - auto p0 = GS(3.5).gen(); + auto p0 = GS(3.5); auto function = Function::parse({"a", "b", "p0"}, "(a*64+b)*p0"); ASSERT_FALSE(function->has_error()); benchmark_tensor_lambda("simple tensor lambda", type, p0, *function); @@ -1006,7 +1006,7 @@ TEST(TensorLambdaBench, simple_lambda) { TEST(TensorLambdaBench, complex_lambda) { auto type = ValueType::from_spec("tensor<float>(a[64],b[64])"); - auto p0 = GS(1.0).idx("x", 3).gen(); + auto p0 = GS(1.0).idx("x", 3); auto function = Function::parse({"a", "b", "p0"}, "(a*64+b)*reduce(p0,sum)"); ASSERT_FALSE(function->has_error()); benchmark_tensor_lambda("complex tensor lambda", type, p0, *function); @@ -1015,7 +1015,7 @@ TEST(TensorLambdaBench, complex_lambda) { //----------------------------------------------------------------------------- TEST(TensorPeekBench, dense_peek) { - auto lhs = GS(1.0).idx("a", 64).idx("b", 64).gen(); + auto lhs = GS(1.0).idx("a", 64).idx("b", 64); benchmark_tensor_peek("dense peek cell verbatim", lhs, verbatim_peek().add("a", 1).add("b", 2)); benchmark_tensor_peek("dense peek cell dynamic", lhs, dynamic_peek().add("a", 1).add("b", 2)); benchmark_tensor_peek("dense peek vector verbatim", lhs, verbatim_peek().add("a", 1)); @@ -1023,7 +1023,7 @@ TEST(TensorPeekBench, dense_peek) { } TEST(TensorPeekBench, sparse_peek) { - auto lhs = GS(1.0).map("a", 64, 1).map("b", 64, 1).gen(); + auto lhs = GS(1.0).map("a", 64, 1).map("b", 64, 1); benchmark_tensor_peek("sparse peek cell verbatim", lhs, verbatim_peek().add("a", 1).add("b", 2)); benchmark_tensor_peek("sparse peek cell dynamic", lhs, dynamic_peek().add("a", 1).add("b", 2)); benchmark_tensor_peek("sparse peek vector verbatim", lhs, verbatim_peek().add("a", 1)); @@ -1031,7 +1031,7 @@ TEST(TensorPeekBench, sparse_peek) { } TEST(TensorPeekBench, mixed_peek) { - auto lhs = GS(1.0).map("a", 8, 1).map("b", 8, 1).idx("c", 8).idx("d", 8).gen(); + auto lhs = GS(1.0).map("a", 8, 1).map("b", 8, 1).idx("c", 8).idx("d", 8); benchmark_tensor_peek("mixed peek cell verbatim", lhs, verbatim_peek().add("a", 1).add("b", 2).add("c", 3).add("d", 4)); benchmark_tensor_peek("mixed peek cell dynamic", lhs, dynamic_peek().add("a", 1).add("b", 2).add("c", 3).add("d", 4)); benchmark_tensor_peek("mixed peek dense verbatim", lhs, verbatim_peek().add("a", 1).add("b", 2)); |