std::vector<float> outputData(4);
+ std::vector<float> expectedOutput
+ {
+ 1.0f, 4.0f, 9.0f, 16.0f
+ };
+
InputTensors inputTensors
{
{0,armnn::ConstTensor(runtime->GetInputTensorInfo(netId, 0), inputData.data())},
{0,armnn::Tensor(runtime->GetOutputTensorInfo(netId, 0), outputData.data())}
};
- // The result of the inference is not important, just the fact that there
- // should not be CopyMemGeneric workloads.
runtime->GetProfiler(netId)->EnableProfiling(true);
// Do the inference
// Contains ActivationWorkload
std::size_t found = dump.find("ActivationWorkload");
BOOST_TEST(found != std::string::npos);
+
// Contains SyncMemGeneric
found = dump.find("SyncMemGeneric");
BOOST_TEST(found != std::string::npos);
+
// Does not contain CopyMemGeneric
found = dump.find("CopyMemGeneric");
BOOST_TEST(found == std::string::npos);
+
+ // Check output is as expected
+ BOOST_TEST(outputData == expectedOutput);
}
inline void ImportOnlyWorkload(std::vector<BackendId> backends)
}
// If we are not Managing the Memory then we must be importing
tensorHandle->SetImportEnabledFlag(!IsMemoryManaged);
- tensorHandle->SetImportFlags(m_ImportFlags);
+ tensorHandle->SetImportFlags(GetImportFlags());
return tensorHandle;
}
}
// If we are not Managing the Memory then we must be importing
tensorHandle->SetImportEnabledFlag(!IsMemoryManaged);
- tensorHandle->SetImportFlags(m_ImportFlags);
+ tensorHandle->SetImportFlags(GetImportFlags());
return tensorHandle;
}
MemorySourceFlags NeonTensorHandleFactory::GetExportFlags() const
{
- return m_ExportFlags;
+ return 0;
}
MemorySourceFlags NeonTensorHandleFactory::GetImportFlags() const
{
- return m_ImportFlags;
+ return static_cast<MemorySourceFlags>(MemorySource::Malloc);
}
} // namespace armnn
{
public:
NeonTensorHandleFactory(std::weak_ptr<NeonMemoryManager> mgr)
- : m_MemoryManager(mgr),
- m_ImportFlags(static_cast<MemorySourceFlags>(MemorySource::Malloc)),
- m_ExportFlags(static_cast<MemorySourceFlags>(MemorySource::Malloc))
+ : m_MemoryManager(mgr)
{}
std::unique_ptr<ITensorHandle> CreateSubTensorHandle(ITensorHandle& parent,
private:
mutable std::shared_ptr<NeonMemoryManager> m_MemoryManager;
- MemorySourceFlags m_ImportFlags;
- MemorySourceFlags m_ExportFlags;
};
} // namespace armnn