Mercurial > hg > GearsTemplate
changeset 187:bacc37265386
main.o fixed
author | mir3636 |
---|---|
date | Thu, 15 Dec 2016 19:51:40 +0900 |
parents | dbc064c26b98 |
children | 6ab77dec8b6a |
files | src/parallel_execution/context.c src/parallel_execution/context.h src/parallel_execution/generate_context.pl src/parallel_execution/main.c |
diffstat | 4 files changed, 14 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/context.c Thu Dec 15 19:38:18 2016 +0900 +++ b/src/parallel_execution/context.c Thu Dec 15 19:51:40 2016 +0900 @@ -13,14 +13,14 @@ context->heapStart = NEWN(context->heapLimit, char); context->heap = context->heapStart; - context->codeNum = Exit; + // context->codeNum = Exit; #include "c/codeGearInit.c" #include "c/dataGearInit.c" - context->data[D_ActiveQueue] = createSynchronizedQueue(context); - context->data[D_WaitQueue] = createSynchronizedQueue(context); + // context->data[D_ActiveQueue] = createSynchronizedQueue(context); + // context->data[D_WaitQueue] = createSynchronizedQueue(context); context->dataNum = D_Queue; }
--- a/src/parallel_execution/context.h Thu Dec 15 19:38:18 2016 +0900 +++ b/src/parallel_execution/context.h Thu Dec 15 19:51:40 2016 +0900 @@ -101,6 +101,10 @@ CUdeviceptr* deviceptr; CUstream stream; } Cudatask; +#else + struct CudaTask { + enum Code next; + } Cudatask; #endif struct Main { enum Code code;
--- a/src/parallel_execution/generate_context.pl Thu Dec 15 19:38:18 2016 +0900 +++ b/src/parallel_execution/generate_context.pl Thu Dec 15 19:51:40 2016 +0900 @@ -81,7 +81,7 @@ } print $fd "};\n"; - open my $fd,">","c/enumCodeInit.c" or die("can't open c/enumCodeInit.c $!"); + open my $fd,">","c/codeGearInit.c" or die("can't open c/codeGearInit.c $!"); for my $code ( sort keys %codeGear ) { print $fd " context->code[C_${code}] = ${code}_stub;\n"; } @@ -98,7 +98,7 @@ print $fd "typedef struct ${data} ${data};\n"; } - open my $fd,">","c/enumDataInit.c" or die("can't open c/enumDataInit.c $!"); + open my $fd,">","c/dataGearInit.c" or die("can't open c/dataGearInit.c $!"); for my $data ( sort keys %dataGear ) { print $fd " ALLOC_DATA(context, ${data});\n"; }
--- a/src/parallel_execution/main.c Thu Dec 15 19:38:18 2016 +0900 +++ b/src/parallel_execution/main.c Thu Dec 15 19:51:40 2016 +0900 @@ -184,7 +184,7 @@ struct Context* worker_context = &worker->contexts[i]; worker_context->next = C_getTask1; worker_context->data[D_Tree] = context->data[D_Tree]; - worker_context->data[D_ActiveQueue] = context->data[D_ActiveQueue]; + // worker_context->data[D_ActiveQueue] = context->data[D_ActiveQueue]; pthread_create(&worker_context->thread, NULL, (void*)&start_code, worker_context); worker_context->thread_num = i; loopCounter->i++; @@ -193,7 +193,7 @@ } loopCounter->i = 0; - goto meta(context, TaskManager); + goto meta(context, C_taskManager); } __code createWorker_stub(struct Context* context) { @@ -207,14 +207,14 @@ pthread_join(worker->contexts[i].thread, NULL); loopCounter->i++; - goto meta(context, TaskManager); + goto meta(context, C_taskManager); } loopCounter->i = 0; Time *t = &context->data[D_Time]->Time; t->next = C_code2; - goto meta(context, EndTime); + goto meta(context, C_end_time); } __code taskManager_stub(struct Context* context) { @@ -243,7 +243,7 @@ struct Context* main_context = NEW(struct Context); initContext(main_context); - main_context->next = CreateData1; + main_context->next = C_createData1; struct Context* worker_contexts = NEWN(cpu_num, struct Context);