================ @@ -1170,6 +1233,76 @@ void ParallelOp::build(mlir::OpBuilder &odsBuilder, /*defaultAttr=*/nullptr, /*combined=*/nullptr); } +void acc::ParallelOp::addNumWorkersOperand( + MLIRContext *context, mlir::Value newValue, + llvm::ArrayRef<DeviceType> effectiveDeviceTypes) { + setNumWorkersDeviceTypeAttr(addDeviceTypeAffectedOperandHelper( + context, getNumWorkersDeviceTypeAttr(), effectiveDeviceTypes, newValue, + getNumWorkersMutable())); +} +void acc::ParallelOp::addVectorLengthOperand( + MLIRContext *context, mlir::Value newValue, + llvm::ArrayRef<DeviceType> effectiveDeviceTypes) { + setVectorLengthDeviceTypeAttr(addDeviceTypeAffectedOperandHelper( + context, getVectorLengthDeviceTypeAttr(), effectiveDeviceTypes, newValue, + getVectorLengthMutable())); +} + +void acc::ParallelOp::addAsyncOnly( + MLIRContext *context, llvm::ArrayRef<DeviceType> effectiveDeviceTypes) { + setAsyncOnlyAttr(addDeviceTypeAffectedOperandHelper( + context, getAsyncOnlyAttr(), effectiveDeviceTypes)); +} + +void acc::ParallelOp::addAsyncOperand( + MLIRContext *context, mlir::Value newValue, + llvm::ArrayRef<DeviceType> effectiveDeviceTypes) { + setAsyncOperandsDeviceTypeAttr(addDeviceTypeAffectedOperandHelper( + context, getAsyncOperandsDeviceTypeAttr(), effectiveDeviceTypes, newValue, + getAsyncOperandsMutable())); +} + +void acc::ParallelOp::addNumGangsOperands( + MLIRContext *context, mlir::ValueRange newValues, + llvm::ArrayRef<DeviceType> effectiveDeviceTypes) { + llvm::SmallVector<int32_t> segments; + if (getNumGangsSegments()) + llvm::copy(*getNumGangsSegments(), std::back_inserter(segments)); + + setNumGangsDeviceTypeAttr(addDeviceTypeAffectedOperandHelper( + context, getNumGangsDeviceTypeAttr(), effectiveDeviceTypes, newValues, + getNumGangsMutable(), segments)); + + setNumGangsSegments(segments); +} +void acc::ParallelOp::addWaitOnly( + MLIRContext *context, llvm::ArrayRef<DeviceType> effectiveDeviceTypes) { + setWaitOnlyAttr(addDeviceTypeAffectedOperandHelper(context, getWaitOnlyAttr(), + effectiveDeviceTypes)); +} +void acc::ParallelOp::addWaitOperands( ---------------- andykaylor wrote:
Is there some way these could be reorganized to avoid the duplicate definitions? https://github.com/llvm/llvm-project/pull/137396 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits