diff --git a/benchmark/ec/ec_config.cc b/benchmark/ec/ec_config.cc index 95e21347bb..a5afccccab 100644 --- a/benchmark/ec/ec_config.cc +++ b/benchmark/ec/ec_config.cc @@ -1,5 +1,8 @@ #include "benchmark/ec/ec_config.h" +#include +#include + #include "tachyon/base/console/iostream.h" #include "tachyon/base/flag/flag_parser.h" diff --git a/benchmark/ec/ec_double_benchmark_gpu.cc b/benchmark/ec/ec_double_benchmark_gpu.cc index ed611f3367..b077a86ec9 100644 --- a/benchmark/ec/ec_double_benchmark_gpu.cc +++ b/benchmark/ec/ec_double_benchmark_gpu.cc @@ -1,4 +1,5 @@ #if TACHYON_CUDA || TACHYON_USE_ROCM + #include // clang-format off diff --git a/benchmark/ec/simple_ec_benchmark_reporter.cc b/benchmark/ec/simple_ec_benchmark_reporter.cc index f74389a010..60d73d0d31 100644 --- a/benchmark/ec/simple_ec_benchmark_reporter.cc +++ b/benchmark/ec/simple_ec_benchmark_reporter.cc @@ -1,5 +1,8 @@ #include "benchmark/ec/simple_ec_benchmark_reporter.h" +#include +#include + #include "absl/strings/substitute.h" #include "tachyon/base/strings/string_number_conversions.h" diff --git a/benchmark/ec/simple_ec_benchmark_reporter.h b/benchmark/ec/simple_ec_benchmark_reporter.h index ff96b2b815..a98e1e3ccb 100644 --- a/benchmark/ec/simple_ec_benchmark_reporter.h +++ b/benchmark/ec/simple_ec_benchmark_reporter.h @@ -1,6 +1,8 @@ #ifndef BENCHMARK_EC_SIMPLE_EC_BENCHMARK_REPORTER_H_ #define BENCHMARK_EC_SIMPLE_EC_BENCHMARK_REPORTER_H_ +#include + #include "benchmark/simple_benchmark_reporter.h" namespace tachyon { diff --git a/benchmark/msm/msm_config.cc b/benchmark/msm/msm_config.cc index 7cc78610a9..04a949c0f3 100644 --- a/benchmark/msm/msm_config.cc +++ b/benchmark/msm/msm_config.cc @@ -1,5 +1,7 @@ #include "benchmark/msm/msm_config.h" +#include + #include "tachyon/base/console/iostream.h" #include "tachyon/base/flag/flag_parser.h" diff --git a/benchmark/msm/msm_config.h b/benchmark/msm/msm_config.h index 249f42760b..49fd91477e 100644 --- a/benchmark/msm/msm_config.h +++ b/benchmark/msm/msm_config.h @@ -34,7 +34,7 @@ class MSMConfig { MSMConfig& operator=(const MSMConfig& other) = delete; const std::vector& degrees() const { return degrees_; } - const std::vector& vendors() const { return vendors_; }; + const std::vector& vendors() const { return vendors_; } int algorithm() const { return algorithm_; } bool check_results() const { return check_results_; } diff --git a/benchmark/msm/msm_runner.h b/benchmark/msm/msm_runner.h index 8c03fe32c0..96e885701f 100644 --- a/benchmark/msm/msm_runner.h +++ b/benchmark/msm/msm_runner.h @@ -3,8 +3,8 @@ #include +#include #include - // clang-format off #include "benchmark/msm/simple_msm_benchmark_reporter.h" // clang-format on diff --git a/benchmark/msm/simple_msm_benchmark_reporter.cc b/benchmark/msm/simple_msm_benchmark_reporter.cc index 47dc5aa017..da7d0b09ef 100644 --- a/benchmark/msm/simple_msm_benchmark_reporter.cc +++ b/benchmark/msm/simple_msm_benchmark_reporter.cc @@ -1,5 +1,8 @@ #include "benchmark/msm/simple_msm_benchmark_reporter.h" +#include +#include + #include "absl/strings/substitute.h" #include "tachyon/base/strings/string_number_conversions.h" diff --git a/benchmark/msm/simple_msm_benchmark_reporter.h b/benchmark/msm/simple_msm_benchmark_reporter.h index 3abfc8f56c..2f339a0b3e 100644 --- a/benchmark/msm/simple_msm_benchmark_reporter.h +++ b/benchmark/msm/simple_msm_benchmark_reporter.h @@ -1,6 +1,8 @@ #ifndef BENCHMARK_MSM_SIMPLE_MSM_BENCHMARK_REPORTER_H_ #define BENCHMARK_MSM_SIMPLE_MSM_BENCHMARK_REPORTER_H_ +#include + #include "benchmark/simple_benchmark_reporter.h" namespace tachyon { diff --git a/tachyon/build/cc_writer.cc b/tachyon/build/cc_writer.cc index 9e6db17551..8e5b385c3d 100644 --- a/tachyon/build/cc_writer.cc +++ b/tachyon/build/cc_writer.cc @@ -1,5 +1,8 @@ #include "tachyon/build/cc_writer.h" +#include +#include + #include "absl/strings/str_join.h" #include "absl/strings/str_replace.h" #include "absl/strings/substitute.h" diff --git a/tachyon/build/cc_writer.h b/tachyon/build/cc_writer.h index 0a63437e75..31aab7b507 100644 --- a/tachyon/build/cc_writer.h +++ b/tachyon/build/cc_writer.h @@ -1,6 +1,8 @@ #ifndef TACHYON_BUILD_CC_WRITER_H_ #define TACHYON_BUILD_CC_WRITER_H_ +#include + #include "tachyon/build/writer.h" namespace tachyon::build { diff --git a/tachyon/build/writer.h b/tachyon/build/writer.h index 8dbd532d3a..4b23a7cec7 100644 --- a/tachyon/build/writer.h +++ b/tachyon/build/writer.h @@ -1,6 +1,8 @@ #ifndef TACHYON_BUILD_WRITER_H_ #define TACHYON_BUILD_WRITER_H_ +#include + #include "tachyon/base/files/file_path.h" namespace tachyon::build { diff --git a/tachyon/c/math/elliptic_curves/msm/msm_gpu.h b/tachyon/c/math/elliptic_curves/msm/msm_gpu.h index 93b2ee8cb8..c2f7f1192b 100644 --- a/tachyon/c/math/elliptic_curves/msm/msm_gpu.h +++ b/tachyon/c/math/elliptic_curves/msm/msm_gpu.h @@ -1,6 +1,11 @@ #ifndef TACHYON_C_MATH_ELLIPTIC_CURVES_MSM_MSM_GPU_H_ #define TACHYON_C_MATH_ELLIPTIC_CURVES_MSM_MSM_GPU_H_ +#include +#include +#include +#include + #include "tachyon/base/console/console_stream.h" #include "tachyon/base/environment.h" #include "tachyon/base/files/file_util.h" diff --git a/tachyon/c/math/elliptic_curves/msm/msm_input_provider.h b/tachyon/c/math/elliptic_curves/msm/msm_input_provider.h index 451eea0efc..5f18e1520a 100644 --- a/tachyon/c/math/elliptic_curves/msm/msm_input_provider.h +++ b/tachyon/c/math/elliptic_curves/msm/msm_input_provider.h @@ -1,6 +1,8 @@ #ifndef TACHYON_C_MATH_ELLIPTIC_CURVES_MSM_MSM_INPUT_PROVIDER_H_ #define TACHYON_C_MATH_ELLIPTIC_CURVES_MSM_MSM_INPUT_PROVIDER_H_ +#include + #include "absl/numeric/bits.h" #include "absl/types/span.h" diff --git a/tachyon/crypto/commitments/pedersen/pedersen.h b/tachyon/crypto/commitments/pedersen/pedersen.h index 71f4a51269..c717663c32 100644 --- a/tachyon/crypto/commitments/pedersen/pedersen.h +++ b/tachyon/crypto/commitments/pedersen/pedersen.h @@ -2,6 +2,8 @@ #define TACHYON_CRYPTO_COMMITMENTS_PEDERSEN_PEDERSEN_H_ #include +#include +#include #include #include "tachyon/base/containers/container_util.h" diff --git a/tachyon/crypto/hashes/prime_field_serializable.h b/tachyon/crypto/hashes/prime_field_serializable.h index 555bb3c120..e2420be72f 100644 --- a/tachyon/crypto/hashes/prime_field_serializable.h +++ b/tachyon/crypto/hashes/prime_field_serializable.h @@ -78,4 +78,4 @@ constexpr bool SerializeBatchToFieldElements( } // namespace tachyon::crypto -#endif // TACHYON_CRYPTO_HASHES_BYTES_SERIALIZABLE_H_ +#endif // TACHYON_CRYPTO_HASHES_PRIME_FIELD_SERIALIZABLE_H_ diff --git a/tachyon/crypto/hashes/sponge/poseidon/poseidon.h b/tachyon/crypto/hashes/sponge/poseidon/poseidon.h index 000a47f68a..8221d39151 100644 --- a/tachyon/crypto/hashes/sponge/poseidon/poseidon.h +++ b/tachyon/crypto/hashes/sponge/poseidon/poseidon.h @@ -6,6 +6,9 @@ #ifndef TACHYON_CRYPTO_HASHES_SPONGE_POSEIDON_POSEIDON_H_ #define TACHYON_CRYPTO_HASHES_SPONGE_POSEIDON_POSEIDON_H_ +#include +#include + #include "tachyon/base/containers/container_util.h" #include "tachyon/base/logging.h" #include "tachyon/crypto/hashes/prime_field_serializable.h" diff --git a/tachyon/crypto/hashes/sponge/poseidon/poseidon_config_unittest.cc b/tachyon/crypto/hashes/sponge/poseidon/poseidon_config_unittest.cc index 6a7518515d..591dbcb86f 100644 --- a/tachyon/crypto/hashes/sponge/poseidon/poseidon_config_unittest.cc +++ b/tachyon/crypto/hashes/sponge/poseidon/poseidon_config_unittest.cc @@ -42,10 +42,10 @@ TYPED_TEST(PoseidonUtilTest, PoseidonConfig_CreateDefault) { {2, true, "25126470399169474618535500283750950727260324358529540538588217772729895991183", "46350838805835525240431215868760423854112287760212339623795708191499274188615"}, {3, true, "16345358380711600255519479157621098002794924491287389755192263320486827897573", "37432344439659887296708509941462699942272362339508052702346957525719991245918"}, {4, true, "2997721997773001075802235431463112417440167809433966871891875582435098138600", "43959024692079347032841256941012668338943730711936867712802582656046301966186"}, - {5, true, "28142027771717376151411984909531650866105717069245696861966432993496676054077","13157425078305676755394500322568002504776463228389342308130514165393397413991"}, - {6, true, "7417004907071346600696060525974582183666365156576759507353305331252133694222","51393878771453405560681338747290999206747890655420330824736778052231938173954"}, - {7, true, "47093173418416013663709314805327945458844779999893881721688570889452680883650","51455917624412053400160569105425532358410121118308957353565646758865245830775"}, - {8, true, "16478680729975035007348178961232525927424769683353433314299437589237598655079","39160448583049384229582837387246752222769278402304070376350288593586064961857"}, + {5, true, "28142027771717376151411984909531650866105717069245696861966432993496676054077", "13157425078305676755394500322568002504776463228389342308130514165393397413991"}, + {6, true, "7417004907071346600696060525974582183666365156576759507353305331252133694222", "51393878771453405560681338747290999206747890655420330824736778052231938173954"}, + {7, true, "47093173418416013663709314805327945458844779999893881721688570889452680883650", "51455917624412053400160569105425532358410121118308957353565646758865245830775"}, + {8, true, "16478680729975035007348178961232525927424769683353433314299437589237598655079", "39160448583049384229582837387246752222769278402304070376350288593586064961857"}, }; // clang-format on diff --git a/tachyon/crypto/hashes/sponge/poseidon/poseidon_unittest.cc b/tachyon/crypto/hashes/sponge/poseidon/poseidon_unittest.cc index 7e00805909..5e8fdd714a 100644 --- a/tachyon/crypto/hashes/sponge/poseidon/poseidon_unittest.cc +++ b/tachyon/crypto/hashes/sponge/poseidon/poseidon_unittest.cc @@ -5,6 +5,8 @@ #include "tachyon/crypto/hashes/sponge/poseidon/poseidon.h" +#include + #include "gtest/gtest.h" #include "tachyon/math/elliptic_curves/bls/bls12_381/fr.h" diff --git a/tachyon/crypto/hashes/sponge/sponge.h b/tachyon/crypto/hashes/sponge/sponge.h index 238b04606c..bd7e03c4a6 100644 --- a/tachyon/crypto/hashes/sponge/sponge.h +++ b/tachyon/crypto/hashes/sponge/sponge.h @@ -18,7 +18,7 @@ namespace tachyon::crypto { // Specifying the output field element size. class TACHYON_EXPORT FieldElementSize { public: - static FieldElementSize Full() { return {false}; } + static FieldElementSize Full() { return FieldElementSize(false); } static FieldElementSize Truncated(size_t num_bits) { return {true, num_bits}; } @@ -47,7 +47,9 @@ class TACHYON_EXPORT FieldElementSize { bool IsTruncated() const { return is_truncated_; } private: - FieldElementSize(bool is_truncated, size_t num_bits = 0) + explicit FieldElementSize(bool is_truncated) + : FieldElementSize(is_truncated, 0) {} + FieldElementSize(bool is_truncated, size_t num_bits) : is_truncated_(is_truncated), num_bits_(num_bits) {} // If |is_truncated_| is false, sample field elements from the entire field. diff --git a/tachyon/examples/cuda_example.cu.cc b/tachyon/examples/cuda_example.cu.cc index 88675bf04c..dd5ff50ad3 100644 --- a/tachyon/examples/cuda_example.cu.cc +++ b/tachyon/examples/cuda_example.cu.cc @@ -70,13 +70,13 @@ int RealMain(int argc, char **argv) { printf("[Vector addition of %d elements]\n", numElements); // Allocate the host input vector A - float *h_A = (float *)malloc(size); + float *h_A = (float *)malloc(size); // NOLINT(readability/casting) // Allocate the host input vector B - float *h_B = (float *)malloc(size); + float *h_B = (float *)malloc(size); // NOLINT(readability/casting) // Allocate the host output vector C - float *h_C = (float *)malloc(size); + float *h_C = (float *)malloc(size); // NOLINT(readability/casting) // Verify that allocations succeeded if (h_A == NULL || h_B == NULL || h_C == NULL) { @@ -86,13 +86,13 @@ int RealMain(int argc, char **argv) { // Initialize the host input vectors for (int i = 0; i < numElements; ++i) { - h_A[i] = rand() / (float)RAND_MAX; - h_B[i] = rand() / (float)RAND_MAX; + h_A[i] = rand() / (float)RAND_MAX; // NOLINT + h_B[i] = rand() / (float)RAND_MAX; // NOLINT } // Allocate the device input vector A float *d_A = NULL; - err = cudaMalloc((void **)&d_A, size); + err = cudaMalloc((void **)&d_A, size); // NOLINT(readability/casting) if (err != cudaSuccess) { fprintf(stderr, "Failed to allocate device vector A (error code %s)!\n", @@ -102,7 +102,7 @@ int RealMain(int argc, char **argv) { // Allocate the device input vector B float *d_B = NULL; - err = cudaMalloc((void **)&d_B, size); + err = cudaMalloc((void **)&d_B, size); // NOLINT(readability/casting) if (err != cudaSuccess) { fprintf(stderr, "Failed to allocate device vector B (error code %s)!\n", @@ -111,8 +111,8 @@ int RealMain(int argc, char **argv) { } // Allocate the device output vector C - float *d_C = NULL; - err = cudaMalloc((void **)&d_C, size); + float *d_C = NULL; // NOLINT(readability/casting) + err = cudaMalloc((void **)&d_C, size); // NOLINT(readability/casting) if (err != cudaSuccess) { fprintf(stderr, "Failed to allocate device vector C (error code %s)!\n", diff --git a/tachyon/export.h b/tachyon/export.h index adf7ec003f..baed172bfb 100644 --- a/tachyon/export.h +++ b/tachyon/export.h @@ -22,4 +22,4 @@ #define TACHYON_EXPORT #endif // defined(TACHYON_COMPONENT_BUILD) -#endif // TACHYON_EXPORT_H_ \ No newline at end of file +#endif // TACHYON_EXPORT_H_ diff --git a/tachyon/math/base/arithmetics.h b/tachyon/math/base/arithmetics.h index d224953b34..bed626224f 100644 --- a/tachyon/math/base/arithmetics.h +++ b/tachyon/math/base/arithmetics.h @@ -12,9 +12,11 @@ #include "tachyon/math/base/arithmetics_results.h" #if defined(__clang__) && HAS_BUILTIN(__builtin_addc) -// See https://clang.llvm.org/docs/LanguageExtensions.html#multiprecision-arithmetic-builtins +// See +// https://clang.llvm.org/docs/LanguageExtensions.html#multiprecision-arithmetic-builtins #elif ARCH_CPU_X86_64 -// See https://www.intel.com/content/www/us/en/docs/cpp-compiler/developer-guide-reference/2021-8/intrinsics-for-multi-precision-arithmetic.html +// See +// https://www.intel.com/content/www/us/en/docs/cpp-compiler/developer-guide-reference/2021-8/intrinsics-for-multi-precision-arithmetic.html #include #endif @@ -77,12 +79,18 @@ ALWAYS_INLINE AddResult AddWithCarry(uint64_t a, uint64_t b, uint64_t carry = 0) { AddResult result; #if defined(__clang__) && HAS_BUILTIN(__builtin_addcl) - static_assert(sizeof(uint64_t) == sizeof(unsigned long)); - result.result = __builtin_addcl(a, b, carry, reinterpret_cast(&result.carry)); + static_assert(sizeof(uint64_t) == + sizeof(unsigned long)); // NOLINT(runtime/int) + result.result = __builtin_addcl( + a, b, carry, + reinterpret_cast(&result.carry)); // NOLINT(runtime/int) #elif ARCH_CPU_X86_64 - static_assert(sizeof(uint64_t) == sizeof(unsigned long long)); + static_assert(sizeof(uint64_t) == + sizeof(unsigned long long)); // NOLINT(runtime/int) result.carry = _addcarry_u64( - carry, a, b, reinterpret_cast(&result.result)); + carry, a, b, + reinterpret_cast( // NOLINT(runtime/int) + &result.result)); #else absl::uint128 tmp = absl::uint128(a) + absl::uint128(b) + absl::uint128(carry); @@ -97,12 +105,18 @@ ALWAYS_INLINE SubResult SubWithBorrow(uint64_t& a, uint64_t b, uint64_t borrow = 0) { SubResult result; #if defined(__clang__) && HAS_BUILTIN(__builtin_subcl) - static_assert(sizeof(uint64_t) == sizeof(unsigned long)); - result.result = __builtin_subcl(a, b, borrow, reinterpret_cast(&result.borrow)); + static_assert(sizeof(uint64_t) == + sizeof(unsigned long)); // NOLINT(runtime/int) + result.result = __builtin_subcl( + a, b, borrow, + reinterpret_cast(&result.borrow)); // NOLINT(runtime/int) #elif ARCH_CPU_X86_64 - static_assert(sizeof(uint64_t) == sizeof(unsigned long long)); + static_assert(sizeof(uint64_t) == + sizeof(unsigned long long)); // NOLINT(runtime/int) result.borrow = _subborrow_u64( - borrow, a, b, reinterpret_cast(&result.result)); + borrow, a, b, + reinterpret_cast( // NOLINT(runtime/int) + &result.result)); #else absl::uint128 tmp = (absl::uint128(1) << 64) + absl::uint128(a) - absl::uint128(b) - absl::uint128(borrow); diff --git a/tachyon/math/base/arithmetics_results.h b/tachyon/math/base/arithmetics_results.h index fbe9776987..a6a2f051a5 100644 --- a/tachyon/math/base/arithmetics_results.h +++ b/tachyon/math/base/arithmetics_results.h @@ -2,6 +2,7 @@ #define TACHYON_MATH_BASE_ARITHMETICS_RESULTS_H_ #include +#include #include "absl/strings/substitute.h" diff --git a/tachyon/math/base/arithmetics_unittest.cc b/tachyon/math/base/arithmetics_unittest.cc index a03e6d34c3..ea9ff36037 100644 --- a/tachyon/math/base/arithmetics_unittest.cc +++ b/tachyon/math/base/arithmetics_unittest.cc @@ -1,5 +1,7 @@ #include "tachyon/math/base/arithmetics.h" +#include + #include "absl/strings/substitute.h" #include "gtest/gtest.h" diff --git a/tachyon/math/base/big_int.cc b/tachyon/math/base/big_int.cc index 1fc5ba115a..8e36cab7a9 100644 --- a/tachyon/math/base/big_int.cc +++ b/tachyon/math/base/big_int.cc @@ -1,5 +1,7 @@ #include "tachyon/math/base/big_int.h" +#include + #include "tachyon/base/strings/string_util.h" #include "tachyon/math/base/gmp/gmp_util.h" diff --git a/tachyon/math/base/big_int.h b/tachyon/math/base/big_int.h index b5881b5827..81b2ecc57c 100644 --- a/tachyon/math/base/big_int.h +++ b/tachyon/math/base/big_int.h @@ -5,6 +5,10 @@ #include #include +#include +#include +#include +#include #include "tachyon/base/compiler_specific.h" #include "tachyon/base/endian_utils.h" @@ -134,6 +138,7 @@ struct ALIGNAS(internal::LimbsAlignment(N)) BigInt { set |= (i == BitNums - 1); #endif if (set) { + // NOLINTNEXTLINE(runtime/int) static_assert(sizeof(unsigned long long) == sizeof(uint64_t)); uint64_t limb = limb_bits.to_ullong(); ret.limbs[limb_idx++] = limb; @@ -161,6 +166,7 @@ struct ALIGNAS(internal::LimbsAlignment(N)) BigInt { set |= (i == 0); #endif if (set) { + // NOLINTNEXTLINE(runtime/int) static_assert(sizeof(unsigned long long) == sizeof(uint64_t)); uint64_t limb = limb_bits.to_ullong(); ret.limbs[limb_idx++] = limb; @@ -924,7 +930,6 @@ class BitTraits> { uint64_t bit_index_value = static_cast(1) << bit_index; return (bigint[limb_index] & bit_index_value) == bit_index_value; } - constexpr static void SetBit(BigInt& bigint, size_t index, bool bit_value) { size_t limb_index = index >> 6; diff --git a/tachyon/math/base/big_int_unittest.cc b/tachyon/math/base/big_int_unittest.cc index 2470d836d8..765c461664 100644 --- a/tachyon/math/base/big_int_unittest.cc +++ b/tachyon/math/base/big_int_unittest.cc @@ -1,5 +1,7 @@ #include "tachyon/math/base/big_int.h" +#include + #include "gtest/gtest.h" namespace tachyon::math { diff --git a/tachyon/math/base/field.h b/tachyon/math/base/field.h index 733455c606..db7c349a22 100644 --- a/tachyon/math/base/field.h +++ b/tachyon/math/base/field.h @@ -1,6 +1,8 @@ #ifndef TACHYON_MATH_BASE_FIELD_H_ #define TACHYON_MATH_BASE_FIELD_H_ +#include + #include "tachyon/math/base/rings.h" namespace tachyon::math { diff --git a/tachyon/math/base/gmp/signed_value.h b/tachyon/math/base/gmp/signed_value.h index e46cb76332..1d846cb575 100644 --- a/tachyon/math/base/gmp/signed_value.h +++ b/tachyon/math/base/gmp/signed_value.h @@ -1,5 +1,5 @@ -#ifndef TACHYON_MATH_BASE_GMP_GMP_SIGN_H_ -#define TACHYON_MATH_BASE_GMP_GMP_SIGN_H_ +#ifndef TACHYON_MATH_BASE_GMP_SIGNED_VALUE_H_ +#define TACHYON_MATH_BASE_GMP_SIGNED_VALUE_H_ #include "tachyon/math/base/gmp/gmp_util.h" #include "tachyon/math/base/sign.h" @@ -34,4 +34,4 @@ class SignedValue { } // namespace tachyon::math -#endif // TACHYON_MATH_BASE_GMP_GMP_SIGN_H_ +#endif // TACHYON_MATH_BASE_GMP_SIGNED_VALUE_H_ diff --git a/tachyon/math/base/sign_unittest.cc b/tachyon/math/base/sign_unittest.cc index 1c73a3c71a..7fbee1fefb 100644 --- a/tachyon/math/base/sign_unittest.cc +++ b/tachyon/math/base/sign_unittest.cc @@ -1,5 +1,7 @@ #include "tachyon/math/base/sign.h" +#include + #include "gtest/gtest.h" namespace tachyon::math { diff --git a/tachyon/math/elliptic_curves/msm/algorithms/bellman/bellman_msm.h b/tachyon/math/elliptic_curves/msm/algorithms/bellman/bellman_msm.h index 895be19894..dd8cff08cd 100644 --- a/tachyon/math/elliptic_curves/msm/algorithms/bellman/bellman_msm.h +++ b/tachyon/math/elliptic_curves/msm/algorithms/bellman/bellman_msm.h @@ -1,6 +1,8 @@ #ifndef TACHYON_MATH_ELLIPTIC_CURVES_MSM_ALGORITHMS_BELLMAN_BELLMAN_MSM_H_ #define TACHYON_MATH_ELLIPTIC_CURVES_MSM_ALGORITHMS_BELLMAN_BELLMAN_MSM_H_ +#include + #include "tachyon/math/elliptic_curves/msm/algorithms/bellman/bellman_msm_impl.h" #include "tachyon/math/elliptic_curves/msm/algorithms/msm_algorithm.h" #include "tachyon/math/elliptic_curves/msm/algorithms/pippenger/pippenger_base.h" diff --git a/tachyon/math/elliptic_curves/msm/algorithms/bellman/bellman_msm_impl.h b/tachyon/math/elliptic_curves/msm/algorithms/bellman/bellman_msm_impl.h index 1959d2946c..e872427b10 100644 --- a/tachyon/math/elliptic_curves/msm/algorithms/bellman/bellman_msm_impl.h +++ b/tachyon/math/elliptic_curves/msm/algorithms/bellman/bellman_msm_impl.h @@ -1,12 +1,14 @@ #ifndef TACHYON_MATH_ELLIPTIC_CURVES_MSM_ALGORITHMS_BELLMAN_BELLMAN_MSM_IMPL_H_ #define TACHYON_MATH_ELLIPTIC_CURVES_MSM_ALGORITHMS_BELLMAN_BELLMAN_MSM_IMPL_H_ +#include #include +#include // It is guided to use "umbrella" header instead of // "third_party/gpus/cuda/include/cub/cub.cuh". // See https://nvlabs.github.io/cub/#sec6 -#include +#include // NOLINT(build/include_order) #include "tachyon/base/bits.h" #include "tachyon/device/gpu/cuda/cub_helper.h" diff --git a/tachyon/math/elliptic_curves/msm/algorithms/cuzk/cuzk.h b/tachyon/math/elliptic_curves/msm/algorithms/cuzk/cuzk.h index be16579c1d..3ed2f21926 100644 --- a/tachyon/math/elliptic_curves/msm/algorithms/cuzk/cuzk.h +++ b/tachyon/math/elliptic_curves/msm/algorithms/cuzk/cuzk.h @@ -1,6 +1,9 @@ #ifndef TACHYON_MATH_ELLIPTIC_CURVES_MSM_ALGORITHMS_CUZK_CUZK_H_ #define TACHYON_MATH_ELLIPTIC_CURVES_MSM_ALGORITHMS_CUZK_CUZK_H_ +#include +#include + #include "gtest/gtest_prod.h" #include "tachyon/base/containers/container_util.h" @@ -162,7 +165,6 @@ class CUZK : public PippengerBase>, } return true; } - bool ConvertELLToCSRTransposed(const CUZKELLSparseMatrix& ell_matrix, CUZKCSRSparseMatrix& csr_matrix, unsigned int idx, diff --git a/tachyon/math/elliptic_curves/msm/algorithms/cuzk/cuzk_unittest.cc b/tachyon/math/elliptic_curves/msm/algorithms/cuzk/cuzk_unittest.cc index 115e22fbe8..b6f7947d92 100644 --- a/tachyon/math/elliptic_curves/msm/algorithms/cuzk/cuzk_unittest.cc +++ b/tachyon/math/elliptic_curves/msm/algorithms/cuzk/cuzk_unittest.cc @@ -1,5 +1,8 @@ #include "tachyon/math/elliptic_curves/msm/algorithms/cuzk/cuzk.h" +#include +#include + #include "gtest/gtest.h" #include "tachyon/base/containers/container_util.h" diff --git a/tachyon/math/elliptic_curves/msm/algorithms/pippenger/pippenger.h b/tachyon/math/elliptic_curves/msm/algorithms/pippenger/pippenger.h index 702afb814f..ae68528397 100644 --- a/tachyon/math/elliptic_curves/msm/algorithms/pippenger/pippenger.h +++ b/tachyon/math/elliptic_curves/msm/algorithms/pippenger/pippenger.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include "tachyon/base/containers/container_util.h" diff --git a/tachyon/math/elliptic_curves/msm/algorithms/pippenger/pippenger_adapter.h b/tachyon/math/elliptic_curves/msm/algorithms/pippenger/pippenger_adapter.h index 77c8d6b5bd..c0545ec939 100644 --- a/tachyon/math/elliptic_curves/msm/algorithms/pippenger/pippenger_adapter.h +++ b/tachyon/math/elliptic_curves/msm/algorithms/pippenger/pippenger_adapter.h @@ -1,6 +1,10 @@ #ifndef TACHYON_MATH_ELLIPTIC_CURVES_MSM_ALGORITHMS_PIPPENGER_PIPPENGER_ADAPTER_H_ #define TACHYON_MATH_ELLIPTIC_CURVES_MSM_ALGORITHMS_PIPPENGER_PIPPENGER_ADAPTER_H_ +#include +#include +#include + #include "absl/base/internal/sysinfo.h" #include "tachyon/math/elliptic_curves/msm/algorithms/pippenger/pippenger.h" diff --git a/tachyon/math/elliptic_curves/msm/variable_base_msm.h b/tachyon/math/elliptic_curves/msm/variable_base_msm.h index 19e86614fc..0c81bf2450 100644 --- a/tachyon/math/elliptic_curves/msm/variable_base_msm.h +++ b/tachyon/math/elliptic_curves/msm/variable_base_msm.h @@ -1,6 +1,8 @@ #ifndef TACHYON_MATH_ELLIPTIC_CURVES_MSM_VARIABLE_BASE_MSM_H_ #define TACHYON_MATH_ELLIPTIC_CURVES_MSM_VARIABLE_BASE_MSM_H_ +#include + #include "tachyon/math/elliptic_curves/msm/algorithms/pippenger/pippenger_adapter.h" namespace tachyon::math { diff --git a/tachyon/math/elliptic_curves/msm/variable_base_msm_gpu.h b/tachyon/math/elliptic_curves/msm/variable_base_msm_gpu.h index 190e4809e5..c596c2e22f 100644 --- a/tachyon/math/elliptic_curves/msm/variable_base_msm_gpu.h +++ b/tachyon/math/elliptic_curves/msm/variable_base_msm_gpu.h @@ -1,6 +1,8 @@ #ifndef TACHYON_MATH_ELLIPTIC_CURVES_MSM_VARIABLE_BASE_MSM_GPU_H_ #define TACHYON_MATH_ELLIPTIC_CURVES_MSM_VARIABLE_BASE_MSM_GPU_H_ +#include + #include "tachyon/math/elliptic_curves/msm/algorithms/bellman/bellman_msm.h" #include "tachyon/math/elliptic_curves/msm/algorithms/cuzk/cuzk.h" diff --git a/tachyon/math/elliptic_curves/msm/variable_base_msm_gpu_unittest.cc b/tachyon/math/elliptic_curves/msm/variable_base_msm_gpu_unittest.cc index f07e9aa665..882d528ce2 100644 --- a/tachyon/math/elliptic_curves/msm/variable_base_msm_gpu_unittest.cc +++ b/tachyon/math/elliptic_curves/msm/variable_base_msm_gpu_unittest.cc @@ -1,5 +1,7 @@ #include "tachyon/math/elliptic_curves/msm/variable_base_msm_gpu.h" +#include + #include "gtest/gtest.h" #include "tachyon/device/gpu/gpu_enums.h" diff --git a/tachyon/math/elliptic_curves/point_xyzz.h b/tachyon/math/elliptic_curves/point_xyzz.h index a1e3982e4e..2094bd9869 100644 --- a/tachyon/math/elliptic_curves/point_xyzz.h +++ b/tachyon/math/elliptic_curves/point_xyzz.h @@ -43,4 +43,4 @@ struct PointConversions, PointXYZZ, } // namespace tachyon::math -#endif // TACHYON_MATH_ELLIPTIC_CURVES_JACOBIAN_POINT_H_ +#endif // TACHYON_MATH_ELLIPTIC_CURVES_POINT_XYZZ_H_ diff --git a/tachyon/math/elliptic_curves/short_weierstrass/affine_point.h b/tachyon/math/elliptic_curves/short_weierstrass/affine_point.h index 442f4dcf30..9daaefd6cf 100644 --- a/tachyon/math/elliptic_curves/short_weierstrass/affine_point.h +++ b/tachyon/math/elliptic_curves/short_weierstrass/affine_point.h @@ -1,7 +1,9 @@ #ifndef TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_AFFINE_POINT_H_ #define TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_AFFINE_POINT_H_ +#include #include +#include #include "absl/strings/substitute.h" @@ -32,9 +34,13 @@ class AffinePoint<_Curve, std::enable_if_t<_Curve::kIsSWCurve>> constexpr AffinePoint() : AffinePoint(BaseField::Zero(), BaseField::Zero(), true) {} - constexpr AffinePoint(const Point2& point, bool infinity = false) + explicit constexpr AffinePoint(const Point2& point) + : AffinePoint(point.x, point.y, false) {} + constexpr AffinePoint(const Point2& point, bool infinity) : AffinePoint(point.x, point.y, infinity) {} - constexpr AffinePoint(Point2&& point, bool infinity = false) + explicit constexpr AffinePoint(Point2&& point) + : AffinePoint(std::move(point.x), std::move(point.y), false) {} + constexpr AffinePoint(Point2&& point, bool infinity) : AffinePoint(std::move(point.x), std::move(point.y), infinity) {} constexpr AffinePoint(const BaseField& x, const BaseField& y, bool infinity = false) diff --git a/tachyon/math/elliptic_curves/short_weierstrass/affine_point_impl.h b/tachyon/math/elliptic_curves/short_weierstrass/affine_point_impl.h index 369aac2d9a..addf093427 100644 --- a/tachyon/math/elliptic_curves/short_weierstrass/affine_point_impl.h +++ b/tachyon/math/elliptic_curves/short_weierstrass/affine_point_impl.h @@ -1,6 +1,8 @@ #ifndef TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_AFFINE_POINT_IMPL_H_ #define TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_AFFINE_POINT_IMPL_H_ +#include + #include "tachyon/math/elliptic_curves/short_weierstrass/affine_point.h" namespace tachyon::math { diff --git a/tachyon/math/elliptic_curves/short_weierstrass/jacobian_point.h b/tachyon/math/elliptic_curves/short_weierstrass/jacobian_point.h index 9cf828170c..58244df192 100644 --- a/tachyon/math/elliptic_curves/short_weierstrass/jacobian_point.h +++ b/tachyon/math/elliptic_curves/short_weierstrass/jacobian_point.h @@ -1,7 +1,9 @@ #ifndef TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_JACOBIAN_POINT_H_ #define TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_JACOBIAN_POINT_H_ +#include #include +#include #include "absl/strings/substitute.h" @@ -31,9 +33,9 @@ class JacobianPoint<_Curve, std::enable_if_t<_Curve::kIsSWCurve>> constexpr JacobianPoint() : JacobianPoint(BaseField::One(), BaseField::One(), BaseField::Zero()) {} - constexpr JacobianPoint(const Point3& point) + explicit constexpr JacobianPoint(const Point3& point) : JacobianPoint(point.x, point.y, point.z) {} - constexpr JacobianPoint(Point3&& point) + explicit constexpr JacobianPoint(Point3&& point) : JacobianPoint(std::move(point.x), std::move(point.y), std::move(point.z)) {} constexpr JacobianPoint(const BaseField& x, const BaseField& y, @@ -197,4 +199,4 @@ class JacobianPoint<_Curve, std::enable_if_t<_Curve::kIsSWCurve>> #include "tachyon/math/elliptic_curves/short_weierstrass/jacobian_point_impl.h" -#endif // TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_PROJECTIVE_POINT_H_ +#endif // TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_JACOBIAN_POINT_H_ diff --git a/tachyon/math/elliptic_curves/short_weierstrass/jacobian_point_impl.h b/tachyon/math/elliptic_curves/short_weierstrass/jacobian_point_impl.h index a025696cd4..cbac3ba579 100644 --- a/tachyon/math/elliptic_curves/short_weierstrass/jacobian_point_impl.h +++ b/tachyon/math/elliptic_curves/short_weierstrass/jacobian_point_impl.h @@ -1,6 +1,8 @@ #ifndef TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_JACOBIAN_POINT_IMPL_H_ #define TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_JACOBIAN_POINT_IMPL_H_ +#include + #include "tachyon/math/elliptic_curves/short_weierstrass/jacobian_point.h" namespace tachyon::math { diff --git a/tachyon/math/elliptic_curves/short_weierstrass/jacobian_point_unittest.cc b/tachyon/math/elliptic_curves/short_weierstrass/jacobian_point_unittest.cc index 8883b61013..55fcdcd307 100644 --- a/tachyon/math/elliptic_curves/short_weierstrass/jacobian_point_unittest.cc +++ b/tachyon/math/elliptic_curves/short_weierstrass/jacobian_point_unittest.cc @@ -1,5 +1,7 @@ #include "tachyon/math/elliptic_curves/short_weierstrass/jacobian_point.h" +#include + #include "gmock/gmock.h" #include "gtest/gtest.h" diff --git a/tachyon/math/elliptic_curves/short_weierstrass/point_xyzz.h b/tachyon/math/elliptic_curves/short_weierstrass/point_xyzz.h index 89b910c15d..4681969504 100644 --- a/tachyon/math/elliptic_curves/short_weierstrass/point_xyzz.h +++ b/tachyon/math/elliptic_curves/short_weierstrass/point_xyzz.h @@ -1,7 +1,9 @@ #ifndef TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_POINT_XYZZ_H_ #define TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_POINT_XYZZ_H_ +#include #include +#include #include "absl/strings/substitute.h" @@ -31,9 +33,9 @@ class PointXYZZ<_Curve, std::enable_if_t<_Curve::kIsSWCurve>> constexpr PointXYZZ() : PointXYZZ(BaseField::One(), BaseField::One(), BaseField::Zero(), BaseField::Zero()) {} - constexpr PointXYZZ(const Point4& point) + explicit constexpr PointXYZZ(const Point4& point) : PointXYZZ(point.x, point.y, point.z, point.w) {} - constexpr PointXYZZ(Point4&& point) + explicit constexpr PointXYZZ(Point4&& point) : PointXYZZ(std::move(point.x), std::move(point.y), std::move(point.z), std::move(point.w)) {} constexpr PointXYZZ(const BaseField& x, const BaseField& y, diff --git a/tachyon/math/elliptic_curves/short_weierstrass/point_xyzz_impl.h b/tachyon/math/elliptic_curves/short_weierstrass/point_xyzz_impl.h index fe5e6c23d5..ce17721b20 100644 --- a/tachyon/math/elliptic_curves/short_weierstrass/point_xyzz_impl.h +++ b/tachyon/math/elliptic_curves/short_weierstrass/point_xyzz_impl.h @@ -1,6 +1,8 @@ #ifndef TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_POINT_XYZZ_IMPL_H_ #define TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_POINT_XYZZ_IMPL_H_ +#include + #include "tachyon/math/elliptic_curves/short_weierstrass/point_xyzz.h" namespace tachyon::math { diff --git a/tachyon/math/elliptic_curves/short_weierstrass/point_xyzz_unittest.cc b/tachyon/math/elliptic_curves/short_weierstrass/point_xyzz_unittest.cc index e960cb5331..5b9ffb4ed0 100644 --- a/tachyon/math/elliptic_curves/short_weierstrass/point_xyzz_unittest.cc +++ b/tachyon/math/elliptic_curves/short_weierstrass/point_xyzz_unittest.cc @@ -1,5 +1,7 @@ #include "tachyon/math/elliptic_curves/short_weierstrass/point_xyzz.h" +#include + #include "gmock/gmock.h" #include "gtest/gtest.h" diff --git a/tachyon/math/elliptic_curves/short_weierstrass/projective_point.h b/tachyon/math/elliptic_curves/short_weierstrass/projective_point.h index 971d236a72..74c4fb3796 100644 --- a/tachyon/math/elliptic_curves/short_weierstrass/projective_point.h +++ b/tachyon/math/elliptic_curves/short_weierstrass/projective_point.h @@ -1,7 +1,9 @@ #ifndef TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_PROJECTIVE_POINT_H_ #define TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_PROJECTIVE_POINT_H_ +#include #include +#include #include "absl/strings/substitute.h" @@ -32,9 +34,9 @@ class ProjectivePoint<_Curve, std::enable_if_t<_Curve::kIsSWCurve>> constexpr ProjectivePoint() : ProjectivePoint(BaseField::One(), BaseField::One(), BaseField::Zero()) { } - constexpr ProjectivePoint(const Point3& point) + explicit constexpr ProjectivePoint(const Point3& point) : ProjectivePoint(point.x, point.y, point.z) {} - constexpr ProjectivePoint(Point3&& point) + explicit constexpr ProjectivePoint(Point3&& point) : ProjectivePoint(std::move(point.x), std::move(point.y), std::move(point.z)) {} constexpr ProjectivePoint(const BaseField& x, const BaseField& y, diff --git a/tachyon/math/elliptic_curves/short_weierstrass/projective_point_impl.h b/tachyon/math/elliptic_curves/short_weierstrass/projective_point_impl.h index 247f10b2a0..6de6229e9f 100644 --- a/tachyon/math/elliptic_curves/short_weierstrass/projective_point_impl.h +++ b/tachyon/math/elliptic_curves/short_weierstrass/projective_point_impl.h @@ -1,8 +1,9 @@ #ifndef TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_PROJECTIVE_POINT_IMPL_H_ #define TACHYON_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_PROJECTIVE_POINT_IMPL_H_ -#include "tachyon/math/elliptic_curves/short_weierstrass/projective_point.h" +#include +#include "tachyon/math/elliptic_curves/short_weierstrass/projective_point.h" namespace tachyon::math { #define CLASS ProjectivePoint> diff --git a/tachyon/math/elliptic_curves/short_weierstrass/projective_point_unittest.cc b/tachyon/math/elliptic_curves/short_weierstrass/projective_point_unittest.cc index a2e26dd4a8..c1cc538114 100644 --- a/tachyon/math/elliptic_curves/short_weierstrass/projective_point_unittest.cc +++ b/tachyon/math/elliptic_curves/short_weierstrass/projective_point_unittest.cc @@ -1,5 +1,7 @@ #include "tachyon/math/elliptic_curves/short_weierstrass/projective_point.h" +#include + #include "gmock/gmock.h" #include "gtest/gtest.h" diff --git a/tachyon/math/finite_fields/cubic_extension_field.h b/tachyon/math/finite_fields/cubic_extension_field.h index 6431d9c132..671f78d0b9 100644 --- a/tachyon/math/finite_fields/cubic_extension_field.h +++ b/tachyon/math/finite_fields/cubic_extension_field.h @@ -6,6 +6,9 @@ #ifndef TACHYON_MATH_FINITE_FIELDS_CUBIC_EXTENSION_FIELD_H_ #define TACHYON_MATH_FINITE_FIELDS_CUBIC_EXTENSION_FIELD_H_ +#include +#include + #include "absl/strings/substitute.h" #include "tachyon/math/base/field.h" diff --git a/tachyon/math/finite_fields/generator/ext_prime_field_generator/ext_prime_field_generator.cc b/tachyon/math/finite_fields/generator/ext_prime_field_generator/ext_prime_field_generator.cc index 35ab9cf68e..9cd2fc3515 100644 --- a/tachyon/math/finite_fields/generator/ext_prime_field_generator/ext_prime_field_generator.cc +++ b/tachyon/math/finite_fields/generator/ext_prime_field_generator/ext_prime_field_generator.cc @@ -102,7 +102,6 @@ int GenerationConfig::GenerateConfigHdr() const { std::string content = absl::StrReplaceAll( tpl_content, { - {"%{namespace}", ns_name}, {"%{class}", class_name}, {"%{degree}", base::NumberToString(degree)}, diff --git a/tachyon/math/finite_fields/generator/generator_util.cc b/tachyon/math/finite_fields/generator/generator_util.cc index 572c4ae2f4..beb1dbd5f7 100644 --- a/tachyon/math/finite_fields/generator/generator_util.cc +++ b/tachyon/math/finite_fields/generator/generator_util.cc @@ -1,5 +1,8 @@ #include "tachyon/math/finite_fields/generator/generator_util.h" +#include +#include + #include "absl/strings/str_join.h" #include "absl/strings/substitute.h" diff --git a/tachyon/math/finite_fields/generator/generator_util.h b/tachyon/math/finite_fields/generator/generator_util.h index 38c7f891fa..39eb767a01 100644 --- a/tachyon/math/finite_fields/generator/generator_util.h +++ b/tachyon/math/finite_fields/generator/generator_util.h @@ -1,6 +1,8 @@ #ifndef TACHYON_MATH_FINITE_FIELDS_GENERATOR_GENERATOR_UTIL_H_ #define TACHYON_MATH_FINITE_FIELDS_GENERATOR_GENERATOR_UTIL_H_ +#include + #include "absl/types/span.h" #include "third_party/gmp/include/gmpxx.h" diff --git a/tachyon/math/finite_fields/modulus.h b/tachyon/math/finite_fields/modulus.h index 216afa4fc8..db2f5abe19 100644 --- a/tachyon/math/finite_fields/modulus.h +++ b/tachyon/math/finite_fields/modulus.h @@ -1,6 +1,8 @@ #ifndef TACHYON_MATH_FINITE_FIELDS_MODULUS_H_ #define TACHYON_MATH_FINITE_FIELDS_MODULUS_H_ +#include + #include "tachyon/math/base/big_int.h" namespace tachyon::math { @@ -68,7 +70,7 @@ class Modulus { inv *= inv; // Multiply inv *= static_cast(modulus[0]); - }; + } return -inv; } }; diff --git a/tachyon/math/finite_fields/prime_field_gmp.h b/tachyon/math/finite_fields/prime_field_gmp.h index d87294caa5..91c99f3bbb 100644 --- a/tachyon/math/finite_fields/prime_field_gmp.h +++ b/tachyon/math/finite_fields/prime_field_gmp.h @@ -7,6 +7,7 @@ #include #include +#include #include "absl/base/call_once.h" #include "absl/base/internal/endian.h" @@ -246,4 +247,4 @@ std::ostream& operator<<(std::ostream& os, const PrimeFieldGmp& f) { #endif // TACHYON_MATH_FINITE_FIELDS_PRIME_FIELD_GMP_H_ -#endif // defined(TACHYON_GMP_BACKEND) +#endif // defined(TACHYON_GMP_BACKEND) // NOLINT(build/header_guard) diff --git a/tachyon/math/finite_fields/prime_field_gpu.h b/tachyon/math/finite_fields/prime_field_gpu.h index f7b2fee049..b2c46a5dd5 100644 --- a/tachyon/math/finite_fields/prime_field_gpu.h +++ b/tachyon/math/finite_fields/prime_field_gpu.h @@ -1,5 +1,5 @@ -#ifndef TACHYON_MATH_FINITE_FIELDS_PRIME_FIELD_CUDA_H_ -#define TACHYON_MATH_FINITE_FIELDS_PRIME_FIELD_CUDA_H_ +#ifndef TACHYON_MATH_FINITE_FIELDS_PRIME_FIELD_GPU_H_ +#define TACHYON_MATH_FINITE_FIELDS_PRIME_FIELD_GPU_H_ #include #include @@ -418,4 +418,4 @@ std::ostream& operator<<(std::ostream& os, const PrimeFieldGpu& f) { } // namespace tachyon::math -#endif // TACHYON_MATH_FINITE_FIELDS_PRIME_FIELD_CUDA_H_ +#endif // TACHYON_MATH_FINITE_FIELDS_PRIME_FIELD_GPU_H_ diff --git a/tachyon/math/finite_fields/prime_field_ops_internal.h b/tachyon/math/finite_fields/prime_field_ops_internal.h index 489ccfcaa6..fe78b627dd 100644 --- a/tachyon/math/finite_fields/prime_field_ops_internal.h +++ b/tachyon/math/finite_fields/prime_field_ops_internal.h @@ -1,5 +1,5 @@ -#ifndef TACHYON_MATH_FINITE_FIELDS_PRIME_FIELD_OPS_INTERNAL_CU_H_ -#define TACHYON_MATH_FINITE_FIELDS_PRIME_FIELD_OPS_INTERNAL_CU_H_ +#ifndef TACHYON_MATH_FINITE_FIELDS_PRIME_FIELD_OPS_INTERNAL_H_ +#define TACHYON_MATH_FINITE_FIELDS_PRIME_FIELD_OPS_INTERNAL_H_ #include @@ -190,4 +190,4 @@ ALWAYS_INLINE AddResult MadcHiCc(uint64_t x, uint64_t y, uint64_t z, } // namespace u64 } // namespace tachyon::math::internal -#endif // TACHYON_MATH_FINITE_FIELDS_PRIME_FIELD_OPS_INTERNAL_CU_H_ +#endif // TACHYON_MATH_FINITE_FIELDS_PRIME_FIELD_OPS_INTERNAL_H_ diff --git a/tachyon/math/finite_fields/quadratic_extension_field.h b/tachyon/math/finite_fields/quadratic_extension_field.h index ec145f5c2a..d2acac8068 100644 --- a/tachyon/math/finite_fields/quadratic_extension_field.h +++ b/tachyon/math/finite_fields/quadratic_extension_field.h @@ -7,6 +7,7 @@ #define TACHYON_MATH_FINITE_FIELDS_QUADRATIC_EXTENSION_FIELD_H_ #include +#include #include #include "absl/strings/substitute.h" @@ -146,7 +147,7 @@ class QuadraticExtensionField : public Field { BaseField lefts[] = {c0_, c1_}; BaseField rights[] = {other.c1_, other.c0_}; c1 = BaseField::SumOfProducts(lefts, rights); - }; + } c0_ = std::move(c0); c1_ = std::move(c1); } else { diff --git a/tachyon/math/geometry/point2.h b/tachyon/math/geometry/point2.h index 9c4aee1f4d..ab499c9561 100644 --- a/tachyon/math/geometry/point2.h +++ b/tachyon/math/geometry/point2.h @@ -1,6 +1,9 @@ #ifndef TACHYON_MATH_GEOMETRY_POINT2_H_ #define TACHYON_MATH_GEOMETRY_POINT2_H_ +#include +#include + #include "absl/strings/substitute.h" namespace tachyon::math { diff --git a/tachyon/math/geometry/point3.h b/tachyon/math/geometry/point3.h index 92dfd3f8fc..9ed8058d3d 100644 --- a/tachyon/math/geometry/point3.h +++ b/tachyon/math/geometry/point3.h @@ -1,6 +1,9 @@ #ifndef TACHYON_MATH_GEOMETRY_POINT3_H_ #define TACHYON_MATH_GEOMETRY_POINT3_H_ +#include +#include + #include "absl/strings/substitute.h" namespace tachyon::math { diff --git a/tachyon/math/geometry/point4.h b/tachyon/math/geometry/point4.h index c7820bad3f..cc4a9511ba 100644 --- a/tachyon/math/geometry/point4.h +++ b/tachyon/math/geometry/point4.h @@ -1,6 +1,9 @@ #ifndef TACHYON_MATH_GEOMETRY_POINT4_H_ #define TACHYON_MATH_GEOMETRY_POINT4_H_ +#include +#include + #include "absl/strings/substitute.h" namespace tachyon::math { diff --git a/tachyon/math/matrix/sparse/sparse_matrix.h b/tachyon/math/matrix/sparse/sparse_matrix.h index c2db572eed..787399e1d5 100644 --- a/tachyon/math/matrix/sparse/sparse_matrix.h +++ b/tachyon/math/matrix/sparse/sparse_matrix.h @@ -1,6 +1,11 @@ #ifndef TACHYON_MATH_MATRIX_SPARSE_SPARSE_MATRIX_H_ #define TACHYON_MATH_MATRIX_SPARSE_SPARSE_MATRIX_H_ +#include +#include +#include +#include + #include "absl/types/span.h" #include "third_party/eigen3/Eigen/SparseCore" @@ -30,9 +35,9 @@ class ELLSparseMatrix { using Elements = std::vector; ELLSparseMatrix() = default; - ELLSparseMatrix(const std::vector& elements_list) + explicit ELLSparseMatrix(const std::vector& elements_list) : elements_list_(elements_list) {} - ELLSparseMatrix(std::vector&& elements_list) + explicit ELLSparseMatrix(std::vector&& elements_list) : elements_list_(std::move(elements_list)) {} ELLSparseMatrix(const ELLSparseMatrix& other) = default; ELLSparseMatrix& operator=(const ELLSparseMatrix& other) = default; diff --git a/tachyon/math/matrix/sparse/sparse_matrix_unittest.cc b/tachyon/math/matrix/sparse/sparse_matrix_unittest.cc index bcc95960e4..a226d269a0 100644 --- a/tachyon/math/matrix/sparse/sparse_matrix_unittest.cc +++ b/tachyon/math/matrix/sparse/sparse_matrix_unittest.cc @@ -1,5 +1,7 @@ #include "tachyon/math/matrix/sparse/sparse_matrix.h" +#include + #include "gmock/gmock.h" #include "gtest/gtest.h" @@ -128,8 +130,7 @@ TEST_F(SparseMatrixTest, CSRSparseMatrixSort) { // clang-format off CSRSparseMatrix test_data( {{3, GF7(1)}, {5, GF7(3)}, {4, GF7(2)}, {0, GF7(4)}, {1, GF7(5)}, {2, GF7(6)}}, - {0, 1, 3, 5, 6} - ); + {0, 1, 3, 5, 6}); // clang-format on EXPECT_FALSE(test_data.IsSorted()); diff --git a/tachyon/math/polynomials/multivariate/multivariate_polynomial.h b/tachyon/math/polynomials/multivariate/multivariate_polynomial.h index b3563f65e7..b6eae2d266 100644 --- a/tachyon/math/polynomials/multivariate/multivariate_polynomial.h +++ b/tachyon/math/polynomials/multivariate/multivariate_polynomial.h @@ -3,7 +3,10 @@ #include +#include #include +#include +#include #include "tachyon/math/polynomials/multivariate/sparse_coefficients.h" #include "tachyon/math/polynomials/polynomial.h" @@ -20,9 +23,9 @@ class MultivariatePolynomial using Literal = typename Coefficients::Literal; constexpr MultivariatePolynomial() = default; - constexpr MultivariatePolynomial(const Coefficients& coefficients) + explicit constexpr MultivariatePolynomial(const Coefficients& coefficients) : coefficients_(coefficients) {} - constexpr MultivariatePolynomial(Coefficients&& coefficients) + explicit constexpr MultivariatePolynomial(Coefficients&& coefficients) : coefficients_(std::move(coefficients)) {} constexpr static MultivariatePolynomial Zero() { diff --git a/tachyon/math/polynomials/multivariate/multivariate_polynomial_ops.h b/tachyon/math/polynomials/multivariate/multivariate_polynomial_ops.h index bdf51a198e..d7fb332471 100644 --- a/tachyon/math/polynomials/multivariate/multivariate_polynomial_ops.h +++ b/tachyon/math/polynomials/multivariate/multivariate_polynomial_ops.h @@ -1,6 +1,9 @@ #ifndef TACHYON_MATH_POLYNOMIALS_MULTIVARIATE_MULTIVARIATE_POLYNOMIAL_OPS_H_ #define TACHYON_MATH_POLYNOMIALS_MULTIVARIATE_MULTIVARIATE_POLYNOMIAL_OPS_H_ +#include +#include + #include "tachyon/base/containers/container_util.h" #include "tachyon/math/polynomials/multivariate/multivariate_polynomial.h" @@ -43,7 +46,7 @@ class MultivariatePolynomialOp> { static MultivariatePolynomial& NegInPlace( MultivariatePolynomial& self) { Terms& terms = self.terms_; - // TODO (TomTaehoonKim): optimize this part by multithreading. + // TODO(TomTaehoonKim): optimize this part by multithreading. for (Term& term : terms) { term.coefficient.NegInPlace(); } diff --git a/tachyon/math/polynomials/multivariate/multivariate_polynomial_unittest.cc b/tachyon/math/polynomials/multivariate/multivariate_polynomial_unittest.cc index 82832c0c86..01d749ed11 100644 --- a/tachyon/math/polynomials/multivariate/multivariate_polynomial_unittest.cc +++ b/tachyon/math/polynomials/multivariate/multivariate_polynomial_unittest.cc @@ -20,162 +20,150 @@ class MultivariatePolynomialTest : public testing::Test { MultivariatePolynomialTest() { // poly0: 2 - polys_.push_back(Poly(Coeffs(1, - { - { - { - { - {0, 0} // Element - } // vector - }, // Literal - GF7(2) // coefficient - } // Term - } // vector - ))); + polys_.push_back(Poly(Coeffs(1, { + { + { + { + {0, 0} // Element + } // vector + }, // Literal + GF7(2) // coefficient + } // Term + }))); // vector // poly1: 1 * x₀ - polys_.push_back(Poly(Coeffs(1, - { - { - { - { - {0, 1} // Element - } // vector - }, // Literal - GF7(1) // coefficient - } // Term - } // vector - ))); + polys_.push_back(Poly(Coeffs(1, { + { + { + { + {0, 1} // Element + } // vector + }, // Literal + GF7(1) // coefficient + } // Term + }))); // vector // poly2: 1 * x₀ (num_vars = 2) - polys_.push_back(Poly(Coeffs(2, - { - { - { - { - {0, 1} // Element - } // vector - }, // Literal - GF7(1) // coefficient - } // Term - } // vector - ))); + polys_.push_back(Poly(Coeffs(2, { + { + { + { + {0, 1} // Element + } // vector + }, // Literal + GF7(1) // coefficient + } // Term + }))); // vector // poly3: 1 * x₀ + 1 * x₁ - polys_.push_back(Poly(Coeffs(2, - { - { - { - { - {0, 1} // Element - } // vector - }, // Literal - GF7(1) // coefficient - }, // Term - { - { - { - {1, 1} // Element - } // vector - }, // Literal - GF7(1) // coefficient - } // Term - } // vector - ))); + polys_.push_back(Poly(Coeffs(2, { + { + { + { + {0, 1} // Element + } // vector + }, // Literal + GF7(1) // coefficient + }, // Term + { + { + { + {1, 1} // Element + } // vector + }, // Literal + GF7(1) // coefficient + } // Term + }))); // vector + // poly4: 1 * x₁ + 1 * x₀ - polys_.push_back(Poly(Coeffs(2, - { - { - { - { - {0, 1} // Element - } // vector - }, // Literal - GF7(1) // coefficient - }, // Term - { - { - { - {1, 1} // Element - } // vector - }, // Literal - GF7(1) // coefficient - } // Term - } // vector - ))); + polys_.push_back(Poly(Coeffs(2, { + { + { + { + {0, 1} // Element + } // vector + }, // Literal + GF7(1) // coefficient + }, // Term + { + { + { + {1, 1} // Element + } // vector + }, // Literal + GF7(1) // coefficient + } // Term + }))); // vector + // poly5: 1 * x₀² + 2 * x₀x₁ + 3 * x₁² + 4 - polys_.push_back(Poly(Coeffs(2, - { - { - { - { - {} // Element - } // vector - }, // Literal - GF7(4) // coefficient - }, // Term - { - { - { - {0, 2} // Element - } // vector - }, // Literal - GF7(1) // coefficient - }, // Term - { - { - { - {0, 1}, // Element - {1, 1} // Element - } // vector - }, // Literal - GF7(2) // coefficient - }, // Term - { - { - { - {1, 2} // Element - } // vector - }, // Literal - GF7(3) // coefficient - } // Term - } // vector - ))); + polys_.push_back(Poly(Coeffs(2, { + { + { + { + {} // Element + } // vector + }, // Literal + GF7(4) // coefficient + }, // Term + { + { + { + {0, 2} // Element + } // vector + }, // Literal + GF7(1) // coefficient + }, // Term + { + { + { + {0, 1}, // Element + {1, 1} // Element + } // vector + }, // Literal + GF7(2) // coefficient + }, // Term + { + { + { + {1, 2} // Element + } // vector + }, // Literal + GF7(3) // coefficient + } // Term + }))); // vector // poly6: 1 * x₀³ + 2 * x₀x₁² + 3 * x₁³ + 4 - polys_.push_back(Poly(Coeffs(2, - { - { - { - { - {1, 0} // Element - } // vector - }, // Literal - GF7(4) // coefficient - }, // Term - { - { - { - {0, 3} // Element - } // vector - }, // Literal - GF7(1) // coefficient - }, // Term - { - { - { - {0, 1}, // Element - {1, 2} // Element - } // vector - }, // Literal - GF7(2) // coefficient - }, // Term - { - { - { - {1, 3} // Element - } // vector - }, // Literal - GF7(3) // coefficient - }, // Term - } // vector - ))); + polys_.push_back(Poly(Coeffs(2, { + { + { + { + {1, 0} // Element + } // vector + }, // Literal + GF7(4) // coefficient + }, // Term + { + { + { + {0, 3} // Element + } // vector + }, // Literal + GF7(1) // coefficient + }, // Term + { + { + { + {0, 1}, // Element + {1, 2} // Element + } // vector + }, // Literal + GF7(2) // coefficient + }, // Term + { + { + { + {1, 3} // Element + } // vector + }, // Literal + GF7(3) // coefficient + }, // Term + }))); // vector } MultivariatePolynomialTest(const MultivariatePolynomialTest&) = delete; MultivariatePolynomialTest& operator=(const MultivariatePolynomialTest&) = @@ -191,18 +179,16 @@ class MultivariatePolynomialTest : public testing::Test { TEST_F(MultivariatePolynomialTest, IsZero) { EXPECT_TRUE(Poly().IsZero()); EXPECT_TRUE(Poly::Zero().IsZero()); - Coeffs a = Coeffs(1, - { - { - { - { - {0, 0} // Element - } // vector - }, // Literal - GF7(0) // coefficient - } // Term - } // vector - ); + Coeffs a = Coeffs(1, { + { + { + { + {0, 0} // Element + } // vector + }, // Literal + GF7(0) // coefficient + } // Term + }); // vector a.Compact(); EXPECT_TRUE(Poly(a).IsZero()); for (size_t i = 0; i < polys_.size(); ++i) { @@ -222,8 +208,7 @@ TEST_F(MultivariatePolynomialTest, IsOne) { }, // Literal GF7(1) // coefficient } // Term - } // vector - )) + })) // vector .IsOne()); for (size_t i = 0; i < polys_.size() - 1; ++i) { EXPECT_FALSE(polys_[i].IsOne()); @@ -332,8 +317,7 @@ TEST_F(MultivariatePolynomialTest, AdditiveOperators) { Poly bma; } tests[] = { { - polys_[0], - polys_[1], + polys_[0], polys_[1], Poly(Coeffs(1, { { @@ -352,8 +336,7 @@ TEST_F(MultivariatePolynomialTest, AdditiveOperators) { }, // Literal GF7(1) // coefficient } // Term - } // vector - )), + })), // vector Poly(Coeffs(1, { { @@ -372,8 +355,7 @@ TEST_F(MultivariatePolynomialTest, AdditiveOperators) { }, // Literal GF7(6) // coefficient } // Term - } // vector - )), + })), // vector Poly(Coeffs(1, { { @@ -392,12 +374,10 @@ TEST_F(MultivariatePolynomialTest, AdditiveOperators) { }, // Literal GF7(1) // coefficient } // Term - } // vector - )), + })), // vector }, { - polys_[0], - polys_[3], + polys_[0], polys_[3], Poly(Coeffs(2, { { @@ -424,8 +404,7 @@ TEST_F(MultivariatePolynomialTest, AdditiveOperators) { }, // Literal GF7(1) // coefficient } // Term - } // vector - )), + })), // vector Poly(Coeffs(2, { { @@ -452,8 +431,8 @@ TEST_F(MultivariatePolynomialTest, AdditiveOperators) { }, // Literal GF7(6) // coefficient } // Term - } // vector - )), + })), // vector + Poly(Coeffs(2, { { @@ -480,8 +459,7 @@ TEST_F(MultivariatePolynomialTest, AdditiveOperators) { }, // Literal GF7(1) // coefficient } // Term - } // vector - )), + })), // vector }, {polys_[5], polys_[6], Poly(Coeffs(2, @@ -544,8 +522,7 @@ TEST_F(MultivariatePolynomialTest, AdditiveOperators) { }, // Literal GF7(3) // coefficient }, // Term - } // vector - )), + })), // vector Poly(Coeffs(2, { { @@ -598,8 +575,8 @@ TEST_F(MultivariatePolynomialTest, AdditiveOperators) { }, // Literal GF7(4) // coefficient }, // Term - } // vector - )), + })), // vector + Poly(Coeffs(2, { { @@ -652,8 +629,7 @@ TEST_F(MultivariatePolynomialTest, AdditiveOperators) { }, // Literal GF7(3) // coefficient }, // Term - } // vector - ))}, + }))}, // vector }; for (const auto& test : tests) { diff --git a/tachyon/math/polynomials/multivariate/sparse_coefficients.h b/tachyon/math/polynomials/multivariate/sparse_coefficients.h index 0d5ee49068..facfb87f30 100644 --- a/tachyon/math/polynomials/multivariate/sparse_coefficients.h +++ b/tachyon/math/polynomials/multivariate/sparse_coefficients.h @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -57,10 +58,12 @@ class SparseCoefficients { Literal() = default; + // NOLINTNEXTLINE(runtime/explicit) Literal(const std::vector& elems) : elements(elems) { DCHECK(base::ranges::is_sorted(elements.begin(), elements.end())); } + // NOLINTNEXTLINE(runtime/explicit) Literal(std::vector&& elems) : elements(std::move(elems)) { DCHECK(base::ranges::is_sorted(elements.begin(), elements.end())); } diff --git a/tachyon/math/polynomials/univariate/dense_coefficients.h b/tachyon/math/polynomials/univariate/dense_coefficients.h index 494d143966..b3b025214f 100644 --- a/tachyon/math/polynomials/univariate/dense_coefficients.h +++ b/tachyon/math/polynomials/univariate/dense_coefficients.h @@ -5,6 +5,7 @@ #include #include +#include #include #include diff --git a/tachyon/math/polynomials/univariate/sparse_coefficients.h b/tachyon/math/polynomials/univariate/sparse_coefficients.h index 5c79916c09..29dbeb841f 100644 --- a/tachyon/math/polynomials/univariate/sparse_coefficients.h +++ b/tachyon/math/polynomials/univariate/sparse_coefficients.h @@ -5,6 +5,7 @@ #include #include +#include #include #include diff --git a/tachyon/math/polynomials/univariate/univariate_polynomial.h b/tachyon/math/polynomials/univariate/univariate_polynomial.h index 6dabf3ad4e..c8bb548e84 100644 --- a/tachyon/math/polynomials/univariate/univariate_polynomial.h +++ b/tachyon/math/polynomials/univariate/univariate_polynomial.h @@ -3,7 +3,9 @@ #include +#include #include +#include #include "tachyon/base/logging.h" #include "tachyon/math/polynomials/polynomial.h" diff --git a/tachyon/math/polynomials/univariate/univariate_polynomial_ops.h b/tachyon/math/polynomials/univariate/univariate_polynomial_ops.h index b73f8e51b7..323e8d32d4 100644 --- a/tachyon/math/polynomials/univariate/univariate_polynomial_ops.h +++ b/tachyon/math/polynomials/univariate/univariate_polynomial_ops.h @@ -3,6 +3,8 @@ #include #include +#include +#include #include "tachyon/base/containers/container_util.h" #include "tachyon/math/base/arithmetics_results.h" diff --git a/tachyon/math/test/launch_op_macros.h b/tachyon/math/test/launch_op_macros.h index 602e76d9ea..34f87e6cae 100644 --- a/tachyon/math/test/launch_op_macros.h +++ b/tachyon/math/test/launch_op_macros.h @@ -1,5 +1,5 @@ -#ifndef TACHYON_MATH_FINITE_FIELDS_KERNELS_TEST_LAUNCH_OP_MACROS_H_ -#define TACHYON_MATH_FINITE_FIELDS_KERNELS_TEST_LAUNCH_OP_MACROS_H_ +#ifndef TACHYON_MATH_TEST_LAUNCH_OP_MACROS_H_ +#define TACHYON_MATH_TEST_LAUNCH_OP_MACROS_H_ #include "tachyon/device/gpu/gpu_device_functions.h" #include "tachyon/device/gpu/gpu_logging.h" @@ -30,4 +30,4 @@ : error; \ } -#endif // TACHYON_MATH_FINITE_FIELDS_KERNELS_TEST_LAUNCH_OP_MACROS_H_ +#endif // TACHYON_MATH_TEST_LAUNCH_OP_MACROS_H_ diff --git a/tachyon/node/base/node_constructors.cc b/tachyon/node/base/node_constructors.cc index 54e1dad09a..a0d55b5516 100644 --- a/tachyon/node/base/node_constructors.cc +++ b/tachyon/node/base/node_constructors.cc @@ -1,5 +1,7 @@ #include "tachyon/node/base/node_constructors.h" +#include + namespace tachyon::node { // static diff --git a/tachyon/node/base/node_cpp_callable.h b/tachyon/node/base/node_cpp_callable.h index 6094fabcd2..764c24d9bd 100644 --- a/tachyon/node/base/node_cpp_callable.h +++ b/tachyon/node/base/node_cpp_callable.h @@ -1,7 +1,10 @@ #ifndef TACHYON_NODE_BASE_NODE_CPP_CALLABLE_H_ #define TACHYON_NODE_BASE_NODE_CPP_CALLABLE_H_ +#include #include +#include +#include #include "absl/strings/substitute.h" #include "third_party/node_addon_api/napi.h" diff --git a/tachyon/node/base/node_cpp_callable_data.h b/tachyon/node/base/node_cpp_callable_data.h index fdea3be02e..732202ce76 100644 --- a/tachyon/node/base/node_cpp_callable_data.h +++ b/tachyon/node/base/node_cpp_callable_data.h @@ -2,6 +2,7 @@ #define TACHYON_NODE_BASE_NODE_CPP_CALLABLE_DATA_H_ #include +#include #include #include "tachyon/export.h" diff --git a/tachyon/node/base/node_cpp_class.h b/tachyon/node/base/node_cpp_class.h index fbcccdac6c..c47b7a2f88 100644 --- a/tachyon/node/base/node_cpp_class.h +++ b/tachyon/node/base/node_cpp_class.h @@ -1,7 +1,11 @@ #ifndef TACHYON_NODE_BASE_NODE_CPP_CLASS_H_ #define TACHYON_NODE_BASE_NODE_CPP_CLASS_H_ +#include +#include #include +#include +#include #include "absl/strings/substitute.h" diff --git a/tachyon/node/base/node_cpp_constructor.h b/tachyon/node/base/node_cpp_constructor.h index 7bdc979bae..395dd4e126 100644 --- a/tachyon/node/base/node_cpp_constructor.h +++ b/tachyon/node/base/node_cpp_constructor.h @@ -1,7 +1,9 @@ #ifndef TACHYON_NODE_BASE_NODE_CPP_CONSTRUCTOR_H_ #define TACHYON_NODE_BASE_NODE_CPP_CONSTRUCTOR_H_ +#include #include +#include #include #include "third_party/node_addon_api/napi.h" @@ -17,10 +19,9 @@ namespace tachyon::node { namespace internal { template -constexpr bool should_override_to_number_v = std::is_enum::value || - (std::is_integral::value && - sizeof(T) <= 4 && - !std::is_same::value); +constexpr bool should_override_to_number_v = + std::is_enum::value || (std::is_integral::value && sizeof(T) <= 4 && + !std::is_same::value); } // namespace internal diff --git a/tachyon/node/base/node_cpp_constructor_matcher.h b/tachyon/node/base/node_cpp_constructor_matcher.h index 07ec714688..c889f7f2e5 100644 --- a/tachyon/node/base/node_cpp_constructor_matcher.h +++ b/tachyon/node/base/node_cpp_constructor_matcher.h @@ -1,6 +1,8 @@ #ifndef TACHYON_NODE_BASE_NODE_CPP_CONSTRUCTOR_MATCHER_H_ #define TACHYON_NODE_BASE_NODE_CPP_CONSTRUCTOR_MATCHER_H_ +#include + #include "third_party/node_addon_api/napi.h" #include "tachyon/base/binding/cpp_constructor_matcher.h" diff --git a/tachyon/node/base/node_cpp_object.h b/tachyon/node/base/node_cpp_object.h index a63d6059b3..aae3642465 100644 --- a/tachyon/node/base/node_cpp_object.h +++ b/tachyon/node/base/node_cpp_object.h @@ -1,7 +1,9 @@ #ifndef TACHYON_NODE_BASE_NODE_CPP_OBJECT_H_ #define TACHYON_NODE_BASE_NODE_CPP_OBJECT_H_ +#include #include +#include #include "tachyon/base/binding/cpp_stack_value.h" #include "tachyon/base/binding/cpp_value.h" diff --git a/tachyon/node/base/node_internals.h b/tachyon/node/base/node_internals.h index fd24fe191c..da4ed5027b 100644 --- a/tachyon/node/base/node_internals.h +++ b/tachyon/node/base/node_internals.h @@ -1,8 +1,10 @@ #ifndef TACHYON_NODE_BASE_NODE_INTERNALS_H_ #define TACHYON_NODE_BASE_NODE_INTERNALS_H_ +#include #include #include +#include #include #include "absl/container/inlined_vector.h" diff --git a/tachyon/node/base/node_module.h b/tachyon/node/base/node_module.h index a1bfd2b46f..fafc38693a 100644 --- a/tachyon/node/base/node_module.h +++ b/tachyon/node/base/node_module.h @@ -1,6 +1,8 @@ #ifndef TACHYON_NODE_BASE_NODE_MODULE_H_ #define TACHYON_NODE_BASE_NODE_MODULE_H_ +#include + #include "tachyon/export.h" #include "tachyon/node/base/node_cpp_bindable.h" #include "tachyon/node/base/node_cpp_callable.h" diff --git a/tachyon/node/base/test/color.h b/tachyon/node/base/test/color.h index e9a2142c0d..030582cc75 100644 --- a/tachyon/node/base/test/color.h +++ b/tachyon/node/base/test/color.h @@ -1,3 +1,8 @@ +#ifndef TACHYON_NODE_BASE_TEST_COLOR_H_ +#define TACHYON_NODE_BASE_TEST_COLOR_H_ + #include "tachyon/node/base/node_module.h" void AddColor(tachyon::node::NodeModule& m); + +#endif // TACHYON_NODE_BASE_TEST_COLOR_H_ diff --git a/tachyon/node/base/test/point.cc b/tachyon/node/base/test/point.cc index 305a744395..5dbd32930a 100644 --- a/tachyon/node/base/test/point.cc +++ b/tachyon/node/base/test/point.cc @@ -1,5 +1,7 @@ #include "tachyon/node/base/test/point.h" +#include + void AddPoint(tachyon::node::NodeModule& m) { AddPointImpl(m, "Point"); } diff --git a/tachyon/node/base/test/point.h b/tachyon/node/base/test/point.h index cac625a2d5..6ace648142 100644 --- a/tachyon/node/base/test/point.h +++ b/tachyon/node/base/test/point.h @@ -1,3 +1,7 @@ +#ifndef TACHYON_NODE_BASE_TEST_POINT_H_ +#define TACHYON_NODE_BASE_TEST_POINT_H_ + +#include #include #include "tachyon/base/binding/test/point.h" @@ -38,3 +42,5 @@ void DoubleWithReference(tachyon::base::test::Point& p); void DoubleWithSharedPtr(std::shared_ptr p); void DoubleWithUniquePtr(std::unique_ptr p); + +#endif // TACHYON_NODE_BASE_TEST_POINT_H_ diff --git a/tachyon/node/math/base/big_int.h b/tachyon/node/math/base/big_int.h index 8336f7f1e5..09f217d9c6 100644 --- a/tachyon/node/math/base/big_int.h +++ b/tachyon/node/math/base/big_int.h @@ -1,6 +1,8 @@ #ifndef TACHYON_NODE_MATH_BASE_BIG_INT_H_ #define TACHYON_NODE_MATH_BASE_BIG_INT_H_ +#include + #include "absl/strings/substitute.h" #include "tachyon/math/base/big_int.h" @@ -68,4 +70,4 @@ class CppValueTraits> { } // namespace internal } // namespace tachyon::node -#endif // TACHYON_NODE_MATH_FINITE_FIELDS_PRIME_FIELD_H_ +#endif // TACHYON_NODE_MATH_BASE_BIG_INT_H_ diff --git a/tachyon/node/math/elliptic_curves/short_weierstrass/affine_point.h b/tachyon/node/math/elliptic_curves/short_weierstrass/affine_point.h index e63d21ec11..698664a57d 100644 --- a/tachyon/node/math/elliptic_curves/short_weierstrass/affine_point.h +++ b/tachyon/node/math/elliptic_curves/short_weierstrass/affine_point.h @@ -24,9 +24,9 @@ void AddAffinePoint(NodeModule& m, std::string_view name) { .AddMethod("eq", &AffinePointTy::operator==) .AddMethod("ne", &AffinePointTy::operator!=) .AddMethod("add", - &AffinePointTy::template operator+ ) + &AffinePointTy::template operator+) .AddMethod("sub", - &AffinePointTy::template operator- ) + &AffinePointTy::template operator-) .AddMethod("negative", &AffinePointTy::Negative) .AddMethod("double", &AffinePointTy::Double); } diff --git a/tachyon/node/math/elliptic_curves/short_weierstrass/jacobian_point.h b/tachyon/node/math/elliptic_curves/short_weierstrass/jacobian_point.h index a8da07ce50..06a03b3b7c 100644 --- a/tachyon/node/math/elliptic_curves/short_weierstrass/jacobian_point.h +++ b/tachyon/node/math/elliptic_curves/short_weierstrass/jacobian_point.h @@ -28,13 +28,13 @@ void AddJacobianPoint(NodeModule& m, std::string_view name) { .AddMethod("eq", &JacobianPointTy::operator==) .AddMethod("ne", &JacobianPointTy::operator!=) .AddMethod("add", - &JacobianPointTy::template operator+ ) + &JacobianPointTy::template operator+) .AddMethod("addMixed", - &JacobianPointTy::template operator+ ) + &JacobianPointTy::template operator+) .AddMethod("sub", - &JacobianPointTy::template operator- ) + &JacobianPointTy::template operator-) .AddMethod("subMixed", - &JacobianPointTy::template operator- ) + &JacobianPointTy::template operator-) .AddMethod("negative", &JacobianPointTy::Negative) .AddMethod("double", &JacobianPointTy::Double); } diff --git a/tachyon/node/math/elliptic_curves/short_weierstrass/point_xyzz.h b/tachyon/node/math/elliptic_curves/short_weierstrass/point_xyzz.h index e7c3747bf3..169b924362 100644 --- a/tachyon/node/math/elliptic_curves/short_weierstrass/point_xyzz.h +++ b/tachyon/node/math/elliptic_curves/short_weierstrass/point_xyzz.h @@ -28,12 +28,12 @@ void AddPointXYZZ(NodeModule& m, std::string_view name) { .AddMethod("toHexString", &PointXYZZTy::ToHexString) .AddMethod("eq", &PointXYZZTy::operator==) .AddMethod("ne", &PointXYZZTy::operator!=) - .AddMethod("add", &PointXYZZTy::template operator+ ) + .AddMethod("add", &PointXYZZTy::template operator+) .AddMethod("addMixed", - &PointXYZZTy::template operator+ ) - .AddMethod("sub", &PointXYZZTy::template operator- ) + &PointXYZZTy::template operator+) + .AddMethod("sub", &PointXYZZTy::template operator-) .AddMethod("subMixed", - &PointXYZZTy::template operator- ) + &PointXYZZTy::template operator-) .AddMethod("negative", &PointXYZZTy::Negative) .AddMethod("double", &PointXYZZTy::Double); } diff --git a/tachyon/node/math/elliptic_curves/short_weierstrass/projective_point.h b/tachyon/node/math/elliptic_curves/short_weierstrass/projective_point.h index c8d3736a23..9cdc2076cd 100644 --- a/tachyon/node/math/elliptic_curves/short_weierstrass/projective_point.h +++ b/tachyon/node/math/elliptic_curves/short_weierstrass/projective_point.h @@ -30,11 +30,11 @@ void AddProjectivePoint(NodeModule& m, std::string_view name) { .AddMethod("add", &ProjectivePointTy::template operator+ ) .AddMethod("addMixed", - &ProjectivePointTy::template operator+ ) + &ProjectivePointTy::template operator+) .AddMethod("sub", &ProjectivePointTy::template operator- ) .AddMethod("subMixed", - &ProjectivePointTy::template operator- ) + &ProjectivePointTy::template operator-) .AddMethod("negative", &ProjectivePointTy::Negative) .AddMethod("double", &ProjectivePointTy::Double); } diff --git a/tachyon/node/math/finite_fields/prime_field.h b/tachyon/node/math/finite_fields/prime_field.h index b93489d423..146103a0b0 100644 --- a/tachyon/node/math/finite_fields/prime_field.h +++ b/tachyon/node/math/finite_fields/prime_field.h @@ -1,6 +1,8 @@ #ifndef TACHYON_NODE_MATH_FINITE_FIELDS_PRIME_FIELD_H_ #define TACHYON_NODE_MATH_FINITE_FIELDS_PRIME_FIELD_H_ +#include + #include "tachyon/node/base/node_module.h" #include "tachyon/node/math/base/big_int.h" @@ -36,14 +38,14 @@ void AddPrimeField(NodeModule& m, std::string_view name) { .AddMethod("toHexString", &PrimeFieldTy::ToHexString) .AddMethod("eq", &PrimeFieldTy::operator==) .AddMethod("ne", &PrimeFieldTy::operator!=) - .AddMethod("lt", &PrimeFieldTy::operator<) - .AddMethod("le", &PrimeFieldTy::operator<=) - .AddMethod("gt", &PrimeFieldTy::operator>) + .AddMethod("lt", &PrimeFieldTy::operator<) // NOLINT + .AddMethod("le", &PrimeFieldTy::operator<=) // NOLINT + .AddMethod("gt", &PrimeFieldTy::operator>) // NOLINT .AddMethod("ge", &PrimeFieldTy::operator>=) - .AddMethod("add", &PrimeFieldTy::template operator+ ) - .AddMethod("sub", &PrimeFieldTy::template operator- ) - .AddMethod("mul", &PrimeFieldTy::template operator* ) - .AddMethod("div", &PrimeFieldTy::template operator/ ) + .AddMethod("add", &PrimeFieldTy::template operator+) + .AddMethod("sub", &PrimeFieldTy::template operator-) + .AddMethod("mul", &PrimeFieldTy::template operator*) + .AddMethod("div", &PrimeFieldTy::template operator/) .AddMethod("negative", &PrimeFieldTy::Negative) .AddMethod("double", &PrimeFieldTy::Double) .AddMethod("square", &PrimeFieldTy::Square); diff --git a/tachyon/py/math/elliptic_curves/short_weierstrass/affine_point.h b/tachyon/py/math/elliptic_curves/short_weierstrass/affine_point.h index 29603218a0..d0843f853d 100644 --- a/tachyon/py/math/elliptic_curves/short_weierstrass/affine_point.h +++ b/tachyon/py/math/elliptic_curves/short_weierstrass/affine_point.h @@ -1,6 +1,8 @@ #ifndef TACHYON_PY_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_AFFINE_POINT_H_ #define TACHYON_PY_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_AFFINE_POINT_H_ +#include + #include "pybind11/operators.h" #include "tachyon/math/base/big_int.h" diff --git a/tachyon/py/math/elliptic_curves/short_weierstrass/jacobian_point.h b/tachyon/py/math/elliptic_curves/short_weierstrass/jacobian_point.h index c461bb6570..8cc4993a18 100644 --- a/tachyon/py/math/elliptic_curves/short_weierstrass/jacobian_point.h +++ b/tachyon/py/math/elliptic_curves/short_weierstrass/jacobian_point.h @@ -1,6 +1,8 @@ #ifndef TACHYON_PY_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_JACOBIAN_POINT_H_ #define TACHYON_PY_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_JACOBIAN_POINT_H_ +#include + #include "pybind11/operators.h" #include "tachyon/math/elliptic_curves/affine_point.h" diff --git a/tachyon/py/math/elliptic_curves/short_weierstrass/point_xyzz.h b/tachyon/py/math/elliptic_curves/short_weierstrass/point_xyzz.h index 9ff15a376a..a93a404978 100644 --- a/tachyon/py/math/elliptic_curves/short_weierstrass/point_xyzz.h +++ b/tachyon/py/math/elliptic_curves/short_weierstrass/point_xyzz.h @@ -1,6 +1,8 @@ #ifndef TACHYON_PY_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_POINT_XYZZ_H_ #define TACHYON_PY_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_POINT_XYZZ_H_ +#include + #include "pybind11/operators.h" #include "tachyon/math/elliptic_curves/affine_point.h" diff --git a/tachyon/py/math/elliptic_curves/short_weierstrass/projective_point.h b/tachyon/py/math/elliptic_curves/short_weierstrass/projective_point.h index 2a28cc68fc..959b531634 100644 --- a/tachyon/py/math/elliptic_curves/short_weierstrass/projective_point.h +++ b/tachyon/py/math/elliptic_curves/short_weierstrass/projective_point.h @@ -1,6 +1,8 @@ #ifndef TACHYON_PY_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_PROJECTIVE_POINT_H_ #define TACHYON_PY_MATH_ELLIPTIC_CURVES_SHORT_WEIERSTRASS_PROJECTIVE_POINT_H_ +#include + #include "pybind11/operators.h" #include "tachyon/math/elliptic_curves/affine_point.h" diff --git a/tachyon/py/math/finite_fields/prime_field.h b/tachyon/py/math/finite_fields/prime_field.h index 2414131756..f8e3ae7fb7 100644 --- a/tachyon/py/math/finite_fields/prime_field.h +++ b/tachyon/py/math/finite_fields/prime_field.h @@ -1,6 +1,8 @@ #ifndef TACHYON_PY_MATH_FINITE_FIELDS_PRIME_FIELD_H_ #define TACHYON_PY_MATH_FINITE_FIELDS_PRIME_FIELD_H_ +#include + #include "pybind11/operators.h" #include "tachyon/py/base/pybind11.h" diff --git a/tachyon/version.h b/tachyon/version.h index c5a360fd23..fa011c26c6 100644 --- a/tachyon/version.h +++ b/tachyon/version.h @@ -18,4 +18,4 @@ TACHYON_EXPORT std::string_view GetRuntimeFullVersionStr(); } // namespace tachyon -#endif // TACHYON_VERSION_H_ \ No newline at end of file +#endif // TACHYON_VERSION_H_ diff --git a/tachyon/version_unittest.cc b/tachyon/version_unittest.cc index c6738528da..dc1184d040 100644 --- a/tachyon/version_unittest.cc +++ b/tachyon/version_unittest.cc @@ -20,4 +20,4 @@ TEST(VersionTest, RunTimeVersionTest) { EXPECT_EQ(TACHYON_VERSION_FULL_STR, GetRuntimeFullVersionStr()); } -} // namespace tachyon \ No newline at end of file +} // namespace tachyon diff --git a/third_party/hwloc/static-components.h b/third_party/hwloc/static-components.h index f0db2dcaef..80ad349e99 100644 --- a/third_party/hwloc/static-components.h +++ b/third_party/hwloc/static-components.h @@ -13,10 +13,11 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TACHYON_THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_ -#define TACHYON_THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_ +#ifndef THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_ +#define THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_ #include + static const struct hwloc_component* hwloc_static_components[] = { &hwloc_noos_component, &hwloc_xml_component, @@ -35,4 +36,4 @@ static const struct hwloc_component* hwloc_static_components[] = { #endif NULL}; -#endif // TACHYON_THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_ +#endif // THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_ diff --git a/third_party/nasm/config.h b/third_party/nasm/config.h index 3533280c47..606550227e 100644 --- a/third_party/nasm/config.h +++ b/third_party/nasm/config.h @@ -1,4 +1,4 @@ -/* config/config.h. Generated from config.h.in by configure. */ +/* config/config.h. Generated from config.h.in by configure. */ // NOLINT(build/header_guard) /* config/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 to call abort() on panics (internal errors), for debugging. */ diff --git a/third_party/polygon_zkevm/zkevm_prover/fr_fail.cc b/third_party/polygon_zkevm/zkevm_prover/fr_fail.cc index 0051fe525b..26fa650134 100644 --- a/third_party/polygon_zkevm/zkevm_prover/fr_fail.cc +++ b/third_party/polygon_zkevm/zkevm_prover/fr_fail.cc @@ -1,3 +1,5 @@ +#include "third_party/polygon_zkevm/zkevm_prover/fr_fail.h" + #include void Fr_fail() { assert(false); }