MCPcopy Create free account
hub / github.com/ByteDance-Seed/Triton-distributed / Var

Class Var

python/little_kernel/core/expr.py:246–261  ·  view source on GitHub ↗

Variable expression (access to local/global variables or parameters)

Source from the content-addressed store, hash-verified

244
245
246class Var(Expr):
247 """Variable expression (access to local/global variables or parameters)"""
248
249 def __init__(self, name: str, expr_type: LLType, defining_stmt=None, is_shared: bool = False,
250 is_global: bool = False):
251 super().__init__(expr_type)
252 self.name = name # Variable name
253 self.defining_stmt = defining_stmt
254 self.is_shared = is_shared # Whether it's a __shared__ variable
255 self.is_global = is_global # Whether it's a __device__ global variable
256
257 def __repr__(self) -> str:
258 return f"Var(name={self.name}, type={self.type}, shared={self.is_shared}, global={self.is_global})"
259
260 def __str__(self) -> str:
261 return f"Var(name={self.name}, type={self.type}, shared={self.is_shared}, global={self.is_global})"
262
263
264# Unary

Callers 13

setUpMethod · 0.90
setUpMethod · 0.90
test_invalid_var_typeMethod · 0.90
setUpMethod · 0.90
test_type_mismatchMethod · 0.90
setUpMethod · 0.90
setUpMethod · 0.90
test_invalid_indexingMethod · 0.90
setUpMethod · 0.90

Calls

no outgoing calls

Tested by 13

setUpMethod · 0.72
setUpMethod · 0.72
test_invalid_var_typeMethod · 0.72
setUpMethod · 0.72
test_type_mismatchMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.72
test_invalid_indexingMethod · 0.72
setUpMethod · 0.72