comparison 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
comparison
equal deleted inserted replaced
1479:163220e54cc0 1480:f2512fb94223
1 #ifndef INCLUDED_GPU_SCHEDULER 1 #ifndef INCLUDED_GPU_SCHEDULER
2 #define INCLUDED_GPU_SCHEDULER 2 #define INCLUDED_GPU_SCHEDULER
3 3
4 #include "Scheduler.h" 4 #include "Scheduler.h"
5 #include "FifoDmaManager.h" 5 #include "FifoDmaManager.h"
6 #include "GpuThreads.h"
6 7
7 #ifdef __APPLE__ 8 #ifdef __APPLE__
8 #include <OpenCL/opencl.h> 9 #include <OpenCL/opencl.h>
9 #else 10 #else
10 #include <CL/cl.h> 11 #include <CL/cl.h>
11 #endif 12 #endif
12 13
14
13 class GpuScheduler : public Scheduler { 15 class GpuScheduler : public Scheduler {
14 public: 16 public:
15 GpuScheduler(); 17 GpuScheduler();
16 18
17 void init_impl(int useRefDma); 19 void init_impl(int useRefDma);
20 void init_gpu();
18 void run(); 21 void run();
19 22 void regist_task(int cmd,const char* filename,const char* functionname);
23
20 void mail_write_from_host(memaddr data) { 24 void mail_write_from_host(memaddr data) {
21 fifoDmaManager->mail_write_from_host(data); 25 fifoDmaManager->mail_write_from_host(data);
22 } 26 }
23 27
24 memaddr mail_read_from_host() { 28 memaddr mail_read_from_host() {
27 31
28 int has_mail_from_host() { 32 int has_mail_from_host() {
29 return fifoDmaManager->has_mail_from_host(); 33 return fifoDmaManager->has_mail_from_host();
30 } 34 }
31 35
36 cl_platform_id platform_id;
37 cl_device_id device_id;
38 cl_uint ret_num_platforms;
39 cl_uint ret_num_devices;
40 cl_context context;
41 cl_command_queue command_queue;
42 cl_int ret;
32 private: 43 private:
33 FifoDmaManager *fifoDmaManager; 44 FifoDmaManager *fifoDmaManager;
45
34 }; 46 };
35 47
36 #endif 48 #endif
37 49
38 #define GpuSchedRegister(gputhreads, str, filename, functionname) \ 50
39 gpu_register_task(gputhreads, str, filename, functionname);