49 lines
1.5 KiB
C
49 lines
1.5 KiB
C
//
|
|
// Created by xiangzhou on 12/28/23.
|
|
//
|
|
|
|
#pragma once
|
|
|
|
#include "C_Tensor.h"
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef void (*Mystery_fn)(const void* const* inputs, const int* const* input_shapes, const int* input_shape_sizes, int* input_data_types, int input_num,
|
|
char** attr_names, int* attr_types, int* attr_sizes, void** attr_values, const int attr_num, void** outputs, const int* const* output_shapes, const int* output_shape_sizes, int* output_data_types, int output_num);
|
|
//----------------------------------------------------------------------------
|
|
// Mystery
|
|
//------------------------------------------------------------------------
|
|
struct MysteryAttribute {
|
|
const char* name_;
|
|
const char* op_type_;
|
|
Mystery_fn fn_;
|
|
int attr_num_;
|
|
const char* attr_name_[MAX_ATTR_COUNT];
|
|
int attr_type_[MAX_ATTR_COUNT];
|
|
int attr_size_[MAX_ATTR_COUNT];
|
|
void* attr_value_[MAX_ATTR_COUNT];
|
|
};
|
|
typedef struct MysteryAttribute MysteryAttribute;
|
|
|
|
|
|
|
|
CREATE_DECL_RUN_FUN(Mystery)
|
|
|
|
//----------------------------------------------------------------------------
|
|
// Utility function to access mystery table and types
|
|
//------------------------------------------------------------------------
|
|
typedef Mystery_fn Mystery_fn_t;
|
|
|
|
struct MysteryItem {
|
|
const char* op_type;
|
|
Mystery_fn_t Mystery_fn;
|
|
};
|
|
|
|
extern Mystery_fn_t getMysteryFn(const char *name);
|
|
extern uint32_t getOnnxTypeAndSize(uint32_t kneType, int32_t kneSize, int *onnxType, int *onnxSize);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|