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

NoScoreHook

struct NoScoreHook

Leaves the scores alone.

Implemented traits​

AnyType, Copyable, Deinitable, DevicePassable, ImplicitlyCopyable, IndexerScoreHook, Movable, RegisterPassable, TrivialRegisterPassable

comptime members​

device_type​

comptime device_type = NoScoreHook

Device-side type; the struct is trivially device-passable.

enabled​

comptime enabled = False

Never runs.

Methods​

__init__​

def __init__() -> Self

Creates the hook.

window​

def window(self, ctx: DeviceContext, first_row: Int, rows: Int) -> Self

Returns the hook unchanged.

Args:

  • ​ctx (DeviceContext): Device context.
  • ​first_row (Int): Query token of the window's row 0.
  • ​rows (Int): Rows in the window.

Returns:

Self: This hook.

window_rows​

def window_rows(self) -> Int

Returns an unbounded row cap, as the hook keeps no scratch.

Returns:

Int: Int.MAX.

after_window​

def after_window(self, ctx: DeviceContext, first_row: Int, rows: Int)

Does nothing.

Args:

  • ​ctx (DeviceContext): Device context.
  • ​first_row (Int): Query token of the window's row 0.
  • ​rows (Int): Rows in the window.

score​

def score[dtype: DType, lane_keys: Int](self, value: Scalar[dtype], row: Int32, key: Int32, key_live: Bool, row_live: Bool) -> Scalar[dtype]

Returns value.

Parameters:

  • ​dtype (DType): Score element type.
  • ​lane_keys (Int): Consecutive keys a warp holds.

Args:

  • ​value (Scalar[dtype]): The score.
  • ​row (Int32): Window row of the query token.
  • ​key (Int32): Key column.
  • ​key_live (Bool): Whether the key is below the row's bound.
  • ​row_live (Bool): Whether the row is in the window.

Returns:

Scalar[dtype]: value.

get_type_name​

static def get_type_name() -> String

Returns the type name for runtime diagnostics.

Returns:

String: Always "NoScoreHook".

Was this page helpful?