77 lines
1.4 KiB
C
77 lines
1.4 KiB
C
/*
|
|
Copyright (c), 2001-2022, Shenshu Tech. Co., Ltd.
|
|
*/
|
|
|
|
#ifndef OT_PLUGIN_TYPE_H
|
|
#define OT_PLUGIN_TYPE_H
|
|
|
|
#include "ot_type.h"
|
|
|
|
#if defined(_MSC_VER)
|
|
#define EXPORT __declspec(dllexport)
|
|
#elif defined(__GNUC__)
|
|
#define EXPORT __attribute__((visibility("default")))
|
|
#else
|
|
#define EXPORT
|
|
#pragma warning cant export dynamic symbos
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
#if __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
#endif /* __cplusplus */
|
|
|
|
enum {
|
|
MAX_OPERAND_NAME_LEN = 64,
|
|
};
|
|
|
|
typedef struct {
|
|
td_s32 height;
|
|
td_s32 width;
|
|
td_s32 chn;
|
|
} OT_NodePluginShape;
|
|
|
|
typedef enum {
|
|
ELEM_TYPE_U8,
|
|
ELEM_TYPE_U16,
|
|
ELEM_TYPE_U32
|
|
} OT_NodePluginElemType;
|
|
|
|
typedef struct {
|
|
td_u64 offset; // addr
|
|
td_char name[MAX_OPERAND_NAME_LEN + 1];
|
|
OT_NodePluginElemType elemType;
|
|
td_u32 num;
|
|
td_u32 stride;
|
|
OT_NodePluginShape shape;
|
|
} OT_NodePluginOperand;
|
|
|
|
typedef struct {
|
|
td_u32 pluginOperandNum;
|
|
OT_NodePluginOperand* pluginOperand;
|
|
} OT_NodePluginOperandArray;
|
|
|
|
typedef struct {
|
|
td_void* param;
|
|
td_u32 size;
|
|
} OT_NodePluginParamItem;
|
|
|
|
typedef struct {
|
|
OT_NodePluginParamItem* hyperParam;
|
|
OT_NodePluginParamItem* trainingParam;
|
|
} OT_NodePluginParam;
|
|
|
|
EXPORT td_s32 OT_NodePluginCompute(const OT_NodePluginOperandArray* inputs, OT_NodePluginOperandArray* outputs,
|
|
OT_NodePluginParam* param);
|
|
|
|
EXPORT td_s32 OT_NodePluginGetNodeType(td_char nodeType[]);
|
|
|
|
#ifdef __cplusplus
|
|
#if __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* __cplusplus */
|
|
|
|
#endif
|