tChanged matrix sizes and plot slightly - numeric - C++ library with numerical … | |
git clone git://src.adamsgaard.dk/numeric | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit f406e541b73a2fb8fde94b069a663bb3447cbec1 | |
parent 524a25f5002f926651d6ee5111f3bcff7641e970 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Thu, 24 Jan 2013 15:42:26 +0100 | |
Changed matrix sizes and plot slightly | |
Diffstat: | |
M matrixmul/Makefile | 17 +++++++++-------- | |
M matrixmul/plot.gp | 4 +++- | |
2 files changed, 12 insertions(+), 9 deletions(-) | |
--- | |
diff --git a/matrixmul/Makefile b/matrixmul/Makefile | |
t@@ -6,8 +6,9 @@ | |
# but the multiplication should be done in a separate loop. | |
# Matrix dimensions are specified as a command line argument. | |
-MATRIXDIMS_SLOW = 10 20 40 80 160 320 640 | |
-MATRIXDIMS = $(MATRIXDIMS_SLOW) 1280 | |
+MATRIXDIMS_SLOW = 8 16 32 64 128 256 | |
+MATRIXDIMS = $(MATRIXDIMS_SLOW) 512 1024 | |
+MATRIXDIMS_FAST = $(MATRIXDIMS) 2048 4096 | |
#PREFIXCMD = nice -n 10 \gtime -ao # For OSX with GNU Time | |
#PREFIXCMD = nice -n -10 time -ao # For Linux | |
PREFIXCMD = time -ao # For Linux | |
t@@ -78,7 +79,7 @@ c-linarr.dat: c-linarr | |
c-omp-arrofarrs.dat: c-omp-arrofarrs | |
# c-omp-arrofarrs | |
@rm -f $@ | |
- @for dims in $(MATRIXDIMS); do \ | |
+ @for dims in $(MATRIXDIMS_FAST); do \ | |
$(PREFIXCMD) $@ -f "$$dims %e" ./$< $$dims; \ | |
echo $$dims; \ | |
done | |
t@@ -87,7 +88,7 @@ c-omp-arrofarrs.dat: c-omp-arrofarrs | |
c-omp-linarr.dat: c-omp-linarr | |
# c-omp-linarr | |
@rm -f $@ | |
- @for dims in $(MATRIXDIMS); do \ | |
+ @for dims in $(MATRIXDIMS_FAST); do \ | |
$(PREFIXCMD) $@ -f "$$dims %e" ./$< $$dims; \ | |
echo $$dims; \ | |
done | |
t@@ -102,7 +103,7 @@ c-omp-linarr: c-linarr.c | |
c-gsl-cblas.dat: c-gsl-cblas | |
# c-gsl-cblas | |
@rm -f $@ | |
- @for dims in $(MATRIXDIMS); do \ | |
+ @for dims in $(MATRIXDIMS_FAST); do \ | |
$(PREFIXCMD) $@ -f "$$dims %e" ./$< $$dims; \ | |
echo $$dims; \ | |
done | |
t@@ -114,7 +115,7 @@ c-gsl-cblas: c-gsl-cblas.c | |
julia.dat: julia.jl | |
# julia.jl | |
@rm -f $@ | |
- @for dims in $(MATRIXDIMS); do \ | |
+ @for dims in $(MATRIXDIMS_FAST); do \ | |
$(PREFIXCMD) $@ -f "$$dims %e" julia $< $$dims; \ | |
echo $$dims; \ | |
done | |
t@@ -141,7 +142,7 @@ cpp-linvectors.dat: cpp-linvectors | |
python-numpy.dat: python-numpy.py | |
# python-numpy.py | |
@rm -f $@ | |
- @for dims in $(MATRIXDIMS); do \ | |
+ @for dims in $(MATRIXDIMS_FAST); do \ | |
$(PREFIXCMD) $@ -f "$$dims %e" python $< $$dims; \ | |
echo $$dims; \ | |
done | |
t@@ -150,7 +151,7 @@ python-numpy.dat: python-numpy.py | |
octave.dat: octave.m | |
# octave.m | |
@rm -f $@ | |
- @for dims in $(MATRIXDIMS); do \ | |
+ @for dims in $(MATRIXDIMS_FAST); do \ | |
$(PREFIXCMD) $@ -f "$$dims %e" octave -qf $< $$dims; \ | |
echo $$dims; \ | |
done | |
diff --git a/matrixmul/plot.gp b/matrixmul/plot.gp | |
t@@ -3,9 +3,10 @@ set output "performance.png" | |
set xlabel "Matrix side length" | |
set ylabel "Execution time [s]" | |
set title "Matrix multiplication\n".platform.",".cpumodel.", ".threads." threa… | |
-#set log xy | |
+set log xy | |
set grid | |
set key outside | |
+set label "http://github.com/anders-dc/numeric/" at screen 0.05,0.02 | |
plot \ | |
"lua-linarr.dat" title "Lua: Linear arrays" w lp, \ | |
"lua-arrofarrs.dat" title "Lua: Arrays of arrays" w lp, \ | |
t@@ -20,3 +21,4 @@ plot \ | |
"julia.dat" title "Julia" w lp, \ | |
"c-gsl-cblas.dat" title "C: GSL CBLAS" w lp, \ | |
"octave.dat" title "Octave" w lp | |
+ |