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
PlatformPredicate
struct PlatformPredicate[expr: PlatformExpr]
A set of devices that a kernel registration applies to.
The type holds the expression of the predicate, so predicates with the same meaning have the same type.
Parameters
- expr (
PlatformExpr): The expression of the platform predicate.
Implemented traits
AnyType,
Copyable,
Deinitable,
ImplicitlyCopyable,
Movable,
RegisterPassable,
TrivialRegisterPassable
Methods
__and__
def __and__(self, other: PlatformPredicate) -> PlatformPredicate[comptime[label: KGENString, api: KGENString, arch: KGENString, model: KGENString] expr[label, api, arch, model] and expr[label, api, arch, model]]
Returns a platform predicate that holds when both predicates hold.
Args:
- other (
PlatformPredicate): The other platform predicate.
Returns:
PlatformPredicate[comptime[label: KGENString, api: KGENString, arch: KGENString, model: KGENString] expr[label, api, arch, model] and expr[label, api, arch, model]]: The conjunction of the two platform predicates.
__or__
def __or__(self, other: PlatformPredicate) -> PlatformPredicate[comptime[label: KGENString, api: KGENString, arch: KGENString, model: KGENString] expr[label, api, arch, model] or expr[label, api, arch, model]]
Returns a platform predicate that holds when either predicate holds.
Args:
- other (
PlatformPredicate): The other platform predicate.
Returns:
PlatformPredicate[comptime[label: KGENString, api: KGENString, arch: KGENString, model: KGENString] expr[label, api, arch, model] or expr[label, api, arch, model]]: The disjunction of the two platform predicates.