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

github.com/marian-nmt/intgemm/intgemm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'example.cc')
-rw-r--r--example.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/example.cc b/example.cc
index 292bd6b..5f558d0 100644
--- a/example.cc
+++ b/example.cc
@@ -1,11 +1,11 @@
-#include "intgemm.h"
+#include "intgemm/intgemm.h"
// This is just for AlignedVector, which helps managed 64-byte aligned memory.
// Feel free to manage memory yourself.
-#include "aligned.h"
-#include "callbacks.h"
+#include "intgemm/aligned.h"
+#include "intgemm/callbacks.h"
#include <cassert>
-#include <math.h>
+#include <cmath>
#include <random>
int main() {
@@ -54,7 +54,7 @@ int main() {
// Do the actual multiply.
intgemm::Int16::Multiply(A_prepared.begin(), B_prepared.begin(), A_rows, width, B_cols, intgemm::callbacks::UnquantizeAndWrite(1.0f / (quant_mult * quant_mult), C.begin()));
// Sanity check. C will be row major.
- assert(fabsf(C[0] - top_left_reference) < 0.05f);
+ assert(std::fabs(C[0] - top_left_reference) < 0.05f);
}
// 8-bit multiplication.
@@ -73,6 +73,7 @@ int main() {
// Do the actual multiply.
intgemm::Int8::Multiply(A_prepared.begin(), B_prepared.begin(), A_rows, width, B_cols, intgemm::callbacks::UnquantizeAndWrite(1.0f / (quant_mult * quant_mult), C.begin()));
// Sanity check. C will be row major.
- assert(fabsf(C[0] - top_left_reference) < 0.05f);
+ assert(std::fabs(C[0] - top_left_reference) < 0.05f);
}
+ return 0;
}