ArmNN
 21.02
RefMemoryManagerTests.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 #include <boost/test/unit_test.hpp>
9 
10 BOOST_AUTO_TEST_SUITE(RefMemoryManagerTests)
11 using namespace armnn;
13 
14 BOOST_AUTO_TEST_CASE(ManageOneThing)
15 {
16  RefMemoryManager memoryManager;
17 
18  Pool* pool = memoryManager.Manage(10);
19 
20  BOOST_CHECK(pool);
21 
22  memoryManager.Acquire();
23 
24  BOOST_CHECK(memoryManager.GetPointer(pool) != nullptr); // Yields a valid pointer
25 
26  memoryManager.Release();
27 }
28 
29 BOOST_AUTO_TEST_CASE(ManageTwoThings)
30 {
31  RefMemoryManager memoryManager;
32 
33  Pool* pool1 = memoryManager.Manage(10);
34  Pool* pool2 = memoryManager.Manage(5);
35 
36  BOOST_CHECK(pool1);
37  BOOST_CHECK(pool2);
38 
39  memoryManager.Acquire();
40 
41  void *p1 = memoryManager.GetPointer(pool1);
42  void *p2 = memoryManager.GetPointer(pool2);
43 
44  BOOST_CHECK(p1);
45  BOOST_CHECK(p2);
46  BOOST_CHECK(p1 != p2);
47 
48  memoryManager.Release();
49 }
50 
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
RefMemoryManager::Pool Pool
Copyright (c) 2021 ARM Limited and Contributors.
Pool * Manage(unsigned int numBytes)
BOOST_AUTO_TEST_CASE(CheckConvolution2dLayer)
BOOST_AUTO_TEST_SUITE_END()
void * GetPointer(Pool *pool)