diff options
author | Kenneth Heafield <github@kheafield.com> | 2018-06-24 00:09:38 +0300 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2018-06-24 00:09:38 +0300 |
commit | 09be9c249c73bd3b4c21d261ad3e718981fe2eaa (patch) | |
tree | 972ee0e680487b56c7935e15dc39bb9cf1c33c50 /intgemm.cc | |
parent | 0ae900a954ee19ebb8d33ba57493e4a14249c719 (diff) |
Change to kName using the name of the implementation behind dispatch
Diffstat (limited to 'intgemm.cc')
-rw-r--r-- | intgemm.cc | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -26,7 +26,9 @@ struct Unsupported_16bit { static void Multiply(const int16_t *, const int16_t *, float *C, float, int, int, int) { throw UnsupportedCPU(); } + static const char *const kName; }; +const char *const Unsupported_16bit::kName = "16-bit Unsupported"; struct Unsupported_8bit { static void Quantize(const float *, int8_t *, float, int) { @@ -38,7 +40,9 @@ struct Unsupported_8bit { static void Multiply(const int8_t *, const int8_t *, float *C, float, int, int, int) { throw UnsupportedCPU(); } + static const char *const kName; }; +const char *const Unsupported_8bit::kName = "8-bit Unsupported"; /* Returns: * avx512 if the CPU supports AVX512F (though really it should be AVX512BW, but @@ -72,9 +76,12 @@ template <class T> T ChooseCPU(T avx512, T avx2, T ssse3, T sse2, T unsupported) void (*Int16::Quantize)(const float *input, int16_t *output, float quant_mult, int size) = ChooseCPU(AVX512_16bit::Quantize, AVX2_16bit::Quantize, SSE2_16bit::Quantize, SSE2_16bit::Quantize, Unsupported_16bit::Quantize); void (*Int16::PrepareB)(const float *input, int16_t *output, float quant_mult, int rows, int cols) = ChooseCPU(AVX512_16bit::PrepareB, AVX2_16bit::PrepareB, SSE2_16bit::PrepareB, SSE2_16bit::PrepareB, Unsupported_16bit::PrepareB); void (*Int16::Multiply)(const int16_t *A, const int16_t *B, float *C, float unquant_mult, int A_rows, int width, int B_cols) = ChooseCPU(AVX512_16bit::Multiply, AVX2_16bit::Multiply, SSE2_16bit::Multiply, SSE2_16bit::Multiply, Unsupported_16bit::Multiply); +const char *const Int16::kName = ChooseCPU(AVX512_16bit::kName, AVX2_16bit::kName, SSE2_16bit::kName, SSE2_16bit::kName, Unsupported_16bit::kName); void (*Int8::Quantize)(const float *input, int8_t *output, float quant_mult, int size) = ChooseCPU(AVX512_8bit::Quantize, AVX2_8bit::Quantize, SSSE3_8bit::Quantize, Unsupported_8bit::Quantize, Unsupported_8bit::Quantize); void (*Int8::PrepareB)(const float *input, int8_t *output, float quant_mult, int rows, int cols) = ChooseCPU(AVX512_8bit::PrepareB, AVX2_8bit::PrepareB, SSSE3_8bit::PrepareB, Unsupported_8bit::PrepareB, Unsupported_8bit::PrepareB); void (*Int8::Multiply)(const int8_t *A, const int8_t *B, float *C, float unquant_mult, int A_rows, int width, int B_cols) = ChooseCPU(AVX512_8bit::Multiply, AVX2_8bit::Multiply, SSSE3_8bit::Multiply, Unsupported_8bit::Multiply, Unsupported_8bit::Multiply); +const char *const Int8::kName = ChooseCPU(AVX512_8bit::kName, AVX2_8bit::kName, SSSE3_8bit::kName, Unsupported_8bit::kName, Unsupported_8bit::kName); + } // namespace intgemm |