MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / TEST_P

Function TEST_P

test/binary.cpp:676–692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

674}
675
676TEST_P(Broadcast, Addition) {
677 auto params = GetParam();
678 af::array lhs = iota(get<0>(params));
679 af::array rhs = constant(1, get<1>(params));
680
681 af::array out = lhs + rhs;
682
683 af::dim4 outdims = broadcastOut(lhs.dims(), rhs.dims());
684 af::dim4 tilerepetions = tileRepeations(lhs.dims(), rhs.dims());
685 af::array tiledlhs = tile(lhs, tilerepetions);
686
687 vector<float> outvec(outdims.elements());
688 tiledlhs.host(outvec.data());
689 for (auto &out : outvec) { out += 1; }
690
691 ASSERT_VEC_ARRAY_EQ(outvec, outdims, out);
692}
693
694TEST_P(Broadcast, Subtraction) {
695 auto params = GetParam();

Callers 1

BINARY_TESTS_NEARFunction · 0.70

Calls 10

constantFunction · 0.85
broadcastOutFunction · 0.85
tileRepeationsFunction · 0.85
seqClass · 0.85
hostMethod · 0.80
iotaFunction · 0.50
tileFunction · 0.50
rangeFunction · 0.50
dimsMethod · 0.45
elementsMethod · 0.45

Tested by

no test coverage detected