
    )`i                     ~    d Z ddlZddlmZ ej        d             Zej        d             Zej        d             ZdS )a3  
Copyright (c) 2024 by FlashInfer team.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
    Nc                 j   t          j        d          }t          j        |
|z   dz             t          j        |
|z             z
  }||}}t          j        | |dz  z   |           t          j        | |dz  z   dz   |           t          j        | |dz  z   dz   |           |rt          j        ||z             nt          j        |t           j                  }|||z  |z  z   }t          j        ||z   |           |t          j        |
|z             |z  z   }t          j        ||z   |           |	t          j        |
|z             |z  z   }t          j        ||z   |           t          j        ||z   |           t          j        ||z   |r|n|           t          j        ||z   |           d S Nr            tl
program_idloadstorecastint64)all_problems_ptrx_ptrw_ptry_ptrx_ld_ptrw_ld_ptry_ld_ptrxwy	xy_indptr	w_indicesd_ind_outw_column_majorpidmknw_i
w_curr_ptr
x_curr_ptr
y_curr_ptrs                          j/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/flashinfer/triton/gemm.pycompute_sm80_group_gemm_argsr'      s   $ -

C
	C!#$$rwy3'?'??AqAHa'+++Ha'!+Q///Ha'!+Q///&/
K"')c/
"
"
"RWS"(5K5KCS1Wq[JHUS[*%%%RWY_--11JHUS[*%%%RWY_--11JHUS[*%%%HX^QHX^.7QQa888HX^Q    c                 j   t          j        d          }t          j        |
|z   dz             t          j        |
|z             z
  }||}}t          j        | |dz  z   |           t          j        | |dz  z   dz   |           t          j        | |dz  z   dz   |           |rt          j        ||z             nt          j        |t           j                  }|||z  |z  z   }t          j        ||z   |           |t          j        |
|z             |z  z   }t          j        ||z   |           |	t          j        |
|z             |z  z   }t          j        ||z   |           t          j        ||z   |           t          j        ||z   |r|n|           t          j        ||z   |           d S r   r   )r   r   r   r   x_stride_ptrw_stride_ptry_stride_ptrr   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   s                          r&   compute_sm90_group_gemm_argsr-   ?   s   $ -

C
	C!#$$rwy3'?'??AqAHa'+++Ha'!+Q///Ha'!+Q///&/
K"')c/
"
"
"RWS"(5K5KCS1Wq[JHUS[*%%%RWY_--11JHUS[*%%%RWY_--11JHUS[*%%%H\C###H\Cn!;!<<<H\C#####r(   c                 `   t          j        d          }t          j        | |z             }t          j        | |z   dz             }t          j        ||z             }t          ||z
            D ]>}t          j        ||z   |z   ||z              t          j        ||z   |z   ||z              ?d S )Nr   r   )r	   r
   r   ranger   )	m_indptrpadded_m_indptrm_rankpadded_m_rankr   m_startm_endpadded_m_startis	            r&   compute_padding_mappingr8   i   s     -

Cghn%%GGHsNQ&''EW_s233N57?## B B
'!A%w{333
(1,nq.@AAAAB Br(   )	__doc__tritontriton.languagelanguager	   jitr'   r-   r8    r(   r&   <module>r?      s             &  &  & R &$ &$ &$R B B B B Br(   