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