reprospect.test.sass.instruction.atomic module

class reprospect.test.sass.instruction.atomic.AtomicMatcher(arch: NVIDIAArch, operation: str = 'ADD', scope: ThreadScope | str | None = None, consistency: str = 'STRONG', dtype: tuple[str | None, int] | 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 RED, these operations capture the return value.

The ATOM 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: tuple[str | None, int] | None = None, memory: MemorySpace | str = MemorySpace.GLOBAL, version: Version | None = None) NoneView on GitHub
Parameters:

dtype – For instance, (‘F’, 64) for a 64-bit floating-point or (S, 32) for a signed 32-bit integer.

consistency: Final[str]
dtype: Final[tuple[str | None, int] | None]
memory: Final[MemorySpace]
operation: Final[str]
scope: Final[str | None]
class reprospect.test.sass.instruction.atomic.ReductionMatcher(arch: NVIDIAArch, operation: str = 'ADD', scope: ThreadScope | str | None = None, consistency: str = 'STRONG', dtype: tuple[str, int] | None = None)View on GitHub

Bases: ArchitectureAwarePatternMatcher

Matcher for reduction operations on generic memory (RED).

RED instructions are typically used when the atomic operation return value is not used. Otherwise, it would typically map to ATOM.

The RED 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: tuple[str, int] | None = None) NoneView on GitHub
Parameters:

dtype – For instance, (‘F’, 64) for a 64-bit floating-point or (S, 32) for a signed 32-bit integer.

consistency: Final[str]
dtype: Final[tuple[str, int] | None]
operation: Final[str]
scope: Final[str | None]
class reprospect.test.sass.instruction.atomic.ThreadScope(*values)View on GitHub

Bases: StrEnum

References:

BLOCK = 'BLOCK'
DEVICE = 'DEVICE'
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.