tilelang.utils.language ======================= .. py:module:: tilelang.utils.language Functions --------- .. autoapisummary:: tilelang.utils.language.is_global tilelang.utils.language.is_shared tilelang.utils.language.is_shared_dynamic tilelang.utils.language.is_local tilelang.utils.language.is_fragment tilelang.utils.language.get_buffer_elems tilelang.utils.language.array_reduce tilelang.utils.language.retrieve_func_from_module tilelang.utils.language.get_buffer_region_from_load Module Contents --------------- .. py:function:: is_global(buffer) Check if the buffer is in the global memory scope. :param buffer: The TVM buffer to check. :type buffer: Buffer :returns: True if the buffer is in global memory, False otherwise. :rtype: bool .. py:function:: is_shared(buffer, allow_dynamic = True) Check if the buffer is in the shared memory scope. :param buffer: The TVM buffer to check. :type buffer: Buffer :returns: True if the buffer is in shared memory, False otherwise. :rtype: bool .. py:function:: is_shared_dynamic(buffer) Check if the buffer is in the dynamic shared memory scope. :param buffer: The TVM buffer to check. :type buffer: Buffer :returns: True if the buffer is in dynamic shared memory, False otherwise. :rtype: bool .. py:function:: is_local(buffer) Check if the buffer is in the local memory scope. :param buffer: The TVM buffer to check. :type buffer: Buffer :returns: True if the buffer is in local memory, False otherwise. :rtype: bool .. py:function:: is_fragment(buffer) Check if the buffer is a fragment (e.g., for matrix multiplication operations). :param buffer: The TVM buffer to check. :type buffer: Buffer :returns: True if the buffer is a fragment, False otherwise. :rtype: bool .. py:function:: get_buffer_elems(buffer) Get the number of elements in the buffer. .. py:function:: array_reduce(array) Reduce an array of integers to a single integer. :param array: The array of integers to reduce. :type array: List[int] :returns: The reduced integer. :rtype: int .. py:function:: retrieve_func_from_module(ir_module) Retrieve the single PrimFunc from an IRModule. :param ir_module: The TVM IRModule to extract the function from. The module should contain exactly one global function. :type ir_module: IRModule :returns: The single function contained in the module. :rtype: PrimFunc :raises ValueError: If ir_module is not an IRModule. :raises AssertionError: If the module contains more than one global function. .. py:function:: get_buffer_region_from_load(buffer_load) Get the buffer region from a buffer load. May encounter buffer load like C[0:128, 0:32], ref to pull request for buffer wise op: https://github.com/apache/tvm/pull/14693 convert load to region