IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo trait

CastAtom

Describes an instruction that converts elements from a source element type to a destination element type.

Implemented traits​

AnyType, Atom, Copyable, Deinitable, ImplicitlyCopyable, Movable, RegisterPassable, TrivialRegisterPassable

comptime members​

dst_dtype​

comptime dst_dtype

The element type the instruction writes.

dst_map​

comptime dst_map

Where each index writes the destination.

DstEngine​

comptime DstEngine

The engine of the storage the instruction writes.

src_dtype​

comptime src_dtype

The element type the instruction reads.

src_map​

comptime src_map

Where each index reads the source.

SrcEngine​

comptime SrcEngine

The engine of the storage the instruction reads.

Required methods​

__call__​

def __call__[TD: DType, LD: TensorLayout, ED: TensorEngine, TS: DType, LS: TensorLayout, ES: TensorEngine](self, dst: MutTileTensor[TD, LD, Engine=ED, address_space=dst.address_space, linear_idx_type=dst.linear_idx_type], src: ImmTileTensor[TS, LS, Engine=ES, address_space=src.address_space, linear_idx_type=src.linear_idx_type]) -> Self.Completion.Result

Issues the instruction once.

Parameters:

  • ​TD (DType): The destination's element type.
  • ​LD (TensorLayout): The destination view's layout.
  • ​ED (TensorEngine): The destination view's engine.
  • ​TS (DType): The source's element type.
  • ​LS (TensorLayout): The source view's layout.
  • ​ES (TensorEngine): The source view's engine.

Args:

Returns:

_Self.Completion.Result: The instruction's handle for a HandleCompletion, else nothing.

Was this page helpful?