Question on PrecomputeCRTTables

Hello,

I have a question regarding PrecomputeCRTTables in CKKS.

I’ve found that sometimes when I run the code in CKKS with FLEXIBLEAUTO as the scaling technique, it returns the following exception:

'lbcrypto::OpenFHEException'
  what():  (...) CryptoParametersCKKSRNS::PrecomputeCRTTables - FLEXIBLEAUTO cannot support this number of levels in this parameter setting. Please use FIXEDMANUAL.

I checked that this exception is thrown from src/pke/lib/scheme/ckksrns/ckksrns-cryptoparameters.cpp.
However, for me, it was hard to clearly figure out when is the exact case for this exception only with the code.
I tried to find some related explanation about this on either comments or documentation, but I couldn’t.

Could you please help me for this or inform me some materials that I can refer to?

Thank you.

Please provide a minimum working examples for us to be able to reconstruct the error. All the parameters you feed to the cryptocontext are important to identify the cause.

Sorry for the poor identification.

Here’s the minimal code example that I’ve checked the exception mentioned above:

int main(void)
{
  CCParams<CryptoContextCKKSRNS> parameters;
  parameters.SetRingDim(32768);
  parameters.SetMultiplicativeDepth(10);
  parameters.SetFirstModSize(46);
  parameters.SetScalingModSize(18);
  parameters.SetSecurityLevel(HEStd_256_classic);
  parameters.SetScalingTechnique(FLEXIBLEAUTO);

  CryptoContext<DCRTPoly> cc = GenCryptoContext(parameters);
  cc->Enable(PKE);
  cc->Enable(KEYSWITCH);
  cc->Enable(LEVELEDSHE);

  return 0;
}