annotate example/bitonic_sort/main.cc @ 2035:33af6d6e1bfc draft

add bitonic sort
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Thu, 05 Feb 2015 23:48:49 +0900
parents
children 0b3d1d2863c8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2035
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include <stdio.h>
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #include <stdlib.h>
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 #include <math.h>
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 #include <sys/stat.h>
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 #include <fcntl.h>
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 #include <sys/time.h>
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 #include <string.h>
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 #include "TaskManager.h"
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 #include "GpuScheduler.h"
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 #include "SchedTask.h"
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 #include "Func.h"
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 extern void task_init();
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 #ifdef GPU
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 extern void gpu_task_init();
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 #endif
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 void TMend(TaskManager *);
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 static double st_time;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 static double ed_time;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 CPU_TYPE spe_cpu = SPE_ANY;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 int length = 1024;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 int* data;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 bool first = false;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 static double
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 getTime()
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 struct timeval tv;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 gettimeofday(&tv, NULL);
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 return tv.tv_sec + (double)tv.tv_usec*1e-6;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 }
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 static void
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 print()
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 for (int i=0; i<length; i++) {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 printf("%d ", data[i]);
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 }
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 puts("");
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 }
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 static void
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 check_data()
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 for (int i=0; i<length-1; i++) {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 if (data[i+1] < data[i]) {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 printf("Data are not sorted at %d. %d > %d \n",i , data[i], data[i+1]);
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 return;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 }
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 }
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 puts("Data are sorted");
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 }
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 const char *usr_help_str = "Usage: ./bitonic_sort [option]\n \
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 options\n \
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 -cpu Number of SPE used (default 1)\n \
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 -l, --length Sorted number of data (default 1200)\n \
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 -h, --help Print this message\n";
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
65
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 void
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 init(int argc, char**argv){
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 for (int i = 1; argv[i]; ++i) {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 if (strcmp(argv[i], "-g") == 0) {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 spe_cpu = GPU_0;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 } else if (strcmp(argv[i], "-any") == 0) {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 spe_cpu = ANY_ANY;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 } else if (strcmp(argv[i], "--length") == 0 || strcmp(argv[i], "-l") == 0) {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 length = (int)atoi(argv[++i]);
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 }
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 }
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 }
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
78
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 void run_start(TaskManager* manager) {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 int dummy = 0;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 int exp = 0;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 for (int i=0;; i++) {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 if (length <= (1<<i)) {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 exp = i;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 dummy = (1<<i) - length;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 length = 1<<i;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 break;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 }
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 }
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
90
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 data = (int*)malloc(length*sizeof(int*));
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 for (int i=0; i<length; i++) {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 if (i<dummy) {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 data[i] = 0;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 } else {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 data[i] = manager->get_random()%1000000;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 }
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 }
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
99
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 //print();
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
101
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 HTask* wait;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 HTask* swap;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 int stage = 1;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 int block = 1;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
106
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 for (int i=stage; 1<<(stage-1) < length; i=stage) {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 for (int j=i, k=block; 0 < j; j--, k=k/2) {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 swap = manager->create_task(SWAP);
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 swap->set_inData(0, data, length*sizeof(int*));
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 swap->set_outData(0, data, length*sizeof(int*));
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 swap->set_param(0, (long)block);
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 swap->set_param(1, (long)1<<(j-1));
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 swap->set_param(2, (long)k);
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 swap->set_cpu(spe_cpu);
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 swap->flip();
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 if (first)
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 swap->wait_for(wait);
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 swap->iterate(length/2);
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
120 wait = swap;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 }
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 stage++;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 block = block<<1;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 first = true;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 }
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 }
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
127
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
128
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
129 int TMmain(TaskManager *manager, int argc, char** argv) {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 task_init();
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 #ifdef GPU
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 gpu_task_init();
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
133 #endif
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 init(argc, argv);
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
135 run_start(manager);
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
136 st_time = getTime();
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
137 manager->set_TMend(TMend);
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
138 return 0;
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
139 }
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
140
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
141 void
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 TMend(TaskManager *manager)
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 {
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 ed_time = getTime();
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 printf("%0.6f\n",ed_time-st_time);
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 //print();
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
147 check_data();
33af6d6e1bfc add bitonic sort
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
148 }