1
1
# matrico Makefile
2
2
3
- CSC = csc
4
- CSI = csi
5
- CHICKEN_INSTALL = chicken-install
6
- CHICKEN_PROFILE = chicken-profile
7
- TEST_NEW_EGG = test-new-egg
3
+ CSC = CHICKEN_REPOSITORY_PATH="/home/ch/opt/CHICKEN/lib/chicken/11/" /home/ch/opt/CHICKEN/bin/csc
4
+ CSI = CHICKEN_REPOSITORY_PATH="/home/ch/opt/CHICKEN/lib/chicken/11/" /home/ch/opt/CHICKEN/bin/csi
5
+ CHICKEN_INSTALL = /home/ch/opt/CHICKEN/bin/chicken-install
6
+ CHICKEN_PROFILE =/home/ch/opt/CHICKEN/bin/chicken-profile
7
+ TEST_NEW_EGG = /home/ch/opt/CHICKEN/bin/test-new-egg
8
+
9
+ # CSC = csc
10
+ # CSI = csi
11
+ # CHICKEN_INSTALL = chicken-install
12
+ # CHICKEN_PROFILE = chicken-profile
13
+ # TEST_NEW_EGG = test-new-egg
8
14
9
15
CLARG =
10
- LEVEL = -O4
16
+ LEVEL = -O3
11
17
DEBUG = -d0
12
- override FLAGS += -C -O2 -C -pipe
18
+ override FLAGS += -strict-types - C -O2 -C -pipe
13
19
14
20
VERSION = $(shell csi -b version.scm -p "(matrico-version) ")
15
21
16
22
DIM = 1000
17
23
18
- .PHONY : linpack, matmul
24
+ .PHONY : mips, linpack, matmul
19
25
20
26
default :
21
27
$(CSC ) -shared -emit-import-library matrico $(LEVEL ) $(DEBUG ) $(FLAGS ) matrico.scm
@@ -32,24 +38,35 @@ test_egg_local:
32
38
tests/check.scm tests/run.scm tests/test-f64vector.scm tests/test-fpmath.scm tests/test-matrico.scm tests/test-utils.scm
33
39
python3 -m http.server --bind 127.0.0.1 &
34
40
sleep 1
35
- $(TEST_NEW_EGG) matrico http://0.0.0.0:8000/matrico.release-info
41
+ sed -e '3 c\(uri targz \"http://0.0.0.0:8000/{egg-name}-{egg-release}.tar.gz\")' matrico.release-info > matrico-dev.release-info
42
+ $(TEST_NEW_EGG) matrico http://0.0.0.0:8000/matrico-dev.release-info
36
43
pkill -9 -f 'python3 -m http.server'
44
+ rm matrico-dev.release-info
37
45
38
46
test_egg_remote :
39
47
$(TEST_NEW_EGG ) matrico https://raw.githubusercontent.com/gramian/matrico/main/matrico.release-info
40
48
41
49
test_install :
42
50
CHICKEN_INSTALL_REPOSITORY=" /tmp/matrico" $(CHICKEN_INSTALL ) -test
43
- CHICKEN_REPOSITORY_PATH=" ` $( CHICKEN_INSTALL) -repository` :/tmp/matrico " $(CSI ) -e " (import matrico) (matrico-cite )"
51
+ CHICKEN_REPOSITORY_PATH=" /tmp/matrico: ` $( CHICKEN_INSTALL) -repository` " $(CSI ) -e " (import matrico) (matrico 'citation )"
44
52
45
53
iprofile :
46
- make matmul LEVEL=' -O4' FLAGS=' -profile' DIM=1000
54
+ make matmul LEVEL=' -O4' FLAGS=' -profile' DIM=100
47
55
ls -1 PROFILE.* | sort -n | head -n1 | $(CHICKEN_PROFILE )
48
56
49
57
sprofile :
50
58
make matmul LEVEL=' -O4' DEBUG=' -d3' DIM=1000 CLARG=' -:P1000'
51
59
ls -1 PROFILE.* | sort -n | head -n1 | $(CHICKEN_PROFILE )
52
60
61
+ mips:LEVEL =-O5
62
+ mips :
63
+ @echo " (include \" matrico.scm\" ) \
64
+ (import matrico) \
65
+ (print " BogoMips:" # \space (matrico 'benchmark)) \
66
+ (newline) \
67
+ (exit)" | $( CSC) $( LEVEL) $( FLAGS) - -o /tmp/miads
68
+ @/tmp/miads
69
+
53
70
matmul:LEVEL =-O5
54
71
matmul :
55
72
@echo " (include \" matrico.scm\" ) \
@@ -60,7 +77,7 @@ matmul:
60
77
(define t0 (current-seconds)) \
61
78
(define C (time (mx-dot* A B))) \
62
79
(define t1 (current-seconds)) \
63
- (print " Megaflops:" # \space (/ (* $(DIM) $(DIM) $(DIM)) (* (- t1 t0) 1000.0 1000.0))) \
80
+ (print " Megaflops:" # \space (inexact->exact (floor ( / (* $(DIM) $(DIM) $(DIM)) (* (- t1 t0) 1000.0 1000.0)) ))) \
64
81
(newline) \
65
82
(exit)" | $( CSC) $( LEVEL) $( FLAGS) - -o /tmp/matmul
66
83
@/tmp/matmul $(CLARG ) 2> matmul.txt
@@ -76,7 +93,7 @@ linpack:
76
93
(define t0 (current-seconds)) \
77
94
(define solver (time (mx-solver A))) \
78
95
(define t1 (current-seconds)) \
79
- (print " Megaflops:" # \space (/ (* $(DIM) $(DIM) $(DIM)) (* (- t1 t0) 1000.0 1000.0))) \
96
+ (print " Megaflops:" # \space (inexact->exact (floor ( / (* $(DIM) $(DIM) $(DIM)) (* (- t1 t0) 1000.0 1000.0)) ))) \
80
97
(print " Residual:" # \space (mx-norm (mx- (solver b) 1.0) 2)) \
81
98
(newline) \
82
99
(exit)" | $( CSC) $( LEVEL) $( FLAGS) - -o /tmp/linpack
0 commit comments