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 function

lop

def lop[lut: Int32](a: Int32, b: Int32, c: Int32) -> Int32

Performs an arbitrary logical operation on 3 inputs using a lookup table.

Implements a 3-input lookup table (LUT) operation. The result is determined by bits in the lookup table value for each input combination.

Note:

  • Only supported on NVIDIA GPUs.
  • Maps to the LOP3.B32 PTX instruction.
  • Lookup table value determines output for each possible input combo.

Parameters:

  • ​lut (Int32): 32-bit lookup table value that defines the logical operation.

Args:

  • ​a (Int32): First input value.
  • ​b (Int32): Second input value.
  • ​c (Int32): Third input value.

Returns:

Int32: Result of applying the lookup table operation to the inputs.

Was this page helpful?