mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-17 08:01:20 -05:00
feat(compiler): Add verifier to TFHE.encode_expand_lut_for_bootstrap
This commit is contained in:
@@ -100,6 +100,8 @@ def TFHE_EncodeExpandLutForBootstrapOp : TFHE_Op<"encode_expand_lut_for_bootstra
|
||||
);
|
||||
|
||||
let results = (outs 1DTensorOf<[I64]> : $result);
|
||||
|
||||
let hasVerifier = 1;
|
||||
}
|
||||
|
||||
def TFHE_EncodeLutForCrtWopPBSOp : TFHE_Op<"encode_lut_for_crt_woppbs", [Pure]> {
|
||||
|
||||
@@ -117,6 +117,24 @@ mlir::LogicalResult MulGLWEIntOp::verify() {
|
||||
*this);
|
||||
}
|
||||
|
||||
mlir::LogicalResult EncodeExpandLutForBootstrapOp::verify() {
|
||||
mlir::IntegerAttr polySizeAttr = this->getPolySizeAttr();
|
||||
|
||||
mlir::RankedTensorType rtt =
|
||||
this->getResult().getType().template cast<mlir::RankedTensorType>();
|
||||
|
||||
if (rtt.getNumElements() != polySizeAttr.getInt()) {
|
||||
this->emitError("The number of elements of the output tensor of ")
|
||||
<< rtt.getNumElements()
|
||||
<< " does not match the size of the polynomial of "
|
||||
<< polySizeAttr.getInt();
|
||||
|
||||
return mlir::failure();
|
||||
}
|
||||
|
||||
return mlir::success();
|
||||
}
|
||||
|
||||
template <typename BootstrapOpT>
|
||||
mlir::LogicalResult verifyBootstrapSingleLUTConstraints(BootstrapOpT &op) {
|
||||
GLWEBootstrapKeyAttr keyAttr = op.getKeyAttr();
|
||||
|
||||
Reference in New Issue
Block a user