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 struct

Fill

struct Fill

Represents memory fill patterns for GPU memory operations.

This struct defines different fill patterns that can be used when allocating or initializing GPU memory. The patterns control how memory is initialized, which can be important for debugging and performance optimization.

Implemented traits​

AnyType, Copyable, Deinitable, EnumLike, Equatable, ImplicitlyCopyable, Movable, RegisterPassable, TrivialRegisterPassable, Writable

comptime members​

NAN​

comptime NAN = Fill(Int(2))

Fill memory with NaN values. Useful for debugging floating point computations.

NONE​

comptime NONE = Fill(Int(0))

No fill pattern - memory is left uninitialized.

ZERO​

comptime ZERO = Fill(Int(1))

Fill memory with zeros.

Methods​

__eq__​

def __eq__(self, other: Self) -> Bool

Tests if two Fill instances have the same fill pattern.

Args:

  • ​other (Self): The Fill instance to compare against.

Returns:

Bool: True if the fill patterns are equal, False otherwise.

write_to​

def write_to(self, mut writer: T)

Writes a string representation of the fill pattern.

Converts the fill pattern into a human-readable string for debugging and display purposes.

Args:

  • ​writer (T): The object to write to.

Was this page helpful?