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

Function testAllBroadcast

test/binary.cpp:858–870  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

856}
857
858void testAllBroadcast(dim4 dims) {
859 af::array A = constant(1, dims);
860 for (int k = 0; k < dims.ndims(); ++k) {
861 dim4 rdims = dims;
862 rdims[k] = 1;
863 af::array B = constant(-1, rdims);
864 af::array C = A + B;
865 ASSERT_ARRAYS_EQ(C, constant(0, dims));
866
867 C = B + A;
868 ASSERT_ARRAYS_EQ(C, constant(0, dims));
869 }
870}
871
872TEST(Broadcast, MatrixMatrix2d) { testAllBroadcast(dim4(10, 15)); }
873

Callers 1

TESTFunction · 0.85

Calls 2

constantFunction · 0.85
ndimsMethod · 0.45

Tested by

no test coverage detected