Mercurial > hg > Game > Cerium
view TaskManager/Gpu/GpuThreads.h @ 1486:756aa0f08814 draft
gpu task loader
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 06 Aug 2012 20:35:31 +0900 |
parents | 85a848d7f181 |
children | 5517f93e2706 |
line wrap: on
line source
#ifndef INCLUDED_GPU_THREADS #define INCLUDED_GPU_THREADS #include <pthread.h> #include "Threads.h" #include "GpuScheduler.h" #include "Sem.h" #ifdef __APPLE__ #include <OpenCL/opencl.h> #else #include <CL/cl.h> #endif class GpuScheduler; typedef struct gpu_arg { int cpuid; // should be syncrhonized GpuScheduler *scheduler; TaskManagerImpl *manager; SemPtr wait; int useRefDma; } gpu_thread_arg_t; class GpuThreads : public Threads { public: /* static GpuThreads* getInstance() { static GpuThreads singleton; return &singleton; }*/ GpuThreads(int useRefDma); ~GpuThreads(); void init(); static void *gpu_thread_run(void *args); int get_mail(int speid, int count, memaddr *ret); int has_mail(int speid, int count, memaddr *ret); void send_mail(int speid, int num, memaddr *data); void add_output_tasklist(int command, memaddr buff, int alloc_size); void set_wait(SemPtr); public: private: gpu_thread_arg_t *args; pthread_t *threads; int use_refdma; }; #endif