From 28594db53643731484c7f3d55c6045a5893aeb41 Mon Sep 17 00:00:00 2001 From: "Mayeul@Zama" Date: Wed, 2 Nov 2022 12:42:30 +0100 Subject: [PATCH] chore(compiler): fix c++11-narrowing --- compiler/CMakeLists.txt | 1 - .../concretelang/ClientLib/ClientParameters.h | 16 ++++++++-------- .../concretelang/Support/CompilationFeedback.h | 10 +++++----- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/compiler/CMakeLists.txt b/compiler/CMakeLists.txt index 2d1609a31..4b3bd7f05 100644 --- a/compiler/CMakeLists.txt +++ b/compiler/CMakeLists.txt @@ -12,7 +12,6 @@ add_definitions("-Wno-dollar-in-identifier-extension") # Wouldn't be able to compile LLVM without this on Mac (using either Clang or AppleClang) if(APPLE) - add_definitions("-Wno-narrowing") else() add_definitions("-Wall -Werror") endif() diff --git a/compiler/include/concretelang/ClientLib/ClientParameters.h b/compiler/include/concretelang/ClientLib/ClientParameters.h index d50b95768..237e62842 100644 --- a/compiler/include/concretelang/ClientLib/ClientParameters.h +++ b/compiler/include/concretelang/ClientLib/ClientParameters.h @@ -42,10 +42,10 @@ const std::string KEYSWITCH_KEY = "ksk_v0"; const std::string CLIENT_PARAMETERS_EXT = ".concrete.params.json"; -typedef size_t DecompositionLevelCount; -typedef size_t DecompositionBaseLog; -typedef size_t PolynomialSize; -typedef size_t Precision; +typedef uint64_t DecompositionLevelCount; +typedef uint64_t DecompositionBaseLog; +typedef uint64_t PolynomialSize; +typedef uint64_t Precision; typedef double Variance; typedef std::vector CRTDecomposition; @@ -117,8 +117,8 @@ struct PackingKeySwitchParam { LweSecretKeyID inputSecretKeyID; LweSecretKeyID outputSecretKeyID; BootstrapKeyID bootstrapKeyID; - size_t level; - size_t baseLog; + DecompositionLevelCount level; + DecompositionBaseLog baseLog; Variance variance; void hash(size_t &seed); @@ -151,11 +151,11 @@ static inline bool operator==(const EncryptionGate &lhs, struct CircuitGateShape { /// Width of the scalar value - size_t width; + uint64_t width; /// Dimensions of the tensor, empty if scalar std::vector dimensions; /// Size of the buffer containing the tensor - size_t size; + uint64_t size; // Indicated whether elements are signed bool sign; }; diff --git a/compiler/include/concretelang/Support/CompilationFeedback.h b/compiler/include/concretelang/Support/CompilationFeedback.h index 35e99205c..8a0d9539b 100644 --- a/compiler/include/concretelang/Support/CompilationFeedback.h +++ b/compiler/include/concretelang/Support/CompilationFeedback.h @@ -23,19 +23,19 @@ struct CompilationFeedback { double complexity; /// @brief the total number of bytes of secret keys - size_t totalSecretKeysSize; + uint64_t totalSecretKeysSize; /// @brief the total number of bytes of bootstrap keys - size_t totalBootstrapKeysSize; + uint64_t totalBootstrapKeysSize; /// @brief the total number of bytes of keyswitch keys - size_t totalKeyswitchKeysSize; + uint64_t totalKeyswitchKeysSize; /// @brief the total number of bytes of inputs - size_t totalInputsSize; + uint64_t totalInputsSize; /// @brief the total number of bytes of outputs - size_t totalOutputsSize; + uint64_t totalOutputsSize; /// Fill the sizes from the client parameters. void