Aron Virginas-Tar | 5605519 | 2018-11-12 18:10:43 +0000 | [diff] [blame] | 1 | // |
Teresa Charlin | fc8978f | 2020-08-06 11:30:46 +0100 | [diff] [blame^] | 2 | // Copyright © 2017 Arm Ltd and Contributors. All rights reserved. |
Aron Virginas-Tar | 5605519 | 2018-11-12 18:10:43 +0000 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include <backendsCommon/test/WorkloadFactoryHelper.hpp> |
| 9 | |
| 10 | #include <reference/RefBackend.hpp> |
| 11 | #include <reference/RefWorkloadFactory.hpp> |
Teresa Charlin | fc8978f | 2020-08-06 11:30:46 +0100 | [diff] [blame^] | 12 | #include "reference/RefTensorHandleFactory.hpp" |
Aron Virginas-Tar | 5605519 | 2018-11-12 18:10:43 +0000 | [diff] [blame] | 13 | |
| 14 | namespace |
| 15 | { |
| 16 | |
| 17 | template<> |
| 18 | struct WorkloadFactoryHelper<armnn::RefWorkloadFactory> |
| 19 | { |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 20 | static armnn::IBackendInternal::IMemoryManagerSharedPtr GetMemoryManager() |
| 21 | { |
| 22 | armnn::RefBackend backend; |
| 23 | return backend.CreateMemoryManager(); |
| 24 | } |
| 25 | |
| 26 | static armnn::RefWorkloadFactory GetFactory( |
| 27 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager = nullptr) |
Aron Virginas-Tar | 5605519 | 2018-11-12 18:10:43 +0000 | [diff] [blame] | 28 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 29 | IgnoreUnused(memoryManager); |
Aron Virginas-Tar | 5605519 | 2018-11-12 18:10:43 +0000 | [diff] [blame] | 30 | return armnn::RefWorkloadFactory(); |
| 31 | } |
Teresa Charlin | fc8978f | 2020-08-06 11:30:46 +0100 | [diff] [blame^] | 32 | |
| 33 | static armnn::RefTensorHandleFactory GetTensorHandleFactory( |
| 34 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager = nullptr) |
| 35 | { |
| 36 | |
| 37 | return armnn::RefTensorHandleFactory(std::static_pointer_cast<armnn::RefMemoryManager>(memoryManager)); |
| 38 | } |
Aron Virginas-Tar | 5605519 | 2018-11-12 18:10:43 +0000 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | using RefWorkloadFactoryHelper = WorkloadFactoryHelper<armnn::RefWorkloadFactory>; |
| 42 | |
| 43 | } // anonymous namespace |