blob: e736efc1d8de49d3b6fa344bf92fb9a2b53c8749 [file] [log] [blame]
Sadik Armagan045f6be2020-09-10 13:37:32 +01001//
2// Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5#pragma once
6
7#include <armnn/backends/IBackendContext.hpp>
8
9namespace armnn
10{
11
Mike Kellyf9f33a02020-10-14 11:48:21 +010012/// The NeonBackendModelContext is used to pass in Neon specific backend ModelOptions. The supported backend
13/// ModelOptions are:
14/// - "FastMathEnabled"\n
15/// Using the fast_math flag can lead to performance improvements in fp32 and fp16 layers but may result in\n
16/// results with reduced or different precision. The fast_math flag will not have any effect on int8 performance.
Matthew Sloyan0a7dc6b2021-02-10 16:50:53 +000017/// - "NumberOfThreads"\n
18/// Specify the number of threads used by the CpuAcc backend.
Sadik Armagan045f6be2020-09-10 13:37:32 +010019class NeonBackendModelContext : public IBackendModelContext
20{
21public:
22 NeonBackendModelContext(const ModelOptions& modelOptions);
23
24 bool IsFastMathEnabled() const;
25
Matthew Sloyan0a7dc6b2021-02-10 16:50:53 +000026 unsigned int GetNumberOfThreads() const;
27
Sadik Armagan045f6be2020-09-10 13:37:32 +010028private:
29 bool m_IsFastMathEnabled;
Matthew Sloyan0a7dc6b2021-02-10 16:50:53 +000030 unsigned int m_NumberOfThreads;
Sadik Armagan045f6be2020-09-10 13:37:32 +010031};
32
33} // namespace armnn