65
|
1 #ifndef INCLUDED_SPE_THREADS
|
|
2 #define INCLUDED_SPE_THREADS
|
|
3
|
|
4 #include <libspe2.h>
|
|
5 #include <pthread.h>
|
|
6
|
|
7 #define SPE_ELF "spe-main"
|
|
8
|
|
9 typedef struct arg {
|
|
10 int speid;
|
|
11 spe_context_ptr_t ctx;
|
|
12 } thread_arg_t;
|
|
13
|
|
14 class SpeThreads {
|
|
15 public:
|
|
16 /* constructor */
|
|
17 SpeThreads(int num = 1);
|
|
18
|
|
19 /* functions */
|
|
20 void init(void);
|
|
21 int get_mail(int speid);
|
|
22 static void *spe_thread_run(void *arg);
|
|
23 static void *frontend_thread_run(void *arg);
|
|
24
|
|
25 private:
|
|
26 /* variables */
|
|
27 spe_program_handle_t *spe_handle;
|
|
28 spe_context_ptr_t *spe_ctx;
|
|
29 pthread_t *threads;
|
|
30 thread_arg_t *args;
|
|
31 int spe_num;
|
|
32 };
|
|
33
|
|
34 #endif
|