Mercurial > hg > Game > Cerium
changeset 1734:4206f70691df draft
profile of each task for GPU
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 01 Nov 2013 19:53:00 +0900 |
parents | 91b690b27066 |
children | 139e2277e8b1 |
files | TaskManager/Gpu/GpuScheduler.cc example/fft/main.cc example/fft/output.pgm example/multiply/main.cc |
diffstat | 4 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Gpu/GpuScheduler.cc Thu Oct 31 21:26:56 2013 +0900 +++ b/TaskManager/Gpu/GpuScheduler.cc Fri Nov 01 19:53:00 2013 +0900 @@ -124,7 +124,7 @@ // 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]->task_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 @@ -244,6 +244,7 @@ param++; } + tasklist[cur]->task_start_time = gettime(); if (tasklist[cur]->dim > 0) { ret = clEnqueueNDRangeKernel(command_queue, kernel[cur], tasklist[cur]->dim, NULL, &tasklist[cur]->x, 0, 0, NULL, NULL); @@ -265,7 +266,8 @@ error(msg); } } - + tasklist[cur]->task_end_time = gettime(); + if (ret<0) { const char *msg=convert_error_status(ret); error(msg); @@ -295,6 +297,7 @@ params_addr = (memaddr)tasklist[cur]->next; } + printf("GPU %d %s\t%lld\n",tasklist[cur]->self->cpu_type,(char*)(gpu_task_list[4].name),tasklist[cur]->task_end_time-tasklist[cur]->task_start_time); cur = 1 - cur; } wait_for_event(event,reply,cur); @@ -314,6 +317,7 @@ connector->mail_write((memaddr)MY_SPE_STATUS_READY); } // TaskArrayの処理 + } int
--- a/example/fft/main.cc Thu Oct 31 21:26:56 2013 +0900 +++ b/example/fft/main.cc Fri Nov 01 19:53:00 2013 +0900 @@ -30,7 +30,7 @@ cl_context context = NULL; cl_command_queue queue = NULL; cl_program program = NULL; -CPU_TYPE spe_cpu = SPE_ANY; +CPU_TYPE spe_cpu = GPU_0; cl_float2* xm; cl_float2* rm;