Mojo struct
KernelConfig
struct KernelConfig
Block/warp/MMA shape configuration for 4-wave-simple kernels.
Fieldsβ
- βblock_shape (
IndexList[3]): Workgroup tile shape(BM, BN, BK). - βwarp_shape (
IndexList[3]): Per-warp tile shape(WM, WN, WK). - βmma_shape (
IndexList[3]): Single-MMA instruction shape(MMA_M, MMA_N, MMA_K).
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDestructible,
Movable,
Writable
Methodsβ
__init__β
__init__(out self, *, block_shape: IndexList[3], warp_shape: IndexList[3], mma_shape: IndexList[3])
Constructs a KernelConfig from the three tile shapes.
Args:
- βblock_shape (
IndexList[3]): Workgroup tile shape(BM, BN, BK). - βwarp_shape (
IndexList[3]): Per-warp tile shape(WM, WN, WK). - βmma_shape (
IndexList[3]): Single-MMA instruction shape(MMA_M, MMA_N, MMA_K).
num_threadsβ
num_threads(self) -> Int
Returns the total threads per workgroup (warps x WARP_SIZE).
Returns:
Int: The number of threads in one workgroup.
write_toβ
write_to(self, mut writer: T)
Writes a human-readable shape tag to writer.
Args:
- βwriter (
T): Sink for the rendered config tag.
write_repr_toβ
write_repr_to(self, mut writer: T)
Writes a debug representation of this config to writer.
Args:
- βwriter (
T): Sink for the rendered config tag.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!