MCPcopy Create free account
hub / github.com/Samsung/ONE / TEST

Function TEST

compiler/loco/src/IR/PermutingCodec.test.cpp:23–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21using namespace loco;
22
23TEST(PemutationTest, feature)
24{
25 Permutation<Domain::Feature> perm;
26
27 // All values are invalid at the beginning
28 ASSERT_FALSE(perm.mapped(FeatureAxis::Count));
29 ASSERT_FALSE(perm.mapped(FeatureAxis::Depth));
30 ASSERT_FALSE(perm.mapped(FeatureAxis::Height));
31 ASSERT_FALSE(perm.mapped(FeatureAxis::Width));
32
33 // Update mapping
34 perm[FeatureAxis::Count] = 5;
35 perm[FeatureAxis::Depth] = 6;
36 perm[FeatureAxis::Height] = 7;
37 perm[FeatureAxis::Width] = 8;
38
39 // Now perm has a mapping for all the axes
40 ASSERT_TRUE(perm.mapped(FeatureAxis::Count));
41 ASSERT_TRUE(perm.mapped(FeatureAxis::Depth));
42 ASSERT_TRUE(perm.mapped(FeatureAxis::Height));
43 ASSERT_TRUE(perm.mapped(FeatureAxis::Width));
44
45 // Check the value
46 ASSERT_EQ(5, perm[FeatureAxis::Count]);
47 ASSERT_EQ(6, perm[FeatureAxis::Depth]);
48 ASSERT_EQ(7, perm[FeatureAxis::Height]);
49 ASSERT_EQ(8, perm[FeatureAxis::Width]);
50}
51
52TEST(PemutationTest, filter)
53{

Callers

nothing calls this directly

Calls 15

mappedMethod · 0.80
rowMethod · 0.80
nthMethod · 0.80
multiplierMethod · 0.80
validMethod · 0.45
axisMethod · 0.45
permMethod · 0.45
rankMethod · 0.45
dimMethod · 0.45
shapeMethod · 0.45
countMethod · 0.45
depthMethod · 0.45

Tested by

no test coverage detected