Add a section of how to link IE with CMake project (#99)
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / kernel_selector / core / auto_tuner_offline.h
1 /*
2 // Copyright (c) 2018 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16
17 #pragma once
18
19 #include <string>
20 #include <mutex>
21 #include "auto_tuner.h"
22 #include "kernel_selector_common.h"
23
24 namespace kernel_selector 
25 {
26     // SKL GT4e
27     void tuning_cache_193B(tuning_data&);
28     void tuning_cache_193B_B1_B16(tuning_data&);
29     void tuning_cache_193B_B8(tuning_data&);
30     void tuning_cache_193B_B32_B64(tuning_data&);
31     //SKL GT2
32     void tuning_cache_1912(tuning_data&);
33     void tuning_cache_1912_B1_B16(tuning_data&);
34     void tuning_cache_1912_B8(tuning_data&);
35     void tuning_cache_1912_B32_B64(tuning_data&);
36     //KBL GT3e
37     void tuning_cache_5927(tuning_data&);
38     void tuning_cache_5927_B1(tuning_data&);
39     //ICL GT2
40     void tuning_cache_8A52(tuning_data&);
41     void tuning_cache_8A52_B1_B16(tuning_data&);
42     //APL 10W
43     void tuning_cache_5A84(tuning_data&);
44     // Device ID for APL E3930.
45     void tuning_cache_5A85(tuning_data&);
46
47     class auto_tuner_offline
48     {
49     private:
50         static std::shared_ptr<auto_tuner_offline> instance;
51         static std::mutex mutex;
52         auto_tuner_offline() = delete;
53         // this is singleton implementation, if called twice with different parameter, 
54         // second call param will be ignored
55         auto_tuner_offline(const std::string& hw_id);
56         tuning_data t_data;
57
58         const std::map<std::string, void(*)(tuning_data&)> sku_cache_fillers
59         {
60             { "0x193B" , tuning_cache_193B },
61             { "0x1912" , tuning_cache_1912 },
62             { "0x5927" , tuning_cache_5927 },
63             { "0x8A52" , tuning_cache_8A52 },
64             { "0x5A84" , tuning_cache_5A84 },
65             { "0x5A85" , tuning_cache_5A84 },
66             { "0x3184" , tuning_cache_5A84 },
67         };
68
69     public:
70         static std::shared_ptr<auto_tuner_offline> get_instance(const std::string& hw_id);
71         tuning_data get_tuning_data() const { return t_data; }
72    };
73 }