Вы находитесь на странице: 1из 4

>> asa172_test

26-Jul-2008 17:46:51
ASA172_TEST
MATLAB version
Test the ASA172 routines.
TEST01:
SIMDO can convert between compressed and
vector indices representing a nested loop.
Here, we set QFOR = FALSE, meaning we do
NOT want to convert from FORTRAN ordering
to lexical ordering.
Here, we actually carry out a triple loop
list the indices, and then compare.
#1: Generate JSUB by counting as we DO the loops:
DO I1 = 1, N1
DO I2 = 1, N2
DO I3 = 1, N3
JSUB

I1

I2

I3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3

1
1
1
1
2
2
2
2
1
1
1
1
2
2
2
2
1
1
1
1
2
2
2
2

1
2
3
4
1
2
3
4
1
2
3
4
1
2
3
4
1
2
3
4
1
2
3
4

#2: Loop on JSUB, retrieve loop indices


QIND = TRUE J ->I(J)
QFOR = FALSE
JSUB

I1

I2

I3

1
2

1
1

1
1

1
2

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

1
1
1
1
1
1
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3

1
1
2
2
2
2
1
1
1
1
2
2
2
2
1
1
1
1
2
2
2
2

3
4
1
2
3
4
1
2
3
4
1
2
3
4
1
2
3
4
1
2
3
4

#3: For any set of loop indices, retrieve JSUB


QIND = FALSE I(J) -> J
QFOR = FALSE
JSUB

I1

I2

I3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3

1
1
1
1
2
2
2
2
1
1
1
1
2
2
2
2
1
1
1
1
2
2
2
2

1
2
3
4
1
2
3
4
1
2
3
4
1
2
3
4
1
2
3
4
1
2
3
4

TEST02:
SIMDO can convert between compressed and
vector indices representing a nested loop.
Here, we set QFOR = TRUE, meaning we DO
want to convert from the FORTRAN

ordering to lexical convention.


Here, we actually carry out a triple loop
list the indices, and then compare.
#1: Generate JSUB by counting as we do the loops.
DO I3 = 1, N3
DO I2 = 1, N2
DO I1 = 1, N1
JSUB

I1

I2

I3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3

1
1
1
2
2
2
1
1
1
2
2
2
1
1
1
2
2
2
1
1
1
2
2
2

1
1
1
1
1
1
2
2
2
2
2
2
3
3
3
3
3
3
4
4
4
4
4
4

#2: Setting QFOR false means loop indices


are generated in lexical order.
QIND = TRUE J -> I(J)
QFOR = TRUE
JSUB

I1

I2

I3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

1
2
3
1
2
3
1
2
3
1
2
3
1
2
3

1
1
1
2
2
2
1
1
1
2
2
2
1
1
1

1
1
1
1
1
1
2
2
2
2
2
2
3
3
3

16
17
18
19
20
21
22
23
24

1
2
3
1
2
3
1
2
3

2
2
2
1
1
1
2
2
2

3
3
3
4
4
4
4
4
4

#3: For any set of loop indices, retrieve JSUB


QIND = FALSE I(J) -> J
QFOR = TRUE
JSUB

I1

I2

I3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3

1
1
1
2
2
2
1
1
1
2
2
2
1
1
1
2
2
2
1
1
1
2
2
2

1
1
1
1
1
1
2
2
2
2
2
2
3
3
3
3
3
3
4
4
4
4
4
4

ASA172_TEST
Normal end of execution.
26-Jul-2008 17:46:51
>>

Вам также может понравиться