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-05-10 14:30:59 +0300
committerKenneth Heafield <github@kheafield.com>2018-05-10 14:30:59 +0300
commit2366de6722ecaf7876ad6c2711c80f4762eaa37b (patch)
tree8d6b8bb7a5566c333f9dca60d58143e904d29463
parent27459bae2926a203e3da071851a838b3cbdfa588 (diff)
Makefile, avoid C++11
-rw-r--r--Makefile12
-rw-r--r--Test.cc10
2 files changed, 18 insertions, 4 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..2bf36d1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,12 @@
+CXX := g++
+CXXFLAGS := -Wall -Werror -fPIC -O3 -march=native
+SRC := AVX_Matrix_Mult.cc SSE_Matrix_Mult.cc stopwatch.cc Test.cc
+OBJ := ${SRC:.cc=.o}
+
+all: Test
+
+Test: ${OBJ}
+ ${CXX} ${CXXFLAGS} ${OBJ} -o Test
+
+.c.o:
+ ${CXX} ${CXXFLAGS} -c $<
diff --git a/Test.cc b/Test.cc
index d0ac222..e09241b 100644
--- a/Test.cc
+++ b/Test.cc
@@ -29,8 +29,6 @@
#include <cstring>
#include <cstdio>
-#include <memory>
-
// Compute A*B^T very naively.
void SlowRef_MatrixMult(const float * A, const float * B, float * C, int num_A_rows, int num_B_rows, int width)
{
@@ -76,10 +74,10 @@ int main(int argc, char ** argv) {
}
// C will thus be num_A_rows x num_B_rows
- std::unique_ptr<float[]> ref_C(new float[num_A_rows*num_B_rows]);
+ float * ref_C = new float[num_A_rows*num_B_rows];
{
StopWatch w("Reference multiply");
- SlowRef_MatrixMult(A, B, ref_C.get(), num_A_rows, num_B_rows, width);
+ SlowRef_MatrixMult(A, B, ref_C, num_A_rows, num_B_rows, width);
}
// The quantized version of C is never explicity created. We de-quantize on the fly
@@ -142,6 +140,10 @@ int main(int argc, char ** argv) {
mean_diff += diff;
}
}
+
+ delete [] ref_C;
+ delete [] SSE_C;
+ delete [] AVX_C;
mean_diff /= (double)num_A_rows*(double)num_B_rows;