diff src/parallel_execution/examples/calc/calc.cbc @ 450:d3d7a7d6a117

Delete USE_CUDA_MAIN_THREAD
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Mon, 04 Dec 2017 04:24:30 +0900
parents 57132ef16009
children 8d7e5d48cad3
line wrap: on
line diff
--- a/src/parallel_execution/examples/calc/calc.cbc	Fri Dec 01 22:47:26 2017 +0900
+++ b/src/parallel_execution/examples/calc/calc.cbc	Mon Dec 04 04:24:30 2017 +0900
@@ -17,42 +17,18 @@
     return 0;
 }
 
-#ifdef USE_CUDAWorker
-#ifdef USE_CUDA_MAIN_THREAD
-extern volatile int cuda_initialized;
-#endif
-#endif
-
 __code initDataGears(struct LoopCounter* loopCounter, struct TaskManager* taskManager) {
     // loopCounter->tree = createRedBlackTree(context);
     loopCounter->i = 0;
     taskManager->taskManager = (union Data*)createTaskManagerImpl(context, cpu_num, gpu_num, 0);
-#ifdef USE_CUDAWorker
-#ifdef USE_CUDA_MAIN_THREAD
-    while(! cuda_initialized) {};
-#endif
-#endif
     goto meta(context, C_code1);
 }
 
 __code initDataGears_stub(struct Context* context) {
     struct TaskManager* taskManager =  Gearef(context, TaskManager);
     taskManager->taskManager = 0;
-#if (! defined(USE_CUDAWorker) || ! defined(USE_CUDA_MAIN_THREAD))
     struct LoopCounter* loopCounter = Gearef(context, LoopCounter);
     goto initDataGears(context, loopCounter, taskManager);
-#else
-    cuda_initialized = 0;
-    pthread_t thread;
-    pthread_create(&thread, NULL, (void*)&start_taskManager, context);
-    while (taskManager->taskManager == 0);
-    TaskManager *t = (TaskManager*)taskManager->taskManager;
-    TaskManagerImpl *im = (TaskManagerImpl*)t->taskManager;
-    struct Queue *q = (Queue *)im->workers[0];
-    createCUDAWorker(context,0,q, im);
-    pthread_join(thread,0);
-    exit(0);
-#endif
 }
 
 __code code1(struct Time* time) {