File tree Expand file tree Collapse file tree 2 files changed +19
-19
lines changed Expand file tree Collapse file tree 2 files changed +19
-19
lines changed Original file line number Diff line number Diff line change 1
- from typing import Any , TypeVar
2
- import luisa_lang
3
- from luisa_lang import Buffer , dispatch_id , static_assert
1
+ # from typing import Any, TypeVar
2
+ # import luisa_lang
3
+ # from luisa_lang import Buffer, dispatch_id, static_assert
4
4
5
- T = TypeVar ("T" , bound = Any )
5
+ # T = TypeVar("T", bound=Any)
6
6
7
- @luisa_lang .kernel
8
- def vecadd (a : Buffer [T ], b : Buffer [T ], c : Buffer [T ]):
9
- static_assert (
10
- type (a [0 ] + b [0 ]) == type (c [0 ]),
11
- f"Type { type (a )} does not support addition." ,
12
- )
13
- tid = dispatch_id ().x
14
- c [tid ] = a [tid ] + b [tid ]
7
+ # @luisa_lang.kernel
8
+ # def vecadd(a: Buffer[T], b: Buffer[T], c: Buffer[T]):
9
+ # static_assert(
10
+ # type(a[0] + b[0]) == type(c[0]),
11
+ # f"Type {type(a)} does not support addition.",
12
+ # )
13
+ # tid = dispatch_id().x
14
+ # c[tid] = a[tid] + b[tid]
Original file line number Diff line number Diff line change 1
- import luisa_lang
2
- from luisa_lang import Buffer , dispatch_id
3
- from dataclasses import dataclass
1
+ # import luisa_lang
2
+ # from luisa_lang import Buffer, dispatch_id
3
+ # from dataclasses import dataclass
4
4
5
5
6
- @luisa_lang .kernel
7
- def vecadd (a : Buffer [float ], b : Buffer [float ], c : Buffer [float ]):
8
- tid = dispatch_id ().x
9
- c [tid ] = a [tid ] + b [tid ]
6
+ # @luisa_lang.kernel
7
+ # def vecadd(a: Buffer[float], b: Buffer[float], c: Buffer[float]):
8
+ # tid = dispatch_id().x
9
+ # c[tid] = a[tid] + b[tid]
You can’t perform that action at this time.
0 commit comments