From 7d5ea415f0107e7d7bb78d44db8e4474978ebbfa Mon Sep 17 00:00:00 2001 From: Zhao Liang Date: Tue, 27 Sep 2022 23:40:46 +0800 Subject: [PATCH] Update docs/lang/articles/kernels/syntax.md Co-authored-by: Vissidarte-Herman <93570324+Vissidarte-Herman@users.noreply.github.com> --- docs/lang/articles/kernels/syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/lang/articles/kernels/syntax.md b/docs/lang/articles/kernels/syntax.md index 785ee20c2623b..4910b050d0a85 100644 --- a/docs/lang/articles/kernels/syntax.md +++ b/docs/lang/articles/kernels/syntax.md @@ -7,7 +7,7 @@ sidebar_position: 1 Embedded in Python, Taichi resembles Python in language syntax. To differentiate Taichi code from native Python code, we use the two decorators `@ti.kernel` and `@ti.func`: + Functions decorated with `@ti.kernel` are called Taichi kernels (or kernels for short). They serve as the entry points where Taichi begins to take over the tasks, and they *must* be called directly by Python code. Usually the users prepare their work in native Python (for example, read data from the disk and preprocess them) and then call kernels to invoke Taichi to take over the actual computation-intensive job. -+ Functions decorated with `@ti.func` are called Taichi functions. They serve as the building blocks of kernels and can *only* be called by kernels or other Taichi functions. Like ordinary Python functions, you can factor your task into several Taichi functions to make your code more readable and reuse them in different kernels. ++ Functions decorated with `@ti.func` are called Taichi functions. They are the building blocks of kernels and can *only* be called by a kernels or another Taichi function. Just as you do with normal Python functions, you can split your tasks into multiple Taichi functions to make your code more readable and reuse them in different kernels. Let's see an example: