Tensor Comprehensions
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
utils.h
Go to the documentation of this file.
1 
16 #pragma once
17 #include <vector>
18 
19 #include <ATen/ATen.h>
20 
21 #include "tc/core/cuda.h"
23 #include "tc/core/utils/dlpack.h"
24 
25 #include <llvm/ADT/Optional.h>
26 
27 namespace tc {
28 namespace autotune {
29 
33 };
34 
38 std::vector<std::size_t> powers2andCeilDivisors(std::size_t val);
39 
40 template <typename Vector, typename... Vectors>
41 Vector mergeVectors(Vector&& v, Vectors&&... vs);
42 
43 std::vector<OptionsWithMedianTime> getOptionsAndMedianRuntimes(
44  const std::string& id,
45  const std::vector<const DLTensor*>& inputs);
46 
47 std::vector<MappingOptions> restoreCandidates(
48  const std::string& id,
49  const std::vector<const DLTensor*>& inputs,
50  const std::vector<const DLTensor*>& outputs);
51 
52 llvm::Optional<MappingOptions> getBestOptions(
53  const std::string& id,
54  const std::vector<const DLTensor*>& inputs,
55  const std::vector<const DLTensor*>& outputs);
56 
57 } // namespace autotune
58 } // namespace tc
59 
std::vector< std::size_t > powers2andCeilDivisors(std::size_t val)
std::vector< MappingOptions > restoreCandidates(const std::string &id, const std::vector< const DLTensor * > &inputs, const std::vector< const DLTensor * > &outputs)
MappingOptions options
Definition: utils.h:31
Duration medianRuntime
Definition: utils.h:32
Definition: mapping_options.h:336
llvm::Optional< MappingOptions > getBestOptions(const std::string &id, const std::vector< const DLTensor * > &inputs, const std::vector< const DLTensor * > &outputs)
Vector mergeVectors(Vector &&v, Vectors &&...vs)
Definition: utils-inl.h:44
std::chrono::high_resolution_clock::duration Duration
Definition: parameters.h:223
std::vector< OptionsWithMedianTime > getOptionsAndMedianRuntimes(const std::string &id, const std::vector< const DLTensor * > &inputs)