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.
30 lines
544 B
C++
30 lines
544 B
C++
/*
|
|
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
|
*/
|
|
#ifndef MYADD_OP_H_
|
|
#define MYADD_OP_H_
|
|
|
|
#include <cvikernel/cvikernel.h>
|
|
#include <vector>
|
|
|
|
class MyAddOp {
|
|
public:
|
|
MyAddOp(cvk_context_t * ctx) : ctx(ctx) {}
|
|
void codeGenBf16(std::vector<int64_t> shape);
|
|
|
|
private:
|
|
typedef struct tiling_info {
|
|
uint32_t n;
|
|
uint32_t c;
|
|
uint32_t h;
|
|
uint32_t w;
|
|
uint64_t offset; // gmem offset
|
|
} tiling_info_t;
|
|
cvk_context_t * ctx;
|
|
std::vector<tiling_info_t> tiles;
|
|
void tiling(int64_t total);
|
|
|
|
};
|
|
|
|
#endif
|