DEVICE_IMPL_OP_OPTILING
函数原型
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
namespace optiling { using SinkTilingFunc = std::function<ge::graphStatus(gert::TilingContext *context)>; class DeviceOpImplRegisterImpl; // 开发者仅关注Tiling成员函数 class DeviceOpImplRegister { public: DeviceOpImplRegister(const char *opType); ~DeviceOpImplRegister(); DeviceOpImplRegister(DeviceOpImplRegister &&other) noexcept; DeviceOpImplRegister(const DeviceOpImplRegister &other); DeviceOpImplRegister &operator=(const DeviceOpImplRegister &) = delete; DeviceOpImplRegister &operator=(DeviceOpImplRegister &&) = delete; DeviceOpImplRegister &Tiling(SinkTilingFunc func); // ... }; } // namespace optiling #define DEVICE_IMPL_OP_OPTILING(optype) \ static optiling::DeviceOpImplRegister VAR_UNUSED g_deviceOpImplRegister##optype = \ optiling::DeviceOpImplRegister(#optype) #endif |
参数说明
参数 |
输入/输出 |
说明 |
---|---|---|
optype |
输入 |
需要注册Tiling函数的OpType(算子类型)。 |
返回值说明
无
约束说明
无
调用示例
1
|
DEVICE_IMPL_OP_OPTILING(TestOptype).Tiling(TestTilingFunc); // 将Tiling函数以及其OpType注册到Tiling下沉 |
父主题: Tiling数据结构注册