Skip to main content
Log in

Mojo struct

AccessProperty

@register_passable(trivial) struct AccessProperty

Specifies performance hint with AccessPolicyWindow for hit_prop and miss_prop fields.

This struct defines cache persistence properties that can be used with AccessPolicyWindow to control how data is cached during GPU memory accesses. It provides hints to the memory subsystem about the expected access patterns, which can improve performance for specific workloads.

Aliases

  • NORMAL = AccessProperty(__init__[__mlir_type.!pop.int_literal](0)): Normal cache persistence with default caching behavior.
  • STREAMING = AccessProperty(__init__[__mlir_type.!pop.int_literal](1)): Streaming access is less likely to persist in cache, optimized for single-use data.
  • PERSISTING = AccessProperty(__init__[__mlir_type.!pop.int_literal](2)): Persisting access is more likely to persist in cache, optimized for reused data.

Implemented traits

AnyType, Copyable, ExplicitlyCopyable, Movable, UnknownDestructibility, Writable

Methods

__init__

__init__(*, other: Self) -> Self

Explicitly construct a deep copy of the provided value.

Args:

  • other (Self): The value to copy.

__eq__

__eq__(self, other: Self) -> Bool

Compares two AccessProperty instances for equality.

Args:

  • other (Self): The AccessProperty to compare with.

Returns:

True if the instances have the same value, False otherwise.

__ne__

__ne__(self, other: Self) -> Bool

Compares two AccessProperty instances for inequality.

Args:

  • other (Self): The AccessProperty to compare with.

Returns:

True if the instances have different values, False otherwise.

__is__

__is__(self, other: Self) -> Bool

Checks if two AccessProperty instances have the same value.

Args:

  • other (Self): The AccessProperty to compare with.

Returns:

True if the instances have the same value, False otherwise.

__isnot__

__isnot__(self, other: Self) -> Bool

Checks if two AccessProperty instances have different values.

Args:

  • other (Self): The AccessProperty to compare with.

Returns:

True if the instances have different values, False otherwise.

__str__

__str__(self) -> String

Returns a string representation of the AccessProperty.

Returns:

A string representation of the AccessProperty.

write_to

write_to[W: Writer](self, mut writer: W)

Writes a string representation of the AccessProperty to a writer.

Parameters:

  • W (Writer): The type of writer to use for output. Must implement the Writer trait.

Args:

  • writer (W): The writer instance to write the formatted string to.