Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/intgemm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2018-06-24 01:24:59 +0300
committerKenneth Heafield <github@kheafield.com>2018-06-24 01:24:59 +0300
commiteb0d3720440d8d560e6144f8e9cc8802bb29fe35 (patch)
tree740b2d6bcbaf489728dbf398f7893ac6ff836720 /ssse3_gemm.h
parent905d41044bd9338b02bc40c0e3ea5bfc4155903e (diff)
And add the SSSE3 split off version
Diffstat (limited to 'ssse3_gemm.h')
-rw-r--r--ssse3_gemm.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/ssse3_gemm.h b/ssse3_gemm.h
new file mode 100644
index 0000000..afbe4f0
--- /dev/null
+++ b/ssse3_gemm.h
@@ -0,0 +1,30 @@
+#pragma once
+#include <stdint.h>
+
+// 16-bit is in sse2_gemm.h
+
+namespace intgemm {
+
+// pmaddubsw (the 8-bit multiply) is SSSE3, so pedantically that's the version we need.
+struct SSSE3_8bit {
+ typedef int8_t Integer;
+
+ // Currently A is prepared by quantization but this could theoretically change.
+ static inline void PrepareA(const float *input, int8_t *output, float quant_mult, int rows, int cols) {
+ Quantize(input, output, quant_mult, rows * cols);
+ }
+
+ static void Quantize(const float *input, int8_t *output, float quant_mult, int size);
+
+ // Tile size for B; B must be a multiple of this block size.
+ static const int kBTileRow = 16;
+ static const int kBTileCol = 8;
+
+ static void PrepareB(const float *input, int8_t *output, float quant_mult, int rows, int cols);
+
+ static void Multiply(const int8_t *A, const int8_t *B, float *C, float unquant_mult, int A_rows, int width, int B_cols);
+
+ static const char *const kName;
+};
+
+} // namespace intgemm