mlir.dialects._spirv_ops_gen

Attributes

Classes

_Dialect

AccessChainOp

Result Type must be an OpTypePointer. Its Type operand must be the type

AddressOfOp

Variables in module scope are defined using symbol names. This op generates

AtomicAndOp

AtomicCompareExchangeOp

AtomicCompareExchangeWeakOp

Has the same semantics as OpAtomicCompareExchange.

AtomicExchangeOp

AtomicIAddOp

AtomicIDecrementOp

AtomicIIncrementOp

AtomicISubOp

AtomicOrOp

AtomicSMaxOp

AtomicSMinOp

AtomicUMaxOp

AtomicUMinOp

AtomicXorOp

BitCountOp

Results are computed per component.

BitFieldInsertOp

Results are computed per component.

BitFieldSExtractOp

Results are computed per component.

BitFieldUExtractOp

The semantics are the same as with OpBitFieldSExtract with the exception

BitReverseOp

Results are computed per component.

BitcastOp

Result Type must be an OpTypePointer, or a scalar or vector of

BitwiseAndOp

Results are computed per component, and within each component, per bit.

BitwiseOrOp

Results are computed per component, and within each component, per bit.

BitwiseXorOp

Results are computed per component, and within each component, per bit.

BranchConditionalOp

Condition must be a Boolean type scalar.

BranchOp

This instruction must be the last instruction in a block.

CLAcosOp

Result is an angle in radians.

CLAcoshOp

Result is an angle in radians.

CLAsinOp

Result is an angle in radians.

CLAsinhOp

Result is an angle in radians.

CLAtan2Op

Result is an angle in radians.

CLAtanOp

Result is an angle in radians.

CLAtanhOp

Result is an angle in radians.

CLCeilOp

Result Type and x must be floating-point or vector(2,3,4,8,16) of

CLCosOp

Result Type and x must be floating-point or vector(2,3,4,8,16) of

CLCoshOp

Result Type and x must be floating-point or vector(2,3,4,8,16) of

CLErfOp

Result Type and x must be floating-point or vector(2,3,4,8,16) of

CLExpOp

Compute the base-e exponential of x. (i.e. ex)

CLFAbsOp

Compute the absolute value of x.

CLFMaxOp

Returns y if x < y, otherwise it returns x. If one argument is a NaN,

CLFMinOp

Returns y if y < x, otherwise it returns x. If one argument is a NaN, Fmin returns the other argument.

CLFloorOp

Result Type and x must be floating-point or vector(2,3,4,8,16) of

CLFmaOp

Result Type, a, b and c must be floating-point or vector(2,3,4,8,16) of

CLLogOp

Result Type and x must be floating-point or vector(2,3,4,8,16) of

CLMixOp

Result Type, x, y and a must be floating-point or vector(2,3,4,8,16) of

CLPowOp

Result Type, x and y must be floating-point or vector(2,3,4,8,16) of

CLPrintfOp

printf returns 0 if it was executed successfully and -1 otherwise.

CLRintOp

Result Type and x must be floating-point or vector(2,3,4,8,16) of

CLRoundOp

Result Type and x must be floating-point or vector(2,3,4,8,16) of

CLRsqrtOp

Result Type and x must be floating-point or vector(2,3,4,8,16) of

CLSAbsOp

Returns |x|, where x is treated as signed integer.

CLSMaxOp

Returns y if x < y, otherwise it returns x, where x and y are treated as signed integers.

CLSMinOp

Returns y if x < y, otherwise it returns x, where x and y are treated as signed integers.

CLSinOp

Result Type and x must be floating-point or vector(2,3,4,8,16) of

CLSinhOp

Result Type and x must be floating-point or vector(2,3,4,8,16) of

CLSqrtOp

Result Type and x must be floating-point or vector(2,3,4,8,16) of

CLTanOp

Result Type and x must be floating-point or vector(2,3,4,8,16) of

CLTanhOp

Result Type and x must be floating-point or vector(2,3,4,8,16) of

CLUMaxOp

Returns y if x < y, otherwise it returns x, where x and y are treated as unsigned integers.

CLUMinOp

Returns y if x < y, otherwise it returns x, where x and y are treated as unsigned integers.

CompositeConstructOp

Result Type must be a composite type, whose top-level

CompositeExtractOp

Result Type must be the type of object selected by the last provided

CompositeInsertOp

Result Type must be the same type as Composite.

ConstantOp

This op declares a SPIR-V normal constant. SPIR-V has multiple constant

ControlBarrierOp

All invocations of this module within Execution scope must reach this

ConvertFToSOp

Result Type must be a scalar or vector of integer type.

ConvertFToUOp

Result Type must be a scalar or vector of integer type, whose Signedness

ConvertPtrToUOp

Result Type must be a scalar of integer type, whose Signedness operand is 0.

ConvertSToFOp

Result Type must be a scalar or vector of floating-point type.

ConvertUToFOp

Result Type must be a scalar or vector of floating-point type.

ConvertUToPtrOp

Result Type must be a physical pointer type.

CopyMemoryOp

If present, any Memory Operands must begin with a memory operand

DotOp

Result Type must be a floating point scalar.

EXTAtomicFAddOp

Perform the following steps atomically with respect to any other atomic

EXTConstantCompositeReplicateOp

Represents a splat composite constant i.e., all elements of composite constant

EXTEmitMeshTasksOp

Defines the grid size of subsequent mesh shader workgroups to generate upon

EXTSetMeshOutputsOp

Vertex Count must be a 32-bit unsigned integer value. It defines the array size

EXTSpecConstantCompositeReplicateOp

Represents a splat spec composite constant i.e., all elements of spec composite

EmitVertexOp

This instruction must only be used when only one stream is present.

EndPrimitiveOp

This instruction must only be used when only one stream is present.

EntryPointOp

Execution Model is the execution model for the entry point and its

ExecutionModeOp

Entry Point must be the Entry Point operand of an OpEntryPoint

FAddOp

Result Type must be a scalar or vector of floating-point type.

FConvertOp

Result Type must be a scalar or vector of floating-point type.

FDivOp

Result Type must be a scalar or vector of floating-point type.

FModOp

Result Type must be a scalar or vector of floating-point type.

FMulOp

Result Type must be a scalar or vector of floating-point type.

FNegateOp

Result Type must be a scalar or vector of floating-point type.

FOrdEqualOp

Result Type must be a scalar or vector of Boolean type.

FOrdGreaterThanEqualOp

Result Type must be a scalar or vector of Boolean type.

FOrdGreaterThanOp

Result Type must be a scalar or vector of Boolean type.

FOrdLessThanEqualOp

Result Type must be a scalar or vector of Boolean type.

FOrdLessThanOp

Result Type must be a scalar or vector of Boolean type.

FOrdNotEqualOp

Result Type must be a scalar or vector of Boolean type.

FRemOp

Result Type must be a scalar or vector of floating-point type.

FSubOp

Result Type must be a scalar or vector of floating-point type.

FUnordEqualOp

Result Type must be a scalar or vector of Boolean type.

FUnordGreaterThanEqualOp

Result Type must be a scalar or vector of Boolean type.

FUnordGreaterThanOp

Result Type must be a scalar or vector of Boolean type.

FUnordLessThanEqualOp

Result Type must be a scalar or vector of Boolean type.

FUnordLessThanOp

Result Type must be a scalar or vector of Boolean type.

FUnordNotEqualOp

Result Type must be a scalar or vector of Boolean type.

FuncOp

This op declares or defines a SPIR-V function using one region, which

FunctionCallOp

Result Type is the type of the return value of the function. It must be

GLAcosOp

The standard trigonometric arc cosine of x radians.

GLAcoshOp

Arc hyperbolic cosine; result is the non-negative inverse of cosh. The resulting

GLAsinOp

The standard trigonometric arc sine of x radians.

GLAsinhOp

Arc hyperbolic sine; result is the inverse of sinh.

GLAtanOp

The standard trigonometric arc tangent of x radians.

GLAtanhOp

Arc hyperbolic tangent; result is the inverse of tanh. The resulting value

GLCeilOp

Result is the value equal to the nearest whole number that is greater than

GLCosOp

The standard trigonometric cosine of x radians.

GLCoshOp

Hyperbolic cosine of x radians.

GLCrossOp

Result is the cross product of x and y, i.e., the resulting components are, in order:

GLDistanceOp

Result is the distance between p0 and p1, i.e., length(p0 - p1).

GLExp2Op

Result is 2 raised to the x power; 2**x.

GLExpOp

Result is the natural exponentiation of x; e^x.

GLFAbsOp

Result is x if x >= 0; otherwise result is -x.

GLFClampOp

Result is min(max(x, minVal), maxVal). The resulting value is undefined if

GLFMaxOp

Result is y if x < y; otherwise result is x. Which operand is the

GLFMinOp

Result is y if y < x; otherwise result is x. Which operand is the result is

GLFMixOp

Result is the linear blend of x and y, i.e., x * (1 - a) + y * a.

GLFSignOp

Result is 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0.

GLFindILsbOp

Results in the bit number of the least-significant 1-bit in the binary

GLFindSMsbOp

For positive numbers, the result will be the bit number of the most significant

GLFindUMsbOp

Results in the bit number of the most-significant 1-bit in the binary

GLFloorOp

Result is the value equal to the nearest whole number that is less than or

GLFmaOp

In uses where this operation is decorated with NoContraction:

GLFractOp

Result is:

GLFrexpStructOp

Result is a structure containing x split into a floating-point significand

GLInverseSqrtOp

Result is the reciprocal of sqrt x. Result is undefined if x <= 0.

GLLdexpOp

Builds a floating-point number from x and the corresponding

GLLengthOp

Result is the length of vector x, i.e., sqrt(x[0]**2 + x[1]**2 + ...).

GLLog2Op

Result is the base-2 logarithm of x, i.e., the value y which satisfies the

GLLogOp

Result is the natural logarithm of x, i.e., the value y which satisfies the

GLNormalizeOp

Result is the vector in the same direction as x but with a length of 1.

GLPackHalf2x16Op

Result is the unsigned integer obtained by converting the components of a

GLPowOp

Result is x raised to the y power; x^y.

GLReflectOp

For the incident vector I and surface orientation N, the result is the reflection direction:

GLRoundEvenOp

Result is the value equal to the nearest whole number to x. A fractional

GLRoundOp

Result is the value equal to the nearest whole number to x. The fraction

GLSAbsOp

Result is x if x ≥ 0; otherwise result is -x, where x is interpreted as a

GLSClampOp

Result is min(max(x, minVal), maxVal), where x, minVal and maxVal are

GLSMaxOp

Result is y if x < y; otherwise result is x, where x and y are interpreted

GLSMinOp

Result is y if y < x; otherwise result is x, where x and y are interpreted

GLSSignOp

Result is 1 if x > 0, 0 if x = 0, or -1 if x < 0, where x is interpreted as

GLSinOp

The standard trigonometric sine of x radians.

GLSinhOp

Hyperbolic sine of x radians.

GLSqrtOp

Result is the square root of x. Result is undefined if x < 0.

GLTanOp

The standard trigonometric tangent of x radians.

GLTanhOp

Hyperbolic tangent of x radians.

GLUClampOp

Result is min(max(x, minVal), maxVal), where x, minVal and maxVal are

GLUMaxOp

Result is y if x < y; otherwise result is x, where x and y are interpreted

GLUMinOp

Result is y if y < x; otherwise result is x, where x and y are interpreted

GLUnpackHalf2x16Op

Result is the two-component floating-point vector with components obtained by

GenericCastToPtrExplicitOp

Result Type must be an OpTypePointer. Its Storage Class must be Storage.

GenericCastToPtrOp

Result Type must be an OpTypePointer. Its Storage Class must be

GlobalVariableOp

The variable type must be an OpTypePointer. Its type operand is the type of

GraphARMOp

This op declares or defines a SPIR-V graph using one region, which

GraphConstantARMOp

Declare a graph constant.

GraphEntryPointARMOp

Graph Entry Point must be the Result of an OpGraphARM instruction.

GraphOutputsARMOp

Values are the graph outputs values and must match the GraphOutputs Type

GroupBroadcastOp

All invocations of this module within Execution must reach this point of

GroupFAddOp

Behavior is undefined if not all invocations of this module within

GroupFMaxOp

Behavior is undefined if not all invocations of this module within

GroupFMinOp

Behavior is undefined if not all invocations of this module within

GroupFMulKHROp

Behavior is undefined if not all invocations of this module within

GroupIAddOp

Behavior is undefined if not all invocations of this module within

GroupIMulKHROp

Behavior is undefined if not all invocations of this module within

GroupNonUniformAllEqualOp

Result Type must be a Boolean type.

GroupNonUniformAllOp

Result Type must be a Boolean type.

GroupNonUniformAnyOp

Result Type must be a Boolean type.

GroupNonUniformBallotBitCountOp

Result Type must be a scalar of integer type, whose Signedness operand

GroupNonUniformBallotFindLSBOp

Result Type must be a scalar of integer type, whose Signedness operand

GroupNonUniformBallotFindMSBOp

Result Type must be a scalar of integer type, whose Signedness operand

GroupNonUniformBallotOp

Result Type must be a vector of four components of integer type scalar,

GroupNonUniformBitwiseAndOp

Result Type must be a scalar or vector of integer type.

GroupNonUniformBitwiseOrOp

Result Type must be a scalar or vector of integer type.

GroupNonUniformBitwiseXorOp

Result Type must be a scalar or vector of integer type.

GroupNonUniformBroadcastOp

Result Type must be a scalar or vector of floating-point type, integer

GroupNonUniformElectOp

Result Type must be a Boolean type.

GroupNonUniformFAddOp

Result Type must be a scalar or vector of floating-point type.

GroupNonUniformFMaxOp

Result Type must be a scalar or vector of floating-point type.

GroupNonUniformFMinOp

Result Type must be a scalar or vector of floating-point type.

GroupNonUniformFMulOp

Result Type must be a scalar or vector of floating-point type.

GroupNonUniformIAddOp

Result Type must be a scalar or vector of integer type.

GroupNonUniformIMulOp

Result Type must be a scalar or vector of integer type.

GroupNonUniformLogicalAndOp

Result Type must be a scalar or vector of Boolean type.

GroupNonUniformLogicalOrOp

Result Type must be a scalar or vector of Boolean type.

GroupNonUniformLogicalXorOp

Result Type must be a scalar or vector of Boolean type.

GroupNonUniformRotateKHROp

Return the Value of the invocation whose id within the group is calculated

GroupNonUniformSMaxOp

Result Type must be a scalar or vector of integer type.

GroupNonUniformSMinOp

Result Type must be a scalar or vector of integer type.

GroupNonUniformShuffleDownOp

Result Type must be a scalar or vector of floating-point type, integer

GroupNonUniformShuffleOp

Result Type must be a scalar or vector of floating-point type, integer

GroupNonUniformShuffleUpOp

Result Type must be a scalar or vector of floating-point type, integer

GroupNonUniformShuffleXorOp

Result Type must be a scalar or vector of floating-point type, integer

GroupNonUniformUMaxOp

Result Type must be a scalar or vector of integer type, whose

GroupNonUniformUMinOp

Result Type must be a scalar or vector of integer type, whose

GroupSMaxOp

Behavior is undefined if not all invocations of this module within

GroupSMinOp

Behavior is undefined if not all invocations of this module within

GroupUMaxOp

Behavior is undefined if not all invocations of this module within

GroupUMinOp

Behavior is undefined if not all invocations of this module within

IAddCarryOp

Result Type must be from OpTypeStruct. The struct must have two

IAddOp

Result Type must be a scalar or vector of integer type.

IEqualOp

Result Type must be a scalar or vector of Boolean type.

IMulOp

Result Type must be a scalar or vector of integer type.

INTELControlBarrierArriveOp

Indicates that an invocation has arrived at a split control barrier. This

INTELControlBarrierWaitOp

Waits for other invocations of this module to arrive at a split control

INTELConvertBF16ToFOp

Interpret a 16-bit integer as bfloat16 and convert the value numerically to 32-bit floating point type.

INTELConvertFToBF16Op

Convert value numerically from 32-bit floating point to bfloat16,

INTELRoundFToTF32Op

Convert value numerically from a 32-bit floating point type to tensor float32,

INTELSubgroupBlockReadOp

Reads one or more components of Result data for each invocation in the

INTELSubgroupBlockWriteOp

Writes one or more components of Data for each invocation in the subgroup

INotEqualOp

Result Type must be a scalar or vector of Boolean type.

ISubBorrowOp

Result Type must be from OpTypeStruct. The struct must have two

ISubOp

Result Type must be a scalar or vector of integer type.

ImageDrefGatherOp

Result Type must be a vector of four components of floating-point type

ImageFetchOp

Result Type must be a vector of four components of floating-point type or

ImageOp

Result Type must be OpTypeImage.

ImageQuerySizeOp

Result Type must be an integer type scalar or vector. The number of

ImageReadOp

Result Type must be a scalar or vector of floating-point type or integer

ImageSampleExplicitLodOp

Result Type must be a vector of four components of floating-point type

ImageSampleImplicitLodOp

An invocation will not execute a dynamic instance of this instruction

ImageSampleProjDrefImplicitLodOp

An invocation will not execute a dynamic instance of this instruction

ImageWriteOp

Image must be an object whose type is OpTypeImage with a Sampled operand

InBoundsPtrAccessChainOp

Example:

IsFiniteOp

Result Type must be a scalar or vector of Boolean type.

IsInfOp

Result Type must be a scalar or vector of Boolean type.

IsNanOp

Result Type must be a scalar or vector of Boolean type.

KHRAssumeTrueOp

KHRCooperativeMatrixLengthOp

Number of components of a cooperative matrix type accessible to each

KHRCooperativeMatrixLoadOp

Load a cooperative matrix through a pointer.

KHRCooperativeMatrixMulAddOp

Linear-algebraic matrix multiply of A by B and then component-wise add C.

KHRCooperativeMatrixStoreOp

Store a cooperative matrix through a pointer.

KHRSubgroupBallotOp

Computes a bitfield value combining the Predicate value from all invocations

KillOp

Fragment-shader discard.

LoadOp

Result Type is the type of the loaded object. It must be a type with

LogicalAndOp

Result Type must be a scalar or vector of Boolean type.

LogicalEqualOp

Result Type must be a scalar or vector of Boolean type.

LogicalNotEqualOp

Result Type must be a scalar or vector of Boolean type.

LogicalNotOp

Result Type must be a scalar or vector of Boolean type.

LogicalOrOp

Result Type must be a scalar or vector of Boolean type.

LoopOp

SPIR-V can explicitly declare structured control-flow constructs using merge

MatrixTimesMatrixOp

Result Type must be an OpTypeMatrix whose Column Type is a vector of

MatrixTimesScalarOp

Result Type must be a matrix type with a float component type.

MatrixTimesVectorOp

Result Type must be a vector of floating-point type.

MemoryBarrierOp

Ensures that memory accesses issued before this instruction will be

MergeOp

We use spirv.mlir.selection/spirv.mlir.loop for modelling structured selection/loop.

ModuleOp

This op defines a SPIR-V module using a MLIR region. The region contains

NotOp

Results are computed per component, and within each component, per bit.

OrderedOp

Result Type must be a scalar or vector of Boolean type.

PtrAccessChainOp

Element is used to do an initial dereference of Base: Base is treated as

PtrCastToGenericOp

Result Type must be an OpTypePointer. Its Storage Class must be Generic.

ReferenceOfOp

Specialization constants in module scope are defined using symbol names.

ReturnOp

This instruction must be the last instruction in a block.

ReturnValueOp

Value is the value returned, by copy, and must match the Return Type

SConvertOp

Result Type must be a scalar or vector of integer type.

SDivOp

Result Type must be a scalar or vector of integer type.

SDotAccSatOp

Result Type must be an integer type whose Width must be greater than or

SDotOp

Result Type must be an integer type whose Width must be greater than or

SGreaterThanEqualOp

Result Type must be a scalar or vector of Boolean type.

SGreaterThanOp

Result Type must be a scalar or vector of Boolean type.

SLessThanEqualOp

Result Type must be a scalar or vector of Boolean type.

SLessThanOp

Result Type must be a scalar or vector of Boolean type.

SModOp

Result Type must be a scalar or vector of integer type.

SMulExtendedOp

Result Type must be from OpTypeStruct. The struct must have two

SNegateOp

Result Type must be a scalar or vector of integer type.

SRemOp

Result Type must be a scalar or vector of integer type.

SUDotAccSatOp

Result Type must be an integer type whose Width must be greater than or

SUDotOp

Result Type must be an integer type whose Width must be greater than or

SelectOp

Before version 1.4, Result Type must be a pointer, scalar, or vector.

SelectionOp

SPIR-V can explicitly declare structured control-flow constructs using merge

ShiftLeftLogicalOp

Result Type must be a scalar or vector of integer type.

ShiftRightArithmeticOp

Result Type must be a scalar or vector of integer type.

ShiftRightLogicalOp

Result Type must be a scalar or vector of integer type.

SpecConstantCompositeOp

This op declares a SPIR-V composite specialization constant. This covers

SpecConstantOp

This op declares a SPIR-V scalar specialization constant. SPIR-V has

SpecConstantOperationOp

This op declares a SPIR-V specialization constant that results from

StoreOp

Pointer is the pointer to store through. Its type must be an

TransposeOp

Result Type must be an OpTypeMatrix.

UConvertOp

Result Type must be a scalar or vector of integer type, whose Signedness

UDivOp

Result Type must be a scalar or vector of integer type, whose Signedness

UDotAccSatOp

Result Type must be an integer type with Signedness of 0 whose Width

UDotOp

Result Type must be an integer type with Signedness of 0 whose Width

UGreaterThanEqualOp

Result Type must be a scalar or vector of Boolean type.

UGreaterThanOp

Result Type must be a scalar or vector of Boolean type.

ULessThanEqualOp

Result Type must be a scalar or vector of Boolean type.

ULessThanOp

Result Type must be a scalar or vector of Boolean type.

UModOp

Result Type must be a scalar or vector of integer type, whose Signedness

UMulExtendedOp

Result Type must be from OpTypeStruct. The struct must have two

UndefOp

Result Type is the type of object to make.

UnorderedOp

Result Type must be a scalar or vector of Boolean type.

UnreachableOp

This instruction must be the last instruction in a block.

VariableOp

Result Type must be an OpTypePointer. Its Type operand is the type of

VectorExtractDynamicOp

Result Type must be a scalar type.

VectorInsertDynamicOp

Result Type must be an OpTypeVector.

VectorShuffleOp

Result Type must be an OpTypeVector. The number of components in Result

VectorTimesMatrixOp

Result Type must be a vector of floating-point type.

VectorTimesScalarOp

Result Type must be a vector of floating-point type.

YieldOp

This op is a special terminator whose only purpose is to terminate

Functions

AccessChain(→ _ods_ir)

mlir_addressof(→ _ods_ir)

AtomicAnd(→ _ods_ir)

AtomicCompareExchange(→ _ods_ir)

AtomicCompareExchangeWeak(→ _ods_ir)

AtomicExchange(→ _ods_ir)

AtomicIAdd(→ _ods_ir)

AtomicIDecrement(→ _ods_ir)

AtomicIIncrement(→ _ods_ir)

AtomicISub(→ _ods_ir)

AtomicOr(→ _ods_ir)

AtomicSMax(→ _ods_ir)

AtomicSMin(→ _ods_ir)

AtomicUMax(→ _ods_ir)

AtomicUMin(→ _ods_ir)

AtomicXor(→ _ods_ir)

BitCount(→ _ods_ir)

BitFieldInsert(→ _ods_ir)

BitFieldSExtract(→ _ods_ir)

BitFieldUExtract(→ _ods_ir)

BitReverse(→ _ods_ir)

Bitcast(→ _ods_ir)

BitwiseAnd(→ _ods_ir)

BitwiseOr(→ _ods_ir)

BitwiseXor(→ _ods_ir)

BranchConditional(→ BranchConditionalOp)

Branch(→ BranchOp)

CL_acos(→ _ods_ir)

CL_acosh(→ _ods_ir)

CL_asin(→ _ods_ir)

CL_asinh(→ _ods_ir)

CL_atan2(→ _ods_ir)

CL_atan(→ _ods_ir)

CL_atanh(→ _ods_ir)

CL_ceil(→ _ods_ir)

CL_cos(→ _ods_ir)

CL_cosh(→ _ods_ir)

CL_erf(→ _ods_ir)

CL_exp(→ _ods_ir)

CL_fabs(→ _ods_ir)

CL_fmax(→ _ods_ir)

CL_fmin(→ _ods_ir)

CL_floor(→ _ods_ir)

CL_fma(→ _ods_ir)

CL_log(→ _ods_ir)

CL_mix(→ _ods_ir)

CL_pow(→ _ods_ir)

CL_printf(→ _ods_ir)

CL_rint(→ _ods_ir)

CL_round(→ _ods_ir)

CL_rsqrt(→ _ods_ir)

CL_s_abs(→ _ods_ir)

CL_s_max(→ _ods_ir)

CL_s_min(→ _ods_ir)

CL_sin(→ _ods_ir)

CL_sinh(→ _ods_ir)

CL_sqrt(→ _ods_ir)

CL_tan(→ _ods_ir)

CL_tanh(→ _ods_ir)

CL_u_max(→ _ods_ir)

CL_u_min(→ _ods_ir)

CompositeConstruct(→ _ods_ir)

CompositeExtract(→ _ods_ir)

CompositeInsert(→ _ods_ir)

Constant(→ _ods_ir)

ControlBarrier(→ ControlBarrierOp)

ConvertFToS(→ _ods_ir)

ConvertFToU(→ _ods_ir)

ConvertPtrToU(→ _ods_ir)

ConvertSToF(→ _ods_ir)

ConvertUToF(→ _ods_ir)

ConvertUToPtr(→ _ods_ir)

CopyMemory(→ CopyMemoryOp)

Dot(→ _ods_ir)

EXT_AtomicFAdd(→ _ods_ir)

EXT_ConstantCompositeReplicate(→ _ods_ir)

EXT_EmitMeshTasks(→ EXTEmitMeshTasksOp)

EXT_SetMeshOutputs(→ EXTSetMeshOutputsOp)

EXT_SpecConstantCompositeReplicate(...)

EmitVertex(→ EmitVertexOp)

EndPrimitive(→ EndPrimitiveOp)

EntryPoint(→ EntryPointOp)

ExecutionMode(→ ExecutionModeOp)

FAdd(→ _ods_ir)

FConvert(→ _ods_ir)

FDiv(→ _ods_ir)

FMod(→ _ods_ir)

FMul(→ _ods_ir)

FNegate(→ _ods_ir)

FOrdEqual(→ _ods_ir)

FOrdGreaterThanEqual(→ _ods_ir)

FOrdGreaterThan(→ _ods_ir)

FOrdLessThanEqual(→ _ods_ir)

FOrdLessThan(→ _ods_ir)

FOrdNotEqual(→ _ods_ir)

FRem(→ _ods_ir)

FSub(→ _ods_ir)

FUnordEqual(→ _ods_ir)

FUnordGreaterThanEqual(→ _ods_ir)

FUnordGreaterThan(→ _ods_ir)

FUnordLessThanEqual(→ _ods_ir)

FUnordLessThan(→ _ods_ir)

FUnordNotEqual(→ _ods_ir)

func(→ FuncOp)

FunctionCall(→ Union[_ods_ir, _ods_ir, FunctionCallOp])

GL_Acos(→ _ods_ir)

GL_Acosh(→ _ods_ir)

GL_Asin(→ _ods_ir)

GL_Asinh(→ _ods_ir)

GL_Atan(→ _ods_ir)

GL_Atanh(→ _ods_ir)

GL_Ceil(→ _ods_ir)

GL_Cos(→ _ods_ir)

GL_Cosh(→ _ods_ir)

GL_Cross(→ _ods_ir)

GL_Distance(→ _ods_ir)

GL_Exp2(→ _ods_ir)

GL_Exp(→ _ods_ir)

GL_FAbs(→ _ods_ir)

GL_FClamp(→ _ods_ir)

GL_FMax(→ _ods_ir)

GL_FMin(→ _ods_ir)

GL_FMix(→ _ods_ir)

GL_FSign(→ _ods_ir)

GL_FindILsb(→ _ods_ir)

GL_FindSMsb(→ _ods_ir)

GL_FindUMsb(→ _ods_ir)

GL_Floor(→ _ods_ir)

GL_Fma(→ _ods_ir)

GL_Fract(→ _ods_ir)

GL_FrexpStruct(→ _ods_ir)

GL_InverseSqrt(→ _ods_ir)

GL_Ldexp(→ _ods_ir)

GL_Length(→ _ods_ir)

GL_Log2(→ _ods_ir)

GL_Log(→ _ods_ir)

GL_Normalize(→ _ods_ir)

GL_PackHalf2x16(→ _ods_ir)

GL_Pow(→ _ods_ir)

GL_Reflect(→ _ods_ir)

GL_RoundEven(→ _ods_ir)

GL_Round(→ _ods_ir)

GL_SAbs(→ _ods_ir)

GL_SClamp(→ _ods_ir)

GL_SMax(→ _ods_ir)

GL_SMin(→ _ods_ir)

GL_SSign(→ _ods_ir)

GL_Sin(→ _ods_ir)

GL_Sinh(→ _ods_ir)

GL_Sqrt(→ _ods_ir)

GL_Tan(→ _ods_ir)

GL_Tanh(→ _ods_ir)

GL_UClamp(→ _ods_ir)

GL_UMax(→ _ods_ir)

GL_UMin(→ _ods_ir)

GL_UnpackHalf2x16(→ _ods_ir)

GenericCastToPtrExplicit(→ _ods_ir)

GenericCastToPtr(→ _ods_ir)

GlobalVariable(→ GlobalVariableOp)

ARM_Graph(→ GraphARMOp)

ARM_GraphConstant(→ _ods_ir)

ARM_GraphEntryPoint(→ GraphEntryPointARMOp)

ARM_GraphOutputs(→ GraphOutputsARMOp)

GroupBroadcast(→ _ods_ir)

GroupFAdd(→ _ods_ir)

GroupFMax(→ _ods_ir)

GroupFMin(→ _ods_ir)

KHR_GroupFMul(→ _ods_ir)

GroupIAdd(→ _ods_ir)

KHR_GroupIMul(→ _ods_ir)

GroupNonUniformAllEqual(→ _ods_ir)

GroupNonUniformAll(→ _ods_ir)

GroupNonUniformAny(→ _ods_ir)

GroupNonUniformBallotBitCount(→ _ods_ir)

GroupNonUniformBallotFindLSB(→ _ods_ir)

GroupNonUniformBallotFindMSB(→ _ods_ir)

GroupNonUniformBallot(→ _ods_ir)

GroupNonUniformBitwiseAnd(→ _ods_ir)

GroupNonUniformBitwiseOr(→ _ods_ir)

GroupNonUniformBitwiseXor(→ _ods_ir)

GroupNonUniformBroadcast(→ _ods_ir)

GroupNonUniformElect(→ _ods_ir)

GroupNonUniformFAdd(→ _ods_ir)

GroupNonUniformFMax(→ _ods_ir)

GroupNonUniformFMin(→ _ods_ir)

GroupNonUniformFMul(→ _ods_ir)

GroupNonUniformIAdd(→ _ods_ir)

GroupNonUniformIMul(→ _ods_ir)

GroupNonUniformLogicalAnd(→ _ods_ir)

GroupNonUniformLogicalOr(→ _ods_ir)

GroupNonUniformLogicalXor(→ _ods_ir)

GroupNonUniformRotateKHR(→ _ods_ir)

GroupNonUniformSMax(→ _ods_ir)

GroupNonUniformSMin(→ _ods_ir)

GroupNonUniformShuffleDown(→ _ods_ir)

GroupNonUniformShuffle(→ _ods_ir)

GroupNonUniformShuffleUp(→ _ods_ir)

GroupNonUniformShuffleXor(→ _ods_ir)

GroupNonUniformUMax(→ _ods_ir)

GroupNonUniformUMin(→ _ods_ir)

GroupSMax(→ _ods_ir)

GroupSMin(→ _ods_ir)

GroupUMax(→ _ods_ir)

GroupUMin(→ _ods_ir)

IAddCarry(→ _ods_ir)

IAdd(→ _ods_ir)

IEqual(→ _ods_ir)

IMul(→ _ods_ir)

INTEL_ControlBarrierArrive(→ INTELControlBarrierArriveOp)

INTEL_ControlBarrierWait(→ INTELControlBarrierWaitOp)

INTEL_ConvertBF16ToF(→ _ods_ir)

INTEL_ConvertFToBF16(→ _ods_ir)

INTEL_RoundFToTF32(→ _ods_ir)

INTEL_SubgroupBlockRead(→ _ods_ir)

INTEL_SubgroupBlockWrite(→ INTELSubgroupBlockWriteOp)

INotEqual(→ _ods_ir)

ISubBorrow(→ _ods_ir)

ISub(→ _ods_ir)

ImageDrefGather(→ _ods_ir)

ImageFetch(→ _ods_ir)

Image(→ _ods_ir)

ImageQuerySize(→ _ods_ir)

ImageRead(→ _ods_ir)

ImageSampleExplicitLod(→ _ods_ir)

ImageSampleImplicitLod(→ _ods_ir)

ImageSampleProjDrefImplicitLod(→ _ods_ir)

ImageWrite(→ ImageWriteOp)

InBoundsPtrAccessChain(→ _ods_ir)

IsFinite(→ _ods_ir)

IsInf(→ _ods_ir)

IsNan(→ _ods_ir)

KHR_AssumeTrue(→ KHRAssumeTrueOp)

KHR_CooperativeMatrixLength(→ _ods_ir)

KHR_CooperativeMatrixLoad(→ _ods_ir)

KHR_CooperativeMatrixMulAdd(→ _ods_ir)

KHR_CooperativeMatrixStore(→ KHRCooperativeMatrixStoreOp)

KHR_SubgroupBallot(→ _ods_ir)

Kill(→ KillOp)

Load(→ _ods_ir)

LogicalAnd(→ _ods_ir)

LogicalEqual(→ _ods_ir)

LogicalNotEqual(→ _ods_ir)

LogicalNot(→ _ods_ir)

LogicalOr(→ _ods_ir)

mlir_loop(→ Union[_ods_ir, _ods_ir, LoopOp])

MatrixTimesMatrix(→ _ods_ir)

MatrixTimesScalar(→ _ods_ir)

MatrixTimesVector(→ _ods_ir)

MemoryBarrier(→ MemoryBarrierOp)

mlir_merge(→ MergeOp)

module(→ ModuleOp)

Not(→ _ods_ir)

Ordered(→ _ods_ir)

PtrAccessChain(→ _ods_ir)

PtrCastToGeneric(→ _ods_ir)

mlir_referenceof(→ _ods_ir)

Return(→ ReturnOp)

ReturnValue(→ ReturnValueOp)

SConvert(→ _ods_ir)

SDiv(→ _ods_ir)

SDotAccSat(→ _ods_ir)

SDot(→ _ods_ir)

SGreaterThanEqual(→ _ods_ir)

SGreaterThan(→ _ods_ir)

SLessThanEqual(→ _ods_ir)

SLessThan(→ _ods_ir)

SMod(→ _ods_ir)

SMulExtended(→ _ods_ir)

SNegate(→ _ods_ir)

SRem(→ _ods_ir)

SUDotAccSat(→ _ods_ir)

SUDot(→ _ods_ir)

Select(→ _ods_ir)

mlir_selection(→ Union[_ods_ir, _ods_ir, SelectionOp])

ShiftLeftLogical(→ _ods_ir)

ShiftRightArithmetic(→ _ods_ir)

ShiftRightLogical(→ _ods_ir)

SpecConstantComposite(→ SpecConstantCompositeOp)

SpecConstant(→ SpecConstantOp)

SpecConstantOperation(→ _ods_ir)

Store(→ StoreOp)

Transpose(→ _ods_ir)

UConvert(→ _ods_ir)

UDiv(→ _ods_ir)

UDotAccSat(→ _ods_ir)

UDot(→ _ods_ir)

UGreaterThanEqual(→ _ods_ir)

UGreaterThan(→ _ods_ir)

ULessThanEqual(→ _ods_ir)

ULessThan(→ _ods_ir)

UMod(→ _ods_ir)

UMulExtended(→ _ods_ir)

Undef(→ _ods_ir)

Unordered(→ _ods_ir)

Unreachable(→ UnreachableOp)

Variable(→ _ods_ir)

VectorExtractDynamic(→ _ods_ir)

VectorInsertDynamic(→ _ods_ir)

VectorShuffle(→ _ods_ir)

VectorTimesMatrix(→ _ods_ir)

VectorTimesScalar(→ _ods_ir)

mlir_yield(→ YieldOp)

Module Contents

mlir.dialects._spirv_ops_gen._ods_ir
class mlir.dialects._spirv_ops_gen._Dialect(descriptor: object)

Bases: _ods_ir

DIALECT_NAMESPACE = 'spirv'
class mlir.dialects._spirv_ops_gen.AccessChainOp(component_ptr, base_ptr, indices, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be an OpTypePointer. Its Type operand must be the type reached by walking the Base’s type hierarchy down to the last provided index in Indexes, and its Storage Class operand must be the same as the Storage Class of Base.

Base must be a pointer, pointing to the base of a composite object.

Indexes walk the type hierarchy to the desired depth, potentially down to scalar granularity. The first index in Indexes will select the top- level member/element/component/element of the base composite. All composite constituents use zero-based numbering, as described by their OpType… instruction. The second index will apply similarly to that result, and so on. Once any non-composite type is reached, there must be no remaining (unused) indexes.

Each index in Indexes

  • must be a scalar integer type,

  • is treated as a signed count, and

  • must be an OpConstant when indexing into a structure.

Example:

%0 = "spirv.Constant"() { value = 1: i32} : () -> i32
%1 = spirv.Variable : !spirv.ptr<!spirv.struct<f32, !spirv.array<4xf32>>, Function>
%2 = spirv.AccessChain %1[%0] : !spirv.ptr<!spirv.struct<f32, !spirv.array<4xf32>>, Function> -> !spirv.ptr<!spirv.array<4xf32>, Function>
%3 = spirv.Load "Function" %2 ["Volatile"] : !spirv.array<4xf32>
OPERATION_NAME = 'spirv.AccessChain'
_ODS_REGIONS = (0, True)
base_ptr() _ods_ir
indices() _ods_ir
component_ptr() _ods_ir
mlir.dialects._spirv_ops_gen.AccessChain(component_ptr, base_ptr, indices, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.AddressOfOp(pointer, variable, *, loc=None, ip=None)

Bases: _ods_ir

Variables in module scope are defined using symbol names. This op generates an SSA value that can be used to refer to the symbol within function scope for use in ops that expect an SSA value. This operation has no corresponding SPIR-V instruction; it’s merely used for modelling purpose in the SPIR-V dialect. Since variables in module scope in SPIR-V dialect are of pointer type, this op returns a pointer type as well, and the type is the same as the variable referenced.

Example:

%0 = spirv.mlir.addressof @global_var : !spirv.ptr<f32, Input>
OPERATION_NAME = 'spirv.mlir.addressof'
_ODS_REGIONS = (0, True)
variable() _ods_ir
pointer() _ods_ir
mlir.dialects._spirv_ops_gen.mlir_addressof(pointer, variable, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.AtomicAndOp(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

  1. load through Pointer to get an Original Value,

  2. get a New Value by the bitwise AND of Original Value and Value, and

  3. store the New Value back through Pointer.

The instruction’s result is the Original Value.

Result Type must be an integer type scalar.

The type of Value must be the same as Result Type. The type of the value pointed to by Pointer must be the same as Result Type.

Memory must be a valid memory Scope.

Example:

%0 = spirv.AtomicAnd <Device> <None> %pointer, %value :
                   !spirv.ptr<i32, StorageBuffer>
OPERATION_NAME = 'spirv.AtomicAnd'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
value() _ods_ir
memory_scope() _ods_ir
semantics() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.AtomicAnd(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.AtomicCompareExchangeOp(pointer, memory_scope, equal_semantics, unequal_semantics, value, comparator, *, results=None, loc=None, ip=None)

Bases: _ods_ir

  1. load through Pointer to get an Original Value,

#. get a New Value from Value only if Original Value equals Comparator, and #. store the New Value back through Pointer’only if ‘Original Value equaled Comparator.

The instruction’s result is the Original Value.

Result Type must be an integer type scalar.

Use Equal for the memory semantics of this instruction when Value and Original Value compare equal.

Use Unequal for the memory semantics of this instruction when Value and Original Value compare unequal. Unequal must not be set to Release or Acquire and Release. In addition, Unequal cannot be set to a stronger memory-order then Equal.

The type of Value must be the same as Result Type. The type of the value pointed to by Pointer must be the same as Result Type. This type must also match the type of Comparator.

Memory is a memory Scope.

Example:

%0 = spirv.AtomicCompareExchange <Workgroup> <Acquire> <None>
                                %pointer, %value, %comparator
                                : !spirv.ptr<i32, WorkGroup>
OPERATION_NAME = 'spirv.AtomicCompareExchange'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
value() _ods_ir
comparator() _ods_ir
memory_scope() _ods_ir
equal_semantics() _ods_ir
unequal_semantics() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.AtomicCompareExchange(pointer, memory_scope, equal_semantics, unequal_semantics, value, comparator, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.AtomicCompareExchangeWeakOp(pointer, memory_scope, equal_semantics, unequal_semantics, value, comparator, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Has the same semantics as OpAtomicCompareExchange.

Memory must be a valid memory Scope.

Example:

%0 = spirv.AtomicCompareExchangeWeak <Workgroup> <Acquire> <None>
                                   %pointer, %value, %comparator
                                   : !spirv.ptr<i32, WorkGroup>
OPERATION_NAME = 'spirv.AtomicCompareExchangeWeak'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
value() _ods_ir
comparator() _ods_ir
memory_scope() _ods_ir
equal_semantics() _ods_ir
unequal_semantics() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.AtomicCompareExchangeWeak(pointer, memory_scope, equal_semantics, unequal_semantics, value, comparator, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.AtomicExchangeOp(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

  1. load through Pointer to get an Original Value,

  2. get a New Value from copying Value, and

  3. store the New Value back through Pointer.

The instruction’s result is the Original Value.

Result Type must be a scalar of integer type or floating-point type.

The type of Value must be the same as Result Type. The type of the value pointed to by Pointer must be the same as Result Type.

Memory is a memory Scope.

Example:

%0 = spirv.AtomicExchange <Workgroup> <Acquire> %pointer, %value,
                        : !spirv.ptr<i32, WorkGroup>
OPERATION_NAME = 'spirv.AtomicExchange'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
value() _ods_ir
memory_scope() _ods_ir
semantics() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.AtomicExchange(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.AtomicIAddOp(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

  1. load through Pointer to get an Original Value,

  2. get a New Value by integer addition of Original Value and Value, and

  3. store the New Value back through Pointer.

The instruction’s result is the Original Value.

Result Type must be an integer type scalar.

The type of Value must be the same as Result Type. The type of the value pointed to by Pointer must be the same as Result Type.

Memory must be a valid memory Scope.

Example:

%0 = spirv.AtomicIAdd <Device> <None> %pointer, %value :
                    !spirv.ptr<i32, StorageBuffer>
OPERATION_NAME = 'spirv.AtomicIAdd'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
value() _ods_ir
memory_scope() _ods_ir
semantics() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.AtomicIAdd(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.AtomicIDecrementOp(pointer, memory_scope, semantics, *, results=None, loc=None, ip=None)

Bases: _ods_ir

  1. load through Pointer to get an Original Value,

#. get a New Value through integer subtraction of 1 from Original Value, and #. store the New Value back through Pointer.

The instruction’s result is the Original Value.

Result Type must be an integer type scalar. The type of the value pointed to by Pointer must be the same as Result Type.

Memory must be a valid memory Scope.

Example:

%0 = spirv.AtomicIDecrement <Device> <None> %pointer :
                          !spirv.ptr<i32, StorageBuffer>
OPERATION_NAME = 'spirv.AtomicIDecrement'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
memory_scope() _ods_ir
semantics() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.AtomicIDecrement(pointer, memory_scope, semantics, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.AtomicIIncrementOp(pointer, memory_scope, semantics, *, results=None, loc=None, ip=None)

Bases: _ods_ir

  1. load through Pointer to get an Original Value,

  2. get a New Value through integer addition of 1 to Original Value, and

  3. store the New Value back through Pointer.

The instruction’s result is the Original Value.

Result Type must be an integer type scalar. The type of the value pointed to by Pointer must be the same as Result Type.

Memory must be a valid memory Scope.

Example:

%0 = spirv.AtomicIncrement <Device> <None> %pointer :
                         !spirv.ptr<i32, StorageBuffer>
OPERATION_NAME = 'spirv.AtomicIIncrement'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
memory_scope() _ods_ir
semantics() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.AtomicIIncrement(pointer, memory_scope, semantics, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.AtomicISubOp(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

  1. load through Pointer to get an Original Value,

#. get a New Value by integer subtraction of Value from Original Value, and #. store the New Value back through Pointer.

The instruction’s result is the Original Value.

Result Type must be an integer type scalar.

The type of Value must be the same as Result Type. The type of the value pointed to by Pointer must be the same as Result Type.

Memory must be a valid memory Scope.

Example:

%0 = spirv.AtomicISub <Device> <None> %pointer, %value :
                    !spirv.ptr<i32, StorageBuffer>
OPERATION_NAME = 'spirv.AtomicISub'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
value() _ods_ir
memory_scope() _ods_ir
semantics() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.AtomicISub(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.AtomicOrOp(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

  1. load through Pointer to get an Original Value,

  2. get a New Value by the bitwise OR of Original Value and Value, and

  3. store the New Value back through Pointer.

The instruction’s result is the Original Value.

Result Type must be an integer type scalar.

The type of Value must be the same as Result Type. The type of the value pointed to by Pointer must be the same as Result Type.

Memory must be a valid memory Scope.

Example:

%0 = spirv.AtomicOr <Device> <None> %pointer, %value :
                  !spirv.ptr<i32, StorageBuffer>
OPERATION_NAME = 'spirv.AtomicOr'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
value() _ods_ir
memory_scope() _ods_ir
semantics() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.AtomicOr(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.AtomicSMaxOp(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

  1. load through Pointer to get an Original Value,

#. get a New Value by finding the largest signed integer of Original Value and Value, and #. store the New Value back through Pointer.

The instruction’s result is the Original Value.

Result Type must be an integer type scalar.

The type of Value must be the same as Result Type. The type of the value pointed to by Pointer must be the same as Result Type.

Memory must be a valid memory Scope.

Example:

%0 = spirv.AtomicSMax <Device> <None> %pointer, %value :
                    !spirv.ptr<i32, StorageBuffer>
OPERATION_NAME = 'spirv.AtomicSMax'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
value() _ods_ir
memory_scope() _ods_ir
semantics() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.AtomicSMax(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.AtomicSMinOp(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

  1. load through Pointer to get an Original Value,

#. get a New Value by finding the smallest signed integer of Original Value and Value, and #. store the New Value back through Pointer.

The instruction’s result is the Original Value.

Result Type must be an integer type scalar.

The type of Value must be the same as Result Type. The type of the value pointed to by Pointer must be the same as Result Type.

Memory must be a valid memory Scope.

Example:

%0 = spirv.AtomicSMin <Device> <None> %pointer, %value :
                    !spirv.ptr<i32, StorageBuffer>
OPERATION_NAME = 'spirv.AtomicSMin'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
value() _ods_ir
memory_scope() _ods_ir
semantics() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.AtomicSMin(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.AtomicUMaxOp(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

  1. load through Pointer to get an Original Value,

#. get a New Value by finding the largest unsigned integer of Original Value and Value, and #. store the New Value back through Pointer.

The instruction’s result is the Original Value.

Result Type must be an integer type scalar.

The type of Value must be the same as Result Type. The type of the value pointed to by Pointer must be the same as Result Type.

Memory must be a valid memory Scope.

Example:

%0 = spirv.AtomicUMax <Device> <None> %pointer, %value :
                    !spirv.ptr<i32, StorageBuffer>
OPERATION_NAME = 'spirv.AtomicUMax'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
value() _ods_ir
memory_scope() _ods_ir
semantics() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.AtomicUMax(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.AtomicUMinOp(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

  1. load through Pointer to get an Original Value,

#. get a New Value by finding the smallest unsigned integer of Original Value and Value, and #. store the New Value back through Pointer.

The instruction’s result is the Original Value.

Result Type must be an integer type scalar.

The type of Value must be the same as Result Type. The type of the value pointed to by Pointer must be the same as Result Type.

Memory must be a valid memory Scope.

Example:

%0 = spirv.AtomicUMin <Device> <None> %pointer, %value :
                    !spirv.ptr<i32, StorageBuffer>
OPERATION_NAME = 'spirv.AtomicUMin'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
value() _ods_ir
memory_scope() _ods_ir
semantics() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.AtomicUMin(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.AtomicXorOp(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

  1. load through Pointer to get an Original Value,

#. get a New Value by the bitwise exclusive OR of Original Value and Value, and #. store the New Value back through Pointer.

The instruction’s result is the Original Value.

Result Type must be an integer type scalar.

The type of Value must be the same as Result Type. The type of the value pointed to by Pointer must be the same as Result Type.

Memory must be a valid memory Scope.

Example:

%0 = spirv.AtomicXor <Device> <None> %pointer, %value :
                   !spirv.ptr<i32, StorageBuffer>
OPERATION_NAME = 'spirv.AtomicXor'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
value() _ods_ir
memory_scope() _ods_ir
semantics() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.AtomicXor(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.BitCountOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Results are computed per component.

Result Type must be a scalar or vector of integer type. The components must be wide enough to hold the unsigned Width of Base as an unsigned value. That is, no sign bit is needed or counted when checking for a wide enough result width.

Base must be a scalar or vector of integer type. It must have the same number of components as Result Type.

The result is the unsigned value that is the number of bits in Base that are 1.

Example:

%2 = spirv.BitCount %0: i32
%3 = spirv.BitCount %1: vector<4xi32>
OPERATION_NAME = 'spirv.BitCount'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.BitCount(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.BitFieldInsertOp(base, insert, offset, count, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Results are computed per component.

Result Type must be a scalar or vector of integer type.

The type of Base and Insert must be the same as Result Type.

Any result bits numbered outside [Offset, Offset + Count - 1] (inclusive) will come from the corresponding bits in Base.

Any result bits numbered in [Offset, Offset + Count - 1] come, in order, from the bits numbered [0, Count - 1] of Insert.

Count must be an integer type scalar. Count is the number of bits taken from Insert. It will be consumed as an unsigned value. Count can be 0, in which case the result will be Base.

Offset must be an integer type scalar. Offset is the lowest-order bit of the bit field. It will be consumed as an unsigned value.

The resulting value is undefined if Count or Offset or their sum is greater than the number of bits in the result.

Example:

%0 = spirv.BitFieldInsert %base, %insert, %offset, %count : vector<3xi32>, i8, i8
OPERATION_NAME = 'spirv.BitFieldInsert'
_ODS_REGIONS = (0, True)
base() _ods_ir
insert() _ods_ir
offset() _ods_ir
count() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.BitFieldInsert(base, insert, offset, count, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.BitFieldSExtractOp(base, offset, count, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Results are computed per component.

Result Type must be a scalar or vector of integer type.

The type of Base must be the same as Result Type.

If Count is greater than 0: The bits of Base numbered in [Offset, Offset

  • Count - 1] (inclusive) become the bits numbered [0, Count - 1] of the

result. The remaining bits of the result will all be the same as bit Offset + Count - 1 of Base.

Count must be an integer type scalar. Count is the number of bits extracted from Base. It will be consumed as an unsigned value. Count can be 0, in which case the result will be 0.

Offset must be an integer type scalar. Offset is the lowest-order bit of the bit field to extract from Base. It will be consumed as an unsigned value.

The resulting value is undefined if Count or Offset or their sum is greater than the number of bits in the result.

Example:

%0 = spirv.BitFieldSExtract %base, %offset, %count : vector<3xi32>, i8, i8
OPERATION_NAME = 'spirv.BitFieldSExtract'
_ODS_REGIONS = (0, True)
base() _ods_ir
offset() _ods_ir
count() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.BitFieldSExtract(base, offset, count, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.BitFieldUExtractOp(base, offset, count, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The semantics are the same as with OpBitFieldSExtract with the exception that there is no sign extension. The remaining bits of the result will all be 0.

Example:

%0 = spirv.BitFieldUExtract %base, %offset, %count : vector<3xi32>, i8, i8
OPERATION_NAME = 'spirv.BitFieldUExtract'
_ODS_REGIONS = (0, True)
base() _ods_ir
offset() _ods_ir
count() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.BitFieldUExtract(base, offset, count, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.BitReverseOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Results are computed per component.

Result Type must be a scalar or vector of integer type.

The type of Base must be the same as Result Type.

The bit-number n of the result will be taken from bit-number Width - 1 - n of Base, where Width is the OpTypeInt operand of the Result Type.

Example:

%2 = spirv.BitReverse %0 : i32
%3 = spirv.BitReverse %1 : vector<4xi32>
OPERATION_NAME = 'spirv.BitReverse'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.BitReverse(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.BitcastOp(result, operand, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be an OpTypePointer, or a scalar or vector of numerical-type.

Operand must have a type of OpTypePointer, or a scalar or vector of numerical-type. It must be a different type than Result Type.

If either Result Type or Operand is a pointer, the other must be a pointer (diverges from the SPIR-V spec).

If Result Type has a different number of components than Operand, the total number of bits in Result Type must equal the total number of bits in Operand. Let L be the type, either Result Type or Operand’s type, that has the larger number of components. Let S be the other type, with the smaller number of components. The number of components in L must be an integer multiple of the number of components in S. The first component (that is, the only or lowest-numbered component) of S maps to the first components of L, and so on, up to the last component of S mapping to the last components of L. Within this mapping, any single component of S (mapping to multiple components of L) maps its lower- ordered bits to the lower-numbered components of L.

Example:

%1 = spirv.Bitcast %0 : f32 to i32
%1 = spirv.Bitcast %0 : vector<2xf32> to i64
%1 = spirv.Bitcast %0 : !spirv.ptr<f32, Function> to !spirv.ptr<i32, Function>
OPERATION_NAME = 'spirv.Bitcast'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.Bitcast(result, operand, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.BitwiseAndOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Results are computed per component, and within each component, per bit.

Result Type must be a scalar or vector of integer type. The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same number of components as Result Type. They must have the same component width as Result Type.

Example:

%2 = spirv.BitwiseAnd %0, %1 : i32
%2 = spirv.BitwiseAnd %0, %1 : vector<4xi32>
OPERATION_NAME = 'spirv.BitwiseAnd'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.BitwiseAnd(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.BitwiseOrOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Results are computed per component, and within each component, per bit.

Result Type must be a scalar or vector of integer type. The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same number of components as Result Type. They must have the same component width as Result Type.

Example:

%2 = spirv.BitwiseOr %0, %1 : i32
%2 = spirv.BitwiseOr %0, %1 : vector<4xi32>
OPERATION_NAME = 'spirv.BitwiseOr'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.BitwiseOr(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.BitwiseXorOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Results are computed per component, and within each component, per bit.

Result Type must be a scalar or vector of integer type. The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same number of components as Result Type. They must have the same component width as Result Type.

Example:

%2 = spirv.BitwiseXor %0, %1 : i32
%2 = spirv.BitwiseXor %0, %1 : vector<4xi32>
OPERATION_NAME = 'spirv.BitwiseXor'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.BitwiseXor(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.BranchConditionalOp(condition, trueTargetOperands, falseTargetOperands, trueTarget, falseTarget, *, branch_weights=None, loc=None, ip=None)

Bases: _ods_ir

Condition must be a Boolean type scalar.

Branch weights are unsigned 32-bit integer literals. There must be either no Branch Weights or exactly two branch weights. If present, the first is the weight for branching to True Label, and the second is the weight for branching to False Label. The implied probability that a branch is taken is its weight divided by the sum of the two Branch weights. At least one weight must be non-zero. A weight of zero does not imply a branch is dead or permit its removal; branch weights are only hints. The two weights must not overflow a 32-bit unsigned integer when added together.

This instruction must be the last instruction in a block.

branch-conditional-op ::= `spirv.BranchConditional` ssa-use
                          (`[` integer-literal, integer-literal `]`)?
                          `,` successor `,` successor
successor ::= bb-id branch-use-list?
branch-use-list ::= `(` ssa-use-list `:` type-list-no-parens `)`

Example:

spirv.BranchConditional %condition, ^true_branch, ^false_branch
spirv.BranchConditional %condition, ^true_branch(%0: i32), ^false_branch(%1: i32)
OPERATION_NAME = 'spirv.BranchConditional'
_ODS_OPERAND_SEGMENTS
_ODS_REGIONS = (0, True)
condition() _ods_ir
trueTargetOperands() _ods_ir
falseTargetOperands() _ods_ir
branch_weights() _ods_ir | None
mlir.dialects._spirv_ops_gen.BranchConditional(condition, true_target_operands, false_target_operands, true_target, false_target, *, branch_weights=None, loc=None, ip=None) BranchConditionalOp
class mlir.dialects._spirv_ops_gen.BranchOp(targetOperands, target, *, loc=None, ip=None)

Bases: _ods_ir

This instruction must be the last instruction in a block.

Example:

spirv.Branch ^target
spirv.Branch ^target(%0, %1: i32, f32)
OPERATION_NAME = 'spirv.Branch'
_ODS_REGIONS = (0, True)
targetOperands() _ods_ir
mlir.dialects._spirv_ops_gen.Branch(target_operands, target, *, loc=None, ip=None) BranchOp
class mlir.dialects._spirv_ops_gen.CLAcosOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is an angle in radians.

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.acos %0 : f32
%3 = spirv.CL.acos %1 : vector<4xf16>
OPERATION_NAME = 'spirv.CL.acos'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_acos(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLAcoshOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is an angle in radians.

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.acosh %0 : f32
%3 = spirv.CL.acosh %1 : vector<4xf16>
OPERATION_NAME = 'spirv.CL.acosh'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_acosh(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLAsinOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is an angle in radians.

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.asin %0 : f32
%3 = spirv.CL.asin %1 : vector<4xf16>
OPERATION_NAME = 'spirv.CL.asin'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_asin(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLAsinhOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is an angle in radians.

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.asinh %0 : f32
%3 = spirv.CL.asinh %1 : vector<4xf16>
OPERATION_NAME = 'spirv.CL.asinh'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_asinh(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLAtan2Op(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is an angle in radians.

Result Type, y and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.atan2 %0, %1 : f32
%3 = spirv.CL.atan2 %0, %1 : vector<4xf16>
OPERATION_NAME = 'spirv.CL.atan2'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_atan2(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLAtanOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is an angle in radians.

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.atan %0 : f32
%3 = spirv.CL.atan %1 : vector<4xf16>
OPERATION_NAME = 'spirv.CL.atan'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_atan(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLAtanhOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is an angle in radians.

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.atanh %0 : f32
%3 = spirv.CL.atanh %1 : vector<4xf16>
OPERATION_NAME = 'spirv.CL.atanh'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_atanh(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLCeilOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.ceil %0 : f32
%3 = spirv.CL.ceil %1 : vector<3xf16>
OPERATION_NAME = 'spirv.CL.ceil'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_ceil(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLCosOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.cos %0 : f32
%3 = spirv.CL.cos %1 : vector<3xf16>
OPERATION_NAME = 'spirv.CL.cos'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_cos(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLCoshOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.cosh %0 : f32
%3 = spirv.CL.cosh %1 : vector<4xf16>
OPERATION_NAME = 'spirv.CL.cosh'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_cosh(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLErfOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.erf %0 : f32
%3 = spirv.CL.erf %1 : vector<3xf16>
OPERATION_NAME = 'spirv.CL.erf'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_erf(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLExpOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Compute the base-e exponential of x. (i.e. ex)

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.exp %0 : f32
%3 = spirv.CL.exp %1 : vector<3xf16>
OPERATION_NAME = 'spirv.CL.exp'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_exp(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLFAbsOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Compute the absolute value of x.

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.fabs %0 : f32
%3 = spirv.CL.fabs %1 : vector<3xf16>
OPERATION_NAME = 'spirv.CL.fabs'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_fabs(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLFMaxOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Returns y if x < y, otherwise it returns x. If one argument is a NaN, Fmax returns the other argument. If both arguments are NaNs, Fmax returns a NaN.

Result Type, x and y must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.fmax %0, %1 : f32
%3 = spirv.CL.fmax %0, %1 : vector<3xf16>
OPERATION_NAME = 'spirv.CL.fmax'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_fmax(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLFMinOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Returns y if y < x, otherwise it returns x. If one argument is a NaN, Fmin returns the other argument. If both arguments are NaNs, Fmin returns a NaN.

Result Type,x and y must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.fmin %0, %1 : f32
%3 = spirv.CL.fmin %0, %1 : vector<3xf16>
OPERATION_NAME = 'spirv.CL.fmin'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_fmin(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLFloorOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.floor %0 : f32
%3 = spirv.CL.floor %1 : vector<3xf16>
OPERATION_NAME = 'spirv.CL.floor'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_floor(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLFmaOp(x, y, z, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type, a, b and c must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%0 = spirv.CL.fma %a, %b, %c : f32
%1 = spirv.CL.fma %a, %b, %c : vector<3xf16>
OPERATION_NAME = 'spirv.CL.fma'
_ODS_REGIONS = (0, True)
x() _ods_ir
y() _ods_ir
z() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_fma(x, y, z, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLLogOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.log %0 : f32
%3 = spirv.CL.log %1 : vector<3xf16>
OPERATION_NAME = 'spirv.CL.log'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_log(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLMixOp(x, y, z, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type, x, y and a must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Note: This instruction can be implemented using contractions such as mad or fma.

Example:

%0 = spirv.CL.mix %a, %b, %c : f32
%1 = spirv.CL.mix %a, %b, %c : vector<3xf16>
OPERATION_NAME = 'spirv.CL.mix'
_ODS_REGIONS = (0, True)
x() _ods_ir
y() _ods_ir
z() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_mix(x, y, z, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLPowOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type, x and y must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.pow %0, %1 : f32
%3 = spirv.CL.pow %0, %1 : vector<3xf16>
OPERATION_NAME = 'spirv.CL.pow'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_pow(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLPrintfOp(result, format, arguments, *, loc=None, ip=None)

Bases: _ods_ir

printf returns 0 if it was executed successfully and -1 otherwise.

Result Type must be i32.

Format must be a pointer(constant) to i8. If there are insufficient arguments for the format, the behavior is undefined. If the format is exhausted while arguments remain, the excess arguments are evaluated (as always) but are otherwise ignored. The printf instruction returns when the end of the format string is encountered.

Example:

%0 = spirv.CL.printf %fmt %1, %2  : !spirv.ptr<i8, UniformConstant>, i32, i32 -> i32
OPERATION_NAME = 'spirv.CL.printf'
_ODS_REGIONS = (0, True)
format() _ods_ir
arguments() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_printf(result, format, arguments, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLRintOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%0 = spirv.CL.rint %0 : f32
%1 = spirv.CL.rint %1 : vector<3xf16>
OPERATION_NAME = 'spirv.CL.rint'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_rint(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLRoundOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.round %0 : f32
%3 = spirv.CL.round %0 : vector<3xf16>
OPERATION_NAME = 'spirv.CL.round'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_round(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLRsqrtOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.rsqrt %0 : f32
%3 = spirv.CL.rsqrt %1 : vector<3xf16>
OPERATION_NAME = 'spirv.CL.rsqrt'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_rsqrt(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLSAbsOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Returns |x|, where x is treated as signed integer.

Result Type and x must be integer or vector(2,3,4,8,16) of integer values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.s_abs %0 : i32
%3 = spirv.CL.s_abs %1 : vector<3xi16>
OPERATION_NAME = 'spirv.CL.s_abs'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_s_abs(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLSMaxOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Returns y if x < y, otherwise it returns x, where x and y are treated as signed integers.

Result Type,x and y must be integer or vector(2,3,4,8,16) of integer values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.s_max %0, %1 : i32
%3 = spirv.CL.s_max %0, %1 : vector<3xi16>
OPERATION_NAME = 'spirv.CL.s_max'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_s_max(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLSMinOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Returns y if x < y, otherwise it returns x, where x and y are treated as signed integers.

Result Type,x and y must be integer or vector(2,3,4,8,16) of integer values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.s_min %0, %1 : i32
%3 = spirv.CL.s_min %0, %1 : vector<3xi16>
OPERATION_NAME = 'spirv.CL.s_min'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_s_min(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLSinOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.sin %0 : f32
%3 = spirv.CL.sin %1 : vector<3xf16>
OPERATION_NAME = 'spirv.CL.sin'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_sin(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLSinhOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.sinh %0 : f32
%3 = spirv.CL.sinh %1 : vector<4xf16>
OPERATION_NAME = 'spirv.CL.sinh'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_sinh(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLSqrtOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.sqrt %0 : f32
%3 = spirv.CL.sqrt %1 : vector<3xf16>
OPERATION_NAME = 'spirv.CL.sqrt'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_sqrt(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLTanOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.tan %0 : f32
%3 = spirv.CL.tan %1 : vector<4xf16>
OPERATION_NAME = 'spirv.CL.tan'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_tan(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLTanhOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type and x must be floating-point or vector(2,3,4,8,16) of floating-point values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.tanh %0 : f32
%3 = spirv.CL.tanh %1 : vector<3xf16>
OPERATION_NAME = 'spirv.CL.tanh'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_tanh(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLUMaxOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Returns y if x < y, otherwise it returns x, where x and y are treated as unsigned integers.

Result Type,x and y must be integer or vector(2,3,4,8,16) of integer values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.u_max %0, %1 : i32
%3 = spirv.CL.u_max %0, %1 : vector<3xi16>
OPERATION_NAME = 'spirv.CL.u_max'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_u_max(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CLUMinOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Returns y if x < y, otherwise it returns x, where x and y are treated as unsigned integers.

Result Type,x and y must be integer or vector(2,3,4,8,16) of integer values.

All of the operands, including the Result Type operand, must be of the same type.

Example:

%2 = spirv.CL.u_min %0, %1 : i32
%3 = spirv.CL.u_min %0, %1 : vector<3xi16>
OPERATION_NAME = 'spirv.CL.u_min'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CL_u_min(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CompositeConstructOp(result, constituents, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a composite type, whose top-level members/elements/components/columns have the same type as the types of the operands, with one exception. The exception is that for constructing a vector, the operands may also be vectors with the same component type as the Result Type component type. When constructing a vector, the total number of components in all the operands must equal the number of components in Result Type.

Constituents will become members of a structure, or elements of an array, or components of a vector, or columns of a matrix. There must be exactly one Constituent for each top-level member/element/component/column of the result, with one exception. The exception is that for constructing a vector, a contiguous subset of the scalars consumed can be represented by a vector operand instead. The Constituents must appear in the order needed by the definition of the type of the result. When constructing a vector, there must be at least two Constituent operands.

Example:

%a = spirv.CompositeConstruct %1, %2, %3 : vector<3xf32>
%b = spirv.CompositeConstruct %a, %1 : (vector<3xf32>, f32) -> vector<4xf32>

%c = spirv.CompositeConstruct %1 :
  (f32) -> !spirv.coopmatrix<4x4xf32, Subgroup, MatrixA>

%d = spirv.CompositeConstruct %a, %4, %5 :
  (vector<3xf32>, !spirv.array<4xf32>, !spirv.struct<(f32)>) ->
    !spirv.struct<(vector<3xf32>, !spirv.array<4xf32>, !spirv.struct<(f32)>)>
OPERATION_NAME = 'spirv.CompositeConstruct'
_ODS_REGIONS = (0, True)
constituents() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CompositeConstruct(result, constituents, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CompositeExtractOp(component, composite, indices, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be the type of object selected by the last provided index. The instruction result is the extracted object.

Composite is the composite to extract from.

Indexes walk the type hierarchy, potentially down to component granularity, to select the part to extract. All indexes must be in bounds. All composite constituents use zero-based numbering, as described by their OpType… instruction.

composite-extract-op ::= ssa-id `=` `spirv.CompositeExtract` ssa-use
                         `[` integer-literal (',' integer-literal)* `]`
                         `:` composite-type

Example:

%0 = spirv.Variable : !spirv.ptr<!spirv.array<4x!spirv.array<4xf32>>, Function>
%1 = spirv.Load "Function" %0 ["Volatile"] : !spirv.array<4x!spirv.array<4xf32>>
%2 = spirv.CompositeExtract %1[1 : i32] : !spirv.array<4x!spirv.array<4xf32>>
OPERATION_NAME = 'spirv.CompositeExtract'
_ODS_REGIONS = (0, True)
composite() _ods_ir
indices() _ods_ir
component() _ods_ir
mlir.dialects._spirv_ops_gen.CompositeExtract(component, composite, indices, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CompositeInsertOp(result, object, composite, indices, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be the same type as Composite.

Object is the object to use as the modified part.

Composite is the composite to copy all but the modified part from.

Indexes walk the type hierarchy of Composite to the desired depth, potentially down to component granularity, to select the part to modify. All indexes must be in bounds. All composite constituents use zero-based numbering, as described by their OpType… instruction. The type of the part selected to modify must match the type of Object.

composite-insert-op ::= ssa-id `=` `spirv.CompositeInsert` ssa-use, ssa-use
                        `[` integer-literal (',' integer-literal)* `]`
                        `:` object-type `into` composite-type

Example:

%0 = spirv.CompositeInsert %object, %composite[1 : i32] : f32 into !spirv.array<4xf32>
OPERATION_NAME = 'spirv.CompositeInsert'
_ODS_REGIONS = (0, True)
object() _ods_ir
composite() _ods_ir
indices() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.CompositeInsert(result, object, composite, indices, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ConstantOp(constant, value, *, loc=None, ip=None)

Bases: _ods_ir

This op declares a SPIR-V normal constant. SPIR-V has multiple constant instructions covering different constant types:

  • OpConstantTrue and OpConstantFalse for boolean constants

  • OpConstant for scalar constants

  • OpConstantComposite for composite constants

  • OpConstantNull for null constants

Having such a plethora of constant instructions renders IR transformations more tedious. Therefore, we use a single spirv.Constant op to represent them all. Note that conversion between those SPIR-V constant instructions and this op is purely mechanical; so it can be scoped to the binary (de)serialization process.

spirv.Constant-op ::= ssa-id `=` `spirv.Constant` attribute-value
                    (`:` spirv-type)?

Example:

%0 = spirv.Constant true
%1 = spirv.Constant dense<[2.0, 3.0]> : vector<2xf32>
%2 = spirv.Constant [dense<3.0> : vector<2xf32>] : !spirv.array<1xvector<2xf32>>

TODO: support constant structs

OPERATION_NAME = 'spirv.Constant'
_ODS_REGIONS = (0, True)
value() _ods_ir
constant() _ods_ir
mlir.dialects._spirv_ops_gen.Constant(constant, value, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ControlBarrierOp(execution_scope, memory_scope, memory_semantics, *, loc=None, ip=None)

Bases: _ods_ir

All invocations of this module within Execution scope must reach this point of execution before any invocation will proceed beyond it.

When Execution is Workgroup or larger, behavior is undefined if this instruction is used in control flow that is non-uniform within Execution. When Execution is Subgroup or Invocation, the behavior of this instruction in non-uniform control flow is defined by the client API.

If Semantics is not None, this instruction also serves as an OpMemoryBarrier instruction, and must also perform and adhere to the description and semantics of an OpMemoryBarrier instruction with the same Memory and Semantics operands. This allows atomically specifying both a control barrier and a memory barrier (that is, without needing two instructions). If Semantics is None, Memory is ignored.

Before version 1.3, it is only valid to use this instruction with TessellationControl, GLCompute, or Kernel execution models. There is no such restriction starting with version 1.3.

When used with the TessellationControl execution model, it also implicitly synchronizes the Output Storage Class: Writes to Output variables performed by any invocation executed prior to a OpControlBarrier will be visible to any other invocation after return from that OpControlBarrier.

Example:

spirv.ControlBarrier <Workgroup>, <Device>, <Acquire|UniformMemory>
OPERATION_NAME = 'spirv.ControlBarrier'
_ODS_REGIONS = (0, True)
execution_scope() _ods_ir
memory_scope() _ods_ir
memory_semantics() _ods_ir
mlir.dialects._spirv_ops_gen.ControlBarrier(execution_scope, memory_scope, memory_semantics, *, loc=None, ip=None) ControlBarrierOp
class mlir.dialects._spirv_ops_gen.ConvertFToSOp(result, operand, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

Float Value must be a scalar or vector of floating-point type. It must have the same number of components as Result Type.

Results are computed per component.

Example:

%1 = spirv.ConvertFToS %0 : f32 to i32
%3 = spirv.ConvertFToS %2 : vector<3xf32> to vector<3xi32>
OPERATION_NAME = 'spirv.ConvertFToS'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ConvertFToS(result, operand, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ConvertFToUOp(result, operand, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type, whose Signedness operand is 0.

Float Value must be a scalar or vector of floating-point type. It must have the same number of components as Result Type.

Results are computed per component.

Example:

%1 = spirv.ConvertFToU %0 : f32 to i32
%3 = spirv.ConvertFToU %2 : vector<3xf32> to vector<3xi32>
OPERATION_NAME = 'spirv.ConvertFToU'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ConvertFToU(result, operand, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ConvertPtrToUOp(result, pointer, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar of integer type, whose Signedness operand is 0.

Pointer must be a physical pointer type. If the bit width of Pointer is smaller than that of Result Type, the conversion zero extends Pointer. If the bit width of Pointer is larger than that of Result Type, the conversion truncates Pointer.

For same bit width Pointer and Result Type, this is the same as OpBitcast.

Example:

%1 = spirv.ConvertPtrToU %0 : !spirv.ptr<i32, Generic> to i32
OPERATION_NAME = 'spirv.ConvertPtrToU'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ConvertPtrToU(result, pointer, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ConvertSToFOp(result, operand, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type.

Signed Value must be a scalar or vector of integer type. It must have the same number of components as Result Type.

Results are computed per component.

Example:

%1 = spirv.ConvertSToF %0 : i32 to f32
%3 = spirv.ConvertSToF %2 : vector<3xi32> to vector<3xf32>
OPERATION_NAME = 'spirv.ConvertSToF'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ConvertSToF(result, operand, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ConvertUToFOp(result, operand, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type.

Unsigned Value must be a scalar or vector of integer type. It must have the same number of components as Result Type.

Results are computed per component.

Example:

%1 = spirv.ConvertUToF %0 : i32 to f32
%3 = spirv.ConvertUToF %2 : vector<3xi32> to vector<3xf32>
OPERATION_NAME = 'spirv.ConvertUToF'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ConvertUToF(result, operand, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ConvertUToPtrOp(result, operand, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a physical pointer type.

Integer Value must be a scalar of integer type, whose Signedness operand is 0. If the bit width of Integer Value is smaller than that of Result Type, the conversion zero extends Integer Value. If the bit width of Integer Value is larger than that of Result Type, the conversion truncates Integer Value.

For same-width Integer Value and Result Type, this is the same as OpBitcast.

Example:

%1 = spirv.ConvertUToPtr %0 :  i32 to !spirv.ptr<i32, Generic>
OPERATION_NAME = 'spirv.ConvertUToPtr'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ConvertUToPtr(result, operand, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.CopyMemoryOp(target, source, *, memory_access=None, alignment=None, source_memory_access=None, source_alignment=None, loc=None, ip=None)

Bases: _ods_ir

If present, any Memory Operands must begin with a memory operand literal. If not present, it is the same as specifying the memory operand None. Before version 1.4, at most one memory operands mask can be provided. Starting with version 1.4 two masks can be provided, as described in Memory Operands. If no masks or only one mask is present, it applies to both Source and Target. If two masks are present, the first applies to Target and cannot include MakePointerVisible, and the second applies to Source and cannot include MakePointerAvailable.

copy-memory-op ::= `spirv.CopyMemory ` storage-class ssa-use
                   storage-class ssa-use
                   (`[` memory-access `]` (`, [` memory-access `]`)?)?
                   ` : ` spirv-element-type

Example:

%0 = spirv.Variable : !spirv.ptr<f32, Function>
%1 = spirv.Variable : !spirv.ptr<f32, Function>
spirv.CopyMemory "Function" %0, "Function" %1 : f32
OPERATION_NAME = 'spirv.CopyMemory'
_ODS_REGIONS = (0, True)
target() _ods_ir
source() _ods_ir
memory_access() _ods_ir | None
alignment() _ods_ir | None
source_memory_access() _ods_ir | None
source_alignment() _ods_ir | None
mlir.dialects._spirv_ops_gen.CopyMemory(target, source, *, memory_access=None, alignment=None, source_memory_access=None, source_alignment=None, loc=None, ip=None) CopyMemoryOp
class mlir.dialects._spirv_ops_gen.DotOp(result, vector1, vector2, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a floating point scalar.

Vector 1 and Vector 2 must be vectors of the same type, and their component type must be Result Type.

Example:

%0 = spirv.Dot %v1, %v2 : vector<4xf32> -> f32
OPERATION_NAME = 'spirv.Dot'
_ODS_REGIONS = (0, True)
vector1() _ods_ir
vector2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.Dot(result, vector1, vector2, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.EXTAtomicFAddOp(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Perform the following steps atomically with respect to any other atomic accesses within Scope to the same location:

  1. load through Pointer to get an Original Value,

  2. get a New Value by float addition of Original Value and Value, and

  3. store the New Value back through Pointer.

The instruction’s result is the Original Value.

Result Type must be a floating-point type scalar.

The type of Value must be the same as Result Type. The type of the value pointed to by Pointer must be the same as Result Type.

Memory must be a valid memory Scope.

Example:

%0 = spirv.EXT.AtomicFAdd <Device> <None> %pointer, %value :
                       !spirv.ptr<f32, StorageBuffer>
OPERATION_NAME = 'spirv.EXT.AtomicFAdd'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
value() _ods_ir
memory_scope() _ods_ir
semantics() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.EXT_AtomicFAdd(pointer, memory_scope, semantics, value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.EXTConstantCompositeReplicateOp(replicated_constant, value, *, loc=None, ip=None)

Bases: _ods_ir

Represents a splat composite constant i.e., all elements of composite constant have the same value.

Example:

%0 = spirv.EXT.ConstantCompositeReplicate [1 : i32] : vector<2xi32>
%1 = spirv.EXT.ConstantCompositeReplicate [1 : i32] : !spirv.array<2 x vector<2xi32>>
%2 = spirv.EXT.ConstantCompositeReplicate [dense<[1, 2]> : vector<2xi32>] : !spirv.array<2 x vector<2xi32>>
OPERATION_NAME = 'spirv.EXT.ConstantCompositeReplicate'
_ODS_REGIONS = (0, True)
value() _ods_ir
replicated_constant() _ods_ir
mlir.dialects._spirv_ops_gen.EXT_ConstantCompositeReplicate(replicated_constant, value, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.EXTEmitMeshTasksOp(group_count_x, group_count_y, group_count_z, *, payload=None, loc=None, ip=None)

Bases: _ods_ir

Defines the grid size of subsequent mesh shader workgroups to generate upon completion of the task shader workgroup.

Group Count X Y Z must each be a 32-bit unsigned integer value. They configure the number of local workgroups in each respective dimensions for the launch of child mesh tasks. See Vulkan API specification for more detail.

Payload is an optional pointer to the payload structure to pass to the generated mesh shader invocations. Payload must be the result of an OpVariable with a storage class of TaskPayloadWorkgroupEXT.

The arguments are taken from the first invocation in each workgroup. Behaviour is undefined if any invocation terminates without executing this instruction, or if any invocation executes this instruction in non-uniform control flow.

This instruction also serves as an OpControlBarrier instruction, and also performs and adheres to the description and semantics of an OpControlBarrier instruction with the Execution and Memory operands set to Workgroup and the Semantics operand set to a combination of WorkgroupMemory and AcquireRelease.

Ceases all further processing: Only instructions executed before OpEmitMeshTasksEXT have observable side effects.

This instruction must be the last instruction in a block.

This instruction is only valid in the TaskEXT Execution Model.

Example:

spirv.EmitMeshTasksEXT %x, %y, %z : i32, i32, i32
spirv.EmitMeshTasksEXT %x, %x, %z, %payload : i32, i32, i32, !spirv.ptr<i32, TaskPayloadWorkgroupEXT>
OPERATION_NAME = 'spirv.EXT.EmitMeshTasks'
_ODS_REGIONS = (0, True)
group_count_x() _ods_ir
group_count_y() _ods_ir
group_count_z() _ods_ir
payload() _ods_ir | None
mlir.dialects._spirv_ops_gen.EXT_EmitMeshTasks(group_count_x, group_count_y, group_count_z, *, payload=None, loc=None, ip=None) EXTEmitMeshTasksOp
class mlir.dialects._spirv_ops_gen.EXTSetMeshOutputsOp(vertex_count, primitive_count, *, loc=None, ip=None)

Bases: _ods_ir

Vertex Count must be a 32-bit unsigned integer value. It defines the array size of per-vertex outputs.

Primitive Count must a 32-bit unsigned integer value. It defines the array size of per-primitive outputs.

The arguments are taken from the first invocation in each workgroup. Behavior is undefined if any invocation executes this instruction more than once or under non-uniform control flow. Behavior is undefined if there is any control flow path to an output write that is not preceded by this instruction.

This instruction is only valid in the MeshEXT Execution Model.

Example:

spirv.SetMeshOutputsEXT %vcount, %pcount : i32, i32
OPERATION_NAME = 'spirv.EXT.SetMeshOutputs'
_ODS_REGIONS = (0, True)
vertex_count() _ods_ir
primitive_count() _ods_ir
mlir.dialects._spirv_ops_gen.EXT_SetMeshOutputs(vertex_count, primitive_count, *, loc=None, ip=None) EXTSetMeshOutputsOp
class mlir.dialects._spirv_ops_gen.EXTSpecConstantCompositeReplicateOp(type_, sym_name, constituent, *, loc=None, ip=None)

Bases: _ods_ir

Represents a splat spec composite constant i.e., all elements of spec composite constant have the same value. The splat value must come from a symbol reference of spec constant instruction.

Example:

spirv.SpecConstant @sc_i32_1 = 1 : i32
spirv.EXT.SpecConstantCompositeReplicate @scc_splat_array_of_i32 (@sc_i32_1) : !spirv.array<3 x i32>
spirv.EXT.SpecConstantCompositeReplicate @scc_splat_struct_of_i32 (@sc_i32_1) : !spirv.struct<(i32, i32, i32)>
OPERATION_NAME = 'spirv.EXT.SpecConstantCompositeReplicate'
_ODS_REGIONS = (0, True)
type_() _ods_ir
sym_name() _ods_ir
constituent() _ods_ir
mlir.dialects._spirv_ops_gen.EXT_SpecConstantCompositeReplicate(type_, sym_name, constituent, *, loc=None, ip=None) EXTSpecConstantCompositeReplicateOp
class mlir.dialects._spirv_ops_gen.EmitVertexOp(*, loc=None, ip=None)

Bases: _ods_ir

This instruction must only be used when only one stream is present.

Example:

spirv.EmitVertex
OPERATION_NAME = 'spirv.EmitVertex'
_ODS_REGIONS = (0, True)
mlir.dialects._spirv_ops_gen.EmitVertex(*, loc=None, ip=None) EmitVertexOp
class mlir.dialects._spirv_ops_gen.EndPrimitiveOp(*, loc=None, ip=None)

Bases: _ods_ir

This instruction must only be used when only one stream is present.

Example:

spirv.EndPrimitive
OPERATION_NAME = 'spirv.EndPrimitive'
_ODS_REGIONS = (0, True)
mlir.dialects._spirv_ops_gen.EndPrimitive(*, loc=None, ip=None) EndPrimitiveOp
class mlir.dialects._spirv_ops_gen.EntryPointOp(execution_model, fn, interface, *, loc=None, ip=None)

Bases: _ods_ir

Execution Model is the execution model for the entry point and its static call tree. See Execution Model.

Entry Point must be the Result of an OpFunction instruction.

Name is a name string for the entry point. A module cannot have two OpEntryPoint instructions with the same Execution Model and the same Name string.

Interface is a list of symbol references to spirv.GlobalVariable operations. These declare the set of global variables from a module that form the interface of this entry point. The set of Interface symbols must be equal to or a superset of the ``spirv.GlobalVariable``s referenced by the entry point’s static call tree, within the interface’s storage classes. Before version 1.4, the interface’s storage classes are limited to the Input and Output storage classes. Starting with version 1.4, the interface’s storage classes are all storage classes used in declaring all global variables referenced by the entry point’s call tree.

execution-model ::= "Vertex" | "TesellationControl" |
                    <and other SPIR-V execution models...>

entry-point-op ::= ssa-id `=` `spirv.EntryPoint` execution-model
                   symbol-reference (`, ` symbol-reference)*

Example:

spirv.EntryPoint "GLCompute" @foo
spirv.EntryPoint "Kernel" @foo, @var1, @var2
OPERATION_NAME = 'spirv.EntryPoint'
_ODS_REGIONS = (0, True)
execution_model() _ods_ir
fn() _ods_ir
interface() _ods_ir
mlir.dialects._spirv_ops_gen.EntryPoint(execution_model, fn, interface, *, loc=None, ip=None) EntryPointOp
class mlir.dialects._spirv_ops_gen.ExecutionModeOp(fn, execution_mode, values, *, loc=None, ip=None)

Bases: _ods_ir

Entry Point must be the Entry Point operand of an OpEntryPoint instruction.

Mode is the execution mode. See Execution Mode.

This instruction is only valid when the Mode operand is an execution mode that takes no Extra Operands, or takes Extra Operands that are not

operands.

execution-mode ::= "Invocations" | "SpacingEqual" |
                   <and other SPIR-V execution modes...>

execution-mode-op ::= `spirv.ExecutionMode ` ssa-use execution-mode
                      (integer-literal (`, ` integer-literal)* )?

Example:

spirv.ExecutionMode @foo "ContractionOff"
spirv.ExecutionMode @bar "LocalSizeHint", 3, 4, 5
OPERATION_NAME = 'spirv.ExecutionMode'
_ODS_REGIONS = (0, True)
fn() _ods_ir
execution_mode() _ods_ir
values() _ods_ir
mlir.dialects._spirv_ops_gen.ExecutionMode(fn, execution_mode, values, *, loc=None, ip=None) ExecutionModeOp
class mlir.dialects._spirv_ops_gen.FAddOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type.

The types of Operand 1 and Operand 2 both must be the same as Result Type.

Results are computed per component.

Example:

%4 = spirv.FAdd %0, %1 : f32
%5 = spirv.FAdd %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FAdd'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FAdd(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FConvertOp(result, operand, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type.

Float Value must be a scalar or vector of floating-point type. It must have the same number of components as Result Type. The component width cannot equal the component width in Result Type.

Results are computed per component.

Example:

%1 = spirv.FConvertOp %0 : f32 to f64
%3 = spirv.FConvertOp %2 : vector<3xf32> to vector<3xf64>
OPERATION_NAME = 'spirv.FConvert'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FConvert(result, operand, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FDivOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type.

The types of Operand 1 and Operand 2 both must be the same as Result Type.

Results are computed per component. The resulting value is undefined if Operand 2 is 0.

Example:

%4 = spirv.FDiv %0, %1 : f32
%5 = spirv.FDiv %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FDiv'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FDiv(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FModOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type.

The types of Operand 1 and Operand 2 both must be the same as Result Type.

Results are computed per component. The resulting value is undefined if Operand 2 is 0. Otherwise, the result is the remainder r of Operand 1 divided by Operand 2 where if r ≠ 0, the sign of r is the same as the sign of Operand 2.

Example:

%4 = spirv.FMod %0, %1 : f32
%5 = spirv.FMod %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FMod'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FMod(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FMulOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type.

The types of Operand 1 and Operand 2 both must be the same as Result Type.

Results are computed per component.

Example:

%4 = spirv.FMul %0, %1 : f32
%5 = spirv.FMul %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FMul'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FMul(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FNegateOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type.

The type of Operand must be the same as Result Type.

Results are computed per component.

Example:

%1 = spirv.FNegate %0 : f32
%3 = spirv.FNegate %2 : vector<4xf32>
OPERATION_NAME = 'spirv.FNegate'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FNegate(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FOrdEqualOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of floating-point type. They must have the same type, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.FOrdEqual %0, %1 : f32
%5 = spirv.FOrdEqual %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FOrdEqual'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FOrdEqual(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FOrdGreaterThanEqualOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of floating-point type. They must have the same type, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.FOrdGreaterThanEqual %0, %1 : f32
%5 = spirv.FOrdGreaterThanEqual %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FOrdGreaterThanEqual'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FOrdGreaterThanEqual(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FOrdGreaterThanOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of floating-point type. They must have the same type, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.FOrdGreaterThan %0, %1 : f32
%5 = spirv.FOrdGreaterThan %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FOrdGreaterThan'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FOrdGreaterThan(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FOrdLessThanEqualOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of floating-point type. They must have the same type, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.FOrdLessThanEqual %0, %1 : f32
%5 = spirv.FOrdLessThanEqual %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FOrdLessThanEqual'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FOrdLessThanEqual(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FOrdLessThanOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of floating-point type. They must have the same type, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.FOrdLessThan %0, %1 : f32
%5 = spirv.FOrdLessThan %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FOrdLessThan'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FOrdLessThan(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FOrdNotEqualOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of floating-point type. They must have the same type, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.FOrdNotEqual %0, %1 : f32
%5 = spirv.FOrdNotEqual %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FOrdNotEqual'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FOrdNotEqual(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FRemOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type.

The types of Operand 1 and Operand 2 both must be the same as Result Type.

Results are computed per component. The resulting value is undefined if Operand 2 is 0. Otherwise, the result is the remainder r of Operand 1 divided by Operand 2 where if r ≠ 0, the sign of r is the same as the sign of Operand 1.

Example:

%4 = spirv.FRemOp %0, %1 : f32
%5 = spirv.FRemOp %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FRem'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FRem(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FSubOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type.

The types of Operand 1 and Operand 2 both must be the same as Result Type.

Results are computed per component.

Example:

%4 = spirv.FRemOp %0, %1 : f32
%5 = spirv.FRemOp %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FSub'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FSub(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FUnordEqualOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of floating-point type. They must have the same type, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.FUnordEqual %0, %1 : f32
%5 = spirv.FUnordEqual %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FUnordEqual'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FUnordEqual(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FUnordGreaterThanEqualOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of floating-point type. They must have the same type, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.FUnordGreaterThanEqual %0, %1 : f32
%5 = spirv.FUnordGreaterThanEqual %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FUnordGreaterThanEqual'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FUnordGreaterThanEqual(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FUnordGreaterThanOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of floating-point type. They must have the same type, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.FUnordGreaterThan %0, %1 : f32
%5 = spirv.FUnordGreaterThan %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FUnordGreaterThan'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FUnordGreaterThan(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FUnordLessThanEqualOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of floating-point type. They must have the same type, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.FUnordLessThanEqual %0, %1 : f32
%5 = spirv.FUnordLessThanEqual %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FUnordLessThanEqual'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FUnordLessThanEqual(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FUnordLessThanOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of floating-point type. They must have the same type, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.FUnordLessThan %0, %1 : f32
%5 = spirv.FUnordLessThan %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FUnordLessThan'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FUnordLessThan(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FUnordNotEqualOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of floating-point type. They must have the same type, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.FUnordNotEqual %0, %1 : f32
%5 = spirv.FUnordNotEqual %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.FUnordNotEqual'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.FUnordNotEqual(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.FuncOp(function_type, sym_name, function_control, *, arg_attrs=None, res_attrs=None, linkage_attributes=None, loc=None, ip=None)

Bases: _ods_ir

This op declares or defines a SPIR-V function using one region, which contains one or more blocks.

Different from the SPIR-V binary format, this op is not allowed to implicitly capture global values, and all external references must use function arguments or symbol references. This op itself defines a symbol that is unique in the enclosing module op.

This op itself takes no operands and generates no results. Its region can take zero or more arguments and return zero or one values.

From SPV_KHR_physical_storage_buffer: If a parameter of function is

  • a pointer (or contains a pointer) in the PhysicalStorageBuffer storage

class, the function parameter must be decorated with exactly one of Aliased or Restrict. * a pointer (or contains a pointer) and the type it points to is a pointer in the PhysicalStorageBuffer storage class, the function parameter must be decorated with exactly one of AliasedPointer or RestrictPointer.

spv-function-control ::= "None" | "Inline" | "DontInline" | ...
spv-function-op ::= `spirv.func` function-signature
                     spv-function-control region

Example:

spirv.func @foo() -> () "None" { ... }
spirv.func @bar() -> () "Inline|Pure" { ... }

spirv.func @aliased_pointer(%arg0: !spirv.ptr<i32, PhysicalStorageBuffer>,
    { spirv.decoration = #spirv.decoration<Aliased> }) -> () "None" { ... }

spirv.func @restrict_pointer(%arg0: !spirv.ptr<i32, PhysicalStorageBuffer>,
    { spirv.decoration = #spirv.decoration<Restrict> }) -> () "None" { ... }

spirv.func @aliased_pointee(%arg0: !spirv.ptr<!spirv.ptr<i32,
    PhysicalStorageBuffer>, Generic> { spirv.decoration =
    #spirv.decoration<AliasedPointer> }) -> () "None" { ... }

spirv.func @restrict_pointee(%arg0: !spirv.ptr<!spirv.ptr<i32,
    PhysicalStorageBuffer>, Generic> { spirv.decoration =
    #spirv.decoration<RestrictPointer> }) -> () "None" { ... }
OPERATION_NAME = 'spirv.func'
_ODS_REGIONS = (1, True)
function_type() _ods_ir
arg_attrs() _ods_ir | None
res_attrs() _ods_ir | None
sym_name() _ods_ir
function_control() _ods_ir
linkage_attributes() _ods_ir | None
body() _ods_ir
mlir.dialects._spirv_ops_gen.func(function_type, sym_name, function_control, *, arg_attrs=None, res_attrs=None, linkage_attributes=None, loc=None, ip=None) FuncOp
class mlir.dialects._spirv_ops_gen.FunctionCallOp(return_value, callee, arguments, *, arg_attrs=None, res_attrs=None, loc=None, ip=None)

Bases: _ods_ir

Result Type is the type of the return value of the function. It must be the same as the Return Type operand of the Function Type operand of the Function operand.

Function is an OpFunction instruction. This could be a forward reference.

Argument N is the object to copy to parameter N of Function.

Note: A forward call is possible because there is no missing type information: Result Type must match the Return Type of the function, and the calling argument types must match the formal parameter types.

Example:

spirv.FunctionCall @f_void(%arg0) : (i32) ->  ()
%0 = spirv.FunctionCall @f_iadd(%arg0, %arg1) : (i32, i32) -> i32
OPERATION_NAME = 'spirv.FunctionCall'
_ODS_REGIONS = (0, True)
arguments() _ods_ir
callee() _ods_ir
arg_attrs() _ods_ir | None
res_attrs() _ods_ir | None
return_value() _ods_ir | None
mlir.dialects._spirv_ops_gen.FunctionCall(return_value, callee, arguments, *, arg_attrs=None, res_attrs=None, loc=None, ip=None) _ods_ir | _ods_ir | FunctionCallOp
class mlir.dialects._spirv_ops_gen.GLAcosOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The standard trigonometric arc cosine of x radians.

Result is an angle, in radians, whose cosine is x. The range of result values is [0, π]. Result is undefined if abs x > 1.

The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Acos %0 : f32
%3 = spirv.GL.Acos %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Acos'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Acos(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLAcoshOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Arc hyperbolic cosine; result is the non-negative inverse of cosh. The resulting value is NaN if x < 1.

The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Acosh %0 : f32
%3 = spirv.GL.Acosh %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Acosh'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Acosh(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLAsinOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The standard trigonometric arc sine of x radians.

Result is an angle, in radians, whose sine is x. The range of result values is [-π / 2, π / 2]. Result is undefined if abs x > 1.

The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Asin %0 : f32
%3 = spirv.GL.Asin %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Asin'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Asin(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLAsinhOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Arc hyperbolic sine; result is the inverse of sinh.

The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Asinh %0 : f32
%3 = spirv.GL.Asinh %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Asinh'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Asinh(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLAtanOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The standard trigonometric arc tangent of x radians.

Result is an angle, in radians, whose tangent is y_over_x. The range of result values is [-π / 2, π / 2].

The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Atan %0 : f32
%3 = spirv.GL.Atan %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Atan'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Atan(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLAtanhOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Arc hyperbolic tangent; result is the inverse of tanh. The resulting value is NaN if abs x ≥ 1.

The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Atanh %0 : f32
%3 = spirv.GL.Atanh %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Atanh'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Atanh(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLCeilOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is the value equal to the nearest whole number that is greater than or equal to x.

The operand x must be a scalar or vector whose component type is floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Ceil %0 : f32
%3 = spirv.GL.Ceil %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Ceil'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Ceil(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLCosOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The standard trigonometric cosine of x radians.

The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Cos %0 : f32
%3 = spirv.GL.Cos %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Cos'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Cos(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLCoshOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Hyperbolic cosine of x radians.

The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Cosh %0 : f32
%3 = spirv.GL.Cosh %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Cosh'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Cosh(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLCrossOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is the cross product of x and y, i.e., the resulting components are, in order:

x[1] * y[2] - y[1] * x[2]

x[2] * y[0] - y[2] * x[0]

x[0] * y[1] - y[0] * x[1]

All the operands must be vectors of 3 components of a floating-point type.

Result Type and the type of all operands must be the same type.

Example:

%2 = spirv.GL.Cross %0, %1 : vector<3xf32>
%3 = spirv.GL.Cross %0, %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Cross'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Cross(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLDistanceOp(p0, p1, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is the distance between p0 and p1, i.e., length(p0 - p1).

The operands must all be a scalar or vector whose component type is floating-point.

Result Type must be a scalar of the same type as the component type of the operands.

Example:

%2 = spirv.GL.Distance %0, %1 : vector<3xf32>, vector<3xf32> -> f32
OPERATION_NAME = 'spirv.GL.Distance'
_ODS_REGIONS = (0, True)
p0() _ods_ir
p1() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Distance(p0, p1, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLExp2Op(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is 2 raised to the x power; 2**x.

exp2(Inf) = Inf.
exp2(-Inf) = +0.

The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Exp2 %0 : f32
%3 = spirv.GL.Exp2 %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Exp2'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Exp2(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLExpOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is the natural exponentiation of x; e^x.

The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.

Result Type and the type of x must be the same type. Results are computed per component.”;

Example:

%2 = spirv.GL.Exp %0 : f32
%3 = spirv.GL.Exp %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Exp'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Exp(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLFAbsOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is x if x >= 0; otherwise result is -x.

The operand x must be a scalar or vector whose component type is floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.FAbs %0 : f32
%3 = spirv.GL.FAbs %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.FAbs'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_FAbs(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLFClampOp(result, x, y, z, *, loc=None, ip=None)

Bases: _ods_ir

Result is min(max(x, minVal), maxVal). The resulting value is undefined if minVal > maxVal. The semantics used by min() and max() are those of FMin and FMax.

The operands must all be a scalar or vector whose component type is floating-point.

Result Type and the type of all operands must be the same type. Results are computed per component.

fclamp-op ::= ssa-id `=` `spirv.GL.FClamp` ssa-use, ssa-use, ssa-use `:`
           float-scalar-vector-type

Example:

%2 = spirv.GL.FClamp %x, %min, %max : f32
%3 = spirv.GL.FClamp %x, %min, %max : vector<3xf16>
OPERATION_NAME = 'spirv.GL.FClamp'
_ODS_REGIONS = (0, True)
x() _ods_ir
y() _ods_ir
z() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_FClamp(result, x, y, z, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLFMaxOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is y if x < y; otherwise result is x. Which operand is the result is undefined if one of the operands is a NaN.

The operands must all be a scalar or vector whose component type is floating-point.

Result Type and the type of all operands must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.FMax %0, %1 : f32
%3 = spirv.GL.FMax %0, %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.FMax'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_FMax(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLFMinOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is y if y < x; otherwise result is x. Which operand is the result is undefined if one of the operands is a NaN.

The operands must all be a scalar or vector whose component type is floating-point.

Result Type and the type of all operands must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.FMin %0, %1 : f32
%3 = spirv.GL.FMin %0, %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.FMin'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_FMin(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLFMixOp(x, y, a, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is the linear blend of x and y, i.e., x * (1 - a) + y * a.

The operands must all be a scalar or vector whose component type is floating-point.

Result Type and the type of all operands must be the same type. Results are computed per component.

Example:

%0 = spirv.GL.FMix %x : f32, %y : f32, %a : f32 -> f32
%0 = spirv.GL.FMix %x : vector<4xf32>, %y : vector<4xf32>, %a : vector<4xf32> -> vector<4xf32>
OPERATION_NAME = 'spirv.GL.FMix'
_ODS_REGIONS = (0, True)
x() _ods_ir
y() _ods_ir
a() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_FMix(x, y, a, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLFSignOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0.

The operand x must be a scalar or vector whose component type is floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.FSign %0 : f32
%3 = spirv.GL.FSign %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.FSign'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_FSign(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLFindILsbOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Results in the bit number of the least-significant 1-bit in the binary representation of Value. If Value is 0, the result is -1.

Result Type and the type of Value must both be integer scalar or integer vector types. Result Type and operand types must have the same number of components with the same component width. Results are computed per component.

OPERATION_NAME = 'spirv.GL.FindILsb'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_FindILsb(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLFindSMsbOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

For positive numbers, the result will be the bit number of the most significant 1-bit. For negative numbers, the result will be the bit number of the most significant 0-bit. For a Value of 0 or -1, the result is -1.

Result Type and the type of Value must both be integer scalar or integer vector types. Result Type and operand types must have the same number of components with the same component width. Results are computed per component.

This instruction is currently limited to 32-bit width components.

OPERATION_NAME = 'spirv.GL.FindSMsb'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_FindSMsb(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLFindUMsbOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Results in the bit number of the most-significant 1-bit in the binary representation of Value. If Value is 0, the result is -1.

Result Type and the type of Value must both be integer scalar or integer vector types. Result Type and operand types must have the same number of components with the same component width. Results are computed per component.

This instruction is currently limited to 32-bit width components.

OPERATION_NAME = 'spirv.GL.FindUMsb'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_FindUMsb(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLFloorOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is the value equal to the nearest whole number that is less than or equal to x.

The operand x must be a scalar or vector whose component type is floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Floor %0 : f32
%3 = spirv.GL.Floor %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Floor'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Floor(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLFmaOp(result, x, y, z, *, loc=None, ip=None)

Bases: _ods_ir

In uses where this operation is decorated with NoContraction:

  • fma is considered a single operation, whereas the expression a * b + c

is considered two operations. * The precision of fma can differ from the precision of the expression a * b + c. * fma will be computed with the same precision as any other fma decorated with NoContraction, giving invariant results for the same input values of a, b, and c.

Otherwise, in the absence of a NoContraction decoration, there are no special constraints on the number of operations or difference in precision between fma and the expression a * b +c.

The operands must all be a scalar or vector whose component type is floating-point.

Result Type and the type of all operands must be the same type. Results are computed per component.

fma-op ::= ssa-id `=` `spirv.GL.Fma` ssa-use, ssa-use, ssa-use `:`
           float-scalar-vector-type

Example:

%0 = spirv.GL.Fma %a, %b, %c : f32
%1 = spirv.GL.Fma %a, %b, %c : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Fma'
_ODS_REGIONS = (0, True)
x() _ods_ir
y() _ods_ir
z() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Fma(result, x, y, z, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLFractOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is:

fract(x) = x - floor(x)
fract(±0) = +0
fract(±Inf) = NaN

The operand x must be a scalar or vector whose component type is floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%result = spirv.GL.Sqrt %x : f32
%result = spirv.GL.Sqrt %x : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Fract'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Fract(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLFrexpStructOp(result, operand, *, loc=None, ip=None)

Bases: _ods_ir

Result is a structure containing x split into a floating-point significand in the range (-1.0, 0.5] or [0.5, 1.0) and an integral exponent of 2, such that:

x = significand * 2^exponent

If x is a zero, the exponent is 0.0. If x is an infinity or a NaN, the exponent is undefined. If x is 0.0, the significand is 0.0. If x is -0.0, the significand is -0.0

Result Type must be an OpTypeStruct with two members. Member 0 must have the same type as the type of x. Member 0 holds the significand. Member 1 must be a scalar or vector with integer component type, with 32-bit component width. Member 1 holds the exponent. These two members and x must have the same number of components.

The operand x must be a scalar or vector whose component type is floating-point.

Example:

%2 = spirv.GL.FrexpStruct %0 : f32 -> !spirv.struct<f32, i32>
%3 = spirv.GL.FrexpStruct %0 : vector<3xf32> -> !spirv.struct<vector<3xf32>, vector<3xi32>>
OPERATION_NAME = 'spirv.GL.FrexpStruct'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_FrexpStruct(result, operand, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLInverseSqrtOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is the reciprocal of sqrt x. Result is undefined if x <= 0.

The operand x must be a scalar or vector whose component type is floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.InverseSqrt %0 : f32
%3 = spirv.GL.InverseSqrt %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.InverseSqrt'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_InverseSqrt(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLLdexpOp(x, exp, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Builds a floating-point number from x and the corresponding integral exponent of two in exp:

significand * 2^exponent

If this product is too large to be represented in the floating-point type, the resulting value is undefined. If exp is greater than +128 (single precision) or +1024 (double precision), the resulting value is undefined. If exp is less than -126 (single precision) or -1022 (double precision), the result may be flushed to zero. Additionally, splitting the value into a significand and exponent using frexp and then reconstructing a floating-point value using ldexp should yield the original input for zero and all finite non-denormalized values.

The operand x must be a scalar or vector whose component type is floating-point.

The exp operand must be a scalar or vector with integer component type. The number of components in x and exp must be the same.

Result Type must be the same type as the type of x. Results are computed per component.

Example:

%y = spirv.GL.Ldexp %x : f32, %exp : i32 -> f32
%y = spirv.GL.Ldexp %x : vector<3xf32>, %exp : vector<3xi32> -> vector<3xf32>
OPERATION_NAME = 'spirv.GL.Ldexp'
_ODS_REGIONS = (0, True)
x() _ods_ir
exp() _ods_ir
y() _ods_ir
mlir.dialects._spirv_ops_gen.GL_Ldexp(x, exp, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLLengthOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is the length of vector x, i.e., sqrt(x[0]**2 + x[1]**2 + …).

The operand x must be a scalar or vector whose component type is floating-point.

Result Type must be a scalar of the same type as the component type of x.

Example:

%2 = spirv.GL.Length %0 : vector<3xf32> -> f32
%3 = spirv.GL.Length %1 : f32 -> f32
OPERATION_NAME = 'spirv.GL.Length'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Length(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLLog2Op(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is the base-2 logarithm of x, i.e., the value y which satisfies the equation x = 2**y. The resulting value is NaN if x < 0. Moreover:

log(Inf) = Inf
log(1.0) = +0
log(±0) = -Inf

The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Log2 %0 : f32
%3 = spirv.GL.Log2 %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Log2'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Log2(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLLogOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is the natural logarithm of x, i.e., the value y which satisfies the equation x = ey. Result is undefined if x <= 0.

The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Log %0 : f32
%3 = spirv.GL.Log %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Log'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Log(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLNormalizeOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is the vector in the same direction as x but with a length of 1.

The operand x must be a scalar or vector whose component type is floating-point.

Result Type and the type of x must be the same type.

Example:

%2 = spirv.GL.Normalize %0 : vector<3xf32>
%3 = spirv.GL.Normalize %1 : vector<4xf16>
OPERATION_NAME = 'spirv.GL.Normalize'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Normalize(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLPackHalf2x16Op(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is the unsigned integer obtained by converting the components of a two-component floating-point vector to the 16-bit OpTypeFloat, and then packing these two 16-bit integers into a 32-bit unsigned integer. The first vector component specifies the 16 least-significant bits of the result; the second component specifies the 16 most-significant bits.

The RelaxedPrecision Decoration only affects the conversion step of the instruction.

The v operand must be a vector of 2 components whose type is a 32-bit floating-point.

Result Type must be a 32-bit integer type.

Example:

%1 = spirv.GL.PackHalf2x16 %0 : vector<2xf32> -> i32
OPERATION_NAME = 'spirv.GL.PackHalf2x16'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_PackHalf2x16(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLPowOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is x raised to the y power; x^y.

Result is undefined if x = 0 and y ≤ 0.

The operand x and y must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.

Result Type and the type of all operands must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Pow %0, %1 : f32
%3 = spirv.GL.Pow %0, %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Pow'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Pow(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLReflectOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

For the incident vector I and surface orientation N, the result is the reflection direction:

I - 2 * dot(N, I) * N

N must already be normalized in order to achieve the desired result.

The operands must all be a scalar or vector whose component type is floating-point.

Result Type and the type of all operands must be the same type.

Example:

%2 = spirv.GL.Reflect %0, %1 : f32
%3 = spirv.GL.Reflect %0, %1 : vector<3xf32>
OPERATION_NAME = 'spirv.GL.Reflect'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Reflect(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLRoundEvenOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is the value equal to the nearest whole number to x. A fractional part of 0.5 will round toward the nearest even whole number. (Both 3.5 and 4.5 for x will be 4.0.)

The operand x must be a scalar or vector whose component type is floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.RoundEven %0 : f32
%3 = spirv.GL.RoundEven %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.RoundEven'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_RoundEven(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLRoundOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is the value equal to the nearest whole number to x. The fraction 0.5 will round in a direction chosen by the implementation, presumably the direction that is fastest. This includes the possibility that Round x is the same value as RoundEven x for all values of x.

The operand x must be a scalar or vector whose component type is floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Round %0 : f32
%3 = spirv.GL.Round %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Round'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Round(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLSAbsOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is x if x ≥ 0; otherwise result is -x, where x is interpreted as a signed integer.

Result Type and the type of x must both be integer scalar or integer vector types. Result Type and operand types must have the same number of components with the same component width. Results are computed per component.

Example:

%2 = spirv.GL.SAbs %0 : i32
%3 = spirv.GL.SAbs %1 : vector<3xi16>
OPERATION_NAME = 'spirv.GL.SAbs'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_SAbs(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLSClampOp(result, x, y, z, *, loc=None, ip=None)

Bases: _ods_ir

Result is min(max(x, minVal), maxVal), where x, minVal and maxVal are interpreted as signed integers. The resulting value is undefined if minVal > maxVal.

Result Type and the type of the operands must both be integer scalar or integer vector types. Result Type and operand types must have the same number of components with the same component width. Results are computed per component.

uclamp-op ::= ssa-id `=` `spirv.GL.UClamp` ssa-use, ssa-use, ssa-use `:`
           sgined-scalar-vector-type

Example:

%2 = spirv.GL.SClamp %x, %min, %max : si32
%3 = spirv.GL.SClamp %x, %min, %max : vector<3xsi16>
OPERATION_NAME = 'spirv.GL.SClamp'
_ODS_REGIONS = (0, True)
x() _ods_ir
y() _ods_ir
z() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_SClamp(result, x, y, z, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLSMaxOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is y if x < y; otherwise result is x, where x and y are interpreted as signed integers.

Result Type and the type of x and y must both be integer scalar or integer vector types. Result Type and operand types must have the same number of components with the same component width. Results are computed per component.

Example:

%2 = spirv.GL.SMax %0, %1 : i32
%3 = spirv.GL.SMax %0, %1 : vector<3xi16>
OPERATION_NAME = 'spirv.GL.SMax'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_SMax(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLSMinOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is y if y < x; otherwise result is x, where x and y are interpreted as signed integers.

Result Type and the type of x and y must both be integer scalar or integer vector types. Result Type and operand types must have the same number of components with the same component width. Results are computed per component.

Example:

%2 = spirv.GL.SMin %0, %1 : i32
%3 = spirv.GL.SMin %0, %1 : vector<3xi16>
OPERATION_NAME = 'spirv.GL.SMin'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_SMin(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLSSignOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is 1 if x > 0, 0 if x = 0, or -1 if x < 0, where x is interpreted as a signed integer.

Result Type and the type of x must both be integer scalar or integer vector types. Result Type and operand types must have the same number of components with the same component width. Results are computed per component.

Example:

%2 = spirv.GL.SSign %0 : i32
%3 = spirv.GL.SSign %1 : vector<3xi16>
OPERATION_NAME = 'spirv.GL.SSign'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_SSign(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLSinOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The standard trigonometric sine of x radians.

The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Sin %0 : f32
%3 = spirv.GL.Sin %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Sin'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Sin(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLSinhOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Hyperbolic sine of x radians.

The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Sinh %0 : f32
%3 = spirv.GL.Sinh %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Sinh'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Sinh(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLSqrtOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is the square root of x. Result is undefined if x < 0.

The operand x must be a scalar or vector whose component type is floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Sqrt %0 : f32
%3 = spirv.GL.Sqrt %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Sqrt'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Sqrt(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLTanOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The standard trigonometric tangent of x radians.

The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Tan %0 : f32
%3 = spirv.GL.Tan %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Tan'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Tan(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLTanhOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Hyperbolic tangent of x radians.

The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.

Result Type and the type of x must be the same type. Results are computed per component.

Example:

%2 = spirv.GL.Tanh %0 : f32
%3 = spirv.GL.Tanh %1 : vector<3xf16>
OPERATION_NAME = 'spirv.GL.Tanh'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_Tanh(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLUClampOp(result, x, y, z, *, loc=None, ip=None)

Bases: _ods_ir

Result is min(max(x, minVal), maxVal), where x, minVal and maxVal are interpreted as unsigned integers. The resulting value is undefined if minVal > maxVal.

Result Type and the type of the operands must both be integer scalar or integer vector types. Result Type and operand types must have the same number of components with the same component width. Results are computed per component.

uclamp-op ::= ssa-id `=` `spirv.GL.UClamp` ssa-use, ssa-use, ssa-use `:`
           unsigned-signless-scalar-vector-type

Example:

%2 = spirv.GL.UClamp %x, %min, %max : i32
%3 = spirv.GL.UClamp %x, %min, %max : vector<3xui16>
OPERATION_NAME = 'spirv.GL.UClamp'
_ODS_REGIONS = (0, True)
x() _ods_ir
y() _ods_ir
z() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_UClamp(result, x, y, z, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLUMaxOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is y if x < y; otherwise result is x, where x and y are interpreted as unsigned integers.

Result Type and the type of x and y must both be integer scalar or integer vector types. Result Type and operand types must have the same number of components with the same component width. Results are computed per component.

Example:

%2 = spirv.GL.UMax %0, %1 : i32
%3 = spirv.GL.UMax %0, %1 : vector<3xi16>
OPERATION_NAME = 'spirv.GL.UMax'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_UMax(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLUMinOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result is y if y < x; otherwise result is x, where x and y are interpreted as unsigned integers.

Result Type and the type of x and y must both be integer scalar or integer vector types. Result Type and operand types must have the same number of components with the same component width. Results are computed per component.

Example:

%2 = spirv.GL.UMin %0, %1 : i32
%3 = spirv.GL.UMin %0, %1 : vector<3xi16>
OPERATION_NAME = 'spirv.GL.UMin'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_UMin(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GLUnpackHalf2x16Op(result, operand, *, loc=None, ip=None)

Bases: _ods_ir

Result is the two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values, interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification, and converting them to 32-bit floating-point values. Subnormal numbers are either preserved or flushed to zero, consistently within an implementation.

The first component of the vector is obtained from the 16 least-significant bits of v; the second component is obtained from the 16 most-significant bits of v.

The RelaxedPrecision Decoration only affects the conversion step of the instruction.

The v operand must be a scalar with 32-bit integer type.

Result Type must be a vector of 2 components whose type is 32-bit floating point.

Example:

%1 = spirv.GL.UnpackHalf2x16 %0 : i32 -> vector<2xf32>
OPERATION_NAME = 'spirv.GL.UnpackHalf2x16'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GL_UnpackHalf2x16(result, operand, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GenericCastToPtrExplicitOp(result, pointer, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be an OpTypePointer. Its Storage Class must be Storage.

Pointer must have a type of OpTypePointer whose Type is the same as the Type of Result Type.Pointer must point to the Generic Storage Class. If the cast fails, the instruction result is an OpConstantNull pointer in the Storage Storage Class.

Storage must be one of the following literal values from Storage Class: Workgroup, CrossWorkgroup, or Function.

Example:

%1 = spirv.GenericCastToPtrExplicitOp %0 : !spirv.ptr<f32, Generic> to
!spirv.ptr<f32, CrossWorkGroup>
OPERATION_NAME = 'spirv.GenericCastToPtrExplicit'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GenericCastToPtrExplicit(result, pointer, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GenericCastToPtrOp(result, pointer, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be an OpTypePointer. Its Storage Class must be Workgroup, CrossWorkgroup, or Function.

Pointer must point to the Generic Storage Class.

Result Type and Pointer must point to the same type.

Example:

%1 = spirv.GenericCastToPtrOp %0 : !spirv.ptr<f32, Generic> to
!spirv.ptr<f32, CrossWorkGroup>
OPERATION_NAME = 'spirv.GenericCastToPtr'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GenericCastToPtr(result, pointer, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GlobalVariableOp(type_, sym_name, *, initializer=None, location=None, binding=None, descriptor_set=None, built_in=None, linkage_attributes=None, loc=None, ip=None)

Bases: _ods_ir

The variable type must be an OpTypePointer. Its type operand is the type of object in memory.

Storage Class is the Storage Class of the memory holding the object. It cannot be Generic. It must be the same as the Storage Class operand of the variable types. Only those storage classes that are valid at module scope (like Input, Output, StorageBuffer, etc.) are valid.

Initializer is optional. If Initializer is present, it will be the initial value of the variable’s memory content. Initializer must be an symbol defined from a constant instruction or other spirv.GlobalVariable operation in module scope. Initializer must have the same type as the type of the defined symbol.

variable-op ::= `spirv.GlobalVariable` spirv-type symbol-ref-id
                (`initializer(` symbol-ref-id `)`)?
                (`bind(` integer-literal, integer-literal `)`)?
                (`built_in(` string-literal `)`)?
                attribute-dict?

where initializer specifies initializer and bind specifies the descriptor set and binding number. built_in specifies SPIR-V BuiltIn decoration associated with the op.

Example:

spirv.GlobalVariable @var0 : !spirv.ptr<f32, Input> @var0
spirv.GlobalVariable @var1 initializer(@var0) : !spirv.ptr<f32, Output>
spirv.GlobalVariable @var2 bind(1, 2) : !spirv.ptr<f32, Uniform>
spirv.GlobalVariable @var3 built_in("GlobalInvocationId") : !spirv.ptr<vector<3xi32>, Input>
OPERATION_NAME = 'spirv.GlobalVariable'
_ODS_REGIONS = (0, True)
type_() _ods_ir
sym_name() _ods_ir
initializer() _ods_ir | None
location() _ods_ir | None

Returns the source location the operation was defined or derived from.

binding() _ods_ir | None
descriptor_set() _ods_ir | None
built_in() _ods_ir | None
linkage_attributes() _ods_ir | None
mlir.dialects._spirv_ops_gen.GlobalVariable(type_, sym_name, *, initializer=None, location=None, binding=None, descriptor_set=None, built_in=None, linkage_attributes=None, loc=None, ip=None) GlobalVariableOp
class mlir.dialects._spirv_ops_gen.GraphARMOp(function_type, sym_name, *, arg_attrs=None, res_attrs=None, entry_point=None, loc=None, ip=None)

Bases: _ods_ir

This op declares or defines a SPIR-V graph using one region, which contains one or more blocks.

This op is not allowed to implicitly capture global values, and all external references must use function arguments or symbol references. This op itself defines a symbol that is unique in the enclosing module op.

Note that this op does not have a 1:1 mapping to the SPIR-V ops representing a graph. Indeed during serialization a single GraphARMOp is serialized into several different SPIR-V ops: OpGraphARM, OpGraphInputARM and OpGraphEndARM. There are as many occurences of OpGraphInputARM ops as many inputs in the graph. Deserialization maps that set of operations into a single GraphARMOp.

This op itself takes no operands and generates no results. Its region can take zero or more arguments and return one or more values.

spv-graph-arm-op ::= `spirv.ARM.Graph` function-signature
                    region

Example:

spirv.ARM.Graph @graph(%arg0: !spirv.arm.tensor<14x19xi16>) -> !spirv.arm.tensor<14x19xi16> {
    spirv.ARM.GraphOutputs %arg0 : !spirv.arm.tensor<14x19xi16>
}
OPERATION_NAME = 'spirv.ARM.Graph'
_ODS_REGIONS = (1, True)
function_type() _ods_ir
arg_attrs() _ods_ir | None
res_attrs() _ods_ir | None
entry_point() _ods_ir | None
sym_name() _ods_ir
body() _ods_ir
mlir.dialects._spirv_ops_gen.ARM_Graph(function_type, sym_name, *, arg_attrs=None, res_attrs=None, entry_point=None, loc=None, ip=None) GraphARMOp
class mlir.dialects._spirv_ops_gen.GraphConstantARMOp(output, graph_constant_id, *, loc=None, ip=None)

Bases: _ods_ir

Declare a graph constant. Result Type must be an OpTypeTensorARM. GraphConstantID must be a 32-bit integer literal.

Example:

%0 = spirv.ARM.GraphConstant { graph_constant_id = 42 : i32 } : !spirv.arm.tensor<2x3xi16>

GraphConstantID is a unique identifier which is use to map the contants defined by GraphConstantARM in the SPIRV module with the one provided at shader creation time via the VkDataGraphPipelineShaderModuleCreateInfoARM. That Vulkan structure provides a list of VkDataGraphPipelineConstantARM which contains the bindings from id to data. (For more details see https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#graphs)

OPERATION_NAME = 'spirv.ARM.GraphConstant'
_ODS_REGIONS = (0, True)
graph_constant_id() _ods_ir
output() _ods_ir
mlir.dialects._spirv_ops_gen.ARM_GraphConstant(output, graph_constant_id, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GraphEntryPointARMOp(fn, interface, *, loc=None, ip=None)

Bases: _ods_ir

Graph Entry Point must be the Result of an OpGraphARM instruction.

Name is a name string for the graphentry point. A module cannot have two OpGraphEntryPointARM instructions with the same Name string.

Interface is a list of symbol references to spirv.GlobalVariable operations. These declare the set of global variables from a module that form the interface of this entry point. The set of Interface symbols must be equal to or a superset of the ``spirv.GlobalVariable``s referenced by the entry point’s static call tree, within the interface’s storage classes.

Example:

spirv.GlobalVariable @arg_0 bind(0, 0) : !spirv.ptr<!spirv.arm.tensor<14x19xi16>, UniformConstant>
spirv.GlobalVariable @res_0 bind(0, 1) : !spirv.ptr<!spirv.arm.tensor<14x19xi16>, UniformConstant>
spirv.ARM.GraphEntryPoint @graph, @arg_0, @res_0
spirv.ARM.Graph @graph(%arg0 : !spirv.arm.tensor<14x19xi16>) -> !spirv.arm.tensor<14x19xi16> {
    ...
}
OPERATION_NAME = 'spirv.ARM.GraphEntryPoint'
_ODS_REGIONS = (0, True)
fn() _ods_ir
interface() _ods_ir
mlir.dialects._spirv_ops_gen.ARM_GraphEntryPoint(fn, interface, *, loc=None, ip=None) GraphEntryPointARMOp
class mlir.dialects._spirv_ops_gen.GraphOutputsARMOp(value, *, loc=None, ip=None)

Bases: _ods_ir

Values are the graph outputs values and must match the GraphOutputs Type operand of the OpTypeGraphARM type of the OpGraphARM body this instruction is in.

This instruction must be the last instruction in a block.

Example:

spirv.ARM.Graph @graph(%arg0 : !spirv.arm.tensor<14x19xi16>) -> !spirv.arm.tensor<14x19xi16> {
    spirv.ARM.GraphOutputs %arg0 : !spirv.arm.tensor<14x19xi16>
}
OPERATION_NAME = 'spirv.ARM.GraphOutputs'
_ODS_REGIONS = (0, True)
value() _ods_ir
mlir.dialects._spirv_ops_gen.ARM_GraphOutputs(value, *, loc=None, ip=None) GraphOutputsARMOp
class mlir.dialects._spirv_ops_gen.GroupBroadcastOp(execution_scope, value, localid, *, results=None, loc=None, ip=None)

Bases: _ods_ir

All invocations of this module within Execution must reach this point of execution.

Behavior is undefined if this instruction is used in control flow that is non-uniform within Execution.

Result Type must be a scalar or vector of floating-point type, integer type, or Boolean type.

Execution must be Workgroup or Subgroup Scope.

The type of Value must be the same as Result Type.

LocalId must be an integer datatype. It can be a scalar, or a vector with 2 components or a vector with 3 components. LocalId must be the same for all invocations in the group.

Example:

%scalar_value = ... : f32
%vector_value = ... : vector<4xf32>
%scalar_localid = ... : i32
%vector_localid = ... : vector<3xi32>
%0 = spirv.GroupBroadcast "Subgroup" %scalar_value, %scalar_localid : f32, i32
%1 = spirv.GroupBroadcast "Workgroup" %vector_value, %vector_localid :
  vector<4xf32>, vector<3xi32>
OPERATION_NAME = 'spirv.GroupBroadcast'
_ODS_REGIONS = (0, True)
value() _ods_ir
localid() _ods_ir
execution_scope() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupBroadcast(execution_scope, value, localid, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupFAddOp(execution_scope, group_operation, x, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Behavior is undefined if not all invocations of this module within Execution reach this point of execution.

Behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction.

Result Type must be a scalar or vector of floating-point type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is 0.

The type of X must be the same as Result Type.

Example:

%0 = spirv.GroupFAdd <Workgroup> <Reduce> %value : f32
OPERATION_NAME = 'spirv.GroupFAdd'
_ODS_REGIONS = (0, True)
x() _ods_ir
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupFAdd(execution_scope, group_operation, x, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupFMaxOp(execution_scope, group_operation, x, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Behavior is undefined if not all invocations of this module within Execution reach this point of execution.

Behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction.

Result Type must be a scalar or vector of floating-point type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is -INF.

The type of X must be the same as Result Type.

Example:

%0 = spirv.GroupFMax <Workgroup> <Reduce> %value : f32
OPERATION_NAME = 'spirv.GroupFMax'
_ODS_REGIONS = (0, True)
x() _ods_ir
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupFMax(execution_scope, group_operation, x, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupFMinOp(execution_scope, group_operation, x, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Behavior is undefined if not all invocations of this module within Execution reach this point of execution.

Behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction.

Result Type must be a scalar or vector of floating-point type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is +INF.

The type of X must be the same as Result Type.

Example:

%0 = spirv.GroupFMin <Workgroup> <Reduce> %value : f32
OPERATION_NAME = 'spirv.GroupFMin'
_ODS_REGIONS = (0, True)
x() _ods_ir
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupFMin(execution_scope, group_operation, x, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupFMulKHROp(execution_scope, group_operation, x, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Behavior is undefined if not all invocations of this module within ‘Execution’ reach this point of execution.

Behavior is undefined unless all invocations within ‘Execution’ execute the same dynamic instance of this instruction.

‘Result Type’ must be a scalar or vector of floating-point type.

‘Execution’ is a Scope. It must be either Workgroup or Subgroup.

The identity I for ‘Operation’ is 1.

The type of ‘X’ must be the same as ‘Result Type’.

Example:

%0 = spirv.KHR.GroupFMul <Workgroup> <Reduce> %value : f32
OPERATION_NAME = 'spirv.KHR.GroupFMul'
_ODS_REGIONS = (0, True)
x() _ods_ir
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.KHR_GroupFMul(execution_scope, group_operation, x, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupIAddOp(execution_scope, group_operation, x, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Behavior is undefined if not all invocations of this module within Execution reach this point of execution.

Behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction.

Result Type must be a scalar or vector of integer type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is 0.

The type of X must be the same as Result Type.

Example:

%0 = spirv.GroupIAdd <Workgroup> <Reduce> %value : i32
OPERATION_NAME = 'spirv.GroupIAdd'
_ODS_REGIONS = (0, True)
x() _ods_ir
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupIAdd(execution_scope, group_operation, x, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupIMulKHROp(execution_scope, group_operation, x, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Behavior is undefined if not all invocations of this module within ‘Execution’ reach this point of execution.

Behavior is undefined unless all invocations within ‘Execution’ execute the same dynamic instance of this instruction.

‘Result Type’ must be a scalar or vector of integer type.

‘Execution’ is a Scope. It must be either Workgroup or Subgroup.

The identity I for ‘Operation’ is 1.

The type of ‘X’ must be the same as ‘Result Type’.

Example:

%0 = spirv.KHR.GroupIMul <Workgroup> <Reduce> %value : i32
OPERATION_NAME = 'spirv.KHR.GroupIMul'
_ODS_REGIONS = (0, True)
x() _ods_ir
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.KHR_GroupIMul(execution_scope, group_operation, x, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformAllEqualOp(execution_scope, value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a Boolean type.

Execution is the scope defining the scope restricted tangle affected by this command. It must be Subgroup.

Value must be a scalar or vector of floating-point type, integer type, or Boolean type. The compare operation is based on this type, and if it is a floating-point type, an ordered-and-equal compare is used.

An invocation will not execute a dynamic instance of this instruction (X’) until all invocations in its scope restricted tangle have executed all dynamic instances that are program-ordered before X’.

Example:

%scalar_value = ... : f32
%vector_value = ... : vector<4xf32>
%0 = spirv.GroupNonUniformAllEqual <Subgroup> %scalar_value : f32, i1
%1 = spirv.GroupNonUniformAllEqual <Subgroup> %vector_value : vector<4xf32>, i1
OPERATION_NAME = 'spirv.GroupNonUniformAllEqual'
_ODS_REGIONS = (0, True)
value() _ods_ir
execution_scope() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformAllEqual(execution_scope, value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformAllOp(execution_scope, predicate, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a Boolean type.

Execution is the scope defining the scope restricted tangle affected by this command. It must be Subgroup.

Predicate must be a Boolean type.

An invocation will not execute a dynamic instance of this instruction (X’) until all invocations in its scope restricted tangle have executed all dynamic instances that are program-ordered before X’.

Example:

%predicate = ... : i1
%0 = spirv.GroupNonUniformAll "Subgroup" %predicate : i1
OPERATION_NAME = 'spirv.GroupNonUniformAll'
_ODS_REGIONS = (0, True)
predicate() _ods_ir
execution_scope() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformAll(execution_scope, predicate, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformAnyOp(execution_scope, predicate, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a Boolean type.

Execution is the scope defining the scope restricted tangle affected by this command. It must be Subgroup.

Predicate must be a Boolean type.

An invocation will not execute a dynamic instance of this instruction (X’) until all invocations in its scope restricted tangle have executed all dynamic instances that are program-ordered before X’.

Example:

%predicate = ... : i1
%0 = spirv.GroupNonUniformAny "Subgroup" %predicate : i1
OPERATION_NAME = 'spirv.GroupNonUniformAny'
_ODS_REGIONS = (0, True)
predicate() _ods_ir
execution_scope() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformAny(execution_scope, predicate, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformBallotBitCountOp(result, execution_scope, group_operation, value, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar of integer type, whose Signedness operand is 0.

Execution is the scope defining the scope restricted tangle affected by this command. It must be Subgroup.

The identity I for Operation is 0.

Value must be a vector of four components of integer type scalar, whose Width operand is 32 and whose Signedness operand is 0.

Value is a set of bitfields where the first invocation is represented in the lowest bit of the first vector component and the last (up to the size of the scope) is the higher bit number of the last bitmask needed to represent all bits of the invocations in the scope restricted tangle.

An invocation will not execute a dynamic instance of this instruction (X’) until all invocations in its scope restricted tangle have executed all dynamic instances that are program-ordered before X’.

Example:

%count = spirv.GroupNonUniformBallotBitCount <Subgroup> <Reduce> %val : vector<4xi32> -> i32
OPERATION_NAME = 'spirv.GroupNonUniformBallotBitCount'
_ODS_REGIONS = (0, True)
value() _ods_ir
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformBallotBitCount(result, execution_scope, group_operation, value, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformBallotFindLSBOp(result, execution_scope, value, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar of integer type, whose Signedness operand is 0.

Execution is a Scope that identifies the group of invocations affected by this command. It must be Subgroup.

Value must be a vector of four components of integer type scalar, whose Width operand is 32 and whose Signedness operand is 0.

Value is a set of bitfields where the first invocation is represented in the lowest bit of the first vector component and the last (up to the size of the group) is the higher bit number of the last bitmask needed to represent all bits of the group invocations.

Example:

%vector = ... : vector<4xi32>
%0 = spirv.GroupNonUniformBallotFindLSB <Subgroup> %vector : vector<4xi32>, i32
OPERATION_NAME = 'spirv.GroupNonUniformBallotFindLSB'
_ODS_REGIONS = (0, True)
value() _ods_ir
execution_scope() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformBallotFindLSB(result, execution_scope, value, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformBallotFindMSBOp(result, execution_scope, value, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar of integer type, whose Signedness operand is 0.

Execution is a Scope that identifies the group of invocations affected by this command. It must be Subgroup.

Value must be a vector of four components of integer type scalar, whose Width operand is 32 and whose Signedness operand is 0.

Value is a set of bitfields where the first invocation is represented in the lowest bit of the first vector component and the last (up to the size of the group) is the higher bit number of the last bitmask needed to represent all bits of the group invocations.

Example:

%vector = ... : vector<4xi32>
%0 = spirv.GroupNonUniformBallotFindMSB <Subgroup> %vector : vector<4xi32>, i32
OPERATION_NAME = 'spirv.GroupNonUniformBallotFindMSB'
_ODS_REGIONS = (0, True)
value() _ods_ir
execution_scope() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformBallotFindMSB(result, execution_scope, value, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformBallotOp(result, execution_scope, predicate, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a vector of four components of integer type scalar, whose Signedness operand is 0.

Result is a set of bitfields where the first invocation is represented in the lowest bit of the first vector component and the last (up to the size of the group) is the higher bit number of the last bitmask needed to represent all bits of the group invocations.

Execution must be Workgroup or Subgroup Scope.

Predicate must be a Boolean type.

Example:

%0 = spirv.GroupNonUniformBallot <Subgroup> %predicate : vector<4xi32>
OPERATION_NAME = 'spirv.GroupNonUniformBallot'
_ODS_REGIONS = (0, True)
predicate() _ods_ir
execution_scope() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformBallot(result, execution_scope, predicate, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformBitwiseAndOp(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is ~0. If Operation is ClusteredReduce, ClusterSize must be present.

The type of Value must be the same as Result Type.

ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. ClusterSize must be at least 1, and must be a power of 2. If ClusterSize is greater than the declared SubGroupSize, executing this instruction results in undefined behavior.

Example:

%four = spirv.Constant 4 : i32
%scalar = ... : i32
%vector = ... : vector<4xi32>
%0 = spirv.GroupNonUniformBitwiseAnd <Workgroup> <Reduce> %scalar : i32 -> i32
%1 = spirv.GroupNonUniformBitwiseAnd <Subgroup> <ClusteredReduce>
       %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>
OPERATION_NAME = 'spirv.GroupNonUniformBitwiseAnd'
_ODS_REGIONS = (0, True)
value() _ods_ir
cluster_size() _ods_ir | None
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformBitwiseAnd(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformBitwiseOrOp(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is 0. If Operation is ClusteredReduce, ClusterSize must be present.

The type of Value must be the same as Result Type.

ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. ClusterSize must be at least 1, and must be a power of 2. If ClusterSize is greater than the declared SubGroupSize, executing this instruction results in undefined behavior.

Example:

%four = spirv.Constant 4 : i32
%scalar = ... : i32
%vector = ... : vector<4xi32>
%0 = spirv.GroupNonUniformBitwiseOr <Workgroup> <Reduce> %scalar : i32 -> i32
%1 = spirv.GroupNonUniformBitwiseOr <Subgroup> <ClusteredReduce>
       %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>
OPERATION_NAME = 'spirv.GroupNonUniformBitwiseOr'
_ODS_REGIONS = (0, True)
value() _ods_ir
cluster_size() _ods_ir | None
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformBitwiseOr(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformBitwiseXorOp(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is 0. If Operation is ClusteredReduce, ClusterSize must be present.

The type of Value must be the same as Result Type.

ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. ClusterSize must be at least 1, and must be a power of 2. If ClusterSize is greater than the declared SubGroupSize, executing this instruction results in undefined behavior.

Example:

%four = spirv.Constant 4 : i32
%scalar = ... : i32
%vector = ... : vector<4xi32>
%0 = spirv.GroupNonUniformBitwiseXor <Workgroup> <Reduce> %scalar : i32 -> i32
%1 = spirv.GroupNonUniformBitwiseXor <Subgroup> <ClusteredReduce>
       %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>
OPERATION_NAME = 'spirv.GroupNonUniformBitwiseXor'
_ODS_REGIONS = (0, True)
value() _ods_ir
cluster_size() _ods_ir | None
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformBitwiseXor(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformBroadcastOp(execution_scope, value, id, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type, integer type, or Boolean type.

Execution must be Workgroup or Subgroup Scope.

The type of Value must be the same as Result Type.

Id must be a scalar of integer type, whose Signedness operand is 0.

Before version 1.5, Id must come from a constant instruction. Starting with version 1.5, Id must be dynamically uniform.

The resulting value is undefined if Id is an inactive invocation, or is greater than or equal to the size of the group.

Example:

%scalar_value = ... : f32
%vector_value = ... : vector<4xf32>
%id = ... : i32
%0 = spirv.GroupNonUniformBroadcast "Subgroup" %scalar_value, %id : f32, i32
%1 = spirv.GroupNonUniformBroadcast "Workgroup" %vector_value, %id :
  vector<4xf32>, i32
OPERATION_NAME = 'spirv.GroupNonUniformBroadcast'
_ODS_REGIONS = (0, True)
value() _ods_ir
id() _ods_ir
execution_scope() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformBroadcast(execution_scope, value, id, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformElectOp(execution_scope, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a Boolean type.

Execution must be Workgroup or Subgroup Scope.

Example:

%0 = spirv.GroupNonUniformElect : i1
OPERATION_NAME = 'spirv.GroupNonUniformElect'
_ODS_REGIONS = (0, True)
execution_scope() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformElect(execution_scope, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformFAddOp(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type.

Execution must be Workgroup or Subgroup Scope.

The identity I for Operation is 0. If Operation is ClusteredReduce, ClusterSize must be specified.

The type of Value must be the same as Result Type. The method used to perform the group operation on the contributed Value(s) from active invocations is implementation defined.

ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. ClusterSize must be at least 1, and must be a power of 2. If ClusterSize is greater than the declared SubGroupSize, executing this instruction results in undefined behavior.

Example:

%four = spirv.Constant 4 : i32
%scalar = ... : f32
%vector = ... : vector<4xf32>
%0 = spirv.GroupNonUniformFAdd <Workgroup> <Reduce> %scalar : f32 -> f32
%1 = spirv.GroupNonUniformFAdd <Subgroup> <ClusteredReduce> %vector cluster_size(%four) : vector<4xf32>, i32 -> vector<4xf32>
OPERATION_NAME = 'spirv.GroupNonUniformFAdd'
_ODS_REGIONS = (0, True)
value() _ods_ir
cluster_size() _ods_ir | None
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformFAdd(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformFMaxOp(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type.

Execution must be Workgroup or Subgroup Scope.

The identity I for Operation is -INF. If Operation is ClusteredReduce, ClusterSize must be specified.

The type of Value must be the same as Result Type. The method used to perform the group operation on the contributed Value(s) from active invocations is implementation defined. From the set of Value(s) provided by active invocations within a subgroup, if for any two Values one of them is a NaN, the other is chosen. If all Value(s) that are used by the current invocation are NaN, then the result is an undefined value.

ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. ClusterSize must be at least 1, and must be a power of 2. If ClusterSize is greater than the declared SubGroupSize, executing this instruction results in undefined behavior.

Example:

%four = spirv.Constant 4 : i32
%scalar = ... : f32
%vector = ... : vector<4xf32>
%0 = spirv.GroupNonUniformFMax <Workgroup> <Reduce> %scalar : f32 -> f32
%1 = spirv.GroupNonUniformFMax <Subgroup> <ClusteredReduce> %vector cluster_size(%four) : vector<4xf32>, i32 -> vector<4xf32>
OPERATION_NAME = 'spirv.GroupNonUniformFMax'
_ODS_REGIONS = (0, True)
value() _ods_ir
cluster_size() _ods_ir | None
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformFMax(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformFMinOp(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type.

Execution must be Workgroup or Subgroup Scope.

The identity I for Operation is +INF. If Operation is ClusteredReduce, ClusterSize must be specified.

The type of Value must be the same as Result Type. The method used to perform the group operation on the contributed Value(s) from active invocations is implementation defined. From the set of Value(s) provided by active invocations within a subgroup, if for any two Values one of them is a NaN, the other is chosen. If all Value(s) that are used by the current invocation are NaN, then the result is an undefined value.

ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. ClusterSize must be at least 1, and must be a power of 2. If ClusterSize is greater than the declared SubGroupSize, executing this instruction results in undefined behavior.

Example:

%four = spirv.Constant 4 : i32
%scalar = ... : f32
%vector = ... : vector<4xf32>
%0 = spirv.GroupNonUniformFMin <Workgroup> <Reduce> %scalar : f32 -> i32
%1 = spirv.GroupNonUniformFMin <Subgroup> <ClusteredReduce> %vector cluster_size(%four) : vector<4xf32>, i32 -> vector<4xf32>
OPERATION_NAME = 'spirv.GroupNonUniformFMin'
_ODS_REGIONS = (0, True)
value() _ods_ir
cluster_size() _ods_ir | None
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformFMin(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformFMulOp(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type.

Execution must be Workgroup or Subgroup Scope.

The identity I for Operation is 1. If Operation is ClusteredReduce, ClusterSize must be specified.

The type of Value must be the same as Result Type. The method used to perform the group operation on the contributed Value(s) from active invocations is implementation defined.

ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. ClusterSize must be at least 1, and must be a power of 2. If ClusterSize is greater than the declared SubGroupSize, executing this instruction results in undefined behavior.

Example:

%four = spirv.Constant 4 : i32
%scalar = ... : f32
%vector = ... : vector<4xf32>
%0 = spirv.GroupNonUniformFMul <Workgroup> <Reduce> %scalar : f32 -> f32
%1 = spirv.GroupNonUniformFMul <Subgroup> <ClusteredReduce> %vector cluster_size(%four) : vector<4xf32>, i32 -> vector<4xf32>
OPERATION_NAME = 'spirv.GroupNonUniformFMul'
_ODS_REGIONS = (0, True)
value() _ods_ir
cluster_size() _ods_ir | None
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformFMul(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformIAddOp(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

Execution must be Workgroup or Subgroup Scope.

The identity I for Operation is 0. If Operation is ClusteredReduce, ClusterSize must be specified.

The type of Value must be the same as Result Type.

ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. ClusterSize must be at least 1, and must be a power of 2. If ClusterSize is greater than the declared SubGroupSize, executing this instruction results in undefined behavior.

Example:

%four = spirv.Constant 4 : i32
%scalar = ... : i32
%vector = ... : vector<4xi32>
%0 = spirv.GroupNonUniformIAdd <Workgroup> <Reduce> %scalar : i32 -> i32
%1 = spirv.GroupNonUniformIAdd <Subgroup> <ClusteredReduce> %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>
OPERATION_NAME = 'spirv.GroupNonUniformIAdd'
_ODS_REGIONS = (0, True)
value() _ods_ir
cluster_size() _ods_ir | None
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformIAdd(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformIMulOp(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

Execution must be Workgroup or Subgroup Scope.

The identity I for Operation is 1. If Operation is ClusteredReduce, ClusterSize must be specified.

The type of Value must be the same as Result Type.

ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. ClusterSize must be at least 1, and must be a power of 2. If ClusterSize is greater than the declared SubGroupSize, executing this instruction results in undefined behavior.

Example:

%four = spirv.Constant 4 : i32
%scalar = ... : i32
%vector = ... : vector<4xi32>
%0 = spirv.GroupNonUniformIMul <Workgroup> <Reduce> %scalar : i32 -> i32
%1 = spirv.GroupNonUniformIMul <Subgroup> <ClusteredReduce> %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>
OPERATION_NAME = 'spirv.GroupNonUniformIMul'
_ODS_REGIONS = (0, True)
value() _ods_ir
cluster_size() _ods_ir | None
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformIMul(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformLogicalAndOp(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is ~0. If Operation is ClusteredReduce, ClusterSize must be present.

The type of Value must be the same as Result Type.

ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. ClusterSize must be at least 1, and must be a power of 2. If ClusterSize is greater than the declared SubGroupSize, executing this instruction results in undefined behavior.

Example:

%four = spirv.Constant 4 : i32
%scalar = ... : i1
%vector = ... : vector<4xi1>
%0 = spirv.GroupNonUniformLogicalAnd <Workgroup> <Reduce> %scalar : i1 -> i1
%1 = spirv.GroupNonUniformLogicalAnd <Subgroup> <ClusteredReduce>
       %vector cluster_size(%four) : vector<4xi1>, i32 -> vector<4xi1>
OPERATION_NAME = 'spirv.GroupNonUniformLogicalAnd'
_ODS_REGIONS = (0, True)
value() _ods_ir
cluster_size() _ods_ir | None
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformLogicalAnd(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformLogicalOrOp(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is 0. If Operation is ClusteredReduce, ClusterSize must be present.

The type of Value must be the same as Result Type.

ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. ClusterSize must be at least 1, and must be a power of 2. If ClusterSize is greater than the declared SubGroupSize, executing this instruction results in undefined behavior.

Example:

%four = spirv.Constant 4 : i32
%scalar = ... : i1
%vector = ... : vector<4xi1>
%0 = spirv.GroupNonUniformLogicalOr <Workgroup> <Reduce> %scalar : i1 -> i1
%1 = spirv.GroupNonUniformLogicalOr <Subgroup> <ClusteredReduce>
       %vector cluster_size(%four) : vector<4xi1>, i32 -> vector<4xi1>
OPERATION_NAME = 'spirv.GroupNonUniformLogicalOr'
_ODS_REGIONS = (0, True)
value() _ods_ir
cluster_size() _ods_ir | None
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformLogicalOr(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformLogicalXorOp(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is 0. If Operation is ClusteredReduce, ClusterSize must be present.

The type of Value must be the same as Result Type.

ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. ClusterSize must be at least 1, and must be a power of 2. If ClusterSize is greater than the declared SubGroupSize, executing this instruction results in undefined behavior.

Example:

%four = spirv.Constant 4 : i32
%scalar = ... : i1
%vector = ... : vector<4xi1>
%0 = spirv.GroupNonUniformLogicalXor <Workgroup> <Reduce> %scalar : i1 -> i1
%1 = spirv.GroupNonUniformLogicalXor <Subgroup> <ClusteredReduce>
       %vector cluster_size(%four) : vector<4xi1>, i32 -> vector<4xi1>
OPERATION_NAME = 'spirv.GroupNonUniformLogicalXor'
_ODS_REGIONS = (0, True)
value() _ods_ir
cluster_size() _ods_ir | None
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformLogicalXor(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformRotateKHROp(execution_scope, value, delta, *, cluster_size=None, results=None, loc=None, ip=None)

Bases: _ods_ir

Return the Value of the invocation whose id within the group is calculated as follows:

LocalId = SubgroupLocalInvocationId if Execution is Subgroup or LocalInvocationId if Execution is Workgroup RotationGroupSize = ClusterSize when ClusterSize is present, otherwise RotationGroupSize = SubgroupMaxSize if the Kernel capability is declared and SubgroupSize if not. Invocation ID = ( (LocalId + Delta) & (RotationGroupSize - 1) ) + (LocalId & ~(RotationGroupSize - 1))

Result Type must be a scalar or vector of floating-point type, integer type, or Boolean type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The type of Value must be the same as Result Type.

Delta must be a scalar of integer type, whose Signedness operand is 0. Delta must be dynamically uniform within Execution.

Delta is treated as unsigned and the resulting value is undefined if the selected lane is inactive.

ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. Behavior is undefined unless ClusterSize is at least 1 and a power of 2. If ClusterSize is greater than the declared SubGroupSize, executing this instruction results in undefined behavior.

Example:

%four = spirv.Constant 4 : i32
%0 = spirv.GroupNonUniformRotateKHR <Subgroup> %value, %delta : f32, i32 -> f32
%1 = spirv.GroupNonUniformRotateKHR <Workgroup> %value, %delta,
     clustersize(%four) : f32, i32, i32 -> f32
OPERATION_NAME = 'spirv.GroupNonUniformRotateKHR'
_ODS_REGIONS = (0, True)
value() _ods_ir
delta() _ods_ir
cluster_size() _ods_ir | None
execution_scope() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformRotateKHR(execution_scope, value, delta, *, cluster_size=None, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformSMaxOp(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

Execution must be Workgroup or Subgroup Scope.

The identity I for Operation is INT_MIN. If Operation is ClusteredReduce, ClusterSize must be specified.

The type of Value must be the same as Result Type.

ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. ClusterSize must be at least 1, and must be a power of 2. If ClusterSize is greater than the declared SubGroupSize, executing this instruction results in undefined behavior.

Example:

%four = spirv.Constant 4 : i32
%scalar = ... : i32
%vector = ... : vector<4xi32>
%0 = spirv.GroupNonUniformSMax <Workgroup> <Reduce> %scalar : i32
%1 = spirv.GroupNonUniformSMax <Subgroup> <ClusteredReduce> %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>
OPERATION_NAME = 'spirv.GroupNonUniformSMax'
_ODS_REGIONS = (0, True)
value() _ods_ir
cluster_size() _ods_ir | None
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformSMax(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformSMinOp(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

Execution must be Workgroup or Subgroup Scope.

The identity I for Operation is INT_MAX. If Operation is ClusteredReduce, ClusterSize must be specified.

The type of Value must be the same as Result Type.

ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. ClusterSize must be at least 1, and must be a power of 2. If ClusterSize is greater than the declared SubGroupSize, executing this instruction results in undefined behavior.

Example:

%four = spirv.Constant 4 : i32
%scalar = ... : i32
%vector = ... : vector<4xi32>
%0 = spirv.GroupNonUniformSMin <Workgroup> <Reduce> %scalar : i32 -> i32
%1 = spirv.GroupNonUniformSMin <Subgroup> <ClusteredReduce> %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>
OPERATION_NAME = 'spirv.GroupNonUniformSMin'
_ODS_REGIONS = (0, True)
value() _ods_ir
cluster_size() _ods_ir | None
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformSMin(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformShuffleDownOp(execution_scope, value, delta, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type, integer type, or Boolean type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The type of Value must be the same as Result Type.

Delta must be a scalar of integer type, whose Signedness operand is 0.

Delta is treated as unsigned and the resulting value is undefined if Delta is greater than or equal to the size of the group, or if the current invocation’s id within the group + Delta is either an inactive invocation or greater than or equal to the size of the group.

Example:

%0 = spirv.GroupNonUniformShuffleDown <Subgroup> %val, %delta : f32, i32
OPERATION_NAME = 'spirv.GroupNonUniformShuffleDown'
_ODS_REGIONS = (0, True)
value() _ods_ir
delta() _ods_ir
execution_scope() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformShuffleDown(execution_scope, value, delta, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformShuffleOp(execution_scope, value, id, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type, integer type, or Boolean type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The type of Value must be the same as Result Type.

Id must be a scalar of integer type, whose Signedness operand is 0.

The resulting value is undefined if Id is an inactive invocation, or is greater than or equal to the size of the group.

Example:

%0 = spirv.GroupNonUniformShuffle <Subgroup> %val, %id : f32, i32
OPERATION_NAME = 'spirv.GroupNonUniformShuffle'
_ODS_REGIONS = (0, True)
value() _ods_ir
id() _ods_ir
execution_scope() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformShuffle(execution_scope, value, id, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformShuffleUpOp(execution_scope, value, delta, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type, integer type, or Boolean type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The type of Value must be the same as Result Type.

Delta must be a scalar of integer type, whose Signedness operand is 0.

Delta is treated as unsigned and the resulting value is undefined if Delta is greater than the current invocation’s id within the group or if the selected lane is inactive.

Example:

%0 = spirv.GroupNonUniformShuffleUp <Subgroup> %val, %delta : f32, i32
OPERATION_NAME = 'spirv.GroupNonUniformShuffleUp'
_ODS_REGIONS = (0, True)
value() _ods_ir
delta() _ods_ir
execution_scope() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformShuffleUp(execution_scope, value, delta, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformShuffleXorOp(execution_scope, value, mask, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type, integer type, or Boolean type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The type of Value must be the same as Result Type.

Mask must be a scalar of integer type, whose Signedness operand is 0.

The resulting value is undefined if current invocation’s id within the group xor’ed with Mask is an inactive invocation, or is greater than or equal to the size of the group.

Example:

%0 = spirv.GroupNonUniformShuffleXor <Subgroup> %val, %mask : f32, i32
OPERATION_NAME = 'spirv.GroupNonUniformShuffleXor'
_ODS_REGIONS = (0, True)
value() _ods_ir
mask() _ods_ir
execution_scope() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformShuffleXor(execution_scope, value, mask, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformUMaxOp(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type, whose Signedness operand is 0.

Execution must be Workgroup or Subgroup Scope.

The identity I for Operation is 0. If Operation is ClusteredReduce, ClusterSize must be specified.

The type of Value must be the same as Result Type.

ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. ClusterSize must be at least 1, and must be a power of 2. If ClusterSize is greater than the declared SubGroupSize, executing this instruction results in undefined behavior.

Example:

%four = spirv.Constant 4 : i32
%scalar = ... : i32
%vector = ... : vector<4xi32>
%0 = spirv.GroupNonUniformUMax <Workgroup> <Reduce> %scalar : i32 -> i32
%1 = spirv.GroupNonUniformUMax <Subgroup> <ClusteredReduce> %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>
OPERATION_NAME = 'spirv.GroupNonUniformUMax'
_ODS_REGIONS = (0, True)
value() _ods_ir
cluster_size() _ods_ir | None
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformUMax(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupNonUniformUMinOp(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type, whose Signedness operand is 0.

Execution must be Workgroup or Subgroup Scope.

The identity I for Operation is UINT_MAX. If Operation is ClusteredReduce, ClusterSize must be specified.

The type of Value must be the same as Result Type.

ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. ClusterSize must be at least 1, and must be a power of 2. If ClusterSize is greater than the declared SubGroupSize, executing this instruction results in undefined behavior.

Example:

%four = spirv.Constant 4 : i32
%scalar = ... : i32
%vector = ... : vector<4xi32>
%0 = spirv.GroupNonUniformUMin <Workgroup> <Reduce> %scalar : i32 -> i32
%1 = spirv.GroupNonUniformUMin <Subgroup> <ClusteredReduce> %vector cluster_size(%four) : vector<4xi32>, i32 -> vector<4xi32>
OPERATION_NAME = 'spirv.GroupNonUniformUMin'
_ODS_REGIONS = (0, True)
value() _ods_ir
cluster_size() _ods_ir | None
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupNonUniformUMin(result, execution_scope, group_operation, value, *, cluster_size=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupSMaxOp(execution_scope, group_operation, x, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Behavior is undefined if not all invocations of this module within Execution reach this point of execution.

Behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction.

Result Type must be a scalar or vector of integer type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is INT_MIN when X is 32 bits wide and LONG_MIN when X is 64 bits wide.

The type of X must be the same as Result Type.

Example:

%0 = spirv.GroupSMax <Workgroup> <Reduce> %value : i32
OPERATION_NAME = 'spirv.GroupSMax'
_ODS_REGIONS = (0, True)
x() _ods_ir
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupSMax(execution_scope, group_operation, x, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupSMinOp(execution_scope, group_operation, x, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Behavior is undefined if not all invocations of this module within Execution reach this point of execution.

Behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction.

Result Type must be a scalar or vector of integer type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is INT_MAX when X is 32 bits wide and LONG_MAX when X is 64 bits wide.

The type of X must be the same as Result Type.

Example:

%0 = spirv.GroupSMin <Workgroup> <Reduce> %value : i32
OPERATION_NAME = 'spirv.GroupSMin'
_ODS_REGIONS = (0, True)
x() _ods_ir
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupSMin(execution_scope, group_operation, x, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupUMaxOp(execution_scope, group_operation, x, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Behavior is undefined if not all invocations of this module within Execution reach this point of execution.

Behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction.

Result Type must be a scalar or vector of integer type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is 0.

The type of X must be the same as Result Type.

Example:

%0 = spirv.GroupUMax <Workgroup> <Reduce> %value : i32
OPERATION_NAME = 'spirv.GroupUMax'
_ODS_REGIONS = (0, True)
x() _ods_ir
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupUMax(execution_scope, group_operation, x, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.GroupUMinOp(execution_scope, group_operation, x, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Behavior is undefined if not all invocations of this module within Execution reach this point of execution.

Behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction.

Result Type must be a scalar or vector of integer type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is UINT_MAX when X is 32 bits wide and ULONG_MAX when X is 64 bits wide.

The type of X must be the same as Result Type.

Example:

%0 = spirv.GroupUMin <Workgroup> <Reduce> %value : i32
OPERATION_NAME = 'spirv.GroupUMin'
_ODS_REGIONS = (0, True)
x() _ods_ir
execution_scope() _ods_ir
group_operation() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.GroupUMin(execution_scope, group_operation, x, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.IAddCarryOp(result, operand1, operand2, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be from OpTypeStruct. The struct must have two members, and the two members must be the same type. The member type must be a scalar or vector of integer type, whose Signedness operand is 0.

Operand 1 and Operand 2 must have the same type as the members of Result Type. These are consumed as unsigned integers.

Results are computed per component.

Member 0 of the result gets the low-order bits (full component width) of the addition.

Member 1 of the result gets the high-order (carry) bit of the result of the addition. That is, it gets the value 1 if the addition overflowed the component width, and 0 otherwise.

Example:

%2 = spirv.IAddCarry %0, %1 : !spirv.struct<(i32, i32)>
%2 = spirv.IAddCarry %0, %1 : !spirv.struct<(vector<2xi32>, vector<2xi32>)>
OPERATION_NAME = 'spirv.IAddCarry'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.IAddCarry(result, operand1, operand2, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.IAddOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same number of components as Result Type. They must have the same component width as Result Type.

The resulting value will equal the low-order N bits of the correct result R, where N is the component width and R is computed with enough precision to avoid overflow and underflow.

Results are computed per component.

Example:

%4 = spirv.IAdd %0, %1 : i32
%5 = spirv.IAdd %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.IAdd'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.IAdd(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.IEqualOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same component width, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.IEqual %0, %1 : i32
%5 = spirv.IEqual %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.IEqual'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.IEqual(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.IMulOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same number of components as Result Type. They must have the same component width as Result Type.

The resulting value will equal the low-order N bits of the correct result R, where N is the component width and R is computed with enough precision to avoid overflow and underflow.

Results are computed per component.

Example:

%4 = spirv.IMul %0, %1 : i32
%5 = spirv.IMul %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.IMul'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.IMul(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.INTELControlBarrierArriveOp(execution_scope, memory_scope, memory_semantics, *, loc=None, ip=None)

Bases: _ods_ir

Indicates that an invocation has arrived at a split control barrier. This may allow other invocations waiting on the split control barrier to continue executing.

When Execution is Workgroup or larger, behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction. When Execution is Subgroup or Invocation, the behavior of this instruction in non-uniform control flow is defined by the client API.

If Semantics is not None, this instruction also serves as the start of a memory barrier similar to an OpMemoryBarrier instruction with the same Memory and Semantics operands. This allows atomically specifying both a control barrier and a memory barrier (that is, without needing two instructions). If Semantics is None, Memory is ignored.

Example:

spirv.ControlBarrierArrive <Workgroup> <Device> <Acquire|UniformMemory>
OPERATION_NAME = 'spirv.INTEL.ControlBarrierArrive'
_ODS_REGIONS = (0, True)
execution_scope() _ods_ir
memory_scope() _ods_ir
memory_semantics() _ods_ir
mlir.dialects._spirv_ops_gen.INTEL_ControlBarrierArrive(execution_scope, memory_scope, memory_semantics, *, loc=None, ip=None) INTELControlBarrierArriveOp
class mlir.dialects._spirv_ops_gen.INTELControlBarrierWaitOp(execution_scope, memory_scope, memory_semantics, *, loc=None, ip=None)

Bases: _ods_ir

Waits for other invocations of this module to arrive at a split control barrier.

When Execution is Workgroup or larger, behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction. When Execution is Subgroup or Invocation, the behavior of this instruction in non-uniform control flow is defined by the client API.

If Semantics is not None, this instruction also serves as the end of a memory barrier similar to an OpMemoryBarrier instruction with the same Memory and Semantics operands. This ensures that memory accesses issued before arriving at the split barrier are observed before memory accesses issued after this instruction. This control is ensured only for memory accesses issued by this invocation and observed by another invocation executing within Memory scope. This allows atomically specifying both a control barrier and a memory barrier (that is, without needing two instructions). If Semantics is None, Memory is ignored.

Example:

spirv.ControlBarrierWait <Workgroup> <Device> <Acquire|UniformMemory>
OPERATION_NAME = 'spirv.INTEL.ControlBarrierWait'
_ODS_REGIONS = (0, True)
execution_scope() _ods_ir
memory_scope() _ods_ir
memory_semantics() _ods_ir
mlir.dialects._spirv_ops_gen.INTEL_ControlBarrierWait(execution_scope, memory_scope, memory_semantics, *, loc=None, ip=None) INTELControlBarrierWaitOp
class mlir.dialects._spirv_ops_gen.INTELConvertBF16ToFOp(result, operand, *, loc=None, ip=None)

Bases: _ods_ir

Interpret a 16-bit integer as bfloat16 and convert the value numerically to 32-bit floating point type.

Result Type must be a scalar or vector of floating-point. The component width must be 32 bits.

Bfloat16 Value must be a scalar or vector of integer type, which is interpreted as a bfloat16 type. The type must have the same number of components as the Result Type. The component width must be 16 bits.

Results are computed per component.

Example:

%1 = spirv.ConvertBF16ToF %0 : i16 to f32
%3 = spirv.ConvertBF16ToF %2 : vector<3xi16> to vector<3xf32>
OPERATION_NAME = 'spirv.INTEL.ConvertBF16ToF'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.INTEL_ConvertBF16ToF(result, operand, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.INTELConvertFToBF16Op(result, operand, *, loc=None, ip=None)

Bases: _ods_ir

Convert value numerically from 32-bit floating point to bfloat16, which is represented as a 16-bit unsigned integer.

Result Type must be a scalar or vector of integer type. The component width must be 16 bits. Bit pattern in the Result represents a bfloat16 value.

Float Value must be a scalar or vector of floating-point type. It must have the same number of components as Result Type. The component width must be 32 bits.

Results are computed per component.

Example:

%1 = spirv.ConvertFToBF16 %0 : f32 to i16
%3 = spirv.ConvertFToBF16 %2 : vector<3xf32> to vector<3xi16>
OPERATION_NAME = 'spirv.INTEL.ConvertFToBF16'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.INTEL_ConvertFToBF16(result, operand, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.INTELRoundFToTF32Op(result, operand, *, loc=None, ip=None)

Bases: _ods_ir

Convert value numerically from a 32-bit floating point type to tensor float32, with rounding to the nearest even.

Result Type must be a scalar or vector of 32-bit floating-point type. The component width must be 32 bits. Bit pattern in the Result represents a tensor float32 value.

Float Value must be a scalar or vector of floating-point type. It must have the same number of components as Result Type. The component width must be 32 bits.

Results are computed per component.

Example:

%1 = spirv.RoundFToTF32 %0 : f32 to f32
%3 = spirv.RoundFToTF32 %2 : vector<3xf32> to vector<3xf32>
OPERATION_NAME = 'spirv.INTEL.RoundFToTF32'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.INTEL_RoundFToTF32(result, operand, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.INTELSubgroupBlockReadOp(value, ptr, *, loc=None, ip=None)

Bases: _ods_ir

Reads one or more components of Result data for each invocation in the subgroup from the specified Ptr as a block operation.

The data is read strided, so the first value read is: Ptr[ SubgroupLocalInvocationId ]

and the second value read is: Ptr[ SubgroupLocalInvocationId + SubgroupMaxSize ] etc.

Result Type may be a scalar or vector type, and its component type must be equal to the type pointed to by Ptr.

The type of Ptr must be a pointer type, and must point to a scalar type.

subgroup-block-read-INTEL-op ::= ssa-id `=` `spirv.INTEL.SubgroupBlockRead`
                            storage-class ssa_use `:` spirv-element-type

Example:

%0 = spirv.INTEL.SubgroupBlockRead "StorageBuffer" %ptr : i32
OPERATION_NAME = 'spirv.INTEL.SubgroupBlockRead'
_ODS_REGIONS = (0, True)
ptr() _ods_ir
value() _ods_ir
mlir.dialects._spirv_ops_gen.INTEL_SubgroupBlockRead(value, ptr, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.INTELSubgroupBlockWriteOp(ptr, value, *, loc=None, ip=None)

Bases: _ods_ir

Writes one or more components of Data for each invocation in the subgroup from the specified Ptr as a block operation.

The data is written strided, so the first value is written to: Ptr[ SubgroupLocalInvocationId ]

and the second value written is: Ptr[ SubgroupLocalInvocationId + SubgroupMaxSize ] etc.

The type of Ptr must be a pointer type, and must point to a scalar type.

The component type of Data must be equal to the type pointed to by Ptr.

subgroup-block-write-INTEL-op ::= ssa-id `=` `spirv.INTEL.SubgroupBlockWrite`
                  storage-class ssa_use `,` ssa-use `:` spirv-element-type

Example:

spirv.INTEL.SubgroupBlockWrite "StorageBuffer" %ptr, %value : i32
OPERATION_NAME = 'spirv.INTEL.SubgroupBlockWrite'
_ODS_REGIONS = (0, True)
ptr() _ods_ir
value() _ods_ir
mlir.dialects._spirv_ops_gen.INTEL_SubgroupBlockWrite(ptr, value, *, loc=None, ip=None) INTELSubgroupBlockWriteOp
class mlir.dialects._spirv_ops_gen.INotEqualOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same component width, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.INotEqual %0, %1 : i32
%5 = spirv.INotEqual %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.INotEqual'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.INotEqual(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ISubBorrowOp(result, operand1, operand2, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be from OpTypeStruct. The struct must have two members, and the two members must be the same type. The member type must be a scalar or vector of integer type, whose Signedness operand is 0.

Operand 1 and Operand 2 must have the same type as the members of Result Type. These are consumed as unsigned integers.

Results are computed per component.

Member 0 of the result gets the low-order bits (full component width) of the subtraction. That is, if Operand 1 is larger than Operand 2, member 0 gets the full value of the subtraction; if Operand 2 is larger than Operand 1, member 0 gets 2w + Operand 1 - Operand 2, where w is the component width.

Member 1 of the result gets 0 if Operand 1 ≥ Operand 2, and gets 1 otherwise.

Example:

%2 = spirv.ISubBorrow %0, %1 : !spirv.struct<(i32, i32)>
%2 = spirv.ISubBorrow %0, %1 : !spirv.struct<(vector<2xi32>, vector<2xi32>)>
OPERATION_NAME = 'spirv.ISubBorrow'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ISubBorrow(result, operand1, operand2, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ISubOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same number of components as Result Type. They must have the same component width as Result Type.

The resulting value will equal the low-order N bits of the correct result R, where N is the component width and R is computed with enough precision to avoid overflow and underflow.

Results are computed per component.

Example:

%4 = spirv.ISub %0, %1 : i32
%5 = spirv.ISub %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.ISub'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ISub(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ImageDrefGatherOp(result, sampled_image, coordinate, dref, operand_arguments, *, image_operands=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a vector of four components of floating-point type or integer type. Its components must be the same as Sampled Type of the underlying OpTypeImage (unless that underlying Sampled Type is OpTypeVoid). It has one component per gathered texel.

Sampled Image must be an object whose type is OpTypeSampledImage. Its OpTypeImage must have a Dim of 2D, Cube, or Rect. The MS operand of the underlying OpTypeImage must be 0.

Coordinate must be a scalar or vector of floating-point type. It contains (u[, v] … [, array layer]) as needed by the definition of Sampled Image.

Dref is the depth-comparison reference value. It must be a 32-bit floating-point type scalar.

Image Operands encodes what operands follow, as per Image Operands.

Example:

%0 = spirv.ImageDrefGather %1, %2, %3 : !spirv.sampled_image<!spirv.image<i32, Dim2D, NoDepth, NonArrayed, SingleSampled, NoSampler, Unknown>>, vector<4xf32>, f32 -> vector<4xi32>
%0 = spirv.ImageDrefGather %1, %2, %3 ["NonPrivateTexel"] : !spirv.sampled_image<!spirv.image<i32, Dim2D, NoDepth, NonArrayed, SingleSampled, NoSampler, Unknown>>, vector<4xf32>, f32 -> vector<4xi32>
OPERATION_NAME = 'spirv.ImageDrefGather'
_ODS_REGIONS = (0, True)
sampled_image() _ods_ir
coordinate() _ods_ir
dref() _ods_ir
operand_arguments() _ods_ir
image_operands() _ods_ir | None
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ImageDrefGather(result, sampled_image, coordinate, dref, operand_arguments, *, image_operands=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ImageFetchOp(result, image, coordinate, operand_arguments, *, image_operands=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a vector of four components of floating-point type or integer type. Its components must be the same as Sampled Type of the underlying OpTypeImage (unless that underlying Sampled Type is OpTypeVoid).

Image must be an object whose type is OpTypeImage. Its Dim operand must not be Cube, and its Sampled operand must be 1.

Coordinate must be a scalar or vector of integer type. It contains (u[, v] … [, array layer]) as needed by the definition of Sampled Image.

Image Operands encodes what operands follow, as per Image Operands.

Example:

%0 = spirv.ImageFetch %1, %2 : !spirv.image<f32, Dim2D, NoDepth, NonArrayed, SingleSampled, NeedSampler, R32f>, vector<2xsi32> -> vector<4xf32>
OPERATION_NAME = 'spirv.ImageFetch'
_ODS_REGIONS = (0, True)
image() _ods_ir
coordinate() _ods_ir
operand_arguments() _ods_ir
image_operands() _ods_ir | None
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ImageFetch(result, image, coordinate, operand_arguments, *, image_operands=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ImageOp(sampled_image, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be OpTypeImage.

Sampled Image must have type OpTypeSampledImage whose Image Type is the same as Result Type.

Example:

%0 = spirv.Image %1 : !spirv.sampled_image<!spirv.image<f32, Cube, NoDepth, NonArrayed, SingleSampled, NoSampler, Unknown>>
OPERATION_NAME = 'spirv.Image'
_ODS_REGIONS = (0, True)
sampled_image() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.Image(sampled_image, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ImageQuerySizeOp(result, image, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be an integer type scalar or vector. The number of components must be:

1 for the 1D and Buffer dimensionalities,

2 for the 2D, Cube, and Rect dimensionalities,

3 for the 3D dimensionality,

plus 1 more if the image type is arrayed. This vector is filled in with (width [, height] [, elements]) where elements is the number of layers in an image array or the number of cubes in a cube-map array.

Image must be an object whose type is OpTypeImage. Its Dim operand must be one of those listed under Result Type, above. Additionally, if its Dim is 1D, 2D, 3D, or Cube, it must also have either an MS of 1 or a Sampled of 0 or 2. There is no implicit level-of-detail consumed by this instruction. See OpImageQuerySizeLod for querying images having level of detail. This operation is allowed on an image decorated as NonReadable. See the client API specification for additional image type restrictions.

Example:

%3 = spirv.ImageQuerySize %0 : !spirv.image<i32, Dim1D, NoDepth, NonArrayed, SingleSampled, NoSampler, Unknown> -> i32
%4 = spirv.ImageQuerySize %1 : !spirv.image<i32, Dim2D, NoDepth, NonArrayed, SingleSampled, NoSampler, Unknown> -> vector<2xi32>
%5 = spirv.ImageQuerySize %2 : !spirv.image<i32, Dim2D, NoDepth, Arrayed, SingleSampled, NoSampler, Unknown> -> vector<3xi32>
OPERATION_NAME = 'spirv.ImageQuerySize'
_ODS_REGIONS = (0, True)
image() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ImageQuerySize(result, image, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ImageReadOp(result, image, coordinate, operand_arguments, *, image_operands=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of floating-point type or integer type. It must be a scalar or vector with component type the same as Sampled Type of the OpTypeImage (unless that Sampled Type is OpTypeVoid).

Image must be an object whose type is OpTypeImage with a Sampled operand of 0 or 2. If the Arrayed operand is 1, then additional capabilities may be required; e.g., ImageCubeArray, or ImageMSArray.

Coordinate must be a scalar or vector of floating-point type or integer type. It contains non-normalized texel coordinates (u[, v] … [, array layer]) as needed by the definition of Image. See the client API specification for handling of coordinates outside the image.

If the Image Dim operand is SubpassData, Coordinate is relative to the current fragment location. See the client API specification for more detail on how these coordinates are applied.

If the Image Dim operand is not SubpassData, the Image Format must not be Unknown, unless the StorageImageReadWithoutFormat Capability was declared.

Image Operands encodes what operands follow, as per Image Operands.

Example:

%0 = spirv.ImageRead %1, %2 : !spirv.image<f32, Dim2D, NoDepth, NonArrayed, SingleSampled, NoSampler, R32f>, vector<2xsi32> -> vector<4xf32>
OPERATION_NAME = 'spirv.ImageRead'
_ODS_REGIONS = (0, True)
image() _ods_ir
coordinate() _ods_ir
operand_arguments() _ods_ir
image_operands() _ods_ir | None
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ImageRead(result, image, coordinate, operand_arguments, *, image_operands=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ImageSampleExplicitLodOp(result, sampled_image, coordinate, image_operands, operand_arguments, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a vector of four components of floating-point type or integer type. Its components must be the same as Sampled Type of the underlying OpTypeImage (unless that underlying Sampled Type is OpTypeVoid).

Sampled Image must be an object whose type is OpTypeSampledImage. Its OpTypeImage must not have a Dim of Buffer. The MS operand of the underlying OpTypeImage must be 0.

Coordinate must be a scalar or vector of floating-point type or integer type. It contains (u[, v] … [, array layer]) as needed by the definition of Sampled Image. Unless the Kernel capability is declared, it must be floating point. It may be a vector larger than needed, but all unused components appear after all used components.

Image Operands encodes what operands follow, as per Image Operands. Either Lod or Grad image operands must be present.

Example:

%result = spirv.ImageSampleExplicitLod %image, %coord ["Lod"](%lod) :
  !spirv.sampled_image<!spirv.image<f32, Dim2D, NoDepth, NonArrayed, SingleSampled, NeedSampler, Unknown>>,
  vector<2xf32> (f32) -> vector<4xf32>
OPERATION_NAME = 'spirv.ImageSampleExplicitLod'
_ODS_REGIONS = (0, True)
sampled_image() _ods_ir
coordinate() _ods_ir
operand_arguments() _ods_ir
image_operands() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ImageSampleExplicitLod(result, sampled_image, coordinate, image_operands, operand_arguments, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ImageSampleImplicitLodOp(result, sampled_image, coordinate, operand_arguments, *, image_operands=None, loc=None, ip=None)

Bases: _ods_ir

An invocation will not execute a dynamic instance of this instruction (X’) until all invocations in its derivative group have executed all dynamic instances that are program-ordered before X’.

Result Type must be a vector of four components of floating-point type or integer type. Its components must be the same as Sampled Type of the underlying OpTypeImage (unless that underlying Sampled Type is OpTypeVoid).

Sampled Image must be an object whose type is OpTypeSampledImage. Its OpTypeImage must not have a Dim of Buffer. The MS operand of the underlying OpTypeImage must be 0.

Coordinate must be a scalar or vector of floating-point type. It contains (u[, v] … [, array layer]) as needed by the definition of Sampled Image. It may be a vector larger than needed, but all unused components appear after all used components.

Image Operands encodes what operands follow, as per Image Operands.

This instruction is only valid in the Fragment Execution Model. In addition, it consumes an implicit derivative that can be affected by code motion.

Example:

%result = spirv.ImageSampleImplicitLod %image, %coord :
  !spirv.sampled_image<!spirv.image<f32, Cube, NoDepth, NonArrayed, SingleSampled, NeedSampler, Unknown>>,
  vector<3xf32> -> vector<4xf32>
OPERATION_NAME = 'spirv.ImageSampleImplicitLod'
_ODS_REGIONS = (0, True)
sampled_image() _ods_ir
coordinate() _ods_ir
operand_arguments() _ods_ir
image_operands() _ods_ir | None
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ImageSampleImplicitLod(result, sampled_image, coordinate, operand_arguments, *, image_operands=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ImageSampleProjDrefImplicitLodOp(sampled_image, coordinate, dref, operand_arguments, *, image_operands=None, results=None, loc=None, ip=None)

Bases: _ods_ir

An invocation will not execute a dynamic instance of this instruction (X’) until all invocations in its derivative group have executed all dynamic instances that are program-ordered before X’.

Result Type must be a scalar of integer type or floating-point type. It must be the same as Sampled Type of the underlying OpTypeImage.

Sampled Image must be an object whose type is OpTypeSampledImage. The Dim operand of the underlying OpTypeImage must be 1D, 2D, 3D, or Rect, and the Arrayed and MS operands must be 0.

Coordinate must be a vector of floating-point type. It contains (u[, v] [, w], q), as needed by the definition of Sampled Image, with the q component consumed for the projective division. That is, the actual sample coordinate is (u/q [, v/q] [, w/q]), as needed by the definition of Sampled Image. It may be a vector larger than needed, but all unused components appear after all used components.

Dref/q is the depth-comparison reference value. Dref must be a 32-bit floating-point type scalar.

Image Operands encodes what operands follow, as per Image Operands.

This instruction is only valid in the Fragment Execution Model. In addition, it consumes an implicit derivative that can be affected by code motion.

Example:

%result = spirv.ImageSampleProjDrefImplicitLod %image, %coord, %dref :
  !spirv.sampled_image<!spirv.image<f32, Dim2D, IsDepth, NonArrayed, SingleSampled, NeedSampler, Unknown>>,
  vector<4xf16>, f32 -> f32
OPERATION_NAME = 'spirv.ImageSampleProjDrefImplicitLod'
_ODS_REGIONS = (0, True)
sampled_image() _ods_ir
coordinate() _ods_ir
dref() _ods_ir
operand_arguments() _ods_ir
image_operands() _ods_ir | None
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ImageSampleProjDrefImplicitLod(sampled_image, coordinate, dref, operand_arguments, *, image_operands=None, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ImageWriteOp(image, coordinate, texel, operand_arguments, *, image_operands=None, loc=None, ip=None)

Bases: _ods_ir

Image must be an object whose type is OpTypeImage with a Sampled operand of 0 or 2. If the Arrayed operand is 1, then additional capabilities may be required; e.g., ImageCubeArray, or ImageMSArray. Its Dim operand must not be SubpassData.

Coordinate must be a scalar or vector of floating-point type or integer type. It contains non-normalized texel coordinates (u[, v] … [, array layer]) as needed by the definition of Image. See the client API specification for handling of coordinates outside the image.

Texel is the data to write. It must be a scalar or vector with component type the same as Sampled Type of the OpTypeImage (unless that Sampled Type is OpTypeVoid).

The Image Format must not be Unknown, unless the StorageImageWriteWithoutFormat Capability was declared.

Image Operands encodes what operands follow, as per Image Operands.

Example:

spirv.ImageWrite %0, %1, %2 : !spirv.image<f32, Dim2D, NoDepth, NonArrayed, SingleSampled, NoSampler, Rgba16>, vector<2xsi32>, vector<4xf32>
OPERATION_NAME = 'spirv.ImageWrite'
_ODS_REGIONS = (0, True)
image() _ods_ir
coordinate() _ods_ir
texel() _ods_ir
operand_arguments() _ods_ir
image_operands() _ods_ir | None
mlir.dialects._spirv_ops_gen.ImageWrite(image, coordinate, texel, operand_arguments, *, image_operands=None, loc=None, ip=None) ImageWriteOp
class mlir.dialects._spirv_ops_gen.InBoundsPtrAccessChainOp(result, base_ptr, element, indices, *, loc=None, ip=None)

Bases: _ods_ir

Example:

func @inbounds_ptr_access_chain(%arg0: !spirv.ptr<f32, CrossWorkgroup>, %arg1 : i64) -> () {
  %0 = spirv.InBoundsPtrAccessChain %arg0[%arg1] : !spirv.ptr<f32, CrossWorkgroup>, i64 -> !spirv.ptr<f32, CrossWorkgroup>
  ...
}
OPERATION_NAME = 'spirv.InBoundsPtrAccessChain'
_ODS_REGIONS = (0, True)
base_ptr() _ods_ir
element() _ods_ir
indices() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.InBoundsPtrAccessChain(result, base_ptr, element, indices, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.IsFiniteOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

x must be a scalar or vector of floating-point type. It must have the same number of components as Result Type.

Results are computed per component.

Example:

%2 = spirv.IsFinite %0: f32
%3 = spirv.IsFinite %1: vector<4xf32>
OPERATION_NAME = 'spirv.IsFinite'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.IsFinite(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.IsInfOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

x must be a scalar or vector of floating-point type. It must have the same number of components as Result Type.

Results are computed per component.

Example:

%2 = spirv.IsInf %0: f32
%3 = spirv.IsInf %1: vector<4xf32>
OPERATION_NAME = 'spirv.IsInf'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.IsInf(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.IsNanOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

x must be a scalar or vector of floating-point type. It must have the same number of components as Result Type.

Results are computed per component.

Example:

%2 = spirv.IsNan %0: f32
%3 = spirv.IsNan %1: vector<4xf32>
OPERATION_NAME = 'spirv.IsNan'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.IsNan(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.KHRAssumeTrueOp(condition, *, loc=None, ip=None)

Bases: _ods_ir

assumetruekhr-op ::= `spirv.KHR.AssumeTrue` ssa-use

Example:

spirv.KHR.AssumeTrue %arg
OPERATION_NAME = 'spirv.KHR.AssumeTrue'
_ODS_REGIONS = (0, True)
condition() _ods_ir
mlir.dialects._spirv_ops_gen.KHR_AssumeTrue(condition, *, loc=None, ip=None) KHRAssumeTrueOp
class mlir.dialects._spirv_ops_gen.KHRCooperativeMatrixLengthOp(cooperative_matrix_type, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Number of components of a cooperative matrix type accessible to each invocation when treated as a composite.

The type attribute must be a cooperative matrix type.

Example:

%0 = spirv.KHR.CooperativeMatrixLength :
       !spirv.coopmatrix<8x16xi32, Subgroup, MatrixA>
OPERATION_NAME = 'spirv.KHR.CooperativeMatrixLength'
_ODS_REGIONS = (0, True)
cooperative_matrix_type() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.KHR_CooperativeMatrixLength(cooperative_matrix_type, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.KHRCooperativeMatrixLoadOp(result, pointer, matrix_layout, stride, *, memory_operand=None, alignment=None, loc=None, ip=None)

Bases: _ods_ir

Load a cooperative matrix through a pointer.

Result Type is the type of the loaded object. It must be a cooperative matrix type.

Pointer is a pointer. Its type must be an OpTypePointer whose Type operand is a scalar or vector type. If the Shader capability was declared, Pointer must point into an array and any ArrayStride decoration on Pointer is ignored.

MemoryLayout specifies how matrix elements are laid out in memory. It must come from a 32-bit integer constant instruction whose value corresponds to a Cooperative Matrix Layout. See the Cooperative Matrix Layout table for a description of the layouts and detailed layout-specific rules.

Stride further qualifies how matrix elements are laid out in memory. It must be a scalar integer type and its exact semantics depend on MemoryLayout.

Memory Operand must be a Memory Operand literal. If not present, it is the same as specifying None.

NOTE: In earlier versions of the SPIR-V spec, ‘Memory Operand’ was known as ‘Memory Access’.

For a given dynamic instance of this instruction, all operands of this instruction must be the same for all invocations in a given scope instance (where the scope is the scope the cooperative matrix type was created with). All invocations in a given scope instance must be active or all must be inactive.

TODO: In the SPIR-V spec, stride is an optional argument. We should also support this optionality in the SPIR-V dialect.

Example:

%0 = spirv.KHR.CooperativeMatrixLoad %ptr, %stride, <RowMajor>
     : !spirv.ptr<i32, StorageBuffer>, i32
         -> !spirv.KHR.coopmatrix<16x8xi32, Workgroup, MatrixA>

%1 = spirv.KHR.CooperativeMatrixLoad %ptr, %stride, <ColumnMajor>, <Volatile>
     : !spirv.ptr<f32, StorageBuffer>, i64
         -> !spirv.KHR.coopmatrix<8x8xf32, Subgroup, MatrixAcc>
OPERATION_NAME = 'spirv.KHR.CooperativeMatrixLoad'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
stride() _ods_ir
matrix_layout() _ods_ir
memory_operand() _ods_ir | None
alignment() _ods_ir | None
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.KHR_CooperativeMatrixLoad(result, pointer, matrix_layout, stride, *, memory_operand=None, alignment=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.KHRCooperativeMatrixMulAddOp(a, b, c, *, matrix_operands=None, results=None, loc=None, ip=None)

Bases: _ods_ir

Linear-algebraic matrix multiply of A by B and then component-wise add C. The order of the operations is implementation-dependent. The internal precision of floating-point operations is defined by the client API. Integer operations used in the multiplication of A by B are performed at the precision of the Result Type and the resulting value will equal the low-order N bits of the correct result R, where N is the result width and R is computed with enough precision to avoid overflow and underflow if the SaturatingAccumulation Cooperative Matrix Operand is not present. If the SaturatingAccumulation Cooperative Matrix Operand is present and overflow or underflow occurs as part of calculating that intermediate result, the result of the instruction is undefined. Integer additions of the elements of that intermediate result with those of C are performed at the precision of Result Type, are exact, and are saturating if the SaturatingAccumulation Cooperative Matrix Operand is present, with the signedness of the saturation being that of the components of Result Type. If the SaturatingAccumulation Cooperative Matrix Operand is not present then the resulting value will equal the low-order N bits of the correct result R, where N is the result width and R is computed with enough precision to avoid overflow and underflow.

Result Type must be a cooperative matrix type with M rows and N columns whose Use must be MatrixAccumulatorKHR.

A is a cooperative matrix with M rows and K columns whose Use must be MatrixAKHR.

B is a cooperative matrix with K rows and N columns whose Use must be MatrixBKHR.

C is a cooperative matrix with M rows and N columns whose Use must be MatrixAccumulatorKHR.

The values of M, N, and K must be consistent across the result and operands. This is referred to as an MxNxK matrix multiply.

A, B, C, and Result Type must have the same scope, and this defines the scope of the operation. A, B, C, and Result Type need not necessarily have the same component type, this is defined by the client API.

If the Component Type of any matrix operand is an integer type, then its components are treated as signed if the Matrix{A,B,C,Result}SignedComponents Cooperative Matrix Operand is present and are treated as unsigned otherwise.

Cooperative Matrix Operands is an optional Cooperative Matrix Operand literal. If not present, it is the same as specifying the Cooperative Matrix Operand None.

For a given dynamic instance of this instruction, all invocations in a given scope instance must be active or all must be inactive (where the scope is the scope of the operation).

cooperative-matrixmuladd-op ::= ssa-id `=` `spirv.KHR.CooperativeMatrixMulAdd`
                          ssa-use `,` ssa-use `,` ssa-use
                          (`<` matrix-operands `>`)? `:`
                          a-cooperative-matrix-type `,`
                          b-cooperative-matrix-type `->`
                            result-cooperative-matrix-type

Example:

%0 = spirv.KHR.CooperativeMatrixMulAdd %matA, %matB, %matC :
  !spirv.coopmatrix<4x4xf32, Subgroup, MatrixA>,
  !spirv.coopmatrix<4x4xf32, Subgroup, MatrixB> ->
    !spirv.coopmatrix<4x4xf32, Subgroup, MatrixAcc>

%1 = spirv.KHR.CooperativeMatrixMulAdd %matA, %matB, %matC, <ASigned | AccSat> :
  !spirv.coopmatrix<8x16xi32, Subgroup, MatrixA>,
  !spirv.coopmatrix<16x4xi32, Subgroup, MatrixB> ->
    !spirv.coopmatrix<8x4xi32, Subgroup, MatrixAcc>
OPERATION_NAME = 'spirv.KHR.CooperativeMatrixMulAdd'
_ODS_REGIONS = (0, True)
a() _ods_ir
b() _ods_ir
c() _ods_ir
matrix_operands() _ods_ir | None
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.KHR_CooperativeMatrixMulAdd(a, b, c, *, matrix_operands=None, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.KHRCooperativeMatrixStoreOp(pointer, object, matrix_layout, stride, *, memory_operand=None, alignment=None, loc=None, ip=None)

Bases: _ods_ir

Store a cooperative matrix through a pointer. Pointer is a pointer. Its type must be an OpTypePointer whose Type operand is a scalar or vector type. If the Shader capability was declared, Pointer must point into an array and any ArrayStride decoration on Pointer is ignored.

Object is the object to store. Its type must be an OpTypeCooperativeMatrixKHR.

MemoryLayout specifies how matrix elements are laid out in memory. It must come from a 32-bit integer constant instruction whose value corresponds to a Cooperative Matrix Layout. See the Cooperative Matrix Layout table for a description of the layouts and detailed layout-specific rules.

Stride further qualifies how matrix elements are laid out in memory. It must be a scalar integer type and its exact semantics depend on MemoryLayout.

Memory Operand must be a Memory Operand literal. If not present, it is the same as specifying None.

NOTE: In earlier versions of the SPIR-V spec, ‘Memory Operand’ was known as ‘Memory Access’.

For a given dynamic instance of this instruction, all operands of this instruction must be the same for all invocations in a given scope instance (where the scope is the scope the cooperative matrix type was created with). All invocations in a given scope instance must be active or all must be inactive.

TODO: In the SPIR-V spec, stride is an optional argument. We should also support this optionality in the SPIR-V dialect.

Example:

spirv.KHR.CooperativeMatrixStore %ptr, %obj, %stride, <RowMajor> :
  !spirv.ptr<i32, StorageBuffer>, !spirv.coopmatrix<16x8xi32, Workgroup, MatrixA>, i32

spirv.KHR.CooperativeMatrixStore %ptr, %obj, %stride, <ColumnMajor>, <Volatile> :
  !spirv.ptr<f32, StorageBuffer>, !spirv.coopmatrix<8x8xf32, Subgroup, MatrixAcc>, i64
OPERATION_NAME = 'spirv.KHR.CooperativeMatrixStore'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
object() _ods_ir
stride() _ods_ir
matrix_layout() _ods_ir
memory_operand() _ods_ir | None
alignment() _ods_ir | None
mlir.dialects._spirv_ops_gen.KHR_CooperativeMatrixStore(pointer, object, matrix_layout, stride, *, memory_operand=None, alignment=None, loc=None, ip=None) KHRCooperativeMatrixStoreOp
class mlir.dialects._spirv_ops_gen.KHRSubgroupBallotOp(result, predicate, *, loc=None, ip=None)

Bases: _ods_ir

Computes a bitfield value combining the Predicate value from all invocations in the current Subgroup that execute the same dynamic instance of this instruction. The bit is set to one if the corresponding invocation is active and the predicate is evaluated to true; otherwise, it is set to zero.

Predicate must be a Boolean type.

Result Type must be a 4 component vector of 32 bit integer types.

Result is a set of bitfields where the first invocation is represented in bit 0 of the first vector component and the last (up to SubgroupSize) is the higher bit number of the last bitmask needed to represent all bits of the subgroup invocations.

subgroup-ballot-op ::= ssa-id `=` `spirv.KHR.SubgroupBallot`
                            ssa-use `:` `vector` `<` 4 `x` `i32` `>`

Example:

%0 = spirv.KHR.SubgroupBallot %predicate : vector<4xi32>
OPERATION_NAME = 'spirv.KHR.SubgroupBallot'
_ODS_REGIONS = (0, True)
predicate() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.KHR_SubgroupBallot(result, predicate, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.KillOp(*, loc=None, ip=None)

Bases: _ods_ir

Fragment-shader discard.

Ceases all further processing in any invocation that executes it: Only instructions these invocations executed before OpKill have observable side effects. If this instruction is executed in non-uniform control flow, all subsequent control flow is non-uniform (for invocations that continue to execute).

This instruction must be the last instruction in a block.

This instruction is only valid in the Fragment Execution Model.

Example:

spirv.Kill
OPERATION_NAME = 'spirv.Kill'
_ODS_REGIONS = (0, True)
mlir.dialects._spirv_ops_gen.Kill(*, loc=None, ip=None) KillOp
class mlir.dialects._spirv_ops_gen.LoadOp(value, ptr, *, memory_access=None, alignment=None, loc=None, ip=None)

Bases: _ods_ir

Result Type is the type of the loaded object. It must be a type with fixed size; i.e., it cannot be, nor include, any OpTypeRuntimeArray types.

Pointer is the pointer to load through. Its type must be an OpTypePointer whose Type operand is the same as Result Type.

If present, any Memory Operands must begin with a memory operand literal. If not present, it is the same as specifying the memory operand None.

memory-access ::= `"None"` | `"Volatile"` | `"Aligned", ` integer-literal
                | `"NonTemporal"`

load-op ::= ssa-id ` = spirv.Load ` storage-class ssa-use
            (`[` memory-access `]`)? ` : ` spirv-element-type

Example:

%0 = spirv.Variable : !spirv.ptr<f32, Function>
%1 = spirv.Load "Function" %0 : f32
%2 = spirv.Load "Function" %0 ["Volatile"] : f32
%3 = spirv.Load "Function" %0 ["Aligned", 4] : f32
OPERATION_NAME = 'spirv.Load'
_ODS_REGIONS = (0, True)
ptr() _ods_ir
memory_access() _ods_ir | None
alignment() _ods_ir | None
value() _ods_ir
mlir.dialects._spirv_ops_gen.Load(value, ptr, *, memory_access=None, alignment=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.LogicalAndOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 must be the same as Result Type.

The type of Operand 2 must be the same as Result Type.

Results are computed per component.

Example:

%2 = spirv.LogicalAnd %0, %1 : i1
%2 = spirv.LogicalAnd %0, %1 : vector<4xi1>
OPERATION_NAME = 'spirv.LogicalAnd'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.LogicalAnd(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.LogicalEqualOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 must be the same as Result Type.

The type of Operand 2 must be the same as Result Type.

Results are computed per component.

Example:

%2 = spirv.LogicalEqual %0, %1 : i1
%2 = spirv.LogicalEqual %0, %1 : vector<4xi1>
OPERATION_NAME = 'spirv.LogicalEqual'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.LogicalEqual(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.LogicalNotEqualOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 must be the same as Result Type.

The type of Operand 2 must be the same as Result Type.

Results are computed per component.

Example:

%2 = spirv.LogicalNotEqual %0, %1 : i1
%2 = spirv.LogicalNotEqual %0, %1 : vector<4xi1>
OPERATION_NAME = 'spirv.LogicalNotEqual'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.LogicalNotEqual(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.LogicalNotOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand must be the same as Result Type.

Results are computed per component.

Example:

%2 = spirv.LogicalNot %0 : i1
%2 = spirv.LogicalNot %0 : vector<4xi1>
OPERATION_NAME = 'spirv.LogicalNot'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.LogicalNot(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.LogicalOrOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 must be the same as Result Type.

The type of Operand 2 must be the same as Result Type.

Results are computed per component.

Example:

%2 = spirv.LogicalOr %0, %1 : i1
%2 = spirv.LogicalOr %0, %1 : vector<4xi1>
OPERATION_NAME = 'spirv.LogicalOr'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.LogicalOr(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.LoopOp(results_, loop_control, *, loc=None, ip=None)

Bases: _ods_ir

SPIR-V can explicitly declare structured control-flow constructs using merge instructions. These explicitly declare a header block before the control flow diverges and a merge block where control flow subsequently converges. These blocks delimit constructs that must nest, and can only be entered and exited in structured ways. See “2.11. Structured Control Flow” of the SPIR-V spec for more details.

Instead of having a spirv.LoopMerge op to directly model loop merge instruction for indicating the merge and continue target, we use regions to delimit the boundary of the loop: the merge target is the next op following the spirv.mlir.loop op and the continue target is the block that has a back-edge pointing to the entry block inside the spirv.mlir.loop’s region. This way it’s easier to discover all blocks belonging to a construct and it plays nicer with the MLIR system.

The spirv.mlir.loop region should contain at least four blocks: one entry block, one loop header block, one loop continue block, one loop merge block. The entry block should be the first block and it should jump to the loop header block, which is the second block. The loop merge block should be the last block. The merge block should only contain a spirv.mlir.merge op. The continue block should be the second to last block and it should have a branch to the loop header block. The loop continue block should be the only block, except the entry block, branching to the header block.

Values defined inside the loop regions cannot be directly used outside of them; however, the loop region can yield values. These values are yielded using a spirv.mlir.merge op and returned as a result of the loop op.

OPERATION_NAME = 'spirv.mlir.loop'
_ODS_REGIONS = (1, True)
loop_control() _ods_ir
results_() _ods_ir
body() _ods_ir
mlir.dialects._spirv_ops_gen.mlir_loop(results_, loop_control, *, loc=None, ip=None) _ods_ir | _ods_ir | LoopOp
class mlir.dialects._spirv_ops_gen.MatrixTimesMatrixOp(result, leftmatrix, rightmatrix, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be an OpTypeMatrix whose Column Type is a vector of floating-point type.

LeftMatrix must be a matrix whose Column Type is the same as the Column Type in Result Type.

RightMatrix must be a matrix with the same Component Type as the Component Type in Result Type. Its number of columns must equal the number of columns in Result Type. Its columns must have the same number of components as the number of columns in LeftMatrix.

Example:

%0 = spirv.MatrixTimesMatrix %matrix_1, %matrix_2 :
    !spirv.matrix<4 x vector<3xf32>>, !spirv.matrix<3 x vector<4xf32>> ->
    !spirv.matrix<4 x vector<4xf32>>
OPERATION_NAME = 'spirv.MatrixTimesMatrix'
_ODS_REGIONS = (0, True)
leftmatrix() _ods_ir
rightmatrix() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.MatrixTimesMatrix(result, leftmatrix, rightmatrix, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.MatrixTimesScalarOp(matrix, scalar, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a matrix type with a float component type.

The type of Matrix must be the same as Result Type. Each component in each column in Matrix is multiplied by Scalar.

Scalar must have the same type as the Component Type in Result Type.

Example:

%0 = spirv.MatrixTimesScalar %matrix, %scalar :
!spirv.matrix<3 x vector<3xf32>>, f32 -> !spirv.matrix<3 x vector<3xf32>>
OPERATION_NAME = 'spirv.MatrixTimesScalar'
_ODS_REGIONS = (0, True)
matrix() _ods_ir
scalar() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.MatrixTimesScalar(matrix, scalar, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.MatrixTimesVectorOp(result, matrix, vector, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a vector of floating-point type.

Matrix must be an OpTypeMatrix whose Column Type is Result Type.

Vector must be a vector with the same Component Type as the Component Type in Result Type. Its number of components must equal the number of columns in Matrix.

Example:

%0 = spirv.MatrixTimesVector %matrix, %vector :
    !spirv.matrix<3 x vector<2xf32>>, vector<3xf32> -> vector<2xf32>
OPERATION_NAME = 'spirv.MatrixTimesVector'
_ODS_REGIONS = (0, True)
matrix() _ods_ir
vector() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.MatrixTimesVector(result, matrix, vector, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.MemoryBarrierOp(memory_scope, memory_semantics, *, loc=None, ip=None)

Bases: _ods_ir

Ensures that memory accesses issued before this instruction will be observed before memory accesses issued after this instruction. This control is ensured only for memory accesses issued by this invocation and observed by another invocation executing within Memory scope. If the Vulkan memory model is declared, this ordering only applies to memory accesses that use the NonPrivatePointer memory operand or NonPrivateTexel image operand.

Semantics declares what kind of memory is being controlled and what kind of control to apply.

To execute both a memory barrier and a control barrier, see OpControlBarrier.

Example:

spirv.MemoryBarrier "Device", "Acquire|UniformMemory"
OPERATION_NAME = 'spirv.MemoryBarrier'
_ODS_REGIONS = (0, True)
memory_scope() _ods_ir
memory_semantics() _ods_ir
mlir.dialects._spirv_ops_gen.MemoryBarrier(memory_scope, memory_semantics, *, loc=None, ip=None) MemoryBarrierOp
class mlir.dialects._spirv_ops_gen.MergeOp(operands_, *, loc=None, ip=None)

Bases: _ods_ir

We use spirv.mlir.selection/spirv.mlir.loop for modelling structured selection/loop. This op is a terminator used inside their regions to mean jumping to the merge point, which is the next op following the spirv.mlir.selection or spirv.mlir.loop op. This op does not have a corresponding instruction in the SPIR-V binary format; it’s solely for structural purpose.

The instruction is also used to yield values from inside the selection/loop region to the outside, as values that were sunk into the region cannot otherwise escape it.

OPERATION_NAME = 'spirv.mlir.merge'
_ODS_REGIONS = (0, True)
operands_() _ods_ir
mlir.dialects._spirv_ops_gen.mlir_merge(operands_, *, loc=None, ip=None) MergeOp
class mlir.dialects._spirv_ops_gen.ModuleOp(addressing_model, memory_model, *, vce_triple=None, sym_name=None, loc=None, ip=None)

Bases: _ods_ir

This op defines a SPIR-V module using a MLIR region. The region contains one block. Module-level operations, including functions definitions, are all placed in this block.

Using an op with a region to define a SPIR-V module enables “embedding” SPIR-V modules in other dialects in a clean manner: this op guarantees the validity and serializability of a SPIR-V module and thus serves as a clear-cut boundary.

This op takes no operands and generates no results. This op should not implicitly capture values from the enclosing environment.

This op has only one region, which only contains one block. The block has no terminator.

addressing-model ::= `Logical` | `Physical32` | `Physical64` | ...
memory-model ::= `Simple` | `GLSL450` | `OpenCL` | `Vulkan` | ...
spv-module-op ::= `spirv.module` addressing-model memory-model
                  (requires  spirv-vce-attribute)?
                  (`attributes` attribute-dict)?
                  region

Example:

spirv.module Logical GLSL450  {}

spirv.module Logical Vulkan
    requires #spirv.vce<v1.0, [Shader], [SPV_KHR_vulkan_memory_model]>
    attributes { some_additional_attr = ... } {
  spirv.func @do_nothing() -> () {
    spirv.Return
  }
}
OPERATION_NAME = 'spirv.module'
_ODS_REGIONS = (1, True)
addressing_model() _ods_ir
memory_model() _ods_ir
vce_triple() _ods_ir | None
sym_name() _ods_ir | None
mlir.dialects._spirv_ops_gen.module(addressing_model, memory_model, *, vce_triple=None, sym_name=None, loc=None, ip=None) ModuleOp
class mlir.dialects._spirv_ops_gen.NotOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Results are computed per component, and within each component, per bit.

Result Type must be a scalar or vector of integer type.

Operand’s type must be a scalar or vector of integer type. It must have the same number of components as Result Type. The component width must equal the component width in Result Type.

Example:

%2 = spirv.Not %0 : i32
%3 = spirv.Not %1 : vector<4xi32>
OPERATION_NAME = 'spirv.Not'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.Not(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.OrderedOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

x must be a scalar or vector of floating-point type. It must have the same number of components as Result Type.

y must have the same type as x.

Results are computed per component.

Example:

%4 = spirv.Ordered %0, %1 : f32
%5 = spirv.Ordered %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.Ordered'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.Ordered(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.PtrAccessChainOp(result, base_ptr, element, indices, *, loc=None, ip=None)

Bases: _ods_ir

Element is used to do an initial dereference of Base: Base is treated as the address of an element in an array, and a new element address is computed from Base and Element to become the OpAccessChain Base to dereference as per OpAccessChain. This computed Base has the same type as the originating Base.

To compute the new element address, Element is treated as a signed count of elements E, relative to the original Base element B, and the address of element B + E is computed using enough precision to avoid overflow and underflow. For objects in the Uniform, StorageBuffer, or PushConstant storage classes, the element’s address or location is calculated using a stride, which will be the Base-type’s Array Stride if the Base type is decorated with ArrayStride. For all other objects, the implementation calculates the element’s address or location.

With one exception, undefined behavior results when B + E is not an element in the same array (same innermost array, if array types are nested) as B. The exception being when B + E = L, where L is the length of the array: the address computation for element L is done with the same stride as any other B + E computation that stays within the array.

Note: If Base is typed to be a pointer to an array and the desired operation is to select an element of that array, OpAccessChain should be directly used, as its first Index selects the array element.

Example:

func @ptr_access_chain(%arg0: !spirv.ptr<f32, CrossWorkgroup>, %arg1 : i64) -> () {
  %0 = spirv.PtrAccessChain %arg0[%arg1] : !spirv.ptr<f32, CrossWorkgroup>, i64 -> !spirv.ptr<f32, CrossWorkgroup>
  ...
}
OPERATION_NAME = 'spirv.PtrAccessChain'
_ODS_REGIONS = (0, True)
base_ptr() _ods_ir
element() _ods_ir
indices() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.PtrAccessChain(result, base_ptr, element, indices, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.PtrCastToGenericOp(result, pointer, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be an OpTypePointer. Its Storage Class must be Generic.

Pointer must point to the Workgroup, CrossWorkgroup, or Function Storage Class.

Result Type and Pointer must point to the same type.

Example:

%1 = spirv.PtrCastToGenericOp %0 : !spirv.ptr<f32, CrossWorkGroup> to
     !spirv.ptr<f32, Generic>
OPERATION_NAME = 'spirv.PtrCastToGeneric'
_ODS_REGIONS = (0, True)
pointer() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.PtrCastToGeneric(result, pointer, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ReferenceOfOp(reference, spec_const, *, loc=None, ip=None)

Bases: _ods_ir

Specialization constants in module scope are defined using symbol names. This op generates an SSA value that can be used to refer to the symbol within function scope for use in ops that expect an SSA value. This operation has no corresponding SPIR-V instruction; it’s merely used for modelling purpose in the SPIR-V dialect. This op’s return type is the same as the specialization constant.

Example:

%0 = spirv.mlir.referenceof @spec_const : f32

TODO Add support for composite specialization constants.

OPERATION_NAME = 'spirv.mlir.referenceof'
_ODS_REGIONS = (0, True)
spec_const() _ods_ir
reference() _ods_ir
mlir.dialects._spirv_ops_gen.mlir_referenceof(reference, spec_const, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ReturnOp(*, loc=None, ip=None)

Bases: _ods_ir

This instruction must be the last instruction in a block.

Example:

spirv.Return
OPERATION_NAME = 'spirv.Return'
_ODS_REGIONS = (0, True)
mlir.dialects._spirv_ops_gen.Return(*, loc=None, ip=None) ReturnOp
class mlir.dialects._spirv_ops_gen.ReturnValueOp(value, *, loc=None, ip=None)

Bases: _ods_ir

Value is the value returned, by copy, and must match the Return Type operand of the OpTypeFunction type of the OpFunction body this return instruction is in.

This instruction must be the last instruction in a block.

Example:

spirv.ReturnValue %0 : f32
OPERATION_NAME = 'spirv.ReturnValue'
_ODS_REGIONS = (0, True)
value() _ods_ir
mlir.dialects._spirv_ops_gen.ReturnValue(value, *, loc=None, ip=None) ReturnValueOp
class mlir.dialects._spirv_ops_gen.SConvertOp(result, operand, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

Signed Value must be a scalar or vector of integer type. It must have the same number of components as Result Type. The component width cannot equal the component width in Result Type.

Results are computed per component.

Example:

%1 = spirv.SConvertOp %0 : i32 to i64
%3 = spirv.SConvertOp %2 : vector<3xi32> to vector<3xi64>
OPERATION_NAME = 'spirv.SConvert'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.SConvert(result, operand, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.SDivOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same number of components as Result Type. They must have the same component width as Result Type.

Results are computed per component. The resulting value is undefined if Operand 2 is 0.

Example:

%4 = spirv.SDiv %0, %1 : i32
%5 = spirv.SDiv %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.SDiv'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.SDiv(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.SDotAccSatOp(vector1, vector2, accumulator, *, format=None, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be an integer type whose Width must be greater than or equal to that of the components of Vector 1 and Vector 2.

Vector 1 and Vector 2 must have the same type.

Vector 1 and Vector 2 must be either 32-bit integers (enabled by the DotProductInput4x8BitPacked capability) or vectors of integer type (enabled by the DotProductInput4x8Bit or DotProductInputAll capability).

The type of Accumulator must be the same as Result Type.

When Vector 1 and Vector 2 are scalar integer types, Packed Vector Format must be specified to select how the integers are to be interpreted as vectors.

All components of the input vectors are sign-extended to the bit width of the result’s type. The sign-extended input vectors are then multiplied component-wise and all components of the vector resulting from the component-wise multiplication are added together. Finally, the resulting sum is added to the input accumulator. This final addition is saturating.

If any of the multiplications or additions, with the exception of the final accumulation, overflow or underflow, the result of the instruction is undefined.

Example:

%r = spirv.SDotAccSat %a, %b, %acc, <PackedVectorFormat4x8Bit> : i32 -> i32
%r = spirv.SDotAccSat %a, %b, %acc, <PackedVectorFormat4x8Bit> : i32 -> i64
%r = spirv.SDotAccSat %a, %b, %acc : vector<4xi8> -> i32
OPERATION_NAME = 'spirv.SDotAccSat'
_ODS_REGIONS = (0, True)
vector1() _ods_ir
vector2() _ods_ir
accumulator() _ods_ir
format() _ods_ir | None
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.SDotAccSat(vector1, vector2, accumulator, *, format=None, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.SDotOp(result, vector1, vector2, *, format=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be an integer type whose Width must be greater than or equal to that of the components of Vector 1 and Vector 2.

Vector 1 and Vector 2 must have the same type.

Vector 1 and Vector 2 must be either 32-bit integers (enabled by the DotProductInput4x8BitPacked capability) or vectors of integer type (enabled by the DotProductInput4x8Bit or DotProductInputAll capability).

When Vector 1 and Vector 2 are scalar integer types, Packed Vector Format must be specified to select how the integers are to be interpreted as vectors.

All components of the input vectors are sign-extended to the bit width of the result’s type. The sign-extended input vectors are then multiplied component-wise and all components of the vector resulting from the component-wise multiplication are added together. The resulting value will equal the low-order N bits of the correct result R, where N is the result width and R is computed with enough precision to avoid overflow and underflow.

Example:

%r = spirv.SDot %a, %b, <PackedVectorFormat4x8Bit> : i32 -> i32
%r = spirv.SDot %a, %b, <PackedVectorFormat4x8Bit> : i32 -> i64
%r = spirv.SDot %a, %b : vector<4xi8> -> i32
OPERATION_NAME = 'spirv.SDot'
_ODS_REGIONS = (0, True)
vector1() _ods_ir
vector2() _ods_ir
format() _ods_ir | None
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.SDot(result, vector1, vector2, *, format=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.SGreaterThanEqualOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same component width, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.SGreaterThanEqual %0, %1 : i32
%5 = spirv.SGreaterThanEqual %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.SGreaterThanEqual'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.SGreaterThanEqual(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.SGreaterThanOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same component width, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.SGreaterThan %0, %1 : i32
%5 = spirv.SGreaterThan %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.SGreaterThan'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.SGreaterThan(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.SLessThanEqualOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same component width, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.SLessThanEqual %0, %1 : i32
%5 = spirv.SLessThanEqual %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.SLessThanEqual'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.SLessThanEqual(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.SLessThanOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same component width, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.SLessThan %0, %1 : i32
%5 = spirv.SLessThan %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.SLessThan'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.SLessThan(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.SModOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same number of components as Result Type. They must have the same component width as Result Type.

Results are computed per component. The resulting value is undefined if Operand 2 is 0. Otherwise, the result is the remainder r of Operand 1 divided by Operand 2 where if r ≠ 0, the sign of r is the same as the sign of Operand 2.

Example:

%4 = spirv.SMod %0, %1 : i32
%5 = spirv.SMod %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.SMod'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.SMod(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.SMulExtendedOp(result, operand1, operand2, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be from OpTypeStruct. The struct must have two members, and the two members must be the same type. The member type must be a scalar or vector of integer type.

Operand 1 and Operand 2 must have the same type as the members of Result Type. These are consumed as signed integers.

Results are computed per component.

Member 0 of the result gets the low-order bits of the multiplication.

Member 1 of the result gets the high-order bits of the multiplication.

Example:

%2 = spirv.SMulExtended %0, %1 : !spirv.struct<(i32, i32)>
%2 = spirv.SMulExtended %0, %1 : !spirv.struct<(vector<2xi32>, vector<2xi32>)>
OPERATION_NAME = 'spirv.SMulExtended'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.SMulExtended(result, operand1, operand2, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.SNegateOp(operand, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

Operand’s type must be a scalar or vector of integer type. It must have the same number of components as Result Type. The component width must equal the component width in Result Type.

Results are computed per component.

Example:

%1 = spirv.SNegate %0 : i32
%3 = spirv.SNegate %2 : vector<4xi32>
OPERATION_NAME = 'spirv.SNegate'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.SNegate(operand, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.SRemOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same number of components as Result Type. They must have the same component width as Result Type.

Results are computed per component. The resulting value is undefined if Operand 2 is 0. Otherwise, the result is the remainder r of Operand 1 divided by Operand 2 where if r ≠ 0, the sign of r is the same as the sign of Operand 1.

Example:

%4 = spirv.SRem %0, %1 : i32
%5 = spirv.SRem %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.SRem'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.SRem(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.SUDotAccSatOp(vector1, vector2, accumulator, *, format=None, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be an integer type whose Width must be greater than or equal to that of the components of Vector 1 and Vector 2.

Vector 1 and Vector 2 must be either 32-bit integers (enabled by the DotProductInput4x8BitPacked capability) or vectors of integer type with the same number of components and same component Width (enabled by the DotProductInput4x8Bit or DotProductInputAll capability). When Vector 1 and Vector 2 are vectors, the components of Vector 2 must have a Signedness of 0.

The type of Accumulator must be the same as Result Type.

When Vector 1 and Vector 2 are scalar integer types, Packed Vector Format must be specified to select how the integers are to be interpreted as vectors.

All components of Vector 1 are sign-extended to the bit width of the result’s type. All components of Vector 2 are zero-extended to the bit width of the result’s type. The sign- or zero-extended input vectors are then multiplied component-wise and all components of the vector resulting from the component-wise multiplication are added together. Finally, the resulting sum is added to the input accumulator. This final addition is saturating.

If any of the multiplications or additions, with the exception of the final accumulation, overflow or underflow, the result of the instruction is undefined.

Example:

%r = spirv.SUDotAccSat %a, %b, %acc, <PackedVectorFormat4x8Bit> : i32 -> i32
%r = spirv.SUDotAccSat %a, %b, %acc, <PackedVectorFormat4x8Bit> : i32 -> i64
%r = spirv.SUDotAccSat %a, %b, %acc : vector<4xi8> -> i32
OPERATION_NAME = 'spirv.SUDotAccSat'
_ODS_REGIONS = (0, True)
vector1() _ods_ir
vector2() _ods_ir
accumulator() _ods_ir
format() _ods_ir | None
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.SUDotAccSat(vector1, vector2, accumulator, *, format=None, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.SUDotOp(result, vector1, vector2, *, format=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be an integer type whose Width must be greater than or equal to that of the components of Vector 1 and Vector 2.

Vector 1 and Vector 2 must be either 32-bit integers (enabled by the DotProductInput4x8BitPacked capability) or vectors of integer type with the same number of components and same component Width (enabled by the DotProductInput4x8Bit or DotProductInputAll capability). When Vector 1 and Vector 2 are vectors, the components of Vector 2 must have a Signedness of 0.

When Vector 1 and Vector 2 are scalar integer types, Packed Vector Format must be specified to select how the integers are to be interpreted as vectors.

All components of Vector 1 are sign-extended to the bit width of the result’s type. All components of Vector 2 are zero-extended to the bit width of the result’s type. The sign- or zero-extended input vectors are then multiplied component-wise and all components of the vector resulting from the component-wise multiplication are added together. The resulting value will equal the low-order N bits of the correct result R, where N is the result width and R is computed with enough precision to avoid overflow and underflow.

Example:

%r = spirv.SUDot %a, %b, <PackedVectorFormat4x8Bit> : i32 -> i32
%r = spirv.SUDot %a, %b, <PackedVectorFormat4x8Bit> : i32 -> i64
%r = spirv.SUDot %a, %b : vector<4xi8> -> i32
OPERATION_NAME = 'spirv.SUDot'
_ODS_REGIONS = (0, True)
vector1() _ods_ir
vector2() _ods_ir
format() _ods_ir | None
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.SUDot(result, vector1, vector2, *, format=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.SelectOp(condition, true_value, false_value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Before version 1.4, Result Type must be a pointer, scalar, or vector.

The types of Object 1 and Object 2 must be the same as Result Type.

Condition must be a scalar or vector of Boolean type.

If Condition is a scalar and true, the result is Object 1. If Condition is a scalar and false, the result is Object 2.

If Condition is a vector, Result Type must be a vector with the same number of components as Condition and the result is a mix of Object 1 and Object 2: When a component of Condition is true, the corresponding component in the result is taken from Object 1, otherwise it is taken from Object 2.

Example:

%3 = spirv.Select %0, %1, %2 : i1, f32
%3 = spirv.Select %0, %1, %2 : i1, vector<3xi32>
%3 = spirv.Select %0, %1, %2 : vector<3xi1>, vector<3xf32>
OPERATION_NAME = 'spirv.Select'
_ODS_REGIONS = (0, True)
condition() _ods_ir
true_value() _ods_ir
false_value() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.Select(condition, true_value, false_value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.SelectionOp(results_, selection_control, *, loc=None, ip=None)

Bases: _ods_ir

SPIR-V can explicitly declare structured control-flow constructs using merge instructions. These explicitly declare a header block before the control flow diverges and a merge block where control flow subsequently converges. These blocks delimit constructs that must nest, and can only be entered and exited in structured ways. See “2.11. Structured Control Flow” of the SPIR-V spec for more details.

Instead of having a spirv.SelectionMerge op to directly model selection merge instruction for indicating the merge target, we use regions to delimit the boundary of the selection: the merge target is the next op following the spirv.mlir.selection op. This way it’s easier to discover all blocks belonging to the selection and it plays nicer with the MLIR system.

The spirv.mlir.selection region should contain at least two blocks: one selection header block, and one selection merge. The selection header block should be the first block. The selection merge block should be the last block. The merge block should only contain a spirv.mlir.merge op.

Values defined inside the selection regions cannot be directly used outside of them; however, the selection region can yield values. These values are yielded using a spirv.mlir.merge op and returned as a result of the selection op.

OPERATION_NAME = 'spirv.mlir.selection'
_ODS_REGIONS = (1, True)
selection_control() _ods_ir
results_() _ods_ir
body() _ods_ir
mlir.dialects._spirv_ops_gen.mlir_selection(results_, selection_control, *, loc=None, ip=None) _ods_ir | _ods_ir | SelectionOp
class mlir.dialects._spirv_ops_gen.ShiftLeftLogicalOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

The type of each Base and Shift must be a scalar or vector of integer type. Base and Shift must have the same number of components. The number of components and bit width of the type of Base must be the same as in Result Type.

Shift is treated as unsigned. The result is undefined if Shift is greater than or equal to the bit width of the components of Base.

The number of components and bit width of Result Type must match those Base type. All types must be integer types.

Results are computed per component.

Example:

%2 = spirv.ShiftLeftLogical %0, %1 : i32, i16
%5 = spirv.ShiftLeftLogical %3, %4 : vector<3xi32>, vector<3xi16>
OPERATION_NAME = 'spirv.ShiftLeftLogical'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ShiftLeftLogical(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ShiftRightArithmeticOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

The type of each Base and Shift must be a scalar or vector of integer type. Base and Shift must have the same number of components. The number of components and bit width of the type of Base must be the same as in Result Type.

Shift is treated as unsigned. The result is undefined if Shift is greater than or equal to the bit width of the components of Base.

Results are computed per component.

Example:

%2 = spirv.ShiftRightArithmetic %0, %1 : i32, i16
%5 = spirv.ShiftRightArithmetic %3, %4 : vector<3xi32>, vector<3xi16>
OPERATION_NAME = 'spirv.ShiftRightArithmetic'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ShiftRightArithmetic(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ShiftRightLogicalOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type.

The type of each Base and Shift must be a scalar or vector of integer type. Base and Shift must have the same number of components. The number of components and bit width of the type of Base must be the same as in Result Type.

Shift is consumed as an unsigned integer. The result is undefined if Shift is greater than or equal to the bit width of the components of Base.

Results are computed per component.

Example:

%2 = spirv.ShiftRightLogical %0, %1 : i32, i16
%5 = spirv.ShiftRightLogical %3, %4 : vector<3xi32>, vector<3xi16>
OPERATION_NAME = 'spirv.ShiftRightLogical'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ShiftRightLogical(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.SpecConstantCompositeOp(type_, sym_name, constituents, *, loc=None, ip=None)

Bases: _ods_ir

This op declares a SPIR-V composite specialization constant. This covers the OpSpecConstantComposite SPIR-V instruction. Scalar constants are covered by spirv.SpecConstant.

A constituent of a spec constant composite can be:

  • A symbol referring of another spec constant.

  • The SSA ID of a non-specialization constant (i.e. defined through

spirv.SpecConstant). * The SSA ID of a spirv.Undef.

spv-spec-constant-composite-op ::= `spirv.SpecConstantComposite` symbol-ref-id ` (`
                                   symbol-ref-id (`, ` symbol-ref-id)*
                                   `) :` composite-type

where composite-type is some non-scalar type that can be represented in the spv dialect: spirv.struct, spirv.array, or vector.

Example:

spirv.SpecConstant @sc1 = 1   : i32
spirv.SpecConstant @sc2 = 2.5 : f32
spirv.SpecConstant @sc3 = 3.5 : f32
spirv.SpecConstantComposite @scc (@sc1, @sc2, @sc3) : !spirv.struct<i32, f32, f32>

TODO Add support for constituents that are:

  • regular constants.

  • undef.

  • spec constant composite.

OPERATION_NAME = 'spirv.SpecConstantComposite'
_ODS_REGIONS = (0, True)
type_() _ods_ir
sym_name() _ods_ir
constituents() _ods_ir
mlir.dialects._spirv_ops_gen.SpecConstantComposite(type_, sym_name, constituents, *, loc=None, ip=None) SpecConstantCompositeOp
class mlir.dialects._spirv_ops_gen.SpecConstantOp(sym_name, default_value, *, loc=None, ip=None)

Bases: _ods_ir

This op declares a SPIR-V scalar specialization constant. SPIR-V has multiple constant instructions covering different scalar types:

  • OpSpecConstantTrue and OpSpecConstantFalse for boolean constants

  • OpSpecConstant for scalar constants

Similar as spirv.Constant, this op represents all of the above cases. OpSpecConstantComposite and OpSpecConstantOp are modelled with separate ops.

spv-spec-constant-op ::= `spirv.SpecConstant` symbol-ref-id
                         `spec_id(` integer `)`
                         `=` attribute-value (`:` spirv-type)?

where spec_id specifies the SPIR-V SpecId decoration associated with the op.

Example:

spirv.SpecConstant @spec_const1 = true
spirv.SpecConstant @spec_const2 spec_id(5) = 42 : i32
OPERATION_NAME = 'spirv.SpecConstant'
_ODS_REGIONS = (0, True)
sym_name() _ods_ir
default_value() _ods_ir
mlir.dialects._spirv_ops_gen.SpecConstant(sym_name, default_value, *, loc=None, ip=None) SpecConstantOp
class mlir.dialects._spirv_ops_gen.SpecConstantOperationOp(result, *, loc=None, ip=None)

Bases: _ods_ir

This op declares a SPIR-V specialization constant that results from doing an operation on other constants (specialization or otherwise).

In the spv dialect, this op is modelled as follows:

spv-spec-constant-operation-op ::= `spirv.SpecConstantOperation` `wraps`
                                     generic-spirv-op `:` function-type

In particular, an spirv.SpecConstantOperation contains exactly one region. In turn, that region, contains exactly 2 instructions:

  • One of SPIR-V’s instructions that are allowed within an

OpSpecConstantOp. * An spirv.mlir.yield instruction as the terminator.

The following SPIR-V instructions are valid:

  • OpSConvert,

  • OpUConvert,

  • OpFConvert,

  • OpSNegate,

  • OpNot,

  • OpIAdd,

  • OpISub,

  • OpIMul,

  • OpUDiv,

  • OpSDiv,

  • OpUMod,

  • OpSRem,

  • OpSMod

  • OpShiftRightLogical,

  • OpShiftRightArithmetic,

  • OpShiftLeftLogical

  • OpBitwiseOr,

  • OpBitwiseXor,

  • OpBitwiseAnd

  • OpVectorShuffle,

  • OpCompositeExtract,

  • OpCompositeInsert

  • OpLogicalOr,

  • OpLogicalAnd,

  • OpLogicalNot,

  • OpLogicalEqual,

  • OpLogicalNotEqual

  • OpSelect

  • OpIEqual,

  • OpINotEqual

  • OpULessThan,

  • OpSLessThan

  • OpUGreaterThan,

  • OpSGreaterThan

  • OpULessThanEqual,

  • OpSLessThanEqual

  • OpUGreaterThanEqual,

  • OpSGreaterThanEqual

TODO Add capability-specific ops when supported.

Example:

%0 = spirv.Constant 1: i32
%1 = spirv.Constant 1: i32

%2 = spirv.SpecConstantOperation wraps "spirv.IAdd"(%0, %1) : (i32, i32) -> i32
OPERATION_NAME = 'spirv.SpecConstantOperation'
_ODS_REGIONS = (1, True)
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

body() _ods_ir
mlir.dialects._spirv_ops_gen.SpecConstantOperation(result, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.StoreOp(ptr, value, *, memory_access=None, alignment=None, loc=None, ip=None)

Bases: _ods_ir

Pointer is the pointer to store through. Its type must be an OpTypePointer whose Type operand is the same as the type of Object.

Object is the object to store.

If present, any Memory Operands must begin with a memory operand literal. If not present, it is the same as specifying the memory operand None.

store-op ::= `spirv.Store ` storage-class ssa-use `, ` ssa-use `, `
              (`[` memory-access `]`)? `:` spirv-element-type

Example:

%0 = spirv.Variable : !spirv.ptr<f32, Function>
%1 = spirv.FMul ... : f32
spirv.Store "Function" %0, %1 : f32
spirv.Store "Function" %0, %1 ["Volatile"] : f32
spirv.Store "Function" %0, %1 ["Aligned", 4] : f32
OPERATION_NAME = 'spirv.Store'
_ODS_REGIONS = (0, True)
ptr() _ods_ir
value() _ods_ir
memory_access() _ods_ir | None
alignment() _ods_ir | None
mlir.dialects._spirv_ops_gen.Store(ptr, value, *, memory_access=None, alignment=None, loc=None, ip=None) StoreOp
class mlir.dialects._spirv_ops_gen.TransposeOp(result, matrix, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be an OpTypeMatrix.

Matrix must be an object of type OpTypeMatrix. The number of columns and the column size of Matrix must be the reverse of those in Result Type. The types of the scalar components in Matrix and Result Type must be the same.

Matrix must have of type of OpTypeMatrix.

Example:

%0 = spirv.Transpose %matrix: !spirv.matrix<2 x vector<3xf32>> ->
!spirv.matrix<3 x vector<2xf32>>
OPERATION_NAME = 'spirv.Transpose'
_ODS_REGIONS = (0, True)
matrix() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.Transpose(result, matrix, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.UConvertOp(result, operand, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type, whose Signedness operand is 0.

Unsigned Value must be a scalar or vector of integer type. It must have the same number of components as Result Type. The component width cannot equal the component width in Result Type.

Results are computed per component.

Example:

%1 = spirv.UConvertOp %0 : i32 to i64
%3 = spirv.UConvertOp %2 : vector<3xi32> to vector<3xi64>
OPERATION_NAME = 'spirv.UConvert'
_ODS_REGIONS = (0, True)
operand() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.UConvert(result, operand, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.UDivOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type, whose Signedness operand is 0.

The types of Operand 1 and Operand 2 both must be the same as Result Type.

Results are computed per component. The resulting value is undefined if Operand 2 is 0.

Example:

%4 = spirv.UDiv %0, %1 : i32
%5 = spirv.UDiv %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.UDiv'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.UDiv(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.UDotAccSatOp(vector1, vector2, accumulator, *, format=None, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be an integer type with Signedness of 0 whose Width must be greater than or equal to that of the components of Vector 1 and Vector 2.

Vector 1 and Vector 2 must have the same type.

Vector 1 and Vector 2 must be either 32-bit integers (enabled by the DotProductInput4x8BitPacked capability) or vectors of integer type with Signedness of 0 (enabled by the DotProductInput4x8Bit or DotProductInputAll capability).

The type of Accumulator must be the same as Result Type.

When Vector 1 and Vector 2 are scalar integer types, Packed Vector Format must be specified to select how the integers are to be interpreted as vectors.

All components of the input vectors are zero-extended to the bit width of the result’s type. The zero-extended input vectors are then multiplied component-wise and all components of the vector resulting from the component-wise multiplication are added together. Finally, the resulting sum is added to the input accumulator. This final addition is saturating.

If any of the multiplications or additions, with the exception of the final accumulation, overflow or underflow, the result of the instruction is undefined.

Example:

%r = spirv.UDotAccSat %a, %b, %acc, <PackedVectorFormat4x8Bit> : i32 -> i32
%r = spirv.UDotAccSat %a, %b, %acc, <PackedVectorFormat4x8Bit> : i32 -> i64
%r = spirv.UDotAccSat %a, %b, %acc : vector<4xi8> -> i32
OPERATION_NAME = 'spirv.UDotAccSat'
_ODS_REGIONS = (0, True)
vector1() _ods_ir
vector2() _ods_ir
accumulator() _ods_ir
format() _ods_ir | None
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.UDotAccSat(vector1, vector2, accumulator, *, format=None, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.UDotOp(result, vector1, vector2, *, format=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be an integer type with Signedness of 0 whose Width must be greater than or equal to that of the components of Vector 1 and Vector 2.

Vector 1 and Vector 2 must have the same type.

Vector 1 and Vector 2 must be either 32-bit integers (enabled by the DotProductInput4x8BitPacked capability) or vectors of integer type with Signedness of 0 (enabled by the DotProductInput4x8Bit or DotProductInputAll capability).

When Vector 1 and Vector 2 are scalar integer types, Packed Vector Format must be specified to select how the integers are to be interpreted as vectors.

All components of the input vectors are zero-extended to the bit width of the result’s type. The zero-extended input vectors are then multiplied component-wise and all components of the vector resulting from the component-wise multiplication are added together. The resulting value will equal the low-order N bits of the correct result R, where N is the result width and R is computed with enough precision to avoid overflow and underflow.

Example:

%r = spirv.UDot %a, %b, <PackedVectorFormat4x8Bit> : i32 -> i32
%r = spirv.UDot %a, %b, <PackedVectorFormat4x8Bit> : i32 -> i64
%r = spirv.UDot %a, %b : vector<4xi8> -> i32
OPERATION_NAME = 'spirv.UDot'
_ODS_REGIONS = (0, True)
vector1() _ods_ir
vector2() _ods_ir
format() _ods_ir | None
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.UDot(result, vector1, vector2, *, format=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.UGreaterThanEqualOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same component width, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.UGreaterThanEqual %0, %1 : i32
%5 = spirv.UGreaterThanEqual %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.UGreaterThanEqual'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.UGreaterThanEqual(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.UGreaterThanOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same component width, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.UGreaterThan %0, %1 : i32
%5 = spirv.UGreaterThan %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.UGreaterThan'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.UGreaterThan(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ULessThanEqualOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same component width, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.ULessThanEqual %0, %1 : i32
%5 = spirv.ULessThanEqual %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.ULessThanEqual'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ULessThanEqual(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.ULessThanOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

The type of Operand 1 and Operand 2 must be a scalar or vector of integer type. They must have the same component width, and they must have the same number of components as Result Type.

Results are computed per component.

Example:

%4 = spirv.ULessThan %0, %1 : i32
%5 = spirv.ULessThan %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.ULessThan'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.ULessThan(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.UModOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of integer type, whose Signedness operand is 0.

The types of Operand 1 and Operand 2 both must be the same as Result Type.

Results are computed per component. The resulting value is undefined if Operand 2 is 0.

Example:

%4 = spirv.UMod %0, %1 : i32
%5 = spirv.UMod %2, %3 : vector<4xi32>
OPERATION_NAME = 'spirv.UMod'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.UMod(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.UMulExtendedOp(result, operand1, operand2, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be from OpTypeStruct. The struct must have two members, and the two members must be the same type. The member type must be a scalar or vector of integer type, whose Signedness operand is 0.

Operand 1 and Operand 2 must have the same type as the members of Result Type. These are consumed as unsigned integers.

Results are computed per component.

Member 0 of the result gets the low-order bits of the multiplication.

Member 1 of the result gets the high-order bits of the multiplication.

Example:

%2 = spirv.UMulExtended %0, %1 : !spirv.struct<(i32, i32)>
%2 = spirv.UMulExtended %0, %1 : !spirv.struct<(vector<2xi32>, vector<2xi32>)>
OPERATION_NAME = 'spirv.UMulExtended'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.UMulExtended(result, operand1, operand2, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.UndefOp(result, *, loc=None, ip=None)

Bases: _ods_ir

Result Type is the type of object to make.

Each consumption of Result yields an arbitrary, possibly different bit pattern or abstract value resulting in possibly different concrete, abstract, or opaque values.

Example:

%0 = spirv.Undef : f32
%1 = spirv.Undef : !spirv.struct<!spirv.array<4 x vector<4xi32>>>
OPERATION_NAME = 'spirv.Undef'
_ODS_REGIONS = (0, True)
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.Undef(result, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.UnorderedOp(operand1, operand2, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar or vector of Boolean type.

x must be a scalar or vector of floating-point type. It must have the same number of components as Result Type.

y must have the same type as x.

Results are computed per component.

Example:

%4 = spirv.Unordered %0, %1 : f32
%5 = spirv.Unordered %2, %3 : vector<4xf32>
OPERATION_NAME = 'spirv.Unordered'
_ODS_REGIONS = (0, True)
operand1() _ods_ir
operand2() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.Unordered(operand1, operand2, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.UnreachableOp(*, loc=None, ip=None)

Bases: _ods_ir

This instruction must be the last instruction in a block.

OPERATION_NAME = 'spirv.Unreachable'
_ODS_REGIONS = (0, True)
mlir.dialects._spirv_ops_gen.Unreachable(*, loc=None, ip=None) UnreachableOp
class mlir.dialects._spirv_ops_gen.VariableOp(pointer, storage_class, *, initializer=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be an OpTypePointer. Its Type operand is the type of object in memory.

Storage Class is the Storage Class of the memory holding the object. Since the op is used to model function-level variables, the storage class must be the Function Storage Class.

Initializer is optional. If Initializer is present, it will be the initial value of the variable’s memory content. Initializer must be an

from a constant instruction or a global (module scope) OpVariable

instruction. Initializer must have the same type as the type pointed to by Result Type.

From SPV_KHR_physical_storage_buffer: If an OpVariable’s pointee type is a pointer (or array of pointers) in PhysicalStorageBuffer storage class, then the variable must be decorated with exactly one of AliasedPointer or RestrictPointer.

variable-op ::= ssa-id `=` `spirv.Variable` (`init(` ssa-use `)`)?
                attribute-dict? `:` spirv-pointer-type

where init specifies initializer.

Example:

%0 = spirv.Constant ...

%1 = spirv.Variable : !spirv.ptr<f32, Function>
%2 = spirv.Variable init(%0): !spirv.ptr<f32, Function>

%3 = spirv.Variable {aliased_pointer} :
  !spirv.ptr<!spirv.ptr<f32, PhysicalStorageBuffer>, Function>
OPERATION_NAME = 'spirv.Variable'
_ODS_REGIONS = (0, True)
initializer() _ods_ir | None
storage_class() _ods_ir
pointer() _ods_ir
mlir.dialects._spirv_ops_gen.Variable(pointer, storage_class, *, initializer=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.VectorExtractDynamicOp(vector, index, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a scalar type.

Vector must have a type OpTypeVector whose Component Type is Result Type.

Index must be a scalar integer. It is interpreted as a 0-based index of which component of Vector to extract.

Behavior is undefined if Index’s value is less than zero or greater than or equal to the number of components in Vector.

Example:

%2 = spirv.VectorExtractDynamic %0[%1] : vector<8xf32>, i32
OPERATION_NAME = 'spirv.VectorExtractDynamic'
_ODS_REGIONS = (0, True)
vector() _ods_ir
index() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.VectorExtractDynamic(vector, index, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.VectorInsertDynamicOp(vector, component, index, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Result Type must be an OpTypeVector.

Vector must have the same type as Result Type and is the vector that the non-written components are copied from.

Component is the value supplied for the component selected by Index. It must have the same type as the type of components in Result Type.

Index must be a scalar integer. It is interpreted as a 0-based index of which component to modify.

Behavior is undefined if Index’s value is less than zero or greater than or equal to the number of components in Vector.

Example:

%scalar = ... : f32
%2 = spirv.VectorInsertDynamic %scalar %0[%1] : f32, vector<8xf32>, i32
OPERATION_NAME = 'spirv.VectorInsertDynamic'
_ODS_REGIONS = (0, True)
vector() _ods_ir
component() _ods_ir
index() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.VectorInsertDynamic(vector, component, index, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.VectorShuffleOp(result, vector1, vector2, components, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be an OpTypeVector. The number of components in Result Type must be the same as the number of Component operands.

Vector 1 and Vector 2 must both have vector types, with the same Component Type as Result Type. They do not have to have the same number of components as Result Type or with each other. They are logically concatenated, forming a single vector with Vector 1’s components appearing before Vector 2’s. The components of this logical vector are logically numbered with a single consecutive set of numbers from 0 to N

  • 1, where N is the total number of components.

Components are these logical numbers (see above), selecting which of the logically numbered components form the result. Each component is an unsigned 32-bit integer. They can select the components in any order and can repeat components. The first component of the result is selected by the first Component operand, the second component of the result is selected by the second Component operand, etc. A Component literal may also be FFFFFFFF, which means the corresponding result component has no source and is undefined. All Component literals must either be FFFFFFFF or in [0, N - 1] (inclusive).

Note: A vector “swizzle” can be done by using the vector for both Vector operands, or using an OpUndef for one of the Vector operands.

Example:

%0 = spirv.VectorShuffle [1: i32, 3: i32, 5: i32] %vector1, %vector2 :
  vector<4xf32>, vector<2xf32> -> vector<3xf32>
OPERATION_NAME = 'spirv.VectorShuffle'
_ODS_REGIONS = (0, True)
vector1() _ods_ir
vector2() _ods_ir
components() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.VectorShuffle(result, vector1, vector2, components, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.VectorTimesMatrixOp(result, vector, matrix, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a vector of floating-point type.

Vector must be a vector with the same Component Type as the Component Type in Result Type. Its number of components must equal the number of components in each column in Matrix.

Matrix must be a matrix with the same Component Type as the Component Type in Result Type. Its number of columns must equal the number of components in Result Type.

Example:

%result = spirv.VectorTimesMatrix %vector, %matrix : vector<4xf32>, !spirv.matrix<4 x vector<4xf32>> -> vector<4xf32>
OPERATION_NAME = 'spirv.VectorTimesMatrix'
_ODS_REGIONS = (0, True)
vector() _ods_ir
matrix() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.VectorTimesMatrix(result, vector, matrix, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.VectorTimesScalarOp(result, vector, scalar, *, loc=None, ip=None)

Bases: _ods_ir

Result Type must be a vector of floating-point type.

The type of Vector must be the same as Result Type. Each component of Vector is multiplied by Scalar.

Scalar must have the same type as the Component Type in Result Type.

Example:

%0 = spirv.VectorTimesScalar %vector, %scalar : vector<4xf32>
OPERATION_NAME = 'spirv.VectorTimesScalar'
_ODS_REGIONS = (0, True)
vector() _ods_ir
scalar() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._spirv_ops_gen.VectorTimesScalar(result, vector, scalar, *, loc=None, ip=None) _ods_ir
class mlir.dialects._spirv_ops_gen.YieldOp(operand, *, loc=None, ip=None)

Bases: _ods_ir

This op is a special terminator whose only purpose is to terminate an spirv.SpecConstantOperation’s enclosed region. It accepts a single operand produced by the preceeding (and only other) instruction in its parent block (see SPIRV_SpecConstantOperation for further details). This op has no corresponding SPIR-V instruction.

Example:

%0 = ... (some op supported by SPIR-V OpSpecConstantOp)
spirv.mlir.yield %0
OPERATION_NAME = 'spirv.mlir.yield'
_ODS_REGIONS = (0, True)
operand() _ods_ir
mlir.dialects._spirv_ops_gen.mlir_yield(operand, *, loc=None, ip=None) YieldOp