File size: 656 Bytes
4a28d4d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) OpenMMLab. All rights reserved.

#include "src/turbomind/kernels/gemm/desc.h"

#include <memory>
#include <optional>
#include <vector>

namespace turbomind::gemm {

class DispatchCache {
public:
    DispatchCache(std::vector<Kernel*> kernels);

    ~DispatchCache();

    std::optional<LaunchSpec> LowerBound(const GemmDesc& desc) const;

    std::optional<LaunchSpec> Find(const GemmDesc& desc) const;

    bool Insert(const GemmDesc& desc, const LaunchSpec& spec);

    int Export(std::ostream& os) const;

    int Import(std::istream& is);

private:
    struct Impl;
    std::unique_ptr<Impl> impl_;
};

}  // namespace turbomind::gemm