commit 3f4938648950a7f3bf9a19c320ca9fae7c52de20 Author: sophgo-forum-service <forum_service@sophgo.com> Date: Mon May 13 13:44:23 2024 +0800 [feat] cviruntime opensource for cv18xx soc. - a4b6a3, add cumsum and gatherelements_pt.
31 lines
816 B
C++
31 lines
816 B
C++
#include <iostream>
|
|
#include <vector>
|
|
#include <algorithm>
|
|
#include <unordered_map>
|
|
#include <runtime/neuron.hpp>
|
|
#include <runtime/op_param.hpp>
|
|
#include <runtime/cpu_function.hpp>
|
|
|
|
class ROIAlignOpRuntime : public cvi::runtime::ICpuFunction {
|
|
|
|
public:
|
|
ROIAlignOpRuntime() {}
|
|
|
|
~ROIAlignOpRuntime();
|
|
void setup(std::vector<std::shared_ptr<cvi::runtime::Neuron>> &inputs,
|
|
std::vector<std::shared_ptr<cvi::runtime::Neuron>> &outputs,
|
|
cvi::OpParam ¶m);
|
|
void run();
|
|
|
|
static ICpuFunction *open() { return new ROIAlignOpRuntime(); }
|
|
static void close(ICpuFunction *func) { delete func; }
|
|
|
|
private:
|
|
std::vector<std::shared_ptr<cvi::runtime::Neuron>> _bottoms;
|
|
std::vector<std::shared_ptr<cvi::runtime::Neuron>> _tops;
|
|
|
|
int pooled_h;
|
|
int pooled_w;
|
|
float spatial_scale;
|
|
};
|