mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 12:15:09 -05:00
enhance(compiler): Better error message for glwe error
This commit is contained in:
@@ -100,10 +100,11 @@ unsigned nbBitsFromLog2StdDev(signed log2StdDev, signed bits) {
|
||||
signed int phantomLeft =
|
||||
(bits - scalingFactor) - phantomBits - p - paddingBits;
|
||||
if (phantomLeft < 0) {
|
||||
// TODO: better message ...
|
||||
emitError() << "GLWE message cannot be represented "
|
||||
<< (bits - scalingFactor) << "vs"
|
||||
<< (phantomBits - p - paddingBits);
|
||||
emitError() << "GLWE padding + message + phantom = "
|
||||
<< phantomBits + p + paddingBits
|
||||
<< " cannot be represented cannot be represented in bits - "
|
||||
"scalingFactor = "
|
||||
<< (bits - scalingFactor);
|
||||
return ::mlir::failure();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// RUN: not zamacompiler %s 2>&1| FileCheck %s
|
||||
|
||||
// CHECK-LABEL: error: GLWE padding + message + phantom = 25 cannot be represented cannot be represented in bits - scalingFactor = 24
|
||||
func @glwe(%arg0: !MidLFHE.glwe<{1024,12,64}{15,7,3,40,-25}>) -> !MidLFHE.glwe<{1024,12,64}{15,7,3,40,-25}> {
|
||||
return %arg0: !MidLFHE.glwe<{1024,12,64}{15,7,3,40,-25}>
|
||||
}
|
||||
Reference in New Issue
Block a user