annotate TaskManager/Gpu/GpuScheduler.h @ 1480:f2512fb94223 draft

GpuTaskManager no compile error
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Wed, 25 Jul 2012 19:41:04 +0900
parents beda5f2f88ce
children 85a848d7f181
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1434
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #ifndef INCLUDED_GPU_SCHEDULER
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #define INCLUDED_GPU_SCHEDULER
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 #include "Scheduler.h"
1447
e8ff87511f46 debug GpuThreads
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1438
diff changeset
5 #include "FifoDmaManager.h"
1480
f2512fb94223 GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1478
diff changeset
6 #include "GpuThreads.h"
1434
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 #ifdef __APPLE__
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 #include <OpenCL/opencl.h>
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 #else
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 #include <CL/cl.h>
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 #endif
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13
1480
f2512fb94223 GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1478
diff changeset
14
1434
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 class GpuScheduler : public Scheduler {
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 public:
1471
e8db2e2d426c fix not working yet.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1447
diff changeset
17 GpuScheduler();
e8db2e2d426c fix not working yet.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1447
diff changeset
18
1434
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 void init_impl(int useRefDma);
1480
f2512fb94223 GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1478
diff changeset
20 void init_gpu();
1447
e8ff87511f46 debug GpuThreads
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1438
diff changeset
21 void run();
1480
f2512fb94223 GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1478
diff changeset
22 void regist_task(int cmd,const char* filename,const char* functionname);
f2512fb94223 GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1478
diff changeset
23
1447
e8ff87511f46 debug GpuThreads
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1438
diff changeset
24 void mail_write_from_host(memaddr data) {
e8ff87511f46 debug GpuThreads
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1438
diff changeset
25 fifoDmaManager->mail_write_from_host(data);
e8ff87511f46 debug GpuThreads
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1438
diff changeset
26 }
e8ff87511f46 debug GpuThreads
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1438
diff changeset
27
e8ff87511f46 debug GpuThreads
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1438
diff changeset
28 memaddr mail_read_from_host() {
e8ff87511f46 debug GpuThreads
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1438
diff changeset
29 return fifoDmaManager->mail_read_from_host();
e8ff87511f46 debug GpuThreads
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1438
diff changeset
30 }
e8ff87511f46 debug GpuThreads
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1438
diff changeset
31
e8ff87511f46 debug GpuThreads
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1438
diff changeset
32 int has_mail_from_host() {
e8ff87511f46 debug GpuThreads
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1438
diff changeset
33 return fifoDmaManager->has_mail_from_host();
e8ff87511f46 debug GpuThreads
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1438
diff changeset
34 }
1434
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35
1480
f2512fb94223 GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1478
diff changeset
36 cl_platform_id platform_id;
f2512fb94223 GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1478
diff changeset
37 cl_device_id device_id;
f2512fb94223 GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1478
diff changeset
38 cl_uint ret_num_platforms;
f2512fb94223 GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1478
diff changeset
39 cl_uint ret_num_devices;
f2512fb94223 GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1478
diff changeset
40 cl_context context;
f2512fb94223 GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1478
diff changeset
41 cl_command_queue command_queue;
f2512fb94223 GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1478
diff changeset
42 cl_int ret;
1434
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 private:
1447
e8ff87511f46 debug GpuThreads
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1438
diff changeset
44 FifoDmaManager *fifoDmaManager;
1480
f2512fb94223 GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1478
diff changeset
45
1434
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 };
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47
05d480ab70ba add GpuScheduler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 #endif
1435
9f6ba00ca15c add gpu_sched_register
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1434
diff changeset
49
1480
f2512fb94223 GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1478
diff changeset
50