diff options
author | Narumol Prangnawarat <narumol.prangnawarat@arm.com> | 2021-12-17 17:27:37 +0000 |
---|---|---|
committer | Francis Murtagh <francis.murtagh@arm.com> | 2022-01-11 11:59:22 +0000 |
commit | b275da5afe480e994fe6cd897b3090c52f1bcdea (patch) | |
tree | 390246b981d5d39f79099b57a56c0f21c2932c05 /src/armnn/test/TensorHandleStrategyTest.cpp | |
parent | 2048bcf8ed671b593ac9af2974e10319b9058b20 (diff) | |
download | armnn-b275da5afe480e994fe6cd897b3090c52f1bcdea.tar.gz |
IVGCVSW-6675 Add functionality for CopyAndImportFactoryPair
to TensorHandleFactoryRegistry
* Add RegisterCopyAndImportFactoryPair
* Add GetMatchingImportFactoryId
* Unit tests
Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com>
Change-Id: I91e71bdeadec8fedbce7088016c06a47a03bdbaa
Diffstat (limited to 'src/armnn/test/TensorHandleStrategyTest.cpp')
-rw-r--r-- | src/armnn/test/TensorHandleStrategyTest.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/armnn/test/TensorHandleStrategyTest.cpp b/src/armnn/test/TensorHandleStrategyTest.cpp index fb26880d0c..374479b941 100644 --- a/src/armnn/test/TensorHandleStrategyTest.cpp +++ b/src/armnn/test/TensorHandleStrategyTest.cpp @@ -392,4 +392,18 @@ TEST_CASE("TensorHandleSelectionStrategy") CHECK(importCount == 1); } +TEST_CASE("RegisterCopyAndImportFactoryPairTest") +{ + TensorHandleFactoryRegistry registry; + ITensorHandleFactory::FactoryId copyId = "CopyFactoryId"; + ITensorHandleFactory::FactoryId importId = "ImportFactoryId"; + registry.RegisterCopyAndImportFactoryPair(copyId, importId); + + // Get mathing import factory id correctly + CHECK((registry.GetMatchingImportFactoryId(copyId) == importId)); + + // Return empty id when Invailid Id is given + CHECK((registry.GetMatchingImportFactoryId("InvalidFactoryId") == "")); +} + } |