# HG changeset patch # User Yuhi TOMARI # Date 1345127485 -32400 # Node ID 289e427bd49f26587ad2454afba775331c06896c # Parent efced19350f80d3b0815794eed4c5a3a3d47a11f fix set param kernelArg diff -r efced19350f8 -r 289e427bd49f TaskManager/Cell/CellTaskManagerImpl.cc --- a/TaskManager/Cell/CellTaskManagerImpl.cc Thu Aug 16 18:21:15 2012 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Thu Aug 16 23:31:25 2012 +0900 @@ -89,12 +89,15 @@ int speid; HTaskPtr htask = activeTaskQueue->getFirst(); while (htask != NULL) { - + if (htask->cpu_type == CPU_PPE) { htask = activeTaskQueue->getNext(htask); } else { +#ifdef __CERIUM_GPU__ + speid = htask->cpu_type - 1; +#else if (htask->cpu_type == SPE_ANY) { speid = cur_anySpeid++; } else { @@ -104,6 +107,7 @@ // 配列的 (SPE0 = arr[0], SPE1 = arr[1]) にするため speid = htask->cpu_type - CPU_SPE - 1; } +#endif speid %= machineNum; set_taskList(htask, taskListInfo[speid]); diff -r efced19350f8 -r 289e427bd49f TaskManager/Gpu/GpuScheduler.cc --- a/TaskManager/Gpu/GpuScheduler.cc Thu Aug 16 18:21:15 2012 +0900 +++ b/TaskManager/Gpu/GpuScheduler.cc Thu Aug 16 23:31:25 2012 +0900 @@ -68,12 +68,16 @@ int err = CL_SUCCESS; int param = 0; - for(;paramparam_count;param++) { - cl_mem memobj = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(nextTask->param(param)), NULL, NULL); - err |= clEnqueueWriteBuffer(command_queue, memobj, CL_TRUE, 0, - sizeof(nextTask->param(param)), nextTask->param(param), 0, NULL, NULL); - err |= clSetKernelArg(kernel, param, sizeof(memaddr), memobj); - } + + //inDataをparamに + //sizeof * nextTask->param_countてきな + cl_mem memobj = clCreateBuffer(context, CL_MEM_READ_WRITE, + sizeof(nextTask->param(param))*nextTask->param_count, NULL, NULL); + err |= clEnqueueWriteBuffer(command_queue, memobj, CL_TRUE, 0, + sizeof(nextTask->param(param))*nextTask->param_count, + nextTask->param(param), 0, NULL, NULL); + err |= clSetKernelArg(kernel, param, sizeof(memaddr), memobj); + for(int i=0;iinData_count;i++) { cl_mem memobj = clCreateBuffer(context, CL_MEM_READ_WRITE, nextTask->inData(i)->size, NULL, NULL); @@ -82,9 +86,7 @@ err |= clSetKernelArg(kernel, param, sizeof(memaddr), memobj); param++; } - // カーネル引数の設定 - - clEnqueueTask(command_queue, kernel, 0, NULL, NULL); + for(int i=0;ioutData_count;i++) { cl_mem memobj = clCreateBuffer(context, CL_MEM_READ_WRITE, nextTask->outData(i)->size, NULL, NULL); @@ -93,6 +95,9 @@ err |= clSetKernelArg(kernel, param, sizeof(memaddr), memobj); param++; } + // カーネル引数の設定 + + clEnqueueTask(command_queue, kernel, 0, NULL, NULL); } clFlush(command_queue); // waiting for queued task