algos_conv1x1_gemv.h 1.3 KB
Newer Older
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
/**
 * \file dnn/src/fallback/conv_bias/conv1x1/algos_conv1x1_gemv.h
 * MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
 *
 * Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 */

#pragma once

#include "megdnn/thin/small_vector.h"
#include "src/common/utils.h"
#include "src/fallback/conv_bias/opr_impl.h"

namespace megdnn {
namespace fallback {

class ConvBiasImpl::AlgoConv1x1Gemv final : public AlgoBase {
public:
    AlgoConv1x1Gemv() = default;

    bool is_reproducible() const override { return true; }

27
    const char* name() const override { return "CONV1x1_GEMV"; }
28

29
    bool usable(const NCBKernSizeParam& param,
30
                AlgoSelectionStrategy algo_selection_strategy) const override;
31
    size_t get_workspace(const NCBKernSizeParam& param) const override;
32
    SmallVector<NCBKern> dispatch_kerns(
33
            const NCBKernSizeParam& param) const override;
34

35
    bool is_preferred(const NCBKernSizeParam&) const override;
36 37 38 39 40 41 42 43 44

protected:
    size_t get_oc_tile_size_heuristic(const NCBKernSizeParam& param) const;
};

}  // namespace fallback
}  // namespace megdnn

// vim: syntax=cpp.doxygen