Tensor Comprehensions
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
genetic_autotuner.h
Go to the documentation of this file.
1 
16 #pragma once
17 #include <chrono>
18 #include <iostream>
19 #include <memory>
20 #include <vector>
21 
24 #include "tc/lang/parser.h"
25 
26 #include <llvm/ADT/Optional.h>
27 
28 namespace tc {
29 namespace autotune {
30 namespace detail {
31 
32 using Duration = std::chrono::high_resolution_clock::duration;
33 
35  public:
36  explicit GeneticAutotuner(const std::string& tc);
37 
38  void storeCaches(const std::string& filename);
39 
40  std::vector<MappingOptions> load(
41  const std::string& cacheFileName,
42  const std::string& tcName,
43  const std::vector<const DLTensor*>& inputs,
44  const size_t numCandidates);
45 
46  llvm::Optional<MappingOptions> tune(
47  const std::string& cacheFileName,
48  const std::string& tcName,
49  const std::unordered_map<size_t, std::vector<const DLTensor*>>& inputs,
50  std::unordered_map<size_t, std::vector<DLTensor*>>& outputs,
51  MappingOptions baseMapping,
52  std::vector<MappingOptions> startingPoints,
53  const TuningParameterFixer& fixedParams);
54 
55  private:
56  std::string tc_;
57  std::map<std::string, lang::TreeRef> tcNameMap_;
58 };
59 
60 } // namespace detail
61 } // namespace autotune
62 } // namespace tc
std::map< std::string, lang::TreeRef > tcNameMap_
Definition: genetic_autotuner.h:57
std::vector< MappingOptions > load(const std::string &cacheFileName, const std::string &tcName, const std::vector< const DLTensor * > &inputs, const size_t numCandidates)
GeneticAutotuner(const std::string &tc)
std::string tc_
Definition: genetic_autotuner.h:56
Definition: mapping_options.h:336
std::chrono::high_resolution_clock::duration Duration
Definition: genetic_autotuner.h:32
Definition: parameters.h:188
void storeCaches(const std::string &filename)
llvm::Optional< MappingOptions > tune(const std::string &cacheFileName, const std::string &tcName, const std::unordered_map< size_t, std::vector< const DLTensor * >> &inputs, std::unordered_map< size_t, std::vector< DLTensor * >> &outputs, MappingOptions baseMapping, std::vector< MappingOptions > startingPoints, const TuningParameterFixer &fixedParams)
Definition: genetic_autotuner.h:34