MCPcopy Create free account
hub / github.com/alibaba/MNN / run

Method run

test/core/MemoryUtilsTest.cpp:16–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14public:
15 virtual ~MemoryUtilsTest() = default;
16 virtual bool run(int precision) {
17 {
18 void *ptr = MNNMemoryAllocAlign(5, 0b111111 + 1);
19 MNNTEST_ASSERT(((intptr_t)ptr & 0b111111) == 0);
20 MNNMemoryFreeAlign(ptr);
21 }
22 {
23 void *ptr = MNNMemoryCallocAlign(8 * sizeof(int), 0b111 + 1);
24 MNNTEST_ASSERT(((intptr_t)ptr & 0b111) == 0);
25 for (int i = 0; i < 8; i++)
26 MNNTEST_ASSERT(((int *)ptr)[i] == 0);
27 MNNMemoryFreeAlign(ptr);
28 }
29 return true;
30 }
31};
32MNNTestSuiteRegister(MemoryUtilsTest, "core/memory_utils");
33#endif

Callers

nothing calls this directly

Calls 3

MNNMemoryAllocAlignFunction · 0.85
MNNMemoryFreeAlignFunction · 0.85
MNNMemoryCallocAlignFunction · 0.85

Tested by

no test coverage detected