Mercurial > hg > Game > Cerium
changeset 1719:d911bef11c8a draft
fix gpu profile
author | Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Oct 2013 19:15:00 +0900 |
parents | 93f051a51d9e |
children | a07d4773012d |
files | TaskManager/Gpu/GpuScheduler.cc example/multiply/main.cc |
diffstat | 2 files changed, 12 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Gpu/GpuScheduler.cc Tue Oct 22 18:07:27 2013 +0900 +++ b/TaskManager/Gpu/GpuScheduler.cc Tue Oct 22 19:15:00 2013 +0900 @@ -100,6 +100,7 @@ cl_mem *memin[2]; cl_mem *memout[2]; TaskListPtr tasklist[2]; + tasklist[0]=NULL;tasklist[1]=NULL; HTask::htask_flag flag; memset(&flag, 0, sizeof(HTask::htask_flag)); @@ -120,12 +121,12 @@ return ; } - (*connector->start_dmawait_profile)(); + (*connector->start_dmawait_profile)(&(connector->start_time)); while (params_addr) { // since we are on the same memory space, we don't has to use dma_load here tasklist[cur] = (TaskListPtr)connector->dma_load(this, params_addr, sizeof(TaskList), DMA_READ_TASKLIST); - tasklist[cur]->start_time = gettime(); + tasklist[cur]->task_start_time = gettime(); /* * get flip flag * flip : When caluculate on input data, to treat this as a output data @@ -275,7 +276,9 @@ reply[cur] = (memaddr)tasklist[cur]->waiter; wait_for_event(event,reply,cur); - tasklist[1-cur]->stop_time = gettime(); + if (tasklist[1-cur]!=NULL) { + tasklist[1-cur]->task_end_time = gettime(); + } //clFlush(command_queue); // waiting for queued task // clFlush(command_queue); @@ -287,14 +290,15 @@ */ params_addr = (memaddr)tasklist[cur]->next; - cur = 1 - cur; } + cur = 1 - cur; } wait_for_event(event,reply,cur); - tasklist[1-cur]->stop_time = gettime(); + tasklist[1-cur]->task_end_time = gettime(); //clFlush(command_queue); // waiting for queued task //clFinish(command_queue); // waiting for queued task - (*connector->end_dmawait_profile)(&connector->global_busy_time); + unsigned long long wait = 0; + (*connector->end_dmawait_profile)(wait, &(connector->start_time), &(connector->stop_time)); connector->mail_write((memaddr)MY_SPE_STATUS_READY); } // TaskArrayの処理
--- a/example/multiply/main.cc Tue Oct 22 18:07:27 2013 +0900 +++ b/example/multiply/main.cc Tue Oct 22 19:15:00 2013 +0900 @@ -6,7 +6,7 @@ #include "Func.h" extern void task_init(void); -//extern void gpu_task_init(void); +extern void gpu_task_init(void); static int task = 1; static int length = DATA_NUM; static CPU_TYPE spe_cpu = SPE_ANY; @@ -111,7 +111,7 @@ init(argc, argv); // Task Register task_init(); - // gpu_task_init(); + gpu_task_init(); for (int i = 0; i < task; ++i) { multi_init(manager); }