#include "ascendc/host_api/tiling/template_argument.h"
// Template argument declaration
ASCENDC_TPL_ARGS_DECL(AddCustomTemplate, // Operator type
ASCENDC_TPL_DATATYPE_DECL(D_T_X, C_DT_FLOAT, C_DT_FLOAT16, ASCENDC_TPL_INPUT(0)), // Template argument declaration for DataType: data type of argument x. The value can be float16 or float32. ASCENDC_TPL_INPUT(0) indicates the 0th input on the kernel.
ASCENDC_TPL_DATATYPE_DECL(D_T_Y, C_DT_FLOAT, C_DT_FLOAT16, ASCENDC_TPL_INPUT(1)), // Template argument declaration for DataType: data type of argument y. The value can be float16 or float32. ASCENDC_TPL_INPUT(1) indicates the first input on the kernel.
ASCENDC_TPL_DATATYPE_DECL(D_T_Z, C_DT_FLOAT, C_DT_FLOAT16, ASCENDC_TPL_OUTPUT(0)), // Template argument declaration for DataType: data type of argument z. The value can be float16 or float32. ASCENDC_TPL_OUTPUT(0) indicates the 0th output on the kernel.
ASCENDC_TPL_UINT_DECL(TILE_NUM, ASCENDC_TPL_8_BW, ASCENDC_TPL_UI_MIX, 2, 0, 2, 3, 5, 10, 12, 13, 9, 8),// Template argument declaration of the custom UINT type: The template arguments include the number of tiles, encoding bit width ASCENDC_TPL_8_BW (8 bits), which indicates that the number of template arguments does not exceed the 8-bit range, and ASCENDC_TPL_UI_MIX, which indicates that the value range is expressed in mixed mode. There are two groups of data {0–2} and {3–5} and exhaustive values 10, 12, 13, 9, and 8. The final result is {0, 1, 2, 3, 4, 5, 10, 12, 13, 9, 8}.
ASCENDC_TPL_BOOL_DECL(IS_SPLIT, 0, 1), // Template argument declaration of the custom bool type: The template argument is a flag bit indicating whether to split. 1: split; 0: not split.
);
// Template argument selection
// Used to check whether the TilingKey is valid when GET_TPL_TILING_KEY is called to obtain the TilingKey.
ASCENDC_TPL_SEL(
ASCENDC_TPL_ARGS_SEL(
ASCENDC_TPL_KERNEL_TYPE_SEL(ASCENDC_TPL_AIV_ONLY), // Kernel type selection, which does not need to be defined in the template argument declaration and is directly configured in SEL. All ASCENDC_TPL_ARGS_SEL configurations must be consistent. If it is not configured, the automatic inference process will be triggered.
ASCENDC_TPL_DATATYPE_SEL(D_T_X, C_DT_FLOAT16),
ASCENDC_TPL_DATATYPE_SEL(D_T_Y, C_DT_FLOAT16),
ASCENDC_TPL_DATATYPE_SEL(D_T_Z, C_DT_FLOAT16),
ASCENDC_TPL_UINT_SEL(TILE_NUM, ASCENDC_TPL_UI_LIST, 1, 8),
ASCENDC_TPL_BOOL_SEL(IS_SPLIT, 0, 1)
),
ASCENDC_TPL_ARGS_SEL(
ASCENDC_TPL_KERNEL_TYPE_SEL(ASCENDC_TPL_AIV_ONLY),
ASCENDC_TPL_DATATYPE_SEL(D_T_X, C_DT_FLOAT),
ASCENDC_TPL_DATATYPE_SEL(D_T_Y, C_DT_FLOAT),
ASCENDC_TPL_DATATYPE_SEL(D_T_Z, C_DT_FLOAT),
ASCENDC_TPL_UINT_SEL(TILE_NUM, ASCENDC_TPL_UI_LIST, 1, 8),
ASCENDC_TPL_BOOL_SEL(IS_SPLIT, 0, 1)
),
);