2 // Copyright (c) 2018 Intel Corporation
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
21 #include "auto_tuner.h"
22 #include "kernel_selector_common.h"
24 namespace kernel_selector
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&);
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&);
37 void tuning_cache_5927(tuning_data&);
38 void tuning_cache_5927_B1(tuning_data&);
40 void tuning_cache_8A52(tuning_data&);
41 void tuning_cache_8A52_B1_B16(tuning_data&);
43 void tuning_cache_5A84(tuning_data&);
44 // Device ID for APL E3930.
45 void tuning_cache_5A85(tuning_data&);
47 class auto_tuner_offline
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);
58 const std::map<std::string, void(*)(tuning_data&)> sku_cache_fillers
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 },
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; }