Mercurial > hg > Game > Cerium
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 |
rev | line source |
---|---|
1434 | 1 #ifndef INCLUDED_GPU_SCHEDULER |
2 #define INCLUDED_GPU_SCHEDULER | |
3 | |
4 #include "Scheduler.h" | |
1447 | 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 | 7 |
8 #ifdef __APPLE__ | |
9 #include <OpenCL/opencl.h> | |
10 #else | |
11 #include <CL/cl.h> | |
12 #endif | |
13 | |
1480
f2512fb94223
GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1478
diff
changeset
|
14 |
1434 | 15 class GpuScheduler : public Scheduler { |
16 public: | |
1471 | 17 GpuScheduler(); |
18 | |
1434 | 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 | 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 | 24 void mail_write_from_host(memaddr data) { |
25 fifoDmaManager->mail_write_from_host(data); | |
26 } | |
27 | |
28 memaddr mail_read_from_host() { | |
29 return fifoDmaManager->mail_read_from_host(); | |
30 } | |
31 | |
32 int has_mail_from_host() { | |
33 return fifoDmaManager->has_mail_from_host(); | |
34 } | |
1434 | 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 | 43 private: |
1447 | 44 FifoDmaManager *fifoDmaManager; |
1480
f2512fb94223
GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1478
diff
changeset
|
45 |
1434 | 46 }; |
47 | |
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 |