tik_continue
Description
Skips the current loop to enter the next one. Used in TIK's for_range loop.
Prototype
tik_continue()
Parameters
None
Applicability
Restrictions
- tik_continue() can be used only in the scope of the for_range statement.
- When block_num of the for_range statement is greater than 1, tik_continue() must not be used in the current loop, but can be used in child loops.
- In the same scope, the code following the tik_continue statement will be skipped.
- For for_range(0, 1), for_range will be expanded. After it is expanded, the statements following tik_continue will not be executed.
- If tik_continue is used in the current scope of for_range, thread_num will be set to 1.
Returns
None
Example
tik_instance = tik.Tik()
data_C_gm = tik_instance.Tensor("float16", (128,), name="data_C", scope=tik.scope_gm)
data_C_ub = tik_instance.Tensor("float16", (128,), name="data_C_ub", scope=tik.scope_ubuf)
data_B_gm = tik_instance.Tensor("float16", (128,), name="data_B", scope=tik.scope_gm)
data_B_ub = tik_instance.Tensor("float16", (128,), name="data_B_ub", scope=tik.scope_ubuf)
tik_instance.data_move(data_B_ub, data_B_gm, 0, 1, 8, 0, 0)
with tik_instance.for_range(0, 8) as i:
with tik_instance.if_scope(i==1):
tik_instance.tik_continue()
tik_instance.data_move(data_C_ub[i*16], data_B_ub[i*16], 0, 1, 1, 0, 0)
tik_instance.data_move(data_C_gm, data_C_ub, 0, 1, 8, 0, 0)
tik_instance.BuildCCE(kernel_name, inputs = [data_B_gm], outputs = [data_C_gm])
Parent topic: Program Control