Mercurial > hg > Game > Cerium
view TaskManager/Gpu/GpuScheduler.h @ 1515:b3644b73d2cf draft
add flip flag test
author | Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 23 Oct 2012 14:41:27 +0900 |
parents | 18b63e697c61 |
children | c7f0e6eb1d50 |
line wrap: on
line source
#ifndef INCLUDED_GPU_SCHEDULER #define INCLUDED_GPU_SCHEDULER #include "Scheduler.h" #include "FifoDmaManager.h" #include "GpuThreads.h" #include "HTask.h" #ifdef __APPLE__ #include <OpenCL/opencl.h> #else #include <CL/cl.h> #endif class GpuScheduler : public Scheduler { public: GpuScheduler(); virtual ~GpuScheduler(); void init_impl(int useRefDma); void init_gpu(); void run(); void mail_write_from_host(memaddr data) { fifoDmaManager->mail_write_from_host(data); } memaddr mail_read_from_host() { return fifoDmaManager->mail_read_from_host(); } int has_mail_from_host() { return fifoDmaManager->has_mail_from_host(); } cl_platform_id platform_id; cl_device_id device_id; cl_uint ret_num_platforms; cl_uint ret_num_devices; cl_context context; cl_command_queue *command_queue; cl_int ret; private: FifoDmaManager *fifoDmaManager; void load_kernel(int cmd); }; #define GpuSchedRegister(str, filename, functionname) \ gpu_register_task(str, filename, functionname); #define GpuNDRangeRegister(str, dimension, g_worksizePtr) \ gpu_register_ndrange(str, dimension, g_worksizePtr); #endif extern void gpu_register_task(int cmd,const char* filename,const char* functionname); extern void gpu_register_ndrange(int, int, size_t*);