tilelang.language.annotations ============================= .. py:module:: tilelang.language.annotations .. autoapi-nested-parse:: Annotation helpers exposed on the TileLang language surface. Functions --------- .. autoapisummary:: tilelang.language.annotations.use_swizzle tilelang.language.annotations.annotate_layout tilelang.language.annotations.annotate_safe_value tilelang.language.annotations.annotate_l2_hit_ratio tilelang.language.annotations.annotate_restrict_buffers Module Contents --------------- .. py:function:: use_swizzle(panel_size, order = 'row', enable = True) Annotate a kernel to use a specific threadblock swizzle pattern. .. py:function:: annotate_layout(layout_map) Annotate the layout of the buffer. .. py:function:: annotate_safe_value(safe_value_map) Annotate the safe value of the buffer. .. py:function:: annotate_l2_hit_ratio(l2_hit_ratio_map) Annotate the L2 hit ratio of the buffer. .. py:function:: annotate_restrict_buffers(*buffers) Mark the given buffer parameters as non-restrict. This annotation tells codegen to omit the `__restrict__` qualifier for the specified kernel buffer parameters. Use this when two (or more) buffers may alias, for example overlapping slices from the same base tensor. .. rubric:: 示例 >>> @T.prim_func ... def buggy_kernel(x: T.Tensor((N,), T.float32), ... y: T.Tensor((N,), T.float32)): ... T.annotate_restrict_buffers(x, y) ... with T.Kernel(N, threads=32) as pid: ... y[pid] = x[pid] + 1