reprospect.testing.binaries.sass.instruction.atomic module

class reprospect.testing.binaries.sass.instruction.atomic.AtomicMatcher(arch: NVIDIAArch, operation: str = 'ADD', scope: ThreadScope | str | None = None, consistency: str = 'STRONG', dtype: TypeInfo | int | DTypeLike | None = None, memory: MemorySpace | str = MemorySpace.GLOBAL, version: Version | None = None)View on GitHub

Bases: ArchitectureAndVersionAwarePatternMatcher

Matcher for atomic operations on:

  • generic memory (ATOM)

  • shared memory (ATOMS)

  • global memory (ATOMG)

Unlike reduction operations on generic memory, these atomic operations use the return value.

The SASS opcode may take several modifiers:

References:

TEMPLATE: Final[str] = '{opcode} (?P<operands>P(?:T|\\d+)), (?P<operands>R(?:Z|\\d+)), {address}, (?P<operands>R(?:Z|\\d+))'
TEMPLATE_CAS: Final[str] = '{opcode} (?P<operands>P(?:T|\\d+)), (?P<operands>R(?:Z|\\d+)), {address}, (?P<operands>R[0-9]+), (?P<operands>R[0-9]+)'
__init__(arch: NVIDIAArch, operation: str = 'ADD', scope: ThreadScope | str | None = None, consistency: str = 'STRONG', dtype: TypeInfo | int | DTypeLike | None = None, memory: MemorySpace | str = MemorySpace.GLOBAL, version: Version | None = None) NoneView on GitHub
consistency: Final[str]
dtype: Final[TypeInfo | None]
memory: Final[MemorySpace]
operation: Final[str]
scope: Final[ThreadScope | None]
class reprospect.testing.binaries.sass.instruction.atomic.ReductionMatcher(arch: NVIDIAArch, operation: str = 'ADD', scope: ThreadScope | str | None = None, consistency: str = 'STRONG', dtype: TypeInfo | int | DTypeLike | None = None)View on GitHub

Bases: ArchitectureAwarePatternMatcher

Matcher for reduction operations on generic memory.

The corresponding SASS opcode is RED on pre-Hopper architectures and REDG on Hopper and later architectures.

These reduction operation instructions are typically emitted when the return value of an atomic operation is unused. When the return value is used, the compiler typically emits an atomic instruction instead.

The SASS opcode may take several modifiers:

References:

TEMPLATE: Final[str] = '{opcode} {address}, (?P<operands>R[0-9]+)'
__init__(arch: NVIDIAArch, operation: str = 'ADD', scope: ThreadScope | str | None = None, consistency: str = 'STRONG', dtype: TypeInfo | int | DTypeLike | None = None) NoneView on GitHub
consistency: Final[str]
dtype: Final[TypeInfo | None]
operation: Final[str]
scope: Final[ThreadScope | None]
class reprospect.testing.binaries.sass.instruction.atomic.ThreadScope(*values)View on GitHub

Bases: StrEnum

References:

BLOCK = 'BLOCK'
DEVICE = 'DEVICE'
SYSTEM = 'SYSTEM'
THREADS = 'THREADS'
__str__()

Return str(self).

convert(*, arch: NVIDIAArch) strView on GitHub

Convert to SASS modifier.

For instance, __NV_THREAD_SCOPE_DEVICE maps to GPU.

References:

Warning

__NV_THREAD_SCOPE_THREAD thread scope is currently implemented using wider __NV_THREAD_SCOPE_BLOCK thread scope.