diff options
author | Kenneth Heafield <github@kheafield.com> | 2020-08-17 14:13:58 +0300 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2020-08-17 14:13:58 +0300 |
commit | 392ada9634c51d8c923f22ad5a5d2da4ecc52534 (patch) | |
tree | d9fb330fc292d7843286085173def50c21293427 | |
parent | dcaf2c8ed96041c08a2b7eb8572ed62e7a256162 (diff) |
Change some typedef to using
-rw-r--r-- | benchmarks/benchmark.cc | 2 | ||||
-rw-r--r-- | interleave.h | 8 | ||||
-rw-r--r-- | test/multiply_test.cc | 8 | ||||
-rw-r--r-- | test/quantize_test.cc | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/benchmarks/benchmark.cc b/benchmarks/benchmark.cc index ebd0920..627a304 100644 --- a/benchmarks/benchmark.cc +++ b/benchmarks/benchmark.cc @@ -43,7 +43,7 @@ struct RandomMatrices { }; template <class Backend> double Run(const RandomMatrices &m) { - typedef typename Backend::Integer Integer; + using Integer = typename Backend::Integer; float quant_mult = 127.0f / 2.0f; float unquant_mult = 1.0f / (quant_mult * quant_mult); AlignedVector<Integer> A_prepared(m.A_rows * m.width); diff --git a/interleave.h b/interleave.h index 2fef188..bcf4d68 100644 --- a/interleave.h +++ b/interleave.h @@ -179,8 +179,8 @@ template <class Register> static inline void Transpose8InLane( // ... ... #define INTGEMM_PREPARE_B_8(target, QuantClass) \ target static inline void PrepareB(const float *input, int8_t *output_shadow, float quant_mult, Index rows, Index cols) { \ - typedef typename QuantClass Quantizer; \ - typedef typename Quantizer::Register Register; \ + using Quantizer = typename QuantClass; \ + using Register = typename Quantizer::Register; \ Quantizer q = Quantizer(quant_mult); \ /* Currently all multipliers have a stride of 8 columns.*/ \ const Index kColStride = 8; \ @@ -214,8 +214,8 @@ target static inline void PrepareB(const float *input, int8_t *output_shadow, fl #define INTGEMM_PREPARE_B_16(target, QuantClass) \ target static inline void PrepareB(const float *input, int16_t *output_shadow, float quant_mult, Index rows, Index cols) { \ - typedef typename QuantClass Quantizer; \ - typedef typename Quantizer::Register Register; \ + using Quantizer = typename QuantClass; \ + using Register = typename Quantizer::Register; \ Quantizer q = Quantizer(quant_mult); \ assert(cols % 8 == 0); \ assert(rows % (sizeof(Register) / sizeof(int16_t)) == 0); \ diff --git a/test/multiply_test.cc b/test/multiply_test.cc index 2db6dd3..a7c6c77 100644 --- a/test/multiply_test.cc +++ b/test/multiply_test.cc @@ -66,7 +66,7 @@ template <class Routine> void TestPrepare(Index rows = 32, Index cols = 16) { it = dist(gen); } - typedef typename Routine::Integer Integer; + using Integer = typename Routine::Integer; // Call Prepare AlignedVector<Integer> test(input.size()); Routine::PrepareB(input.begin(), test.begin(), 1, rows, cols); @@ -119,7 +119,7 @@ template <class Routine> void TestSelectColumnsB(Index rows = 64, Index cols = 1 for (auto& it : input) { it = dist(gen); } - typedef typename Routine::Integer Integer; + using Integer = typename Routine::Integer; AlignedVector<Integer> prepared(input.size()); Routine::PrepareB(input.begin(), prepared.begin(), 1, rows, cols); @@ -255,7 +255,7 @@ TEST_CASE("MaxAbsolute AVX512BW", "[max]") { template <class Routine> void TestMultiply(Index A_rows, Index width, Index B_cols, float int_tolerance=.1, float float_tolerance=1, float MSE_float_tolerance=0, float MSE_int_tolerance=0) { - typedef typename Routine::Integer Integer; + using Integer = typename Routine::Integer; std::ostringstream info; info << Routine::kName << "\t" << A_rows << '\t' << width << '\t' << B_cols << '\n'; @@ -307,7 +307,7 @@ template <class Routine> void TestMultiply(Index A_rows, Index width, Index B_co //Require different number of arguments. I don't think the refactoring is worth it. template <class Routine> void TestMultiplyBias(Index A_rows, Index width, Index B_cols, float int_tolerance = 0.1f, float float_tolerance = 1.0f, float MSE_float_tolerance = 0.0f, float MSE_int_tolerance = 0.0f) { - typedef typename Routine::Integer Integer; + using Integer = typename Routine::Integer; std::ostringstream info; info << Routine::kName << "\t" << A_rows << '\t' << width << '\t' << B_cols << '\n'; diff --git a/test/quantize_test.cc b/test/quantize_test.cc index 2eb693f..15e68c9 100644 --- a/test/quantize_test.cc +++ b/test/quantize_test.cc @@ -81,7 +81,7 @@ template <class I> bool IsOff(float from, I ref, I test) { } template <class Backend> bool Test(const float *input_unaligned, float quant_mult, std::size_t size) { - typedef typename Backend::Integer Integer; + using Integer = typename Backend::Integer; bool success = true; AlignedVector<float> input(size); std::memcpy(input.begin(), input_unaligned, sizeof(float) * size); |