aboutsummaryrefslogtreecommitdiffstats
path: root/eval/src/tests/instruction/generic_join
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2021-02-02 15:27:14 +0000
committerArne Juul <arnej@verizonmedia.com>2021-02-02 15:37:25 +0000
commit9b3a2d5fdbc00c304b1da6e7a15c57dcbdab2c8e (patch)
tree94e41b9f2c76b1717db34490167799618e065217 /eval/src/tests/instruction/generic_join
parent941bf25aea1ff089f54b62ec78af5d4f14d2af35 (diff)
followup on GenSpec after review
* avoid changing layouts in-place, call cpy() first * do cells_float() vs cells_double() more equally * minor cosmetic fixes
Diffstat (limited to 'eval/src/tests/instruction/generic_join')
-rw-r--r--eval/src/tests/instruction/generic_join/generic_join_test.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/eval/src/tests/instruction/generic_join/generic_join_test.cpp b/eval/src/tests/instruction/generic_join/generic_join_test.cpp
index e8af8f8ad38..cce3dc352e7 100644
--- a/eval/src/tests/instruction/generic_join/generic_join_test.cpp
+++ b/eval/src/tests/instruction/generic_join/generic_join_test.cpp
@@ -19,9 +19,9 @@ using vespalib::make_string_short::fmt;
GenSpec::seq_t N_16ths = [] (size_t i) { return (i + 1.0) / 16.0; };
-GenSpec G() { return GenSpec().cells_float().seq(N_16ths); }
+GenSpec G() { return GenSpec().seq(N_16ths); }
-std::vector<GenSpec> join_layouts = {
+const std::vector<GenSpec> join_layouts = {
G(), G(),
G().idx("x", 5), G().idx("x", 5),
G().idx("x", 5), G().idx("y", 5),
@@ -107,8 +107,12 @@ TEST(GenericJoinTest, generic_join_works_for_simple_and_fast_values) {
for (size_t i = 0; i < join_layouts.size(); i += 2) {
const auto &l = join_layouts[i];
const auto &r = join_layouts[i+1];
- for (TensorSpec lhs : { l.gen(), l.cpy().cells_double().gen() }) {
- for (TensorSpec rhs : { r.gen(), r.cpy().cells_double().gen() }) {
+ for (TensorSpec lhs : { l.cpy().cells_float().gen(),
+ l.cpy().cells_double().gen() })
+ {
+ for (TensorSpec rhs : { r.cpy().cells_float().gen(),
+ r.cpy().cells_double().gen() })
+ {
for (auto fun: {operation::Add::f, operation::Sub::f, operation::Mul::f, operation::Div::f}) {
SCOPED_TRACE(fmt("\n===\nLHS: %s\nRHS: %s\n===\n", lhs.to_string().c_str(), rhs.to_string().c_str()));
auto expect = ReferenceOperations::join(lhs, rhs, fun);