tilelang.layout.fragment ======================== .. py:module:: tilelang.layout.fragment .. autoapi-nested-parse:: Wrapping Layouts. Classes ------- .. autoapisummary:: tilelang.layout.fragment.Fragment Functions --------- .. autoapisummary:: tilelang.layout.fragment.make_swizzled_layout Module Contents --------------- .. py:class:: Fragment(shape, forward_fn=None, forward_thread_fn=None, replicate=1, forward_index_fn=None) Bases: :py:obj:`tilelang.layout.Layout` A Fragment layout object that encapsulates iteration variables (forward_vars), thread iteration variables (forward_thread), and index transformations (forward_index). This class supports replication (thread_replicate) and index mapping for fine-grained control over multi-dimensional data layouts. .. py:property:: thread Returns the forward_thread (IterVar) of the Fragment, representing the thread dimension or mapping. .. py:method:: get_thread_size() Returns the extent (range size) of the thread dimension. If the Fragment was replicated over threads, this will reflect the number of threads. .. py:method:: repeat(repeats, repeat_on_thread = False, lower_dim_first = True) Returns a new Fragment that repeats the iteration space a given number of times. :param repeats: Number of times to repeat. :type repeats: int :param repeat_on_thread: If set, the repeat will happen on the thread dimension. :type repeat_on_thread: bool, optional :param lower_dim_first: If set to True, repeat on lower dimensions first. :type lower_dim_first: bool, optional :returns: A new Fragment with the repeated iteration space. :rtype: Fragment .. py:method:: replicate(replicate) Replicate the Fragment across a new thread dimension. :param replicate: The replication factor or number of threads. :type replicate: int :returns: A new Fragment with an additional replicate dimension. :rtype: Fragment .. py:method:: condense_rep_var() Condense or fold the replicate variable into the existing iteration space. This operation may be used to reduce dimensionality if the replicate variable is no longer needed as a separate dimension. :returns: A new Fragment where the replicate variable is condensed. :rtype: Fragment .. py:method:: map_forward_thread(indices) Get the thread mapping expression for a given set of argument indices. :param indices: Indices for which to compute the thread mapping. :type indices: list of PrimExpr :returns: The computed thread expression for the provided indices. :rtype: PrimExpr .. py:method:: __repr__() String representation of the Fragment for debugging and logging. :returns: A string showing the thread dimension and the index dimension. :rtype: str .. py:function:: make_swizzled_layout(buffer)