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

Function TEST

test/join.cpp:130–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128JOIN_INIT(JoinSmall2, join_small, 2, 0, 3, 2);
129
130TEST(Join, JoinLargeDim) {
131 using af::constant;
132 using af::deviceGC;
133 using af::span;
134
135 // const int nx = 32;
136 const int nx = 1;
137 const int ny = 4 * 1024 * 1024;
138 const int nw = 4 * 1024 * 1024;
139
140 deviceGC();
141 {
142 array in = randu(nx, ny, u8);
143 array joined = join(0, in, in);
144 dim4 in_dims = in.dims();
145 dim4 joined_dims = joined.dims();
146
147 ASSERT_EQ(2 * in_dims[0], joined_dims[0]);
148 ASSERT_EQ(0.f, sum<float>((joined(0, span) - joined(1, span)).as(f32)));
149
150 array in2 = constant(1, (dim_t)nx, (dim_t)ny, (dim_t)2, (dim_t)nw, u8);
151 joined = join(3, in, in);
152 in_dims = in.dims();
153 joined_dims = joined.dims();
154 ASSERT_EQ(2 * in_dims[3], joined_dims[3]);
155 }
156}
157
158///////////////////////////////// CPP ////////////////////////////////////
159//

Callers

nothing calls this directly

Calls 12

deviceGCFunction · 0.85
randuFunction · 0.85
constantFunction · 0.85
seqClass · 0.85
randnFunction · 0.85
resultClass · 0.85
asMethod · 0.80
joinFunction · 0.50
copyFunction · 0.50
dim4Class · 0.50
dimsMethod · 0.45
elementsMethod · 0.45

Tested by

no test coverage detected