opr_impl.h 2.0 KB
Newer Older
1
/**
2
 * \file dnn/src/cuda/remap/opr_impl.h
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
 * 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/oprs.h"

namespace megdnn {
namespace cuda {
class RemapImpl final : public Remap {
18
public:
19
    using Remap::Remap;
20

21 22
    void exec(_megdnn_tensor_in src, _megdnn_tensor_in map_xy,
              _megdnn_tensor_out dst, _megdnn_workspace workspace) override;
23

24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
    size_t get_workspace_in_bytes(const TensorLayout& src,
                                  const TensorLayout& map_xy,
                                  const TensorLayout& dst) override {
        return 0;
    }
};

class RemapBackwardDataImpl final : public RemapBackwardData {
public:
    using RemapBackwardData::RemapBackwardData;
    void exec(_megdnn_tensor_in map_xy, _megdnn_tensor_in diff,
              _megdnn_tensor_out grad, _megdnn_workspace workspace) override;
    size_t get_workspace_in_bytes(const TensorLayout& map_xy,
                                  const TensorLayout& diff,
                                  const TensorLayout& grad) override {
        return 0;
    }
};

class RemapBackwardMatImpl final : public RemapBackwardMat {
public:
    using RemapBackwardMat::RemapBackwardMat;
    void exec(_megdnn_tensor_in src, _megdnn_tensor_in map_xy,
              _megdnn_tensor_in diff, _megdnn_tensor_out grad,
              _megdnn_workspace workspace) override;
    size_t get_workspace_in_bytes(const TensorLayout& src,
                                  const TensorLayout& map_xy,
                                  const TensorLayout& diff,
                                  const TensorLayout& grad) override {
53 54 55
        return 0;
    }
};
56

57 58 59 60
}  // namespace cuda
}  // namespace megdnn

// vim: syntax=cpp.doxygen