Mercurial > hg > Game > Cerium
annotate TaskManager/Gpu/GpuScheduler.h @ 1485:cdf5d5d60b71 draft
minor fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 06 Aug 2012 20:17:30 +0900 |
parents | f402f6444237 |
children | 756aa0f08814 |
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 |
1447 | 23 void mail_write_from_host(memaddr data) { |
1482 | 24 fifoDmaManager->mail_write_from_host(data); |
1447 | 25 } |
26 | |
27 memaddr mail_read_from_host() { | |
28 return fifoDmaManager->mail_read_from_host(); | |
29 } | |
30 | |
31 int has_mail_from_host() { | |
32 return fifoDmaManager->has_mail_from_host(); | |
33 } | |
1434 | 34 |
1480
f2512fb94223
GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1478
diff
changeset
|
35 cl_platform_id platform_id; |
f2512fb94223
GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1478
diff
changeset
|
36 cl_device_id device_id; |
f2512fb94223
GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1478
diff
changeset
|
37 cl_uint ret_num_platforms; |
f2512fb94223
GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1478
diff
changeset
|
38 cl_uint ret_num_devices; |
f2512fb94223
GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1478
diff
changeset
|
39 cl_context context; |
f2512fb94223
GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1478
diff
changeset
|
40 cl_command_queue command_queue; |
f2512fb94223
GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1478
diff
changeset
|
41 cl_int ret; |
1434 | 42 private: |
1447 | 43 FifoDmaManager *fifoDmaManager; |
1480
f2512fb94223
GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1478
diff
changeset
|
44 |
1434 | 45 }; |
46 | |
1485 | 47 extern void gpu_register_task(int cmd,const char* filename,const char* functionname); |
48 | |
1434 | 49 #endif |
1435
9f6ba00ca15c
add gpu_sched_register
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1434
diff
changeset
|
50 |
1483
f402f6444237
create gpuTaskinit
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1482
diff
changeset
|
51 #define GpuSchedRegister(str, filename, functionname) \ |
f402f6444237
create gpuTaskinit
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1482
diff
changeset
|
52 gpu_register_task(str, filename, functionname); |