MCPcopy Create free account
hub / github.com/apache/tvm / ldmatrix_impl

Function ldmatrix_impl

python/tvm/s_tir/tensor_intrin/cuda.py:184–220  ·  view source on GitHub ↗
(warp_handle: T.handle, shared_handle: T.handle)

Source from the content-addressed store, hash-verified

182
183 @T.prim_func(s_tir=True)
184 def ldmatrix_impl(warp_handle: T.handle, shared_handle: T.handle) -> None:
185 s0 = T.int32()
186 s1 = T.int32()
187 shared = T.match_buffer(
188 shared_handle,
189 (smem_tile_row, smem_tile_col),
190 dtype,
191 align=64,
192 offset_factor=offset_factor,
193 scope=shared_scope,
194 strides=[s0, s1],
195 )
196 warp = T.match_buffer(
197 warp_handle,
198 (WARP_SIZE, local_size),
199 dtype,
200 align=64,
201 offset_factor=offset_factor,
202 scope="warp",
203 )
204
205 with T.sblock("root"):
206 T.reads(shared[0:smem_tile_row, 0:smem_tile_col])
207 T.writes(warp[0:WARP_SIZE, 0:local_size])
208 for tx in T.thread_binding(0, WARP_SIZE, "threadIdx.x"):
209 T.evaluate(
210 T.ptx.ldmatrix_legacy(
211 transpose_in_ldmatrix,
212 4, # Always load 4 matrices
213 ".b16",
214 warp.data,
215 warp.elem_offset + lift(local_size) * tx,
216 shared.access_ptr("r"),
217 smem_offset(tx, s0),
218 dtype=dtype,
219 )
220 )
221
222 return ldmatrix_desc, ldmatrix_impl
223

Callers

nothing calls this directly

Calls 2

access_ptrMethod · 0.80
evaluateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…