comparison src/parallel_execution/MultiDimIterator.cbc @ 462:8d7e5d48cad3

Running CPU examples
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Wed, 20 Dec 2017 22:05:08 +0900
parents 6b71cf5b1c22
children ac244346c85d
comparison
equal deleted inserted replaced
461:6b71cf5b1c22 462:8d7e5d48cad3
1 #include "../context.h" 1 #include "../context.h"
2 #include "Iterator.h"
3 #include "TaskManager.h"
2 #include <stdio.h> 4 #include <stdio.h>
3 5
4 Iterator* createMultiDimIterator(struct Context* context, int x, int y, int z) { 6 Iterator* createMultiDimIterator(struct Context* context, int x, int y, int z) {
5 struct Iterator* iterator = new Iterator(); 7 struct Iterator* iterator = new Iterator();
6 struct MultiDimIterator* multiDimIterator = new MultiDimIterator(); 8 struct MultiDimIterator* multiDimIterator = new MultiDimIterator();
75 int x = iterator->counterX; 77 int x = iterator->counterX;
76 int y = iterator->counterY; 78 int y = iterator->counterY;
77 int z = iterator->counterZ; 79 int z = iterator->counterZ;
78 struct Context* iterateTask = createMultiDimIterateTask(task, x, y, z); 80 struct Context* iterateTask = createMultiDimIterateTask(task, x, y, z);
79 struct TaskManager* taskManager = task->taskManager; 81 struct TaskManager* taskManager = task->taskManager;
80 goto taskManager->spawn(iterateTask, next(...)); 82 goto taskManager->spawn(iterateTask, execMultiDimIterator2);
81 } 83 }
82 84
83 __code execMultiDimIterator1_stub(struct Context* context) { 85 __code execMultiDimIterator1_stub(struct Context* context) {
84 MultiDimIterator* iterator = (MultiDimIterator*)GearImpl(context, Iterator, iterator); 86 MultiDimIterator* iterator = (MultiDimIterator*)GearImpl(context, Iterator, iterator);
85 Context* task = Gearef(context, Iterator)->task; 87 Context* task = Gearef(context, Iterator)->task;