DEVICE_IMPL_OP_OPTILING
Function
Generates a registration class for tiling offload in the tiling offload scenario, and calls member functions of the registration class to register the tiling functions to be offloaded.
Prototype
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; // Developers only need to focus on the tiling member function. 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 |
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
optype |
Input |
Operator type for which the tiling function needs to be registered. |
Returns
None
Restrictions
None
Example
1
|
DEVICE_IMPL_OP_OPTILING(TestOptype).Tiling(TestTilingFunc); // Register the tiling function and its operator type with the tiling offload. |
Parent topic: Tiling sinking downwards