MCPcopy
hub / github.com/tinygrad/tinygrad / launch_dims

Method launch_dims

tinygrad/uop/ops.py:1066–1069  ·  view source on GitHub ↗
(self, var_vals:dict[str, int])

Source from the content-addressed store, hash-verified

1064 def runtimevars(self) -> dict[str, int]: return {v.expr: i for i, v in enumerate(self.vars) if v.expr == 'core_id'}
1065
1066 def launch_dims(self, var_vals:dict[str, int]) -> tuple[tuple[int, ...], tuple[int, ...]|None]:
1067 global_size = tuple([sym_infer(sz, var_vals) for sz in self.global_size]) # type: ignore[arg-type]
1068 local_size = tuple([sym_infer(sz, var_vals) for sz in self.local_size]) if self.local_size is not None else None
1069 return global_size, local_size
1070
1071 def vals(self, var_vals:dict[str, int]): return tuple(var_vals[k.expr] if k.expr not in self.runtimevars else None for k in self.vars)
1072

Callers 8

exec_kernelFunction · 0.80
exec_validateFunction · 0.80
__init__Method · 0.80
__init__Method · 0.80
test_profile_multiopsMethod · 0.80

Calls 1

sym_inferFunction · 0.85

Tested by 2

test_profile_multiopsMethod · 0.64