view TaskManager/Cell/CellTaskManagerImpl.h @ 2022:fac44ad2867d draft

make a sound
author Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
date Wed, 16 Jul 2014 02:50:32 +0900
parents 33c03287ff81
children
line wrap: on
line source

#ifndef INCLUDED_CELL_TASK_MANAGER_IMPL
#define INCLUDED_CELL_TASK_MANAGER_IMPL

#include "TaskManagerImpl.h"
#include "FifoTaskManagerImpl.h"
#include "Sem.h"
#ifdef __CERIUM_CELL__
#include "SpeThreads.h"
#else
#include "CpuThreads.h"
#endif

class CellTaskManagerImpl : public TaskManagerImpl {
public:
    /* constructor */
    CellTaskManagerImpl(int num, int gpu, Threads *cpus) : TaskManagerImpl(num) {
         ioNum = 2;
         gpuNum = gpu; speThreads = cpus; cpu_num = num-gpu; id_offset = gpu ;
    }
    ~CellTaskManagerImpl();

    /* variables */
    int cpu_num;
    int id_offset;
    SemPtr receive_wait;  //semaphore to wait any message from spe

    QueueInfo<TaskList> **taskListInfo;
    QueueInfo<TaskList> **speTaskList;  // running task

    Threads *speThreads;
    FifoTaskManagerImpl *ppeManager;
    int spe_running;
    int spuIdle;
    int gpuNum;
    int ioNum;
    /* functions */
    // system
    void init(int spuIdle,int useRefDma, int export_task_log);
    void run();
    void poll();
    void poll1(int spu_limit);
    void poll2(int spu_limit);
    void mail_check(int id);
    TaskListPtr createTaskList();
    //void set_runTaskList(*QueueInfo<HTask>);
    void set_runTaskList(QueueInfo<HTask>* activeTaskQueue);
    void sendTaskList();
    void append_activeTask(HTaskPtr);
    void show_profile() ;
    void start_profile() ;
    void export_task_log() ;
    void polling();
    void debug_check_spe_idle(QueueInfo<HTask> * activeTaskQueue, int spe_running_);
    void print_arch();
private:
    void send_taskList(int id);
    void show_dead_lock_info();

};

#endif