8 #include <boost/test/unit_test.hpp> 11 using namespace armnn;
15 std::shared_ptr<RefMemoryManager> memoryManager = std::make_shared<RefMemoryManager>();
23 memoryManager->Acquire();
25 float* buffer =
reinterpret_cast<float*
>(handle.Map());
27 BOOST_CHECK(buffer !=
nullptr);
31 BOOST_CHECK(buffer[0] == 2.5f);
34 memoryManager->Release();
36 memoryManager->Acquire();
38 float* buffer =
reinterpret_cast<float*
>(handle.Map());
40 BOOST_CHECK(buffer !=
nullptr);
44 BOOST_CHECK(buffer[0] == 3.5f);
46 memoryManager->Release();
51 std::shared_ptr<RefMemoryManager> memoryManager = std::make_shared<RefMemoryManager>();
56 auto handle = handleFactory.CreateTensorHandle(
info,
true);
60 memoryManager->Acquire();
62 float* buffer =
reinterpret_cast<float*
>(handle->Map());
63 BOOST_CHECK(buffer !=
nullptr);
66 BOOST_CHECK(buffer[0] == 1.5f);
67 BOOST_CHECK(buffer[1] == 2.5f);
69 memoryManager->Release();
71 memoryManager->Acquire();
73 float* buffer =
reinterpret_cast<float*
>(handle->Map());
74 BOOST_CHECK(buffer !=
nullptr);
77 BOOST_CHECK(buffer[0] == 3.5f);
78 BOOST_CHECK(buffer[1] == 4.5f);
80 memoryManager->Release();
82 float testPtr[2] = { 2.5f, 5.5f };
89 std::shared_ptr<RefMemoryManager> memoryManager = std::make_shared<RefMemoryManager>();
94 auto handle = handleFactory.CreateTensorHandle(
info,
false);
97 memoryManager->Acquire();
102 float testPtr[2] = { 2.5f, 5.5f };
105 float* buffer =
reinterpret_cast<float*
>(handle->Map());
106 BOOST_CHECK(buffer !=
nullptr);
107 BOOST_CHECK(buffer == testPtr);
109 BOOST_CHECK(buffer[0] == 2.5f);
110 BOOST_CHECK(buffer[1] == 5.5f);
113 BOOST_CHECK(buffer[0] == 3.5f);
114 BOOST_CHECK(buffer[1] == 10.0f);
115 memoryManager->Release();
129 float testPtr[2] = { 2.5f, 5.5f };
132 float* buffer =
reinterpret_cast<float*
>(handle.Map());
133 BOOST_CHECK(buffer !=
nullptr);
134 BOOST_CHECK(buffer == testPtr);
136 BOOST_CHECK(buffer[0] == 2.5f);
137 BOOST_CHECK(buffer[1] == 5.5f);
140 BOOST_CHECK(buffer[0] == 3.5f);
141 BOOST_CHECK(buffer[1] == 10.0f);
146 std::shared_ptr<RefMemoryManager> memoryManager = std::make_shared<RefMemoryManager>();
155 std::vector<Capability> capabilities = handleFactory.GetCapabilities(input,
158 BOOST_CHECK(capabilities.empty());
163 std::shared_ptr<RefMemoryManager> memoryManager = std::make_shared<RefMemoryManager>();
167 ARMNN_ASSERT(!(handleFactory.SupportsInPlaceComputation()));
170 #if !defined(__ANDROID__) 177 int* testPtr =
new int(4);
196 int* testPtr =
new int(4);
212 int* testPtr =
new int[2];
215 void* misalignedPtr =
static_cast<void*
>(
reinterpret_cast<char*
>(testPtr) + 1);
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Copyright (c) 2020 ARM Limited.
#define ARMNN_ASSERT(COND)
BOOST_AUTO_TEST_CASE(CheckConvolution2dLayer)
BOOST_AUTO_TEST_SUITE_END()
virtual const IInputSlot & GetInputSlot(unsigned int index) const =0
Get a const input slot handle by slot index.
virtual const IOutputSlot & GetOutputSlot(unsigned int index) const =0
Get the const output slot handle by slot index.
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
virtual int Connect(IInputSlot &destination)=0
static INetworkPtr Create(NetworkOptions networkOptions={})