MCPcopy Index your code
hub / github.com/apache/tvm / commit

Method commit

python/tvm/backend/cuda/lang/alloc_pool.py:504–529  ·  view source on GitHub ↗

Emit pool size annotation into the IR. Must be called after all ``alloc()`` / ``move_base_to()`` calls. Parameters ---------- size : int, optional Explicit shared memory size in bytes. When *None* (the default), the high-water mark ``max_off

(self, size=None)

Source from the content-addressed store, hash-verified

502 self.max_offset = max(self.max_offset, self.offset)
503
504 def commit(self, size=None):
505 """Emit pool size annotation into the IR.
506
507 Must be called after all ``alloc()`` / ``move_base_to()`` calls.
508
509 Parameters
510 ----------
511 size : int, optional
512 Explicit shared memory size in bytes. When *None* (the default),
513 the high-water mark ``max_offset`` tracked by the allocator is used.
514 """
515 if not self._owns_buffer:
516 return
517 ir = _get_ir()
518 frame_mod = _get_frame()
519 resolved = size if size is not None else self.max_offset
520 assert resolved >= self.max_offset, (
521 f"Specified smem size ({resolved}) is smaller than "
522 f"the pool high-water mark ({self.max_offset})"
523 )
524 attr_frame = ir.attr(self.ptr, "tirx.pool_max_bytes", resolved)
525 if isinstance(attr_frame, frame_mod.AttrFrame):
526 from functools import partial
527
528 attr_frame.add_callback(partial(attr_frame.__exit__, None, None, None))
529 attr_frame.__enter__()

Callers 2

dsmem_copyFunction · 0.95
test_funcFunction · 0.95

Calls 5

_get_irFunction · 0.85
_get_frameFunction · 0.85
attrMethod · 0.80
add_callbackMethod · 0.80
__enter__Method · 0.45

Tested by 2

dsmem_copyFunction · 0.76
test_funcFunction · 0.76