Mojo struct
LayoutTensorBuild
@register_passable(trivial)
struct LayoutTensorBuild[dtype: DType, *, __layout: Layout = __init__[::Origin[{False}]](IntTuple(1)), __layout_init: Bool = False, __address_space: AddressSpace = 0, __layout_bitwidth: Int = Int(bitwidthof[::DType,__mlir_type.!kgen.target]()), __circular: Bool = False]
Fields
- runtime_layout (
RuntimeLayout[__layout, bitwidth=__layout_bitwidth]
):
Implemented traits
AnyType
,
Copyable
,
ExplicitlyCopyable
,
Movable
,
UnknownDestructibility
Methods
__init__
__init__() -> Self
row_major
row_major[*shapes: Int](self) -> LayoutTensorBuild[dtype, __layout=row_major[::Origin[{False}]](_to_int_tuple[::VariadicList[::Int]]()), __layout_init=True]
row_major(self, shape0: ValueOrUnknown[dim], shape1: ValueOrUnknown[dim]) -> LayoutTensorBuild[dtype, __layout=row_major(dim, dim), __layout_init=True]
row_major(self, shape0: ValueOrUnknown[dim], shape1: ValueOrUnknown[dim], shape2: ValueOrUnknown[dim]) -> LayoutTensorBuild[dtype, __layout=row_major(dim, dim, dim), __layout_init=True]
row_major(self, shape0: ValueOrUnknown[dim], shape1: ValueOrUnknown[dim], shape2: ValueOrUnknown[dim], shape3: ValueOrUnknown[dim]) -> LayoutTensorBuild[dtype, __layout=row_major(dim, dim, dim, dim), __layout_init=True]
row_major(self, shape0: ValueOrUnknown[dim], shape1: ValueOrUnknown[dim], shape2: ValueOrUnknown[dim], shape3: ValueOrUnknown[dim], shape4: ValueOrUnknown[dim]) -> LayoutTensorBuild[dtype, __layout=row_major(dim, dim, dim, dim, dim), __layout_init=True]
col_major
col_major[*shapes: Int](self) -> LayoutTensorBuild[dtype, __layout=col_major[::Origin[{False}]](_to_int_tuple[::VariadicList[::Int]]()), __layout_init=True]
col_major(self, shape0: ValueOrUnknown[dim], shape1: ValueOrUnknown[dim]) -> LayoutTensorBuild[dtype, __layout=col_major(dim, dim), __layout_init=True]
col_major(self, shape0: ValueOrUnknown[dim], shape1: ValueOrUnknown[dim], shape2: ValueOrUnknown[dim]) -> LayoutTensorBuild[dtype, __layout=col_major(dim, dim, dim), __layout_init=True]
col_major(self, shape0: ValueOrUnknown[dim], shape1: ValueOrUnknown[dim], shape2: ValueOrUnknown[dim], shape3: ValueOrUnknown[dim]) -> LayoutTensorBuild[dtype, __layout=col_major(dim, dim, dim, dim), __layout_init=True]
col_major(self, shape0: ValueOrUnknown[dim], shape1: ValueOrUnknown[dim], shape2: ValueOrUnknown[dim], shape3: ValueOrUnknown[dim], shape4: ValueOrUnknown[dim]) -> LayoutTensorBuild[dtype, __layout=col_major(dim, dim, dim, dim, dim), __layout_init=True]
layout
layout[shape0: Int](self) -> LayoutTensorBuild[dtype, __layout=__init__[::Origin[{False}]](IntTuple(shape0)), __layout_init=True]
layout[rank: Int, shape: IndexList[$0], stride: IndexList[$0]](self) -> LayoutTensorBuild[dtype, __layout=__init__[::Origin[{False}],::Origin[{False}]](_to_int_tuple[::Int](shape), _to_int_tuple[::Int](stride)), __layout_init=True]
layout[rank: Int](self, shape: IndexList[rank], stride: IndexList[rank]) -> LayoutTensorBuild[dtype, __layout=__init__[::Origin[{False}],::Origin[{False}]](_to_int_tuple[::Int](-1), _to_int_tuple[::Int](-1)), __layout_init=True]
layout(self, shape0: ValueOrUnknown[dim]) -> LayoutTensorBuild[dtype, __layout=__init__[::Origin[{False}]](IntTuple(dim)), __layout_init=True]
shared
shared(self) -> LayoutTensorBuild[dtype, __layout=__layout, __layout_init=__layout_init, __address_space=3]
local
local(self) -> LayoutTensorBuild[dtype, __layout=__layout, __layout_init=__layout_init, __address_space=5]
alloc
alloc(self) -> LayoutTensor[dtype, __layout, __layout.rank(), address_space=__address_space]
view
view[address_space: AddressSpace](self, ptr: UnsafePointer[SIMD[dtype, 1], address_space=address_space]) -> LayoutTensor[dtype, __layout, __layout.rank(), address_space=address_space]
circular
circular(self) -> LayoutTensorBuild[dtype, __layout=__layout, __layout_init=__layout_init, __address_space=__address_space, __circular=True]
iter
iter(self, ptr: UnsafePointer[SIMD[dtype, 1], address_space=__address_space], bound: Int) -> LayoutTensorIter[dtype, __layout, address_space=__address_space, circular=__circular]
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!