Mercurial > hg > Game > Cerium
diff TaskManager/Cell/SpeThreads.h.orig @ 1476:0094cd28bf41 draft
remove GpuTaskManagerImpl
author | Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 19 Jul 2012 11:56:35 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Cell/SpeThreads.h.orig Thu Jul 19 11:56:35 2012 +0900 @@ -0,0 +1,39 @@ +#ifndef INCLUDED_SPE_THREADS +#define INCLUDED_SPE_THREADS + +#include <libspe2.h> +#include <pthread.h> +#include "Threads.h" +#define SPE_ELF "spe-main" + +typedef struct arg { + int speid; + spe_context_ptr_t ctx; +} thread_arg_t; + + +class SpeThreads : public Threads { +public: + /* constructor */ + SpeThreads(int num = 1); + ~SpeThreads(void); + + /* functions */ + void init(void); + int get_mail(int speid, int count, memaddr *ret); // BLOCKING + int has_mail(int speid, int count, memaddr *ret); // NONBLOCK + void send_mail(int speid, int num, memaddr *data); // BLOCKING + static void *spe_thread_run(void *arg); + static void *frontend_thread_run(void *arg); + void add_output_tasklist(int command, memaddr buff, int alloc_size); + +private: + /* variables */ + spe_program_handle_t *spe_handle; + spe_context_ptr_t *spe_ctx; + pthread_t *threads; + thread_arg_t *args; + int cpu_num; +}; + +#endif