GET_TILING_DATA
Function Usage
Obtains the tiling information input by the kernel entrypoint function of the operator and fills the information in the registered Tiling structure. This function is compiled in macro expansion mode. The TilingData structure needs to be defined in the corresponding operator implementation on the host to implement and register the Tiling function for TilingData computation. For details, see Tiling Implementation on the Host. If a user has registered multiple TilingData structures in TilingData Structure Registration, the default registered structures will be returned when this API is called.
Prototype
1
|
GET_TILING_DATA(tiling_data, tiling_arg) |
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
tiling_data |
Output |
Tiling data, for which the default tiling structure variable is returned. |
|
tiling_arg |
Input |
Tiling argument of the entrypoint function of the operator. |
Availability
Constraints
- This function needs to be used in the operator kernel code, and the type of tiling_data does not need to be declared.
- Currently, the kernel launch project is not supported.
Example
1 2 3 4 5 6 7 |
extern "C" __global__ __aicore__ void add_custom(__gm__ uint8_t *x, __gm__ uint8_t *y, __gm__ uint8_t *z, __gm__ uint8_t *tiling) { GET_TILING_DATA(tilingData, tiling); KernelAdd op; op.Init(x, y, z, tilingData.blkDim, tilingData.totalSize, tilingData.splitTile); op.Process(); } |