# HG changeset patch # User Shohei KOKUBO # Date 1404440791 -32400 # Node ID 6bf6450bd45a1ebc7d88d6b9fdffde32ec122d8c # Parent 8c618e912c88b2be6d7a015e002fda6724bdfe59 minor change diff -r 8c618e912c88 -r 6bf6450bd45a TaskManager/Cuda/CudaScheduler.cc --- a/TaskManager/Cuda/CudaScheduler.cc Tue Jul 01 17:04:01 2014 +0900 +++ b/TaskManager/Cuda/CudaScheduler.cc Fri Jul 04 11:26:31 2014 +0900 @@ -134,15 +134,15 @@ for(int i=0;iinData_count;i++) { ListElement *input_buf = nextTask->inData(i); if (input_buf->size==0) break; - if (!transmitted.count(input_buf)) { + if (!transmitted.count(input_buf->addr)) { createBuffer(&cudabuffer[cur], cudabuffer[cur].memin, param, input_buf->size); if (ret!=0) { CudaTaskError(cudabuffer, cur, tasklist, ret); continue; } ret = cuMemcpyHtoDAsync(cudabuffer[cur].memin[param], input_buf->addr, input_buf->size, cudabuffer[cur].stream); if (ret!=0) { CudaTaskError(cudabuffer, cur, tasklist, ret); continue; } - transmitted.insert(make_pair(input_buf, &cudabuffer[cur].memin[param])); - reverse_map.insert(make_pair(&cudabuffer[cur].memin[param], input_buf)); + transmitted.insert(make_pair(input_buf->addr, &cudabuffer[cur].memin[param])); + reverse_map.insert(make_pair(&cudabuffer[cur].memin[param], input_buf->addr)); } - cudabuffer[cur].kernelParams[param] = transmitted[input_buf]; + cudabuffer[cur].kernelParams[param] = transmitted[input_buf->addr]; param++; } @@ -151,13 +151,13 @@ for(int i = 0; ioutData_count;i++) { // set output data ListElement *output_buf = nextTask->outData(i); if (output_buf->size==0) break; - if (!transmitted.count(output_buf)) { + if (!transmitted.count(output_buf->addr)) { createBuffer(&cudabuffer[cur], cudabuffer[cur].memout, i, output_buf->size); if (ret!=0) { CudaTaskError(cudabuffer, cur, tasklist, ret); continue; } - transmitted.insert(make_pair(output_buf, &cudabuffer[cur].memout[i])); - reverse_map.insert(make_pair(&cudabuffer[cur].memout[i], output_buf)); + transmitted.insert(make_pair(output_buf->addr, &cudabuffer[cur].memout[i])); + reverse_map.insert(make_pair(&cudabuffer[cur].memout[i], output_buf->addr)); } - cudabuffer[cur].kernelParams[param] = transmitted[output_buf]; + cudabuffer[cur].kernelParams[param] = transmitted[output_buf->addr]; param++; } cudabuffer[cur].out_size = param - cudabuffer[cur].in_size; // no buffer on flip, but flip use memout event @@ -193,11 +193,11 @@ for(int i=0;ioutData_count;i++) { // read output data ListElement *output_buf = nextTask->outData(i); if (output_buf->size==0) break; - if (transmitted.count(output_buf)) { - ret = cuMemcpyDtoHAsync(output_buf->addr, *transmitted[output_buf], output_buf->size, cudabuffer[cur].stream); + if (transmitted.count(output_buf->addr)) { + ret = cuMemcpyDtoHAsync(output_buf->addr, *transmitted[output_buf->addr], output_buf->size, cudabuffer[cur].stream); if (ret!=0) { CudaTaskError(cudabuffer, cur, tasklist, ret); continue; } - reverse_map.erase(transmitted[output_buf]); - transmitted.erase(output_buf); + reverse_map.erase(transmitted[output_buf->addr]); + transmitted.erase(output_buf->addr); } } } @@ -205,7 +205,7 @@ } static void -release_buf_event(int cur, CudaScheduler::CudaBufferPtr mem, map map) { +release_buf_event(int cur, CudaScheduler::CudaBufferPtr mem, map map) { for (int i=0; i transmitted; - map reverse_map; + map transmitted; + map reverse_map; HTask::htask_flag flag[STAGE];