DEVICE_IMPL_OP_OPTILING
功 能 说 明
在Tiling下 沉场 景 中,该 宏 定 义 用 于 生 成Tiling下 沉 的 注 册 类,再 通 过 调 用 注 册 类 的 成 员 函 数 来 注 册 需 要 下 沉 的Tiling函 数。
函 数 原 型
Text
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
参 数 说 明
表 1 DEVICE_IMPL_OP_OPTILING参 数 说 明
表 2 Tiling成 员 函 数 参 数 说 明
返 回 值 说 明
无
约 束 说 明
无
调 用 示 例
Text
DEVICE_IMPL_OP_OPTILING(TestOptype).Tiling(TestTilingFunc); // 将Tiling函 数 以 及 其OpType注 册 到Tiling下 沉