Files
sglang/python/sglang/jit_kernel/tests/test_add_constant.py
2025-12-25 16:24:37 +08:00

15 lines
267 B
Python

import torch
from sglang.jit_kernel.add_constant import add_constant
def main():
c = 1024
src = torch.arange(0, 1024 + 1, dtype=torch.int32).cuda()
dst = add_constant(src, c)
assert torch.all(dst == src + c)
if __name__ == "__main__":
main()