• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
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 
9 #include<string>
10 
11 namespace armnn
12 {
13 
14 /// The ClBackendModelContext is used to pass in CL specific backend ModelOptions. The supported backend ModelOptions
15 /// are:
16 ///  - "FastMathEnabled"\n
17 ///    Using the fast_math flag can lead to performance improvements in fp32 and fp16 layers but may result in\n
18 ///    results with reduced or different precision. The fast_math flag will not have any effect on int8 performance.
19 class ClBackendModelContext : public IBackendModelContext
20 {
21 public:
22     ClBackendModelContext(const ModelOptions& modelOptions);
23 
24     std::string GetCachedNetworkFilePath() const;
25 
26     bool IsFastMathEnabled() const;
27 
28     bool SaveCachedNetwork() const;
29 
30 private:
31     std::string m_CachedNetworkFilePath;
32     bool m_IsFastMathEnabled;
33     bool m_SaveCachedNetwork;
34 
35 };
36 
37 } // namespace armnn