Skip to content

[CuTeDSL] Add dataclass example: passing pointers via frozen dataclass#3070

Open
fengxie wants to merge 2 commits intoNVIDIA:mainfrom
fengxie:add-dataclass-example
Open

[CuTeDSL] Add dataclass example: passing pointers via frozen dataclass#3070
fengxie wants to merge 2 commits intoNVIDIA:mainfrom
fengxie:add-dataclass-example

Conversation

@fengxie
Copy link
Collaborator

@fengxie fengxie commented Feb 25, 2026

Demonstrates passing pointers from tensor arguments in @cute.jit to @cute.kernel using @DataClass(frozen=True). Shows the pattern of extracting pointers with tensor.iterator, bundling into a dataclass, and reconstructing tensors in the kernel.

Uses fake tensors for compilation and TVM-FFI for runtime dispatch.

Demonstrates passing pointers from tensor arguments in @cute.jit to
@cute.kernel using @DataClass(frozen=True). Shows the pattern of
extracting pointers with tensor.iterator, bundling into a dataclass,
and reconstructing tensors in the kernel.

Uses fake tensors for compilation and TVM-FFI for runtime dispatch.

Co-authored-by: Cursor <cursoragent@cursor.com>
@fengxie fengxie changed the title Add dataclass example: passing pointers via frozen dataclass [CuTe DSL] Add dataclass example: passing pointers via frozen dataclass Feb 25, 2026
@fengxie fengxie changed the title [CuTe DSL] Add dataclass example: passing pointers via frozen dataclass [CuTeDSL] Add dataclass example: passing pointers via frozen dataclass Feb 25, 2026
@fengxie fengxie force-pushed the add-dataclass-example branch 2 times, most recently from 2469879 to 2e878e6 Compare February 25, 2026 16:44
Demonstrates passing tensors from @cute.jit to @cute.kernel using
@DataClass(frozen=True). Shows the pattern of bundling tensors into
a dataclass with static configuration.

Uses fake tensors for compilation and TVM-FFI for runtime dispatch.
Includes reference check against PyTorch implementation.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant