Add matmult tests
[openscop.git] / tests / test_matmult_matrix.scop
blob73aeba90e3dc5a02e8a39b4e5c6b2975d139604a
1 # Matmul example, matrix representation
3 OpenScop
5 # =============================================== Global
6 # Language
9 # Context
10 CONTEXT
11 1 3
12 # e/i   N    1
13    1    1   -1    ## N-1 >= 0
15 # Parameter names are provided
17 # Parameter names
18
20 # Iterator names are provided
22 # Iterator names
23 i j k 
25 # Scattering dimension names are not provided
28 # Number of statements
31 # =============================================== Statement 1
32 # Number of relations describing the statement
35 # ----------------------------------------------  1.1 Domain
36 DOMAIN
37 4 5
38 # e/i   i    j    N    1
39    1    1    0    0    0    ## i >= 0
40    1   -1    0    1   -1    ## -i+N-1 >= 0
41    1    0    1    0    0    ## j >= 0
42    1    0   -1    1   -1    ## -j+N-1 >= 0
44 # ----------------------------------------------  1.2 Scattering
45 SCATTERING
46 5 5
47 #  e    i    j    N    1
48    0    0    0    0    0    ## 0
49    0    1    0    0    0    ## i
50    0    0    0    0    0    ## 0
51    0    0    1    0    0    ## j
52    0    0    0    0    0    ## 0
54 # ----------------------------------------------  1.3 Access
55 WRITE
56 3 5
57 # eq    i    j    N    1
58    0    0    0    0    1    ## C
59    0    1    0    0    0    ##  [i]
60    0    0    1    0    0    ##     [j]
62 # ----------------------------------------------  1.4 Body
63 # Statement body is provided
65 # Original iterator names
66 i j 
67 # Statement body
68 c[i][j] = 0.0;
71 # =============================================== Statement 2
72 # Number of relations describing the statement
75 # ----------------------------------------------  2.1 Domain
76 DOMAIN
77 6 6
78 # e/i   i    j    k    N    1
79    1    1    0    0    0    0    ## i >= 0
80    1   -1    0    0    1   -1    ## -i+N-1 >= 0
81    1    0    1    0    0    0    ## j >= 0
82    1    0   -1    0    1   -1    ## -j+N-1 >= 0
83    1    0    0    1    0    0    ## k >= 0
84    1    0    0   -1    1   -1    ## -k+N-1 >= 0
86 # ----------------------------------------------  2.2 Scattering
87 SCATTERING
88 7 6
89 #  e    i    j    k    N    1
90    0    0    0    0    0    0    ## 0
91    0    1    0    0    0    0    ## i
92    0    0    0    0    0    0    ## 0
93    0    0    1    0    0    0    ## j
94    0    0    0    0    0    1    ## 1
95    0    0    0    1    0    0    ## k
96    0    0    0    0    0    0    ## 0
98 # ----------------------------------------------  2.3 Access
99 RDWR
100 3 6
101 # eq    i    j    k    N    1
102    0    0    0    0    0    1    ## C
103    0    1    0    0    0    0    ##  [i]
104    0    0    1    0    0    0    ##     [j]
106 READ
107 3 6
108 # eq    i    j    k    N    1
109    0    0    0    0    0    2    ## A
110    0    1    0    0    0    0    ##  [i]
111    0    0    0    1    0    0    ##     [k]
113 READ
114 3 6
115 # eq    i    j    k    N    1
116    0    0    0    0    0    3    ## B
117    0    0    0    1    0    0    ##  [k]
118    0    0    1    0    0    0    ##     [j]
120 # ----------------------------------------------  2.4 Body
121 # Statement body is provided
123 # Original iterator names
124 i j k 
125 # Statement body
126 c[i][j] = c[i][j] + a[i][k] * b[k][j];