Mercurial > hg > Members > yutaka > manager
annotate spe/Run.cc @ 8:ec2c1003f9b6 default tip
fix mandel
author | yutaka@localhost.localdomain |
---|---|
date | Mon, 12 Apr 2010 23:58:19 +0900 |
parents | dcd83cefb980 |
children |
rev | line source |
---|---|
0 | 1 #include <stdio.h> |
2 #include "Run.h" | |
3 | |
4 void | |
5 run(void *in, void *out, int data_length) | |
6 { | |
7 | |
1
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
8 for (int i = 0; i < data_length / sizeof(int); i++) { |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
9 |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
10 int *in_spe = (int*)in; |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
11 int *out_spe = (int*)out; |
0 | 12 |
1
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
13 //printf("in_spe %d\n",in_spe[i]); |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
14 |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
15 out_spe[i] = 1; |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
16 |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
17 for (int j = 2; j < in_spe[i]; j++) { |
0 | 18 |
1
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
19 if ( in_spe[i] % j == 0) { |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
20 out_spe[i] = 0; |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
21 break; |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
22 } |
0 | 23 |
1
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
24 } |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
25 |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
26 //if (out_spe[i] == 1) { |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
27 // printf("in_spe[%d] %d\n",i,in_spe[i]); |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
28 //} |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
29 |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
30 /* |
0 | 31 out_spe[i] = in_spe[i] + 1; |
32 | |
33 out_spe[i] = out_spe[i] + 1; | |
34 out_spe[i] = out_spe[i]*out_spe[i]; | |
35 out_spe[i] = out_spe[i] + 1; | |
1
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
36 */ |
0 | 37 //printf("[SPE]int_spe %f\n",in_spe[i]); |
1
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
38 |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
39 //printf("[SPE]outt_spe %f\n",out_spe[i]); |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
40 |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
41 |
dcd83cefb980
check , ppe_only, show time , function add.
yutaka@localhost.localdomain
parents:
0
diff
changeset
|
42 |
0 | 43 } |
44 | |
45 } |