Skip to main content

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, Equatable, ImplicitlyCopyable, ImplicitlyDestructible, Movable, RegisterPassable, TrivialRegisterPassable, Writable

comptime members

NAN

comptime NAN = Fill(2)

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

NONE

comptime NONE = Fill(0)

No fill pattern - memory is left uninitialized.

ZERO

comptime ZERO = Fill(1)

Fill memory with zeros.

Methods

__eq__

__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

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?