@@ -1566,23 +1566,34 @@ LogicalResult NVVM::ClusterLaunchControlQueryCancelOp::verify() {
15661566LogicalResult NVVM::ReduxOp::verify () {
15671567 mlir::Type reduxType = getType ();
15681568
1569- if (!reduxType.isF32 () && getAbs ())
1570- return emitOpError (" abs attribute is supported only for f32 type" );
1571-
1572- if (!reduxType.isF32 () && getNan ())
1573- return emitOpError (" nan attribute is supported only for f32 type" );
1569+ if (!reduxType.isF32 ()) {
1570+ if (getAbs ())
1571+ return emitOpError (" abs attribute is supported only for f32 type" );
1572+ if (getNan ())
1573+ return emitOpError (" nan attribute is supported only for f32 type" );
1574+ }
15741575
15751576 NVVM::ReduxKind kind = getKind ();
15761577 switch (kind) {
1578+ case NVVM::ReduxKind::ADD:
1579+ case NVVM::ReduxKind::AND:
1580+ case NVVM::ReduxKind::OR:
1581+ case NVVM::ReduxKind::XOR:
1582+ case NVVM::ReduxKind::MAX:
1583+ case NVVM::ReduxKind::MIN:
1584+ case NVVM::ReduxKind::UMAX:
1585+ case NVVM::ReduxKind::UMIN:
1586+ if (!reduxType.isInteger (32 ))
1587+ return emitOpError (" '" )
1588+ << stringifyEnum (kind) << " ' redux kind unsupported with "
1589+ << getType () << " type. Only supported type is 'i32'." ;
1590+ break ;
15771591 case NVVM::ReduxKind::FMIN:
15781592 case NVVM::ReduxKind::FMAX:
15791593 if (!reduxType.isF32 ())
1580- return emitOpError (" fmin and fmax redux kind must be used with f32 type" );
1581- break ;
1582- default :
1583- if (reduxType.isF32 ())
1584- return emitOpError (
1585- " only fmin and fmax redux kinds are supported for f32 type" );
1594+ return emitOpError (" '" )
1595+ << stringifyEnum (kind) << " ' redux kind unsupported with "
1596+ << getType () << " type. Only supported type is 'f32'." ;
15861597 break ;
15871598 }
15881599
0 commit comments