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

Function _factor_warpid

python/tvm/tirx/exec_context.py:295–310  ·  view source on GitHub ↗
(warp: AxisRange)

Source from the content-addressed store, hash-verified

293
294
295def _factor_warpid(warp: AxisRange) -> tuple[AxisRange, AxisRange] | None:
296 if warp.stride != 1:
297 return None
298 off = warp.offset
299 ext = warp.extent
300 wid_off = off % WG_SIZE
301 wgid_off = off // WG_SIZE
302
303 if wid_off == 0 and ext % WG_SIZE == 0:
304 return (
305 AxisRange(extent=WG_SIZE, offset=0),
306 AxisRange(extent=ext // WG_SIZE, offset=wgid_off),
307 )
308 if ext <= WG_SIZE - wid_off:
309 return (AxisRange(extent=ext, offset=wid_off), AxisRange(extent=1, offset=wgid_off))
310 return None
311
312
313def _flat_product_range(

Callers 2

filter_narrowFunction · 0.85
scope_switchFunction · 0.85

Calls 1

AxisRangeClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…