Mercurial > hg > Game > Cerium
annotate TaskManager/Gpu/GpuScheduler.h @ 1530:c7f0e6eb1d50 draft
add comment
author | Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 06 Dec 2012 16:49:41 +0900 |
parents | b3644b73d2cf |
children | 68200bc3ab6b |
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" |
1506
a7895ab4d0e3
add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1486
diff
changeset
|
7 #include "HTask.h" |
1434 | 8 |
9 #ifdef __APPLE__ | |
10 #include <OpenCL/opencl.h> | |
11 #else | |
12 #include <CL/cl.h> | |
13 #endif | |
14 | |
15 class GpuScheduler : public Scheduler { | |
16 public: | |
1471 | 17 GpuScheduler(); |
1506
a7895ab4d0e3
add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1486
diff
changeset
|
18 virtual ~GpuScheduler(); |
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(); |
1508 | 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() { | |
1508 | 28 return fifoDmaManager->mail_read_from_host(); |
1447 | 29 } |
30 | |
31 int has_mail_from_host() { | |
1508 | 32 return fifoDmaManager->has_mail_from_host(); |
1447 | 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; |
1508 | 40 cl_command_queue *command_queue; |
1480
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; |
1486 | 44 void load_kernel(int cmd); |
1480
f2512fb94223
GpuTaskManager no compile error
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1478
diff
changeset
|
45 |
1434 | 46 }; |
47 | |
1513
18b63e697c61
many_task/quick_sort is changed recursive to loop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1508
diff
changeset
|
48 #define GpuSchedRegister(str, filename, functionname) \ |
18b63e697c61
many_task/quick_sort is changed recursive to loop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1508
diff
changeset
|
49 gpu_register_task(str, filename, functionname); |
1434 | 50 #endif |
1435
9f6ba00ca15c
add gpu_sched_register
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1434
diff
changeset
|
51 |
1513
18b63e697c61
many_task/quick_sort is changed recursive to loop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1508
diff
changeset
|
52 extern void gpu_register_task(int cmd,const char* filename,const char* functionname); |
1515
b3644b73d2cf
add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1513
diff
changeset
|
53 |